#include "forty.h"
#include "card.h"
-#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXX11__)
+#ifndef __WXMSW__
#include "pictures.xpm"
#include "symbols.xbm"
#endif
dc.SetPen(*pen);
dc.DrawRoundedRectangle(x, y, m_width, m_height, 4);
} // Card::DrawNullCard()
-
-
// Event tables
BEGIN_EVENT_TABLE(LifeFrame, wxFrame)
EVT_MENU (wxID_NEW, LifeFrame::OnMenu)
+#if wxUSE_FILEDLG
EVT_MENU (wxID_OPEN, LifeFrame::OnOpen)
+#endif
EVT_MENU (ID_SAMPLES, LifeFrame::OnSamples)
EVT_MENU (wxID_ABOUT, LifeFrame::OnMenu)
EVT_MENU (wxID_EXIT, LifeFrame::OnMenu)
// --------------------------------------------------------------------------
// frame constructor
-LifeFrame::LifeFrame() :
+LifeFrame::LifeFrame() :
wxFrame( (wxFrame *) NULL, wxID_ANY, _("Life!"), wxDefaultPosition ),
m_navigator(NULL)
{
wxMenu *menuHelp = new wxMenu(wxMENU_TEAROFF);
menuFile->Append(wxID_NEW, wxGetStockLabel(wxID_NEW), _("Start a new game"));
+#if wxUSE_FILEDLG
menuFile->Append(wxID_OPEN, wxGetStockLabel(wxID_OPEN), _("Open an existing Life pattern"));
+#endif
menuFile->Append(ID_SAMPLES, _("&Sample game..."), _("Select a sample configuration"));
#if ! (defined(__SMARTPHONE__) || defined(__POCKETPC__))
menuFile->AppendSeparator();
ADD_TOOL(wxID_NEW, tbBitmaps[0], wxGetStockLabel(wxID_NEW, false), _("Start a new game"));
#ifndef __POCKETPC__
+#if wxUSE_FILEDLG
ADD_TOOL(wxID_OPEN, tbBitmaps[1], wxGetStockLabel(wxID_OPEN, false), _("Open an existing Life pattern"));
+#endif // wxUSE_FILEDLG
toolBar->AddSeparator();
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();
-#endif
+#endif // __POCKETPC__
ADD_TOOL(ID_START, tbBitmaps[5], _("Start"), _("Start"));
ADD_TOOL(wxID_STOP, tbBitmaps[6], wxGetStockLabel(wxID_STOP, false), _("Stop"));
}
}
+#if wxUSE_FILEDLG
void LifeFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
{
wxFileDialog filedlg(this,
}
}
}
+#endif
void LifeFrame::OnSamples(wxCommandEvent& WXUNUSED(event))
{
{
// do nothing. I just don't want the background to be erased, you know.
}
-
-
#include "wx/wx.h"
#endif
-#ifndef __WXMSW__
+#if !defined(__WXMSW__) && !defined(__WXPM__)
#include "mondrian.xpm"
#endif
#endif // wxUSE_LOG
void OnBrowser(wxCommandEvent& event);
void OnPlugProvider(wxCommandEvent& event);
-
+
DECLARE_EVENT_TABLE()
};
wxMenu *helpMenu = new wxMenu;
helpMenu->Append(wxID_ABOUT, _T("&About...\tF1"), _T("Show about dialog"));
- menuFile->AppendCheckItem(ID_PlugProvider, _T("&Plug-in art provider"), _T("Enable custom art provider"));
+ menuFile->AppendCheckItem(ID_PlugProvider, _T("&Plug-in art provider"), _T("Enable custom art provider"));
menuFile->AppendSeparator();
#if wxUSE_LOG
#include "wx/clntdata.h"
-#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXCOCOA__)
+#ifndef __WXMSW__
#include "mondrian.xpm"
#endif
#include "wx/wx.h"
#endif
-#ifndef __WXMSW__
+#if !defined(__WXMSW__) && !defined(__WXPM__)
#include "mondrian.xpm"
+#endif
+#ifndef __WXMSW__
#include "bitmaps/toolbrai.xpm"
#include "bitmaps/toolchar.xpm"
#include "bitmaps/tooldata.xpm"
EVT_MENU(LIST_TOGGLE_LINES, MyFrame::OnToggleLines)
EVT_UPDATE_UI(LIST_SHOW_COL_INFO, MyFrame::OnUpdateShowColInfo)
- EVT_UPDATE_UI(LIST_TOGGLE_MULTI_SEL, MyFrame::OnUpdateToggleMultiSel)
+ EVT_UPDATE_UI(LIST_TOGGLE_MULTI_SEL, MyFrame::OnUpdateToggleMultiSel)
END_EVENT_TABLE()
BEGIN_EVENT_TABLE(MyListCtrl, wxListCtrl)
// Show popupmenu at position
wxMenu menu(wxT("Test"));
menu.Append(LIST_ABOUT, _T("&About"));
- PopupMenu(&menu, event.GetPoint());
+ PopupMenu(&menu, event.GetPoint());
wxLogMessage( wxT("OnColumnRightClick at %d."), event.GetColumn() );
}
buf.Printf(_T("Item %d in column 2"), i);
SetItem(i, 2, buf);
}
-
#include "wx/toolbar.h"
#include "minifram.h"
-#if !defined(__WXMSW__)
+#if !defined(__WXMSW__) && !defined(__WXPM__)
#include "mondrian.xpm"
#endif
#include "bitmaps/new.xpm"
mini_frame->SendSizeEvent();
}
}
-
-
win->SetSashVisible(wxSASH_RIGHT, true);
win->SetExtraBorderSize(10);
- wxTextCtrl* textWindow = new wxTextCtrl(win, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize,
+ wxTextCtrl* textWindow = new wxTextCtrl(win, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE|wxSUNKEN_BORDER);
// wxTE_MULTILINE|wxNO_BORDER);
textWindow->SetValue(_T("A help window"));
{
m_leftWindow1->Show(true);
}
+#if wxUSE_MDI_ARCHITECTURE
wxLayoutAlgorithm layout;
layout.LayoutMDIFrame(this);
+#endif // wxUSE_MDI_ARCHITECTURE
}
void MyFrame::OnSashDrag(wxSashEvent& event)
break;
}
}
+
+#if wxUSE_MDI_ARCHITECTURE
wxLayoutAlgorithm layout;
layout.LayoutMDIFrame(this);
+#endif // wxUSE_MDI_ARCHITECTURE
// Leaves bits of itself behind sometimes
GetClientWindow()->Refresh();
// Define the repainting behaviour
void MyCanvas::OnDraw(wxDC& dc)
{
- dc.SetFont(*wxSWISS_FONT);
- dc.SetPen(*wxGREEN_PEN);
- dc.DrawLine(0, 0, 200, 200);
- dc.DrawLine(200, 0, 0, 200);
+ dc.SetFont(*wxSWISS_FONT);
+ dc.SetPen(*wxGREEN_PEN);
+ dc.DrawLine(0, 0, 200, 200);
+ dc.DrawLine(200, 0, 0, 200);
- dc.SetBrush(*wxCYAN_BRUSH);
- dc.SetPen(*wxRED_PEN);
- dc.DrawRectangle(100, 100, 100, 50);
- dc.DrawRoundedRectangle(150, 150, 100, 50, 20);
+ dc.SetBrush(*wxCYAN_BRUSH);
+ dc.SetPen(*wxRED_PEN);
+ dc.DrawRectangle(100, 100, 100, 50);
+ dc.DrawRoundedRectangle(150, 150, 100, 50, 20);
- dc.DrawEllipse(250, 250, 100, 50);
+ dc.DrawEllipse(250, 250, 100, 50);
#if wxUSE_SPLINES
- dc.DrawSpline(50, 200, 50, 100, 200, 10);
+ dc.DrawSpline(50, 200, 50, 100, 200, 10);
#endif // wxUSE_SPLINES
- dc.DrawLine(50, 230, 200, 230);
- dc.DrawText(_T("This is a test string"), 50, 230);
-
- wxPoint points[3];
- points[0].x = 200; points[0].y = 300;
- points[1].x = 100; points[1].y = 400;
- points[2].x = 300; points[2].y = 400;
-
- dc.DrawPolygon(3, points);
+ dc.DrawLine(50, 230, 200, 230);
+ dc.DrawText(_T("This is a test string"), 50, 230);
+
+ wxPoint points[3];
+ points[0].x = 200; points[0].y = 300;
+ points[1].x = 100; points[1].y = 400;
+ points[2].x = 300; points[2].y = 400;
+
+ dc.DrawPolygon(3, points);
}
// This implements a tiny doodling program! Drag the mouse using
void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event))
{
+#if wxUSE_MDI_ARCHITECTURE
wxLayoutAlgorithm layout;
layout.LayoutMDIFrame(this);
+#endif // wxUSE_MDI_ARCHITECTURE
}
// Note that SASHTEST_NEW_WINDOW and SASHTEST_ABOUT commands get passed
if (event.GetActive() && canvas)
canvas->SetFocus();
}
-
#endif
#ifndef WX_PRECOMP
- #include <wx/wx.h>
+ #include "wx/wx.h"
#endif
-#include <wx/toolbar.h>
-#include <wx/log.h>
-#include <wx/image.h>
+#include "wx/toolbar.h"
+#include "wx/log.h"
+#include "wx/image.h"
// define this to 1 to use wxToolBarSimple instead of the native one
#define USE_GENERIC_TBAR 0
// resources
// ----------------------------------------------------------------------------
-#if USE_XPM_BITMAPS
+#if !defined(__WXMSW__) && !defined(__WXPM__)
#include "mondrian.xpm"
+#endif
+
+#if USE_XPM_BITMAPS
#include "bitmaps/new.xpm"
#include "bitmaps/open.xpm"
#include "bitmaps/save.xpm"
// adding a combo to a vertical toolbar is not very smart
if ( m_horzToolbar )
{
- wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO, _T(""), wxDefaultPosition, wxSize(200,wxDefaultCoord) );
+ wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO, wxEmptyString, wxDefaultPosition, wxSize(200,wxDefaultCoord) );
combo->Append(_T("This"));
combo->Append(_T("is a"));
combo->Append(_T("combobox"));
tbarMenu->AppendSeparator();
- tbarMenu->Append(IDM_TOOLBAR_ENABLEPRINT, _T("&Enable print button\tCtrl-E"), _T(""));
- tbarMenu->Append(IDM_TOOLBAR_DELETEPRINT, _T("&Delete print button\tCtrl-D"), _T(""));
- tbarMenu->Append(IDM_TOOLBAR_INSERTPRINT, _T("&Insert print button\tCtrl-I"), _T(""));
- tbarMenu->Append(IDM_TOOLBAR_TOGGLEHELP, _T("Toggle &help button\tCtrl-T"), _T(""));
+ tbarMenu->Append(IDM_TOOLBAR_ENABLEPRINT, _T("&Enable print button\tCtrl-E"), wxEmptyString);
+ tbarMenu->Append(IDM_TOOLBAR_DELETEPRINT, _T("&Delete print button\tCtrl-D"), wxEmptyString);
+ tbarMenu->Append(IDM_TOOLBAR_INSERTPRINT, _T("&Insert print button\tCtrl-I"), wxEmptyString);
+ tbarMenu->Append(IDM_TOOLBAR_TOGGLEHELP, _T("Toggle &help button\tCtrl-T"), wxEmptyString);
tbarMenu->AppendSeparator();
- tbarMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN1, _T("Toggle &1st radio button\tCtrl-1"), _T(""));
- tbarMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN2, _T("Toggle &2nd radio button\tCtrl-2"), _T(""));
- tbarMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN3, _T("Toggle &3rd radio button\tCtrl-3"), _T(""));
+ tbarMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN1, _T("Toggle &1st radio button\tCtrl-1"), wxEmptyString);
+ tbarMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN2, _T("Toggle &2nd radio button\tCtrl-2"), wxEmptyString);
+ tbarMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN3, _T("Toggle &3rd radio button\tCtrl-3"), wxEmptyString);
tbarMenu->AppendSeparator();
- tbarMenu->Append(IDM_TOOLBAR_CHANGE_TOOLTIP, _T("Change tool tip"), _T(""));
+ tbarMenu->Append(IDM_TOOLBAR_CHANGE_TOOLTIP, _T("Change tool tip"), wxEmptyString);
tbarMenu->AppendSeparator();
tbarMenu->AppendRadioItem(IDM_TOOLBAR_SHOW_TEXT, _T("Show &text\tAlt-T"));
tbarMenu->AppendRadioItem(IDM_TOOLBAR_SHOW_ICONS, _T("Show &icons\tAlt-I"));
// Create the toolbar
RecreateToolbar();
- m_textWindow = new wxTextCtrl(this, wxID_ANY, _T(""), wxPoint(0, 0), wxDefaultSize, wxTE_MULTILINE);
+ m_textWindow = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxPoint(0, 0), wxDefaultSize, wxTE_MULTILINE);
}
#if USE_GENERIC_TBAR
SetStatusText(str);
}
else
- SetStatusText(_T(""));
+ SetStatusText(wxEmptyString);
#else
wxUnusedVar(event);
#endif // wxUSE_STATUSBAR
event.GetId() - IDM_TOOLBAR_TOGGLERADIOBTN1, true);
}
}
-