9 :
EmberUI::ScalableDialog(parent, wxID_ANY, title, wxSize(1200, 800), wxDEFAULT_DIALOG_STYLE | wxSTAY_ON_TOP),
10 progress_bar_(
nullptr), log_text_(
nullptr), cancel_button_(
nullptr), status_label_(
nullptr),
11 was_cancelled_(false), is_complete_(false), current_progress_(0), max_progress_(100) {
20 wxBoxSizer *main_sizer =
new wxBoxSizer(wxVERTICAL);
23 status_label_ =
new wxStaticText(
this, wxID_ANY,
"Initializing...");
25 status_font.SetPointSize(10);
26 status_font.SetWeight(wxFONTWEIGHT_BOLD);
31 progress_bar_ =
new wxGauge(
this, wxID_ANY, 100, wxDefaultPosition, wxSize(-1, 25));
32 main_sizer->Add(
progress_bar_, 0, wxLEFT | wxRIGHT | wxEXPAND, 10);
35 wxStaticText *progress_text =
new wxStaticText(
this, wxID_ANY,
"0%");
36 progress_text->SetName(
"progress_text");
37 main_sizer->Add(progress_text, 0, wxALL | wxALIGN_CENTER, 5);
40 main_sizer->Add(
new wxStaticLine(
this), 0, wxALL | wxEXPAND, 5);
43 wxStaticText *log_label =
new wxStaticText(
this, wxID_ANY,
"Parsing Details:");
44 wxFont log_label_font = log_label->GetFont();
45 log_label_font.SetPointSize(9);
46 log_label_font.SetWeight(wxFONTWEIGHT_BOLD);
47 log_label->SetFont(log_label_font);
48 main_sizer->Add(log_label, 0, wxLEFT | wxRIGHT | wxTOP, 10);
51 log_text_ =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
52 wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH2 | wxTE_WORDWRAP | wxHSCROLL | wxVSCROLL);
55 wxFont log_font(9, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
57 log_text_->SetBackgroundColour(wxColour(30, 30, 30));
58 log_text_->SetForegroundColour(wxColour(200, 200, 200));
60 main_sizer->Add(
log_text_, 1, wxALL | wxEXPAND, 10);
69 AppendLog(
"Loading started...",
"[INIT]");
118 wxDateTime now = wxDateTime::Now();
119 wxString timestamp = now.Format(
"%H:%M:%S");
122 wxString formatted_message;
123 if (!prefix.IsEmpty()) {
124 formatted_message = wxString::Format(
"[%s] %s %s\n", timestamp.c_str(), prefix.c_str(), message.c_str());
126 formatted_message = wxString::Format(
"[%s] %s\n", timestamp.c_str(), message.c_str());
130 if (prefix.Contains(
"ERROR") || prefix.Contains(
"FAIL")) {
131 log_text_->SetDefaultStyle(wxTextAttr(wxColour(255, 100, 100)));
132 }
else if (prefix.Contains(
"WARN")) {
133 log_text_->SetDefaultStyle(wxTextAttr(wxColour(255, 200, 100)));
134 }
else if (prefix.Contains(
"SUCCESS") || prefix.Contains(
"COMPLETE")) {
135 log_text_->SetDefaultStyle(wxTextAttr(wxColour(100, 255, 100)));
136 }
else if (prefix.Contains(
"STEP")) {
137 log_text_->SetDefaultStyle(wxTextAttr(wxColour(100, 200, 255)));
139 log_text_->SetDefaultStyle(wxTextAttr(wxColour(200, 200, 200)));
142 log_text_->AppendText(formatted_message);
MainFrame::OnExit MainFrame::OnNewProject MainFrame::OnCloseProject MainFrame::OnToggleMaximize MainFrame::OnPreviousScene MainFrame::OnPreferences MainFrame::OnEditorTool EVT_BUTTON(ID_MonitorTool, MainFrame::OnMonitorTool) EVT_PAINT(MainFrame