Ember
Loading...
Searching...
No Matches
LoadingDialog Class Reference

Custom loading dialog with detailed progress information. More...

#include <LoadingDialog.h>

Inheritance diagram for LoadingDialog:
EmberUI::ScalableDialog

Public Member Functions

 LoadingDialog (wxWindow *parent, const wxString &title)
virtual ~LoadingDialog ()
bool UpdateProgress (int current, int max, const wxString &message=wxEmptyString)
 Update progress and optionally add a log message.
void AppendLog (const wxString &message, const wxString &prefix="")
 Add a log message without updating progress.
void ClearLog ()
 Clear all log messages.
void SetMaxProgress (int max)
 Set the maximum value for the progress bar.
bool WasCancelled () const
 Check if the user requested cancellation.
void MarkComplete ()
 Mark loading as complete and change button to "Close".
Public Member Functions inherited from EmberUI::ScalableDialog
 ScalableDialog (wxWindow *parent, wxWindowID id, const wxString &title, const wxSize &logicalSize=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
 Constructs the dialog with logical size for DPI scaling.
virtual ~ScalableDialog ()=default

Private Member Functions

void CreateControls ()
void OnCancel (wxCommandEvent &event)
void OnClose (wxCloseEvent &event)
 wxDECLARE_EVENT_TABLE ()

Private Attributes

wxGauge * progress_bar_
wxTextCtrl * log_text_
wxButton * cancel_button_
wxStaticText * status_label_
bool was_cancelled_
bool is_complete_
int current_progress_
int max_progress_

Additional Inherited Members

Protected Member Functions inherited from EmberUI::ScalableDialog
int Scaled (int px) const
 Scales a logical pixel value to physical pixels.
wxSize Scaled (const wxSize &size) const
 Scales a logical size to physical pixels.
int Margin () const
 Returns the standard margin in physical pixels.
int Spacing () const
 Returns the standard spacing in physical pixels.
int Padding () const
 Returns the standard padding in physical pixels.
wxStaticBoxSizer * CreateGroup (wxWindow *parent, const wxString &title)
 Creates a grouped section with a title.
wxBoxSizer * CreateLabeledRow (wxWindow *parent, const wxString &label, wxWindow *control, int logicalLabelWidth=Layout::LABEL_WIDTH)
 Creates a row with a label and control.

Detailed Description

Custom loading dialog with detailed progress information.

Shows a progress bar and a scrollable terminal-like log of all parsing steps. Grays out the UI behind it (modal behavior).

Definition at line 14 of file LoadingDialog.h.

Constructor & Destructor Documentation

◆ LoadingDialog()

LoadingDialog::LoadingDialog ( wxWindow * parent,
const wxString & title )

◆ ~LoadingDialog()

LoadingDialog::~LoadingDialog ( )
virtual

Definition at line 16 of file LoadingDialog.cpp.

Member Function Documentation

◆ AppendLog()

void LoadingDialog::AppendLog ( const wxString & message,
const wxString & prefix = "" )

Add a log message without updating progress.

Parameters
messageMessage to append to the log
prefixOptional prefix (e.g., "[INFO]", "[WARN]")

Definition at line 113 of file LoadingDialog.cpp.

◆ ClearLog()

void LoadingDialog::ClearLog ( )

Clear all log messages.

Definition at line 149 of file LoadingDialog.cpp.

◆ CreateControls()

void LoadingDialog::CreateControls ( )
private

Definition at line 18 of file LoadingDialog.cpp.

◆ MarkComplete()

void LoadingDialog::MarkComplete ( )

Mark loading as complete and change button to "Close".

Definition at line 162 of file LoadingDialog.cpp.

◆ OnCancel()

void LoadingDialog::OnCancel ( wxCommandEvent & event)
private

Definition at line 176 of file LoadingDialog.cpp.

◆ OnClose()

void LoadingDialog::OnClose ( wxCloseEvent & event)
private

Definition at line 199 of file LoadingDialog.cpp.

◆ SetMaxProgress()

void LoadingDialog::SetMaxProgress ( int max)

Set the maximum value for the progress bar.

Definition at line 155 of file LoadingDialog.cpp.

◆ UpdateProgress()

bool LoadingDialog::UpdateProgress ( int current,
int max,
const wxString & message = wxEmptyString )

Update progress and optionally add a log message.

Parameters
currentCurrent progress value
maxMaximum progress value
messageMessage to display in the log (optional)
Returns
true to continue, false if user cancelled

Definition at line 72 of file LoadingDialog.cpp.

◆ WasCancelled()

bool LoadingDialog::WasCancelled ( ) const
inline

Check if the user requested cancellation.

Definition at line 48 of file LoadingDialog.h.

◆ wxDECLARE_EVENT_TABLE()

LoadingDialog::wxDECLARE_EVENT_TABLE ( )
private

Member Data Documentation

◆ cancel_button_

wxButton* LoadingDialog::cancel_button_
private

Definition at line 63 of file LoadingDialog.h.

◆ current_progress_

int LoadingDialog::current_progress_
private

Definition at line 68 of file LoadingDialog.h.

◆ is_complete_

bool LoadingDialog::is_complete_
private

Definition at line 67 of file LoadingDialog.h.

◆ log_text_

wxTextCtrl* LoadingDialog::log_text_
private

Definition at line 62 of file LoadingDialog.h.

◆ max_progress_

int LoadingDialog::max_progress_
private

Definition at line 69 of file LoadingDialog.h.

◆ progress_bar_

wxGauge* LoadingDialog::progress_bar_
private

Definition at line 61 of file LoadingDialog.h.

◆ status_label_

wxStaticText* LoadingDialog::status_label_
private

Definition at line 64 of file LoadingDialog.h.

◆ was_cancelled_

bool LoadingDialog::was_cancelled_
private

Definition at line 66 of file LoadingDialog.h.


The documentation for this class was generated from the following files: