]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/dbbrowse/dbbrowse.cpp
Modified to use the newly defined names for functions/classes/structs defined to...
[wxWidgets.git] / demos / dbbrowse / dbbrowse.cpp
index 2f44733d7d2d50ccfa561bca5ffae8d5cfe8bb1a..a51faf47e2b218feb0419abf1a1ecce7a75a216b 100644 (file)
@@ -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
@@ -179,7 +180,8 @@ bool MainApp::OnInit(void)  // Does everything needed for a program start
      w = p_ProgramCfg->Read("/MainFrame/w", 750), h = p_ProgramCfg->Read("/MainFrame/h", 600);
  //---------------------------------------------------------------------------------------
  // Create the main frame window
- frame = new MainFrame((wxFrame *) NULL, (char *) _("DBBrowser - mj10777"),wxPoint(x,y),wxSize(w,h));
+ Temp0.Printf("%s - %s",GetAppName().c_str(),GetVendorName().c_str());
+ frame = new MainFrame((wxFrame *) NULL,(char *) Temp0.c_str(),wxPoint(x,y),wxSize(w,h));
  //---------------------------------------------------------------------------------------
  // Set the Backgroundcolour (only need if your are NOT using wxSYS_COLOUR_BACKGROUND)
  frame->SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BACKGROUND));
@@ -221,7 +223,7 @@ bool MainApp::OnInit(void)  // Does everything needed for a program start
  //---------------------------------------------------------------------------------------
  frame->p_Splitter = new DocSplitterWindow(frame,-1);
  // p_Splitter->SetCursor(wxCursor(wxCURSOR_PENCIL));
- frame->pDoc                       = new mjDoc();
+ frame->pDoc                       = new MainDoc();
  frame->pDoc->p_MainFrame          = frame;
  frame->pDoc->p_Splitter           = frame->p_Splitter;
  frame->pDoc->p_Splitter->pDoc     = frame->pDoc;       // ControlBase: saving the Sash
@@ -261,7 +263,8 @@ bool MainApp::OnInit(void)  // Does everything needed for a program start
 MainFrame::MainFrame(wxFrame *frame, char *title,  const wxPoint& pos, const wxSize& size):
   wxFrame(frame, -1, title,  pos, size)
 {
- //--- Everything is done in MainApp -----------------------------------------------------
+ p_Splitter = NULL; pDoc = NULL; p_Help = NULL;    // Keep the Pointers clean !
+ //--- Everything else is done in MainApp::OnInit() --------------------------------------
 }
 //----------------------------------------------------------------------------------------
 MainFrame::~MainFrame(void)
@@ -283,7 +286,8 @@ MainFrame::~MainFrame(void)
  // we want here!)
  // delete wxConfigBase::Set((wxConfigBase *) NULL);
  p_ProgramCfg->Flush(TRUE);        // saves   Objekt
- delete frame->pDoc;               // Cleanup (mjDoc::~mjDoc)
+ if (pDoc)                         // If we have a Valid Document
+  delete pDoc;                     // Cleanup (MainDoc::~MainDoc)
 } // MainFrame::~MainFrame(void)
 //----------------------------------------------------------------------------------------
 void MainFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
@@ -296,9 +300,10 @@ void MainFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
 //----------------------------------------------------------------------------------------
 void MainFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
 {
- wxMessageDialog dialog(this, _("DBBrowser\nMark Johnson\nBerlin, Germany\nmj10777@gmx.net\n (c) 1999"),
-      _("About DBBrowser"), wxOK|wxCANCEL);
-
+ wxString Temp0, Temp1;
+ Temp0.Printf(_("%s\nMark Johnson\nBerlin, Germany\nmj10777@gmx.net\n (c) 2000"),p_ProgramCfg->GetAppName().c_str());
+ Temp1.Printf(_("About %s"),p_ProgramCfg->GetAppName().c_str());
+ wxMessageDialog dialog(this, Temp0,Temp1,wxOK|wxCANCEL);
  dialog.ShowModal();
 }
 //----------------------------------------------------------------------------------------