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) #if defined(SYS_WINDOWS)
wxString wxString
format_tooltip(const wxString &s) { 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 #endif
@ -583,6 +590,9 @@ mmg_dialog::mmg_dialog():
mdlg = this; mdlg = this;
log_window = new wxLogWindow(this, wxT("mmg debug output"), false);
wxLog::SetActiveTarget(log_window);
file_menu = new wxMenu(); file_menu = new wxMenu();
file_menu->Append(ID_M_FILE_NEW, wxT("&New\tCtrl-N"), file_menu->Append(ID_M_FILE_NEW, wxT("&New\tCtrl-N"),
wxT("Start with empty settings")); wxT("Start with empty settings"));

View File

@ -111,6 +111,7 @@ public:
job_dialog *jdlg; job_dialog *jdlg;
wxHtmlHelpController *help; wxHtmlHelpController *help;
wxLogWindow *log_window;
bool warned_chapter_editor_not_empty; 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); siz_all->Add(siz_about, 0, wxGROW | wxALL, 5);
SetSizer(siz_all); SetSizer(siz_all);
log_window = new wxLogWindow(this, wxT("mmg debug output"), false);
wxLog::SetActiveTarget(log_window);
load_preferences(); load_preferences();
} }
@ -205,7 +202,7 @@ tab_settings::on_on_top_selected(wxCommandEvent &evt) {
void void
tab_settings::on_gui_debugging_selected(wxCommandEvent &evt) { tab_settings::on_gui_debugging_selected(wxCommandEvent &evt) {
save_preferences(); save_preferences();
log_window->Show(cb_gui_debugging->IsChecked()); mdlg->log_window->Show(cb_gui_debugging->IsChecked());
} }
void void
@ -241,7 +238,7 @@ tab_settings::load_preferences() {
cb_warn_usage->SetValue(b); cb_warn_usage->SetValue(b);
cfg->Read(wxT("gui_debugging"), &b, false); cfg->Read(wxT("gui_debugging"), &b, false);
cb_gui_debugging->SetValue(b); cb_gui_debugging->SetValue(b);
log_window->Show(b); mdlg->log_window->Show(b);
} }
void void

View File

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