Ember
Loading...
Searching...
No Matches
LoadingDialog.h
Go to the documentation of this file.
1#pragma once
2
3#include <wx/gauge.h>
4#include <wx/textctrl.h>
5#include <wx/wx.h>
6
13class LoadingDialog : public wxDialog {
14 public:
15 LoadingDialog(wxWindow *parent, const wxString &title);
16 virtual ~LoadingDialog();
17
25 bool UpdateProgress(int current, int max, const wxString &message = wxEmptyString);
26
32 void AppendLog(const wxString &message, const wxString &prefix = "");
33
37 void ClearLog();
38
42 void SetMaxProgress(int max);
43
47 bool WasCancelled() const { return was_cancelled_; }
48
52 void MarkComplete();
53
54 private:
55 void CreateControls();
56 void OnCancel(wxCommandEvent &event);
57 void OnClose(wxCloseEvent &event);
58
59 private:
60 wxGauge *progress_bar_;
61 wxTextCtrl *log_text_;
62 wxButton *cancel_button_;
63 wxStaticText *status_label_;
64
69
71};
void MarkComplete()
Mark loading as complete and change button to "Close".
wxButton * cancel_button_
void OnCancel(wxCommandEvent &event)
wxGauge * progress_bar_
void OnClose(wxCloseEvent &event)
void ClearLog()
Clear all log messages.
void SetMaxProgress(int max)
Set the maximum value for the progress bar.
virtual ~LoadingDialog()
bool UpdateProgress(int current, int max, const wxString &message=wxEmptyString)
Update progress and optionally add a log message.
wxStaticText * status_label_
bool WasCancelled() const
Check if the user requested cancellation.
LoadingDialog(wxWindow *parent, const wxString &title)
wxTextCtrl * log_text_
void AppendLog(const wxString &message, const wxString &prefix="")
Add a log message without updating progress.