Ember
Loading...
Searching...
No Matches
LoadingDialog.h
Go to the documentation of this file.
1#pragma once
2
4#include <wx/gauge.h>
5#include <wx/textctrl.h>
6#include <wx/wx.h>
7
15 public:
16 LoadingDialog(wxWindow *parent, const wxString &title);
17 virtual ~LoadingDialog();
18
26 bool UpdateProgress(int current, int max, const wxString &message = wxEmptyString);
27
33 void AppendLog(const wxString &message, const wxString &prefix = "");
34
38 void ClearLog();
39
43 void SetMaxProgress(int max);
44
48 bool WasCancelled() const { return was_cancelled_; }
49
53 void MarkComplete();
54
55 private:
56 void CreateControls();
57 void OnCancel(wxCommandEvent &event);
58 void OnClose(wxCloseEvent &event);
59
60 private:
61 wxGauge *progress_bar_;
62 wxTextCtrl *log_text_;
63 wxButton *cancel_button_;
64 wxStaticText *status_label_;
65
70
72};
DPI-aware dialog base class for scalable layouts.
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.