]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/dbbrowse/dbbrowse.cpp
made the code a bit more readable by not using _T() around to-be-generated code snippets
[wxWidgets.git] / demos / dbbrowse / dbbrowse.cpp
index 28eafd9a980752bfe2368e0bc2b1b4712166b513..8f19fc8526ce6ca6b678235e2277932c9dedcf4d 100644 (file)
@@ -9,13 +9,7 @@
 // Licence:     wxWindows license
 // RCS-ID:      $Id$
 //----------------------------------------------------------------------------------------
-//-- all #ifdefs that the whole Project needs. -------------------------------------------
-//----------------------------------------------------------------------------------------
-#ifdef __GNUG__
-#pragma implementation
-#pragma interface
-#endif
-//----------------------------------------------------------------------------------------
+
 // For compilers that support precompilation, includes "wx/wx.h".
 #include "wx/wxprec.h"
 //----------------------------------------------------------------------------------------
@@ -26,6 +20,8 @@
 #ifndef WX_PRECOMP
 #include "wx/wx.h"
 #endif
+
+#include "wx/stockitem.h"
 //----------------------------------------------------------------------------------------
 #ifndef __WXMSW__
 #include "bitmaps/logo.xpm"
@@ -39,9 +35,9 @@
 //-- Some Global Vars for this file ------------------------------------------------------
 //----------------------------------------------------------------------------------------
 BEGIN_EVENT_TABLE(MainFrame, wxFrame)
-    EVT_MENU(QUIT, MainFrame::OnQuit)                  // Program End
-    EVT_MENU(ABOUT, MainFrame::OnAbout)                // Program Discription
-    EVT_MENU(HELP, MainFrame::OnHelp)                  // Program Help
+    EVT_MENU(wxID_EXIT, MainFrame::OnQuit)                  // Program End
+    EVT_MENU(wxID_ABOUT, MainFrame::OnAbout)                // Program Discription
+    EVT_MENU(wxID_HELP, MainFrame::OnHelp)                  // Program Help
 END_EVENT_TABLE()
 
 //----------------------------------------------------------------------------------------
@@ -91,20 +87,21 @@ bool MainApp::OnInit(void)  // Does everything needed for a program start
         langid   = argv[1];         // cz, std, fr, de , pl
         break;
     case 1:
+    case 0:
         break;
     };
     //---------------------------------------------------------------------------------------
     // Win-Registry : Workplace\HKEY_CURRENT_USERS\Software\%GetVendorName()\%GetAppName()
     //---------------------------------------------------------------------------------------
     SetVendorName(_T("mj10777"));           // Needed to get Configuration Information
-    SetAppName(_T("DBBrowse"));            // "" , also needed for s_LangHelp
+    SetAppName(_T("DBBrowse"));             // "" , also needed for s_LangHelp
     //---------------------------------------------------------------------------------------
     // we're using wxConfig's "create-on-demand" feature: it will create the
     // config object when it's used for the first time. It has a number of
     // advantages compared with explicitly creating our wxConfig:
     //  1) we don't pay for it if we don't use it
     //  2) there is no danger to create it twice
-    
+
     // application and vendor name are used by wxConfig to construct the name
     // of the config file/registry key and must be set before the first call
     // to Get() if you want to override the default values (the application
@@ -120,7 +117,7 @@ bool MainApp::OnInit(void)  // Does everything needed for a program start
     {
         Temp0.Empty();
         p_ProgramCfg->Read(_T("/Local/langid"),&Temp0); // >const char *langid< can't be used here
-        if (Temp0 == _T(""))
+        if (Temp0.empty())
             langid = _T("std");  // Standard language is "std" = english
         else
             langid = Temp0;
@@ -185,7 +182,7 @@ bool MainApp::OnInit(void)  // Does everything needed for a program start
     Temp0.Printf(_T("%s - %s"),GetAppName().c_str(),GetVendorName().c_str());
     frame = new MainFrame((wxFrame *) NULL,(wxChar *) Temp0.c_str(),wxPoint(x,y),wxSize(w,h));
     //---------------------------------------------------------------------------------------
-    // Set the Backgroundcolour (only need if your are NOT using wxSYS_COLOUR_BACKGROUND)
+    // Set the Backgroundcolour (only needed if you are NOT using wxSYS_COLOUR_BACKGROUND)
     frame->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BACKGROUND));
     // frame->SetBackgroundColour(wxColour(255, 255, 255));
     // frame->SetBackgroundColour(* wxWHITE);
@@ -206,12 +203,12 @@ bool MainApp::OnInit(void)  // Does everything needed for a program start
     // Make a menubar
     wxMenu *file_menu = new wxMenu;
     wxMenu *help_menu = new wxMenu;
-    
-    help_menu->Append(HELP, _("&Help"));
+
+    help_menu->Append(wxID_HELP, wxGetStockLabel(wxID_HELP));
     help_menu->AppendSeparator();
-    help_menu->Append(ABOUT, _("&About"));
-    file_menu->Append(QUIT, _("E&xit"));
-    
+    help_menu->Append(wxID_ABOUT, _("&About"));
+    file_menu->Append(wxID_EXIT, wxGetStockLabel(wxID_EXIT));
+
     wxMenuBar *menu_bar = new wxMenuBar;
     menu_bar->Append(file_menu, _("&File"));
     menu_bar->Append(help_menu, _("&Help"));
@@ -232,7 +229,7 @@ bool MainApp::OnInit(void)  // Does everything needed for a program start
     frame->pDoc->p_Splitter           = frame->p_Splitter;
     frame->pDoc->p_Splitter->pDoc     = frame->pDoc;       // ControlBase: saving the Sash
     //---------------------------------------------------------------------------------------
-    //-- Problem : GetClientSize(Width,Hight) are not the same as the values given in the ---
+    //-- Problem : GetClientSize(Width,Height) are not the same as the values given in the ---
     //--            construction of the Frame.                                            ---
     //-- Solved  : GetClientSize is called here and the difference is noted. When the     ---
     //--           Window is closed the diff. is added to the result of GetClientSize.    ---