//----------------------------------------------------------------------------------------
//-- 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
}
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
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
//----------------------------------------------------------------------------------------
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;
//----------------------------------------------------------------------------------------
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);
}
//----------------------------------------------------------------------------------------