X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/66d6c315a3d99ada984f44966b5d92642aff147f..12ed316d02733e7111a6967f6ae41e2c0ceaa57a:/demos/dbbrowse/dbbrowse.cpp diff --git a/demos/dbbrowse/dbbrowse.cpp b/demos/dbbrowse/dbbrowse.cpp index 090073bd2d..c75312caab 100644 --- a/demos/dbbrowse/dbbrowse.cpp +++ b/demos/dbbrowse/dbbrowse.cpp @@ -38,8 +38,6 @@ //---------------------------------------------------------------------------------------- //-- Some Global Vars for this file ------------------------------------------------------ //---------------------------------------------------------------------------------------- -MainFrame *frame = NULL; // The one and only MainFrame -//---------------------------------------------------------------------------------------- BEGIN_EVENT_TABLE(MainFrame, wxFrame) EVT_MENU(QUIT, MainFrame::OnQuit) // Program End EVT_MENU(ABOUT, MainFrame::OnAbout) // Program Discription @@ -151,8 +149,10 @@ bool MainApp::OnInit(void) // Does everything needed for a program start } else { // Read in Foreign language's text for GetAppName() and Help - m_locale.AddCatalog(GetAppName().c_str()); - m_locale.AddCatalog("Help"); + Temp0 = GetAppName(); + Temp0 = Temp0.Lower(); + m_locale.AddCatalog(Temp0.c_str()); + m_locale.AddCatalog("help"); } } // Support the following languages (std = english) else @@ -165,6 +165,7 @@ bool MainApp::OnInit(void) // Does everything needed for a program start p_ProgramCfg->Write("/Local/language",s_Language); p_ProgramCfg->Write("/Local/langid",s_LangId); s_LangHelp.Printf("help.%s/%s.hhp",s_LangId.c_str(),GetAppName().c_str()); // "help.std/Garantie.hhp"; + s_LangHelp = s_LangHelp.Lower(); // A must for Linux //--------------------------------------------------------------------------------------- Temp0 = "NONE"; // I don't remember why I did this p_ProgramCfg->Write("/NONE",Temp0); // I don't remember why I did this @@ -268,6 +269,11 @@ MainFrame::MainFrame(wxFrame *frame, char *title, const wxPoint& pos, const wxS //---------------------------------------------------------------------------------------- MainFrame::~MainFrame(void) { + // Close the help frame; this will cause the config data to get written. + if (p_Help->GetFrame()) // returns NULL if no help frame active + p_Help->GetFrame()->Close(TRUE); + delete p_Help; // Memory Leak + p_Help = NULL; // save the control's values to the config if (p_ProgramCfg == NULL) return; @@ -291,9 +297,6 @@ MainFrame::~MainFrame(void) //---------------------------------------------------------------------------------------- void MainFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { - // Close the help frame; this will cause the config data to get written. - if (p_Help->GetFrame()) // returns NULL if no help frame active - p_Help->GetFrame()->Close(TRUE); Close(TRUE); } //----------------------------------------------------------------------------------------