if (pDbList->PtrDb->errorList[i])
{
msg.Append(pDbList->PtrDb->errorList[i]);
- if (wxStrcmp(pDbList->PtrDb->errorList[i],_T("")) != 0)
+ if (wxStrcmp(pDbList->PtrDb->errorList[i],wxEmptyString) != 0)
msg.Append(_T("\n"));
}
}
BrowserDB::BrowserDB()
{
PointerToNULL(0);
- ODBCSource = _T(""); // ODBC data source name (created with ODBC Administrator under Win95/NT)
- UserName = _T(""); // database username - must already exist in the data source
- Password = _T(""); // password database username
+ ODBCSource = wxEmptyString; // ODBC data source name (created with ODBC Administrator under Win95/NT)
+ UserName = wxEmptyString; // database username - must already exist in the data source
+ Password = wxEmptyString; // password database username
OnFillSqlTyp();
OnFilldbTyp();
} // BrowserDB Constructor
// Connect to datasource
//---------------------------------------------------------------------------------------
DlgUser *p_Dlg;
- p_Dlg = new DlgUser(pDoc->p_MainFrame,pDoc,_T(""));
+ p_Dlg = new DlgUser(pDoc->p_MainFrame,pDoc,wxEmptyString);
p_Dlg->s_DSN = ODBCSource;
p_Dlg->s_User = UserName;
p_Dlg->s_Password = Password;
// wxLogMessage(">>>%s<<<>>>%s<<<",UserName.c_str(),Password.c_str());
if (db_BrowserDB == NULL)
{
- DbConnectInf.SetDsn(wxT(""));
- DbConnectInf.SetUserID(wxT(""));
- DbConnectInf.SetPassword(wxT(""));
+ DbConnectInf.SetDsn(wxEmptyString);
+ DbConnectInf.SetUserID(wxEmptyString);
+ DbConnectInf.SetPassword(wxEmptyString);
if (!Quiet)
{
wxLogMessage(_("\n-E-> BrowserDB::OnConnectDataSource() DB CONNECTION ERROR : Unable to connect to the data source.\n\nCheck the name of your data source to verify it has been correctly entered/spelled.\n\nWith some databases, the user name and password must\nbe created with full rights to the table prior to making a connection\n(using tools provided by the database manufacturer)"));
switch(i_dbDataType)
{
case DB_DATA_TYPE_VARCHAR:
- wxStrcpy(s_temp,_T(""));
+ wxStrcpy(s_temp,wxEmptyString);
if (!db_BrowserDB->GetData((UWORD)(i+1),(SWORD)((cl_BrowserDB+i)->pColFor->i_dbDataType),&s_temp[0],sizeof(s_temp), &cb))
{
Temp0.Printf(_("\n-E-> BrowserDB::OnGetNext - ODBC-Error with GetNext of >%s<.\n-E-> "),(cl_BrowserDB+i)->tableName);
i_SqlTyp[21] = SQL_NUMERIC; s_SqlTyp[21] = _T("SQL_NUMERIC");
i_SqlTyp[22] = SQL_LONGVARCHAR; s_SqlTyp[22] = _T("SQL_LONGVARCHAR");
i_SqlTyp[23] = SQL_REAL; s_SqlTyp[23] = _T("SQL_REAL");
- i_SqlTyp[0] = 23; s_SqlTyp[0] = _T("");
+ i_SqlTyp[0] = 23; s_SqlTyp[0] = wxEmptyString;
}
//----------------------------------------------------------------------------------------
i_dbTyp[2] = DB_DATA_TYPE_INTEGER; s_dbTyp[2] = _T("DB_DATA_TYPE_INTEGER");
i_dbTyp[3] = DB_DATA_TYPE_FLOAT; s_dbTyp[3] = _T("DB_DATA_TYPE_FLOAT");
i_dbTyp[4] = DB_DATA_TYPE_DATE; s_dbTyp[4] = _T("DB_DATA_TYPE_DATE");
- i_dbTyp[0] = 4; s_dbTyp[0] = _T("");
+ i_dbTyp[0] = 4; s_dbTyp[0] = wxEmptyString;
}
//----------------------------------------------------------------------------------------
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
+
+#include "wx/stockitem.h"
//----------------------------------------------------------------------------------------
#ifndef __WXMSW__
#include "bitmaps/logo.xpm"
//-- 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()
//----------------------------------------------------------------------------------------
// 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
{
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;
// 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"));
public:
MainFrame(wxFrame *frame, wxChar *title, const wxPoint& pos, const wxSize& size);
~MainFrame(void);
-
+
public:
// menu callbacks
void OnAbout(wxCommandEvent& event);
//----------------------------------------------------------------------------------------
// ID for the menu quit command
//----------------------------------------------------------------------------------------
-#define QUIT 777
-#define ABOUT 778
-#define HELP 779
#define TREE_CTRL_PGM 102
#define GRID_CTRL 103
#define TREE_CTRL_DB 104
{
b_EditModus = false;
//---------------------------------------------------------------------------------------
- popupMenu1 = new wxMenu(_T(""));
+ popupMenu1 = new wxMenu;
popupMenu1->Append(GRID_EDIT, _("Edit Modus"));
- popupMenu2 = new wxMenu(_T(""));
+ popupMenu2 = new wxMenu;
popupMenu2->Append(GRID_BROWSE, _("Browse Modus"));
}
//----------------------------------------------------------------------------------------
void DBGrid::OnSelectCell( wxGridEvent& ev )
{
- logBuf = _T("");
+ logBuf = wxEmptyString;
logBuf << _T("Selected cell at row ") << ev.GetRow()
<< _T(" col ") << ev.GetCol();
wxLogMessage( _T("%s"), logBuf.c_str() );
//----------------------------------------------------------------------------------------
static inline const wxChar *bool2String(bool b)
{
- return b ? _T("") : _T("not ");
+ return b ? wxEmptyString : _T("not ");
}
//----------------------------------------------------------------------------------------
Temp2.Printf(_T("(%d) - %s"),((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkCol,((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName);
Docu = AppendItem(Folder,Temp2,TreeIc_KEY,TreeIc_KEY,new DBTreeData(Temp1));
Temp2 = ((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkTableName;
- if (Temp2 == _T(""))
+ if (Temp2.empty())
Temp2 = _("None");
Temp2.Printf(_("This Primary Key is used in the following Tables : %s"),Temp2.c_str());
Funkt = AppendItem(Docu,Temp2,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData(_T("KEY")));
Expand(Root);
//---------------------------------------------------------------------------------------
popupMenu1 = NULL;
- popupMenu1 = new wxMenu(_T(""));
+ popupMenu1 = new wxMenu;
popupMenu1->Append(DATA_DB, _("Make wxDB.cpp/h "));
popupMenu1->AppendSeparator();
popupMenu1->Append(DATA_TABLE_ALL, _("Make all wxTable.cpp/h classes"));
popupMenu2 = NULL;
- popupMenu2 = new wxMenu(_T(""));
+ popupMenu2 = new wxMenu;
popupMenu2->Append(DATA_SHOW, _("Show Data"));
popupMenu2->AppendSeparator();
popupMenu2->Append(DATA_TABLE, _("Make wxTable.cpp/h "));
//layout->height.AsIs();
m_Password->SetConstraints(layout);
- m_OK = new wxButton(this, wxID_OK, _("OK"));
+ m_OK = new wxButton(this, wxID_OK);
m_OK->SetFont(* pDoc->ft_Doc);
layout = new wxLayoutConstraints;
layout->left.SameAs(this, wxLeft, 10);
layout->width.Absolute(75);
m_OK->SetConstraints(layout);
- m_Cancel = new wxButton(this, wxID_CANCEL, _("Cancel"));
+ m_Cancel = new wxButton(this, wxID_CANCEL);
m_Cancel->SetFont(* pDoc->ft_Doc);
layout = new wxLayoutConstraints;
layout->left.SameAs(m_OK, wxRight, 10);
{
wxChar Dsn[SQL_MAX_DSN_LENGTH+1];
wxChar DsDesc[254+1]; // BJO20002501 instead of 512
- Temp0 = _T("");
+ Temp0 = wxEmptyString;
i_DSN = 0; // Counter
int i;
//---------------------------------------------------------------------------------------
s_SortDSNList.Add(Dsn);
s_SortDsDescList.Add(KeyString);
}
-
+
//---------------------------------------------------------------------------------------
// Allocate n ODBC-DSN objects to hold the information
// Allocate n wxDatabase objects to hold the column information
// ODBC-DSN object
(p_DSN+i)->Dsn = s_SortDSNList[i];
(p_DSN+i)->Drv = KeyString;
- (p_DSN+i)->Usr = _T("");
- (p_DSN+i)->Pas = _T("");
+ (p_DSN+i)->Usr = wxEmptyString;
+ (p_DSN+i)->Pas = wxEmptyString;
Temp0.Printf(_T("%02d) Dsn(%s) DsDesc(%s)"),i,(p_DSN+i)->Dsn.c_str(),(p_DSN+i)->Drv.c_str());
wxLogMessage(Temp0);
p_TabArea->Show(false); // Deactivate the Window
p_TabArea->RemoveTab(p_DBTree->i_ViewNr);
p_TabArea->Show(true); // Activate the Window
- OnChosenTbl(77,_T(""));
+ OnChosenTbl(77,wxEmptyString);
}
//-------------------------
p_TabArea->Show(false); // Deactivate the Window
p_TabArea->Show(false); // Deactivate the Window
p_DBGrid = new DBGrid(p_TabArea,GRID_CTRL_DB,wxDefaultPosition, wxDefaultSize,
wxSUNKEN_BORDER);
- p_TabArea->AddTab(p_DBGrid, Table, _T(""));
+ p_TabArea->AddTab(p_DBGrid, Table, wxEmptyString);
p_DBGrid->i_ViewNr = p_TabArea->GetTabCount()-1;
p_DBGrid->pDoc = this;
p_DBGrid->db_Br = db_Br;
p_PageArea->Show(false); // Deactivate the Window
p_DBGrid = new DBGrid(p_PageArea,GRID_CTRL_DB,wxDefaultPosition, wxDefaultSize,
wxSUNKEN_BORDER);
- p_PageArea->AddTab(p_DBGrid, Table, _T(""));
+ p_PageArea->AddTab(p_DBGrid, Table, wxEmptyString);
p_DBGrid->i_ViewNr = p_PageArea->GetTabCount()-1;
p_DBGrid->pDoc = this;
p_DBGrid->db_Br = db_Br;
//----------------------------------------------------------------------------------------
static inline const wxChar *bool2String(bool b)
{
- return b ? _T("") : _T("not ");
+ return b ? wxEmptyString : _T("not ");
}
//----------------------------------------------------------------------------------------
PgmCtrl::~PgmCtrl()
{
delete p_imageListNormal;
- delete popupMenu1;
+ delete popupMenu1;
}
//----------------------------------------------------------------------------------------
}
//---------------------------------------------------------------------------------------
popupMenu1 = NULL;
- popupMenu1 = new wxMenu(_T(""));
+ popupMenu1 = new wxMenu;
popupMenu1->Append(PGMCTRL_ODBC_USER, _("Set Username and Password"));
// popupMenu1->AppendSeparator();
//---------------------------------------------------------------------------------------
// wxMessageBox(SaveDSN);
int i;
//--------------------------------------------
- DlgUser *p_Dlg = new DlgUser(this,pDoc,_T(""));
+ DlgUser *p_Dlg = new DlgUser(this,pDoc,wxEmptyString);
//-------------------------------------------
for (i=0;i<pDoc->i_DSN;i++)
{
void OnRightSelect(wxTreeEvent& event);
void OnMouseMove(wxMouseEvent& event);
void OnUserPassword(wxCommandEvent& event);
-
+
public:
//----------------------------------------------------------------------------------------
// NB: due to an ugly wxMSW hack you _must_ use DECLARE_DYNAMIC_CLASS()
int wins, games, score;
m_scoreFile->ReadPlayersScore(m_player, wins, games, score);
m_game->NewPlayer(wins, games, score);
-
+
wxClientDC dc(this);
dc.SetFont(* m_font);
m_game->DisplayScore(dc);
}
}
}
-
+
/*
Called when the main frame is closed
*/
int mouseX = (int)event.GetX();
int mouseY = (int)event.GetY();
- wxClientDC dc(this);
+ wxClientDC dc(this);
PrepareDC(dc);
dc.SetFont(* m_font);
void FortyCanvas::SetCursorStyle(int x, int y)
{
// Only set cursor to a hand if 'helping hand' is enabled and
- // the card under the cursor can go somewhere
+ // the card under the cursor can go somewhere
if (m_game->CanYouGo(x, y) && m_helpingHand)
{
SetCursor(* m_handCursor);
void FortyCanvas::Undo()
{
- wxClientDC dc(this);
+ wxClientDC dc(this);
PrepareDC(dc);
dc.SetFont(* m_font);
m_game->Undo(dc);
void FortyCanvas::Redo()
{
- wxClientDC dc(this);
+ wxClientDC dc(this);
PrepareDC(dc);
dc.SetFont(* m_font);
m_game->Redo(dc);
#include "wx/html/htmlwin.h"
#endif
+#include "wx/stockitem.h"
+
BEGIN_EVENT_TABLE(FortyFrame, wxFrame)
- EVT_MENU(NEW_GAME, FortyFrame::NewGame)
+ EVT_MENU(wxID_NEW, FortyFrame::NewGame)
EVT_MENU(wxID_EXIT, FortyFrame::Exit)
EVT_MENU(wxID_ABOUT, FortyFrame::About)
EVT_MENU(wxID_HELP_CONTENTS, FortyFrame::Help)
- EVT_MENU(UNDO, FortyFrame::Undo)
- EVT_MENU(REDO, FortyFrame::Redo)
+ EVT_MENU(wxID_UNDO, FortyFrame::Undo)
+ EVT_MENU(wxID_REDO, FortyFrame::Redo)
EVT_MENU(SCORES, FortyFrame::Scores)
EVT_MENU(RIGHT_BUTTON_UNDO, FortyFrame::ToggleRightButtonUndo)
EVT_MENU(HELPING_HAND, FortyFrame::ToggleHelpingHand)
// Make a menu bar
wxMenu* gameMenu = new wxMenu;
- gameMenu->Append(NEW_GAME, _T("&New"), _T("Start a new game"));
+ gameMenu->Append(wxID_NEW, wxGetStockLabel(wxID_NEW), _T("Start a new game"));
gameMenu->Append(SCORES, _T("&Scores..."), _T("Displays scores"));
- gameMenu->Append(wxID_EXIT, _T("E&xit"), _T("Exits Forty Thieves"));
+ gameMenu->Append(wxID_EXIT, wxGetStockLabel(wxID_EXIT), _T("Exits Forty Thieves"));
wxMenu* editMenu = new wxMenu;
- editMenu->Append(UNDO, _T("&Undo"), _T("Undo the last move"));
- editMenu->Append(REDO, _T("&Redo"), _T("Redo a move that has been undone"));
+ editMenu->Append(wxID_UNDO, wxGetStockLabel(wxID_UNDO), _T("Undo the last move"));
+ editMenu->Append(wxID_REDO, wxGetStockLabel(wxID_REDO), _T("Redo a move that has been undone"));
wxMenu* optionsMenu = new wxMenu;
optionsMenu->Append(RIGHT_BUTTON_UNDO,
//----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(FortyAboutDialog,wxDialog)
+ EVT_BUTTON(wxID_CLOSE, wxDialog::OnOK)
END_EVENT_TABLE()
FortyAboutDialog::FortyAboutDialog( wxWindow *parent, wxWindowID id, const wxString &title,
}
}
- if (htmlText.IsEmpty())
+ if (htmlText.empty())
{
htmlText.Printf(wxT("<html><head><title>Warning</title></head><body><P>Sorry, could not find resource for About dialog<P></body></html>"));
}
wxASSERT( item1 );
item0->Add( item1, 0, wxALIGN_CENTRE|wxALL, 5 );
- wxButton *item2 = new wxButton( parent, wxID_CANCEL, _T("&Close"), wxDefaultPosition, wxDefaultSize, 0 );
+ wxButton *item2 = new wxButton( parent, wxID_CLOSE );
item2->SetDefault();
item2->SetFocus();
private:
enum MenuCommands {
- NEW_GAME = 10,
- SCORES,
- UNDO,
- REDO,
+ SCORES = 10,
RIGHT_BUTTON_UNDO,
HELPING_HAND,
LARGE_CARDS
m_textField = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize);
- m_OK = new wxButton(this, wxID_OK, _T("OK"));
- m_cancel = new wxButton(this, wxID_CANCEL, _T("Cancel"));
+ m_OK = new wxButton(this, wxID_OK);
+ m_cancel = new wxButton(this, wxID_CANCEL);
wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
button_sizer->Add( m_OK, 0, wxALL, 10 );
// locate and resize with sizers
wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
topsizer->Add( list, 1, wxALL|wxGROW, 10 );
- wxButton *button = new wxButton(this, wxID_OK, _("OK"));
+ wxButton *button = new wxButton(this, wxID_OK);
topsizer->Add( button, 0, wxALIGN_CENTER_HORIZONTAL|wxALL , 10 );
button->SetFocus();
#endif //precompiled headers
#include "wx/math.h"
+#include "wx/stockitem.h"
#include <stdlib.h>
#include <time.h>
// Make a menubar
wxMenu *file_menu = new wxMenu;
- file_menu->Append(wxID_EXIT, _T("E&xit"));
+ file_menu->Append(wxID_EXIT, wxGetStockLabel(wxID_EXIT));
menuBar = new wxMenuBar;
menuBar->Append(file_menu, _T("&File"));
frame->SetMenuBar(menuBar);
Life::Life()
{
// pattern description
- m_name = _("");
- m_rules = _("");
- m_description = _("");
+ m_name = wxEmptyString;
+ m_rules = wxEmptyString;
+ m_description = wxEmptyString;
// pattern data
m_numcells = 0;
m_available = NULL;
// reset state
- m_name = _("");
- m_rules = _("");
- m_description = _("");
+ m_name = wxEmptyString;
+ m_rules = wxEmptyString;
+ m_description = wxEmptyString;
m_numcells = 0;
}
y = c->m_y;
first = false;
}
-
+
LifeCell cell;
cell.i = first? 0 : x + CELLBOX / 2;
cell.j = first? 0 : y + CELLBOX / 2;
y = c->m_y;
first = false;
}
-
+
LifeCell cell;
cell.i = first? 0 : x + CELLBOX / 2;
cell.j = first? 0 : y + CELLBOX / 2;
y = c->m_y;
first = false;
}
-
+
LifeCell cell;
cell.i = first? 0 : x + CELLBOX / 2;
cell.j = first? 0 : y + CELLBOX / 2;
y = c->m_y;
first = false;
}
-
+
LifeCell cell;
cell.i = first? 0 : x + CELLBOX / 2;
cell.j = first? 0 : y + CELLBOX / 2;
t2 |= g_tab[ ((t4 & 0x0000ffff) << 4 ) + ((t3 >> 24) & 0xf) ] << 24;
t2 |= g_tab[ ((t4 & 0xffff0000) >> 12) + ((t3 >> 28) & 0xf) ] << 28;
- c->m_on[0] = c->m_on[1] = c->m_on[2] = c->m_on[3] =
+ c->m_on[0] = c->m_on[1] = c->m_on[2] = c->m_on[3] =
c->m_on[4] = c->m_on[5] = c->m_on[6] = c->m_on[7] = 0;
c->m_live1 = t1;
c->m_live2 = t2;
0x11112110,
0x11112121,
0x11112221,
- 0x11112232,
+ 0x11112232,
0x11122100,
0x11122111,
0x11122211,
m_rules = rules;
m_shape = shape;
};
-
- // A more convenient ctor for the built-in samples
+
+ // A more convenient ctor for the built-in samples
LifePattern(wxString name,
wxString description,
int width,
{
m_name = name;
m_description = description;
- m_rules = _("");
+ m_rules = wxEmptyString;
m_shape.Add( wxString::Format(_T("%i %i"), -width/2, -height/2) );
for(int j = 0; j < height; j++)
{
{
wxInt32 i;
wxInt32 j;
-};
+};
// A private class that contains data about a block of cells
class LifeCellBox;
#include "wx/statline.h"
#include "wx/wfstream.h"
#include "wx/filedlg.h"
+#include "wx/stockitem.h"
#include "life.h"
#include "game.h"
ID_SOUTH,
ID_EAST,
ID_WEST,
- ID_ZOOMIN,
- ID_ZOOMOUT,
ID_INFO,
// game menu
ID_START,
ID_STEP,
- ID_STOP,
ID_TOPSPEED,
// speed selection slider
// Event tables
BEGIN_EVENT_TABLE(LifeFrame, wxFrame)
- EVT_MENU (wxID_NEW, LifeFrame::OnMenu)
- EVT_MENU (wxID_OPEN, LifeFrame::OnOpen)
- EVT_MENU (ID_SAMPLES, LifeFrame::OnSamples)
- EVT_MENU (wxID_ABOUT, LifeFrame::OnMenu)
- EVT_MENU (wxID_EXIT, LifeFrame::OnMenu)
- EVT_MENU (ID_SHOWNAV, LifeFrame::OnMenu)
- EVT_MENU (ID_ORIGIN, LifeFrame::OnNavigate)
- EVT_BUTTON (ID_CENTER, LifeFrame::OnNavigate)
- EVT_BUTTON (ID_NORTH, LifeFrame::OnNavigate)
- EVT_BUTTON (ID_SOUTH, LifeFrame::OnNavigate)
- EVT_BUTTON (ID_EAST, LifeFrame::OnNavigate)
- EVT_BUTTON (ID_WEST, LifeFrame::OnNavigate)
- EVT_MENU (ID_ZOOMIN, LifeFrame::OnZoom)
- EVT_MENU (ID_ZOOMOUT, LifeFrame::OnZoom)
- EVT_MENU (ID_INFO, LifeFrame::OnMenu)
- EVT_MENU (ID_START, LifeFrame::OnMenu)
- EVT_MENU (ID_STEP, LifeFrame::OnMenu)
- EVT_MENU (ID_STOP, LifeFrame::OnMenu)
- EVT_MENU (ID_TOPSPEED, LifeFrame::OnMenu)
- EVT_COMMAND_SCROLL (ID_SLIDER, LifeFrame::OnSlider)
- EVT_TIMER (ID_TIMER, LifeFrame::OnTimer)
- EVT_CLOSE ( LifeFrame::OnClose)
+ EVT_MENU (wxID_NEW, LifeFrame::OnMenu)
+ EVT_MENU (wxID_OPEN, LifeFrame::OnOpen)
+ EVT_MENU (ID_SAMPLES, LifeFrame::OnSamples)
+ EVT_MENU (wxID_ABOUT, LifeFrame::OnMenu)
+ EVT_MENU (wxID_EXIT, LifeFrame::OnMenu)
+ EVT_MENU (ID_SHOWNAV, LifeFrame::OnMenu)
+ EVT_MENU (ID_ORIGIN, LifeFrame::OnNavigate)
+ EVT_BUTTON (ID_CENTER, LifeFrame::OnNavigate)
+ EVT_BUTTON (ID_NORTH, LifeFrame::OnNavigate)
+ EVT_BUTTON (ID_SOUTH, LifeFrame::OnNavigate)
+ EVT_BUTTON (ID_EAST, LifeFrame::OnNavigate)
+ EVT_BUTTON (ID_WEST, LifeFrame::OnNavigate)
+ EVT_MENU (wxID_ZOOM_IN, LifeFrame::OnZoom)
+ EVT_MENU (wxID_ZOOM_OUT,LifeFrame::OnZoom)
+ EVT_MENU (ID_INFO, LifeFrame::OnMenu)
+ EVT_MENU (ID_START, LifeFrame::OnMenu)
+ EVT_MENU (ID_STEP, LifeFrame::OnMenu)
+ EVT_MENU (wxID_STOP, LifeFrame::OnMenu)
+ EVT_MENU (ID_TOPSPEED, LifeFrame::OnMenu)
+ EVT_COMMAND_SCROLL (ID_SLIDER, LifeFrame::OnSlider)
+ EVT_TIMER (ID_TIMER, LifeFrame::OnTimer)
+ EVT_CLOSE ( LifeFrame::OnClose)
END_EVENT_TABLE()
BEGIN_EVENT_TABLE(LifeNavigator, wxMiniFrame)
wxMenu *menuGame = new wxMenu(wxMENU_TEAROFF);
wxMenu *menuHelp = new wxMenu(wxMENU_TEAROFF);
- menuFile->Append(wxID_NEW, _("&New"), _("Start a new game"));
- menuFile->Append(wxID_OPEN, _("&Open..."), _("Open an existing Life pattern"));
+ menuFile->Append(wxID_NEW, wxGetStockLabel(wxID_NEW), _("Start a new game"));
+ menuFile->Append(wxID_OPEN, wxGetStockLabel(wxID_OPEN), _("Open an existing Life pattern"));
menuFile->Append(ID_SAMPLES, _("&Sample game..."), _("Select a sample configuration"));
menuFile->AppendSeparator();
- menuFile->Append(wxID_EXIT, _("E&xit\tAlt-X"), _("Quit this program"));
+ menuFile->Append(wxID_EXIT, wxGetStockLabel(wxID_EXIT, true, _T("Alt-X")), _("Quit this program"));
menuView->Append(ID_SHOWNAV, _("Navigation &toolbox"), _("Show or hide toolbox"), wxITEM_CHECK);
menuView->Check(ID_SHOWNAV, true);
menuView->Append(ID_EAST, _("&East"), _("Find easternmost cell"));
menuView->Append(ID_WEST, _("&West"), _("Find westernmost cell"));
menuView->AppendSeparator();
- menuView->Append(ID_ZOOMIN, _("Zoom &in\tCtrl-I"), _("Zoom in"));
- menuView->Append(ID_ZOOMOUT, _("Zoom &out\tCtrl-O"), _("Zoom out"));
+ menuView->Append(wxID_ZOOM_IN, wxGetStockLabel(wxID_ZOOM_IN, true, _T("Ctrl-I")), _("Zoom in"));
+ menuView->Append(wxID_ZOOM_OUT, wxGetStockLabel(wxID_ZOOM_OUT, true, _T("Ctrl-O")), _("Zoom out"));
menuView->Append(ID_INFO, _("&Description\tCtrl-D"), _("View pattern description"));
menuGame->Append(ID_START, _("&Start\tCtrl-S"), _("Start"));
menuGame->Append(ID_STEP, _("&Next\tCtrl-N"), _("Single step"));
- menuGame->Append(ID_STOP, _("S&top\tCtrl-T"), _("Stop"));
- menuGame->Enable(ID_STOP, false);
+ menuGame->Append(wxID_STOP, wxGetStockLabel(wxID_STOP, true, _T("Ctrl-T")), _("Stop"));
+ menuGame->Enable(wxID_STOP, false);
menuGame->AppendSeparator();
menuGame->Append(ID_TOPSPEED, _("T&op speed!"), _("Go as fast as possible"));
toolBar->SetMargins(5, 5);
toolBar->SetToolBitmapSize(wxSize(16, 16));
- ADD_TOOL(wxID_NEW, tbBitmaps[0], _("New"), _("Start a new game"));
- ADD_TOOL(wxID_OPEN, tbBitmaps[1], _("Open"), _("Open an existing Life pattern"));
+ ADD_TOOL(wxID_NEW, tbBitmaps[0], wxGetStockLabel(wxID_NEW, false), _("Start a new game"));
+ ADD_TOOL(wxID_OPEN, tbBitmaps[1], wxGetStockLabel(wxID_OPEN, false), _("Open an existing Life pattern"));
toolBar->AddSeparator();
- ADD_TOOL(ID_ZOOMIN, tbBitmaps[2], _("Zoom in"), _("Zoom in"));
- ADD_TOOL(ID_ZOOMOUT, tbBitmaps[3], _("Zoom out"), _("Zoom out"));
+ ADD_TOOL(wxID_ZOOM_IN, tbBitmaps[2], wxGetStockLabel(wxID_ZOOM_IN, false), _("Zoom in"));
+ ADD_TOOL(wxID_ZOOM_OUT, tbBitmaps[3], wxGetStockLabel(wxID_ZOOM_OUT, false), _("Zoom out"));
ADD_TOOL(ID_INFO, tbBitmaps[4], _("Description"), _("Show description"));
toolBar->AddSeparator();
ADD_TOOL(ID_START, tbBitmaps[5], _("Start"), _("Start"));
- ADD_TOOL(ID_STOP, tbBitmaps[6], _("Stop"), _("Stop"));
+ ADD_TOOL(wxID_STOP, tbBitmaps[6], wxGetStockLabel(wxID_STOP, false), _("Stop"));
toolBar->Realize();
- toolBar->EnableTool(ID_STOP, false); // must be after Realize() !
+ toolBar->EnableTool(wxID_STOP, false); // must be after Realize() !
#if wxUSE_STATUSBAR
// status bar
{
// start / stop
GetToolBar()->EnableTool(ID_START, !m_running);
- GetToolBar()->EnableTool(ID_STOP, m_running);
+ GetToolBar()->EnableTool(wxID_STOP, m_running);
GetMenuBar()->Enable(ID_START, !m_running);
GetMenuBar()->Enable(ID_STEP, !m_running);
- GetMenuBar()->Enable(ID_STOP, m_running);
+ GetMenuBar()->Enable(wxID_STOP, m_running);
GetMenuBar()->Enable(ID_TOPSPEED, !m_topspeed);
// zooming
int cellsize = m_canvas->GetCellSize();
- GetToolBar()->EnableTool(ID_ZOOMIN, cellsize < 32);
- GetToolBar()->EnableTool(ID_ZOOMOUT, cellsize > 1);
- GetMenuBar()->Enable(ID_ZOOMIN, cellsize < 32);
- GetMenuBar()->Enable(ID_ZOOMOUT, cellsize > 1);
+ GetToolBar()->EnableTool(wxID_ZOOM_IN, cellsize < 32);
+ GetToolBar()->EnableTool(wxID_ZOOM_OUT, cellsize > 1);
+ GetMenuBar()->Enable(wxID_ZOOM_IN, cellsize < 32);
+ GetMenuBar()->Enable(wxID_ZOOM_OUT, cellsize > 1);
}
// Event handlers -----------------------------------------------------------
{
wxString desc = m_life->GetDescription();
- if ( desc.IsEmpty() )
+ if ( desc.empty() )
desc = _("Not available");
// should we make the description editable here?
}
case ID_START : OnStart(); break;
case ID_STEP : OnStep(); break;
- case ID_STOP : OnStop(); break;
+ case wxID_STOP : OnStop(); break;
case ID_TOPSPEED:
{
m_running = true;
{
int cellsize = m_canvas->GetCellSize();
- if ((event.GetId() == ID_ZOOMIN) && cellsize < 32)
+ if ((event.GetId() == wxID_ZOOM_IN) && cellsize < 32)
{
m_canvas->SetCellSize(cellsize * 2);
UpdateUI();
}
- else if ((event.GetId() == ID_ZOOMOUT) && cellsize > 1)
+ else if ((event.GetId() == wxID_ZOOM_OUT) && cellsize > 1)
{
m_canvas->SetCellSize(cellsize / 2);
UpdateUI();
wxInt32 m_viewportY; // first visible cell (y coord)
wxInt32 m_viewportW; // number of visible cells (w)
wxInt32 m_viewportH; // number of visible cells (h)
- int m_thumbX; // horiz. scrollbar thumb position
- int m_thumbY; // vert. scrollbar thumb position
- wxInt32 m_mi, m_mj; // last mouse position
+ int m_thumbX; // horiz. scrollbar thumb position
+ int m_thumbY; // vert. scrollbar thumb position
+ wxInt32 m_mi, m_mj; // last mouse position
};
void OnStop();
void OnStep();
- Life *m_life;
+ Life *m_life;
LifeCanvas *m_canvas;
LifeNavigator *m_navigator;
wxStaticText *m_text;
{
wxBufferedInputStream buff_is(is);
wxTextInputStream text_is(buff_is);
- wxString line, rest;
+ wxString line, rest;
// check stream
m_ok = is.IsOk();
LIFE_CHECKVAL(_("Error reading signature. Not a Life pattern?"));
// read description
- m_description = wxT("");
+ m_description = wxEmptyString;
line = text_is.ReadLine();
while (buff_is.IsOk() && line.StartsWith(wxT("#D"), &rest))
{
{
line = ( text_is.ReadLine() ).Trim();
- if (!line.IsEmpty())
+ if (!line.empty())
{
if (line.StartsWith(wxT("#P "), &rest))
m_shape.Add(rest);
inline wxArrayString GetShape() const { return m_shape; };
inline LifePattern GetPattern() const
{
- return LifePattern(_(""), m_description, m_rules, m_shape);
+ return LifePattern(wxEmptyString, m_description, m_rules, m_shape);
};
private: