Enhanced stock labels usage. Source cleaning.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31677 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-01-31 18:18:18 +00:00
parent faa9724741
commit 5d2ac6b8c6
21 changed files with 140 additions and 142 deletions

View File

@@ -26,6 +26,8 @@
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "wx/stockitem.h"
//----------------------------------------------------------------------------------------
#ifndef __WXMSW__
#include "bitmaps/logo.xpm"
@@ -39,9 +41,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()
//----------------------------------------------------------------------------------------
@@ -97,14 +99,14 @@ bool MainApp::OnInit(void) // Does everything needed for a program start
// 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 +122,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;
@@ -206,12 +208,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"));