Moved the log window so that it gets initialized as early as possible. Modified the tooltip word wrap a bit (trial-and-error). Looks better now. Nope, I don't know how it should be done right.

This commit is contained in:
Moritz Bunkus 2005-02-27 20:39:02 +00:00
parent acb5a61918
commit 505423bab6
4 changed files with 15 additions and 8 deletions

View File

@ -501,9 +501,16 @@ format_date_time(time_t date_time) {
#if defined(SYS_WINDOWS)
wxString
format_tooltip(const wxString &s) {
wxString tooltip(s);
wxString tooltip(s), nl(wxT("\n"));
unsigned int i;
return break_line(tooltip, 30);
for (i = 30; i < tooltip.length(); ++i)
if (wxT(' ') == tooltip[i])
return tooltip.Left(i) + nl + tooltip.Right(tooltip.length() - i - 1);
else if (wxT('(') == tooltip[i])
return tooltip.Left(i) + nl + tooltip.Right(tooltip.length() - i);
return tooltip;
}
#endif
@ -583,6 +590,9 @@ mmg_dialog::mmg_dialog():
mdlg = this;
log_window = new wxLogWindow(this, wxT("mmg debug output"), false);
wxLog::SetActiveTarget(log_window);
file_menu = new wxMenu();
file_menu->Append(ID_M_FILE_NEW, wxT("&New\tCtrl-N"),
wxT("Start with empty settings"));

View File

@ -111,6 +111,7 @@ public:
job_dialog *jdlg;
wxHtmlHelpController *help;
wxLogWindow *log_window;
bool warned_chapter_editor_not_empty;

View File

@ -154,9 +154,6 @@ tab_settings::tab_settings(wxWindow *parent):
siz_all->Add(siz_about, 0, wxGROW | wxALL, 5);
SetSizer(siz_all);
log_window = new wxLogWindow(this, wxT("mmg debug output"), false);
wxLog::SetActiveTarget(log_window);
load_preferences();
}
@ -205,7 +202,7 @@ tab_settings::on_on_top_selected(wxCommandEvent &evt) {
void
tab_settings::on_gui_debugging_selected(wxCommandEvent &evt) {
save_preferences();
log_window->Show(cb_gui_debugging->IsChecked());
mdlg->log_window->Show(cb_gui_debugging->IsChecked());
}
void
@ -241,7 +238,7 @@ tab_settings::load_preferences() {
cb_warn_usage->SetValue(b);
cfg->Read(wxT("gui_debugging"), &b, false);
cb_gui_debugging->SetValue(b);
log_window->Show(b);
mdlg->log_window->Show(b);
}
void

View File

@ -38,7 +38,6 @@ public:
wxCheckBox *cb_filenew_after_add_to_jobqueue;
wxCheckBox *cb_warn_usage, *cb_gui_debugging;
wxComboBox *cob_priority;
wxLogWindow *log_window;
public:
tab_settings(wxWindow *parent);