General tidy-up (mainly typecasts) to allow the use of the SGI native
compilers (tested on Irix 6.5 with -mips3 -n32). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@623 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -127,7 +127,7 @@ int MyApp::OnExit()
|
||||
// clean up: Set() returns the active config object as Get() does, but unlike
|
||||
// Get() it doesn't try to create one if there is none (definitely not what
|
||||
// we want here!)
|
||||
delete wxConfigBase::Set(NULL);
|
||||
delete wxConfigBase::Set((wxConfigBase *) NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -138,7 +138,7 @@ int MyApp::OnExit()
|
||||
|
||||
// main frame ctor
|
||||
MyFrame::MyFrame()
|
||||
: wxFrame(NULL, -1, "wxConfig Demo")
|
||||
: wxFrame((wxFrame *) NULL, -1, "wxConfig Demo")
|
||||
{
|
||||
// menu
|
||||
wxMenu *file_menu = new wxMenu;
|
||||
@@ -205,7 +205,7 @@ void MyFrame::OnDelete(wxCommandEvent&)
|
||||
if ( wxConfigBase::Get()->DeleteAll() ) {
|
||||
wxLogMessage("Config file/registry key successfully deleted.");
|
||||
|
||||
delete wxConfigBase::Set(NULL);
|
||||
delete wxConfigBase::Set((wxConfigBase *) NULL);
|
||||
wxConfigBase::DontCreateOnDemand();
|
||||
}
|
||||
else
|
||||
|
@@ -92,14 +92,14 @@ IMPLEMENT_APP (MyApp)
|
||||
// MyApp
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
const MINIMAL_QUIT = 100;
|
||||
const MINIMAL_TEXT = 101;
|
||||
const MINIMAL_ABOUT = 102;
|
||||
const int MINIMAL_QUIT = 100;
|
||||
const int MINIMAL_TEXT = 101;
|
||||
const int MINIMAL_ABOUT = 102;
|
||||
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
// Create the main frame window
|
||||
MyFrame *frame = new MyFrame(NULL, "Controls wxWindows App", 50, 50, 500, 420 );
|
||||
MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "Controls wxWindows App", 50, 50, 500, 420 );
|
||||
|
||||
// Give it an icon
|
||||
#ifdef __WXMSW__
|
||||
@@ -127,31 +127,31 @@ bool MyApp::OnInit(void)
|
||||
// MyPanel
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
const ID_NOTEBOOK = 1000;
|
||||
const int ID_NOTEBOOK = 1000;
|
||||
|
||||
const ID_LISTBOX = 130;
|
||||
const ID_LISTBOX_SEL_NUM = 131;
|
||||
const ID_LISTBOX_SEL_STR = 132;
|
||||
const ID_LISTBOX_CLEAR = 133;
|
||||
const ID_LISTBOX_APPEND = 134;
|
||||
const int ID_LISTBOX = 130;
|
||||
const int ID_LISTBOX_SEL_NUM = 131;
|
||||
const int ID_LISTBOX_SEL_STR = 132;
|
||||
const int ID_LISTBOX_CLEAR = 133;
|
||||
const int ID_LISTBOX_APPEND = 134;
|
||||
|
||||
const ID_CHOICE = 120;
|
||||
const ID_CHOICE_SEL_NUM = 121;
|
||||
const ID_CHOICE_SEL_STR = 122;
|
||||
const ID_CHOICE_CLEAR = 123;
|
||||
const ID_CHOICE_APPEND = 124;
|
||||
const int ID_CHOICE = 120;
|
||||
const int ID_CHOICE_SEL_NUM = 121;
|
||||
const int ID_CHOICE_SEL_STR = 122;
|
||||
const int ID_CHOICE_CLEAR = 123;
|
||||
const int ID_CHOICE_APPEND = 124;
|
||||
|
||||
const ID_COMBO = 140;
|
||||
const ID_COMBO_SEL_NUM = 141;
|
||||
const ID_COMBO_SEL_STR = 142;
|
||||
const ID_COMBO_CLEAR = 143;
|
||||
const ID_COMBO_APPEND = 144;
|
||||
const int ID_COMBO = 140;
|
||||
const int ID_COMBO_SEL_NUM = 141;
|
||||
const int ID_COMBO_SEL_STR = 142;
|
||||
const int ID_COMBO_CLEAR = 143;
|
||||
const int ID_COMBO_APPEND = 144;
|
||||
|
||||
const ID_TEXT = 150;
|
||||
const int ID_TEXT = 150;
|
||||
|
||||
const ID_RADIOBOX = 160;
|
||||
const ID_RADIOBOX_SEL_NUM = 161;
|
||||
const ID_RADIOBOX_SEL_STR = 162;
|
||||
const int ID_RADIOBOX = 160;
|
||||
const int ID_RADIOBOX_SEL_NUM = 161;
|
||||
const int ID_RADIOBOX_SEL_STR = 162;
|
||||
|
||||
BEGIN_EVENT_TABLE(MyPanel, wxPanel)
|
||||
EVT_SIZE ( MyPanel::OnSize)
|
||||
|
@@ -40,7 +40,7 @@
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
|
||||
MyCanvas *myCanvas = NULL;
|
||||
MyCanvas *myCanvas = (MyCanvas *) NULL;
|
||||
|
||||
// A macro needed for some compilers (AIX) that need 'main' to be defined
|
||||
// in the application itself.
|
||||
@@ -53,7 +53,7 @@ bool MyApp::OnInit(void)
|
||||
m_canvasFont = *wxNORMAL_FONT;
|
||||
|
||||
// Create the main frame window
|
||||
MyFrame *frame = new MyFrame(NULL, "wxWindows dialogs example", wxPoint(50, 50), wxSize(400, 300));
|
||||
MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "wxWindows dialogs example", wxPoint(50, 50), wxSize(400, 300));
|
||||
|
||||
// Make a menubar
|
||||
wxMenu *file_menu = new wxMenu;
|
||||
@@ -78,7 +78,11 @@ bool MyApp::OnInit(void)
|
||||
file_menu->AppendSeparator();
|
||||
file_menu->Append(DIALOGS_FILE_OPEN, "&Open file");
|
||||
file_menu->Append(DIALOGS_FILE_SAVE, "Sa&ve file");
|
||||
#ifndef __WXGTK__
|
||||
// don't add a menu entry for something that isn't in wxGTK. It only
|
||||
// confuses the user
|
||||
file_menu->Append(DIALOGS_DIR_CHOOSE, "&Choose a directory");
|
||||
#endif
|
||||
file_menu->AppendSeparator();
|
||||
file_menu->Append(wxID_EXIT, "E&xit");
|
||||
wxMenuBar *menu_bar = new wxMenuBar;
|
||||
|
@@ -125,7 +125,7 @@ END_EVENT_TABLE()
|
||||
bool DnDApp::OnInit(void)
|
||||
{
|
||||
// create the main frame window
|
||||
DnDFrame *frame = new DnDFrame(NULL, "Drag & Drop wxWindows App",
|
||||
DnDFrame *frame = new DnDFrame((wxFrame *) NULL, "Drag & Drop wxWindows App",
|
||||
50, 50, 450, 340);
|
||||
|
||||
// activate it
|
||||
|
@@ -203,7 +203,7 @@ bool DrawingCommand::Undo(void)
|
||||
doc->GetDoodleSegments().Append(segment);
|
||||
doc->Modify(TRUE);
|
||||
doc->UpdateAllViews();
|
||||
segment = NULL;
|
||||
segment = (DoodleSegment *) NULL;
|
||||
}
|
||||
doc->Modify(TRUE);
|
||||
doc->UpdateAllViews();
|
||||
|
@@ -41,7 +41,7 @@
|
||||
#include "doc.h"
|
||||
#include "view.h"
|
||||
|
||||
MyFrame *frame = NULL;
|
||||
MyFrame *frame = (MyFrame *) NULL;
|
||||
|
||||
// In single window mode, don't have any child windows; use
|
||||
// main window.
|
||||
@@ -51,7 +51,7 @@ IMPLEMENT_APP(MyApp)
|
||||
|
||||
MyApp::MyApp(void)
|
||||
{
|
||||
m_docManager = NULL;
|
||||
m_docManager = (wxDocManager *) NULL;
|
||||
}
|
||||
|
||||
bool MyApp::OnInit(void)
|
||||
@@ -88,7 +88,7 @@ bool MyApp::OnInit(void)
|
||||
CLASSINFO(TextEditDocument), CLASSINFO(TextEditView));
|
||||
|
||||
//// Create the main frame window
|
||||
frame = new MyFrame(m_docManager, NULL, -1, "DocView Demo", wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE);
|
||||
frame = new MyFrame(m_docManager, (wxFrame *) NULL, -1, "DocView Demo", wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE);
|
||||
|
||||
//// Give it an icon (this is ignored in MDI mode: uses resources)
|
||||
#ifdef __WXMSW__
|
||||
@@ -97,7 +97,7 @@ bool MyApp::OnInit(void)
|
||||
|
||||
//// Make a menubar
|
||||
wxMenu *file_menu = new wxMenu;
|
||||
wxMenu *edit_menu = NULL;
|
||||
wxMenu *edit_menu = (wxMenu *) NULL;
|
||||
|
||||
file_menu->Append(wxID_NEW, "&New...");
|
||||
file_menu->Append(wxID_OPEN, "&Open...");
|
||||
@@ -138,7 +138,7 @@ bool MyApp::OnInit(void)
|
||||
menu_bar->Append(help_menu, "&Help");
|
||||
|
||||
if (singleWindowMode)
|
||||
frame->canvas = frame->CreateCanvas(NULL, frame);
|
||||
frame->canvas = frame->CreateCanvas((wxView *) NULL, frame);
|
||||
|
||||
//// Associate the menu bar with the frame
|
||||
frame->SetMenuBar(menu_bar);
|
||||
@@ -189,7 +189,7 @@ wxFrame *MyApp::CreateChildFrame(wxDocument *doc, wxView *view, bool isCanvas)
|
||||
file_menu->Append(wxID_PREVIEW, "Print Pre&view");
|
||||
}
|
||||
|
||||
wxMenu *edit_menu = NULL;
|
||||
wxMenu *edit_menu = (wxMenu *) NULL;
|
||||
|
||||
if (isCanvas)
|
||||
{
|
||||
@@ -234,8 +234,8 @@ MyFrame::MyFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxS
|
||||
wxDocParentFrame(manager, frame, id, title, pos, size, type)
|
||||
{
|
||||
// This pointer only needed if in single window mode
|
||||
canvas = NULL;
|
||||
editMenu = NULL;
|
||||
canvas = (MyCanvas *) NULL;
|
||||
editMenu = (wxMenu *) NULL;
|
||||
}
|
||||
|
||||
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
|
||||
|
@@ -128,14 +128,14 @@ bool DrawingView::OnClose(bool deleteWindow)
|
||||
// Clear the canvas in case we're in single-window mode,
|
||||
// and the canvas stays.
|
||||
canvas->Clear();
|
||||
canvas->view = NULL;
|
||||
canvas = NULL;
|
||||
canvas->view = (wxView *) NULL;
|
||||
canvas = (MyCanvas *) NULL;
|
||||
|
||||
wxString s(wxTheApp->GetAppName());
|
||||
if (frame)
|
||||
frame->SetTitle(s);
|
||||
|
||||
SetFrame(NULL);
|
||||
SetFrame((wxFrame *) NULL);
|
||||
|
||||
Activate(FALSE);
|
||||
|
||||
@@ -150,7 +150,7 @@ bool DrawingView::OnClose(bool deleteWindow)
|
||||
void DrawingView::OnCut(wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
DrawingDocument *doc = (DrawingDocument *)GetDocument();
|
||||
doc->GetCommandProcessor()->Submit(new DrawingCommand("Cut Last Segment", DOODLE_CUT, doc, NULL));
|
||||
doc->GetCommandProcessor()->Submit(new DrawingCommand((char *) "Cut Last Segment", DOODLE_CUT, doc, (DoodleSegment *) NULL));
|
||||
}
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(TextEditView, wxView)
|
||||
@@ -230,7 +230,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||
if (!view)
|
||||
return;
|
||||
|
||||
static DoodleSegment *currentSegment = NULL;
|
||||
static DoodleSegment *currentSegment = (DoodleSegment *) NULL;
|
||||
|
||||
wxClientDC dc(this);
|
||||
PrepareDC(dc);
|
||||
@@ -244,7 +244,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||
if (currentSegment->lines.Number() == 0)
|
||||
{
|
||||
delete currentSegment;
|
||||
currentSegment = NULL;
|
||||
currentSegment = (DoodleSegment *) NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -254,7 +254,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||
doc->GetCommandProcessor()->Submit(new DrawingCommand("Add Segment", DOODLE_ADD, doc, currentSegment));
|
||||
|
||||
view->GetDocument()->Modify(TRUE);
|
||||
currentSegment = NULL;
|
||||
currentSegment = (DoodleSegment *) NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -46,12 +46,12 @@ class DrawingView: public wxView
|
||||
wxFrame *frame;
|
||||
MyCanvas *canvas;
|
||||
|
||||
DrawingView(void) { canvas = NULL; frame = NULL; };
|
||||
DrawingView(void) { canvas = (MyCanvas *) NULL; frame = (wxFrame *) NULL; };
|
||||
~DrawingView(void) {};
|
||||
|
||||
bool OnCreate(wxDocument *doc, long flags);
|
||||
void OnDraw(wxDC *dc);
|
||||
void OnUpdate(wxView *sender, wxObject *hint = NULL);
|
||||
void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
|
||||
bool OnClose(bool deleteWindow = TRUE);
|
||||
|
||||
void OnCut(wxCommandEvent& event);
|
||||
@@ -67,12 +67,12 @@ class TextEditView: public wxView
|
||||
wxFrame *frame;
|
||||
MyTextWindow *textsw;
|
||||
|
||||
TextEditView(wxDocument *doc = NULL): wxView(doc) { frame = NULL; textsw = NULL; }
|
||||
TextEditView(wxDocument *doc = (wxDocument *) NULL): wxView(doc) { frame = (wxFrame *) NULL; textsw = (MyTextWindow *) NULL; }
|
||||
~TextEditView(void) {}
|
||||
|
||||
bool OnCreate(wxDocument *doc, long flags);
|
||||
void OnDraw(wxDC *dc);
|
||||
void OnUpdate(wxView *sender, wxObject *hint = NULL);
|
||||
void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
|
||||
bool OnClose(bool deleteWindow = TRUE);
|
||||
};
|
||||
|
||||
|
@@ -203,7 +203,7 @@ bool DrawingCommand::Undo(void)
|
||||
doc->GetDoodleSegments().Append(segment);
|
||||
doc->Modify(TRUE);
|
||||
doc->UpdateAllViews();
|
||||
segment = NULL;
|
||||
segment = (DoodleSegment *) NULL;
|
||||
}
|
||||
doc->Modify(TRUE);
|
||||
doc->UpdateAllViews();
|
||||
|
@@ -37,13 +37,13 @@
|
||||
#include "doc.h"
|
||||
#include "view.h"
|
||||
|
||||
MyFrame *frame = NULL;
|
||||
MyFrame *frame = (MyFrame *) NULL;
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
|
||||
MyApp::MyApp(void)
|
||||
{
|
||||
m_docManager = NULL;
|
||||
m_docManager = (wxDocManager *) NULL;
|
||||
}
|
||||
|
||||
bool MyApp::OnInit(void)
|
||||
@@ -52,7 +52,7 @@ bool MyApp::OnInit(void)
|
||||
m_docManager = new wxDocManager;
|
||||
|
||||
//// Create a template relating drawing documents to their views
|
||||
(void) new wxDocTemplate(m_docManager, "Drawing", "*.drw", "", "drw", "Drawing Doc", "Drawing View",
|
||||
(void) new wxDocTemplate((wxDocManager *) m_docManager, "Drawing", "*.drw", "", "drw", "Drawing Doc", "Drawing View",
|
||||
CLASSINFO(DrawingDocument), CLASSINFO(DrawingView));
|
||||
|
||||
//// Create a template relating text documents to their views
|
||||
@@ -60,7 +60,7 @@ bool MyApp::OnInit(void)
|
||||
CLASSINFO(TextEditDocument), CLASSINFO(TextEditView));
|
||||
|
||||
//// Create the main frame window
|
||||
frame = new MyFrame(m_docManager, NULL, "DocView Demo", wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE);
|
||||
frame = new MyFrame((wxDocManager *) m_docManager, (wxFrame *) NULL, (const wxString) "DocView Demo", wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE);
|
||||
|
||||
//// Give it an icon (this is ignored in MDI mode: uses resources)
|
||||
#ifdef __WXMSW__
|
||||
@@ -72,7 +72,7 @@ bool MyApp::OnInit(void)
|
||||
|
||||
//// Make a menubar
|
||||
wxMenu *file_menu = new wxMenu;
|
||||
wxMenu *edit_menu = NULL;
|
||||
wxMenu *edit_menu = (wxMenu *) NULL;
|
||||
|
||||
file_menu->Append(wxID_NEW, "&New...");
|
||||
file_menu->Append(wxID_OPEN, "&Open...");
|
||||
@@ -147,7 +147,7 @@ wxMDIChildFrame *MyApp::CreateChildFrame(wxDocument *doc, wxView *view, bool isC
|
||||
file_menu->AppendSeparator();
|
||||
file_menu->Append(wxID_EXIT, "E&xit");
|
||||
|
||||
wxMenu *edit_menu = NULL;
|
||||
wxMenu *edit_menu = (wxMenu *) NULL;
|
||||
|
||||
if (isCanvas)
|
||||
{
|
||||
@@ -189,7 +189,7 @@ MyFrame::MyFrame(wxDocManager *manager, wxFrame *frame, const wxString& title,
|
||||
const wxPoint& pos, const wxSize& size, long type):
|
||||
wxDocMDIParentFrame(manager, frame, -1, title, pos, size, type, "myFrame")
|
||||
{
|
||||
editMenu = NULL;
|
||||
editMenu = (wxMenu *) NULL;
|
||||
}
|
||||
|
||||
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
|
||||
|
@@ -106,8 +106,8 @@ bool DrawingView::OnClose(bool deleteWindow)
|
||||
// Clear the canvas in case we're in single-window mode,
|
||||
// and the canvas stays.
|
||||
canvas->Clear();
|
||||
canvas->view = NULL;
|
||||
canvas = NULL;
|
||||
canvas->view = (wxView *) NULL;
|
||||
canvas = (MyCanvas *) NULL;
|
||||
|
||||
wxString s(wxTheApp->GetAppName());
|
||||
if (frame)
|
||||
@@ -128,7 +128,7 @@ bool DrawingView::OnClose(bool deleteWindow)
|
||||
void DrawingView::OnCut(wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
DrawingDocument *doc = (DrawingDocument *)GetDocument();
|
||||
doc->GetCommandProcessor()->Submit(new DrawingCommand("Cut Last Segment", DOODLE_CUT, doc, NULL));
|
||||
doc->GetCommandProcessor()->Submit(new DrawingCommand((const wxString) "Cut Last Segment", DOODLE_CUT, doc, (DoodleSegment *) NULL));
|
||||
}
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(TextEditView, wxView)
|
||||
@@ -208,7 +208,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||
if (!view)
|
||||
return;
|
||||
|
||||
static DoodleSegment *currentSegment = NULL;
|
||||
static DoodleSegment *currentSegment = (DoodleSegment *) NULL;
|
||||
|
||||
wxClientDC dc(this);
|
||||
PrepareDC(dc);
|
||||
@@ -222,7 +222,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||
if (currentSegment->lines.Number() == 0)
|
||||
{
|
||||
delete currentSegment;
|
||||
currentSegment = NULL;
|
||||
currentSegment = (DoodleSegment *) NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -232,7 +232,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||
doc->GetCommandProcessor()->Submit(new DrawingCommand("Add Segment", DOODLE_ADD, doc, currentSegment));
|
||||
|
||||
view->GetDocument()->Modify(TRUE);
|
||||
currentSegment = NULL;
|
||||
currentSegment = (DoodleSegment *) NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -46,12 +46,12 @@ class DrawingView: public wxView
|
||||
wxFrame *frame;
|
||||
MyCanvas *canvas;
|
||||
|
||||
DrawingView(void) { canvas = NULL; frame = NULL; };
|
||||
DrawingView(void) { canvas = (MyCanvas *) NULL; frame = (wxFrame *) NULL; };
|
||||
~DrawingView(void) {};
|
||||
|
||||
bool OnCreate(wxDocument *doc, long flags);
|
||||
void OnDraw(wxDC *dc);
|
||||
void OnUpdate(wxView *sender, wxObject *hint = NULL);
|
||||
void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
|
||||
bool OnClose(bool deleteWindow = TRUE);
|
||||
|
||||
void OnCut(wxCommandEvent& event);
|
||||
@@ -67,12 +67,12 @@ class TextEditView: public wxView
|
||||
wxFrame *frame;
|
||||
MyTextWindow *textsw;
|
||||
|
||||
TextEditView(wxDocument *doc = NULL): wxView(doc) { frame = NULL; textsw = NULL; }
|
||||
TextEditView(wxDocument *doc = (wxDocument *) NULL): wxView(doc) { frame = (wxFrame *) NULL; textsw = (MyTextWindow *) NULL; }
|
||||
~TextEditView(void) {}
|
||||
|
||||
bool OnCreate(wxDocument *doc, long flags);
|
||||
void OnDraw(wxDC *dc);
|
||||
void OnUpdate(wxView *sender, wxObject *hint = NULL);
|
||||
void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
|
||||
bool OnClose(bool deleteWindow = TRUE);
|
||||
};
|
||||
|
||||
|
113
samples/dynamic/minimal.cpp
Normal file
113
samples/dynamic/minimal.cpp
Normal file
@@ -0,0 +1,113 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: minimal.cpp
|
||||
// Purpose: Dynamic events wxWindows sample
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "minimal.cpp"
|
||||
#pragma interface "minimal.cpp"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#ifdef __WXGTK__
|
||||
#include "mondrian.xpm"
|
||||
#endif
|
||||
|
||||
// Define a new application type
|
||||
class MyApp: public wxApp
|
||||
{ public:
|
||||
bool OnInit(void);
|
||||
};
|
||||
|
||||
// Define a new frame type
|
||||
class MyFrame: public wxFrame
|
||||
{ public:
|
||||
MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h);
|
||||
|
||||
public:
|
||||
void OnQuit(wxCommandEvent& event);
|
||||
void OnAbout(wxCommandEvent& event);
|
||||
bool OnClose(void) { return TRUE; }
|
||||
};
|
||||
|
||||
// ID for the menu commands
|
||||
#define MINIMAL_QUIT 1
|
||||
#define MINIMAL_TEXT 101
|
||||
#define MINIMAL_ABOUT 102
|
||||
|
||||
// Create a new application object
|
||||
IMPLEMENT_APP (MyApp)
|
||||
|
||||
// `Main program' equivalent, creating windows and returning main app frame
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
// Create the main frame window
|
||||
MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "Minimal wxWindows App", 50, 50, 450, 340);
|
||||
|
||||
frame->Connect( MINIMAL_QUIT, -1, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction)MyFrame::OnQuit );
|
||||
frame->Connect( MINIMAL_ABOUT, -1, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction)MyFrame::OnAbout );
|
||||
|
||||
// Give it an icon
|
||||
#ifdef __WXMSW__
|
||||
frame->SetIcon(wxIcon("mondrian"));
|
||||
#else
|
||||
frame->SetIcon(wxIcon(mondrian_xpm));
|
||||
#endif
|
||||
|
||||
// Make a menubar
|
||||
wxMenu *file_menu = new wxMenu;
|
||||
|
||||
file_menu->Append(MINIMAL_ABOUT, "&About");
|
||||
file_menu->Append(MINIMAL_QUIT, "E&xit");
|
||||
wxMenuBar *menu_bar = new wxMenuBar;
|
||||
menu_bar->Append(file_menu, "&File");
|
||||
frame->SetMenuBar(menu_bar);
|
||||
|
||||
// Make a panel with a message
|
||||
wxPanel *panel = new wxPanel(frame, -1, wxPoint(0, 0), wxSize(400, 200), wxTAB_TRAVERSAL);
|
||||
|
||||
(void)new wxStaticText(panel, 311, "Hello!", wxPoint(10, 10), wxSize(-1, -1), 0);
|
||||
|
||||
// Show the frame
|
||||
frame->Show(TRUE);
|
||||
|
||||
SetTopWindow(frame);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// My frame constructor
|
||||
MyFrame::MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h):
|
||||
wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h))
|
||||
{}
|
||||
|
||||
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
Close(TRUE);
|
||||
}
|
||||
|
||||
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxMessageDialog dialog(this, "This is a minimal sample\nA second line in the message box",
|
||||
"About Minimal", wxYES_NO|wxCANCEL);
|
||||
|
||||
dialog.ShowModal();
|
||||
}
|
||||
|
||||
|
@@ -76,7 +76,7 @@ Pile::Pile(int x, int y, int dx, int dy)
|
||||
void Pile::Redraw(wxDC& dc )
|
||||
{
|
||||
wxWindow *frame = wxTheApp->GetTopWindow();
|
||||
wxWindow *canvas = NULL;
|
||||
wxWindow *canvas = (wxWindow *) NULL;
|
||||
if (frame)
|
||||
{
|
||||
wxNode *node = frame->GetChildren()->First();
|
||||
|
@@ -149,10 +149,10 @@ void ScoreFile::ReadPlayersScore(
|
||||
|
||||
m_config->SetPath("/Players");
|
||||
m_config->SetPath(player);
|
||||
if (m_config->Read(&myScore, "Score") &&
|
||||
m_config->Read(&myGames, "Games") &&
|
||||
m_config->Read(&myWins, "Wins") &&
|
||||
m_config->Read(&check, "Check"))
|
||||
if (m_config->Read(&myScore, (const char *) "Score",0L) &&
|
||||
m_config->Read(&myGames, (const char *) "Games",0L) &&
|
||||
m_config->Read(&myWins, (const char *) "Wins",0L) &&
|
||||
m_config->Read(&check, (const char *) "Check",0L))
|
||||
{
|
||||
if (check != CalcCheck(player, myGames, myWins, myScore))
|
||||
{
|
||||
|
@@ -62,8 +62,8 @@ class MyFrame: public wxFrame
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
wxBitmap *cellBitmap1 = NULL;
|
||||
wxBitmap *cellBitmap2 = NULL;
|
||||
wxBitmap *cellBitmap1 = (wxBitmap *) NULL;
|
||||
wxBitmap *cellBitmap2 = (wxBitmap *) NULL;
|
||||
|
||||
// ID for the menu quit command
|
||||
#define GRID_QUIT 1
|
||||
@@ -94,7 +94,7 @@ bool MyApp::OnInit(void)
|
||||
#endif
|
||||
|
||||
// Create the main frame window
|
||||
MyFrame *frame = new MyFrame(NULL, "wxGrid Sample", wxPoint(50, 50), wxSize(450, 300));
|
||||
MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "wxGrid Sample", wxPoint(50, 50), wxSize(450, 300));
|
||||
|
||||
// Give it an icon
|
||||
#ifdef __WXMSW__
|
||||
@@ -161,7 +161,7 @@ bool MyApp::OnInit(void)
|
||||
MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size):
|
||||
wxFrame(frame, -1, title, pos, size)
|
||||
{
|
||||
grid = NULL;
|
||||
grid = (wxGenericGrid *) NULL;
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
@@ -210,7 +210,7 @@ void MyFrame::ToggleDividers(wxCommandEvent& WXUNUSED(event))
|
||||
if (!grid->GetDividerPen())
|
||||
grid->SetDividerPen(wxThePenList->FindOrCreatePen("LIGHT GREY", 1, wxSOLID));
|
||||
else
|
||||
grid->SetDividerPen(NULL);
|
||||
grid->SetDividerPen((wxPen *) NULL);
|
||||
grid->Refresh();
|
||||
}
|
||||
|
||||
|
@@ -95,7 +95,7 @@ bool MyApp::OnInit(void)
|
||||
m_locale.AddCatalog("fileutils"); // 3) and another just for testing
|
||||
|
||||
// Create the main frame window
|
||||
MyFrame *frame = new MyFrame(NULL, _("Minimal wxWindows App"), 50, 50, 150, 40);
|
||||
MyFrame *frame = new MyFrame((wxFrame *) NULL, _("Minimal wxWindows App"), 50, 50, 150, 40);
|
||||
|
||||
// Give it an icon
|
||||
#ifdef __WXMSW__
|
||||
|
@@ -28,8 +28,8 @@
|
||||
#include "layout.h"
|
||||
|
||||
// Declare two frames
|
||||
MyFrame *frame = NULL;
|
||||
wxMenuBar *menu_bar = NULL;
|
||||
MyFrame *frame = (MyFrame *) NULL;
|
||||
wxMenuBar *menu_bar = (wxMenuBar *) NULL;
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
|
||||
@@ -40,7 +40,7 @@ MyApp::MyApp()
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
// Create the main frame window
|
||||
frame = new MyFrame(NULL, "wxWindows Layout Demo", 0, 0, 550, 500);
|
||||
frame = new MyFrame((MyFrame *) NULL, (char *) "wxWindows Layout Demo", 0, 0, 550, 500);
|
||||
|
||||
frame->SetAutoLayout(TRUE);
|
||||
|
||||
@@ -156,9 +156,9 @@ bool MyApp::OnInit(void)
|
||||
MyFrame::MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h):
|
||||
wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h))
|
||||
{
|
||||
panel = NULL;
|
||||
text_window = NULL;
|
||||
canvas = NULL;
|
||||
panel = (wxPanel *) NULL;
|
||||
text_window = (MyTextWindow *) NULL;
|
||||
canvas = (MyWindow *) NULL;
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
@@ -171,7 +171,7 @@ END_EVENT_TABLE()
|
||||
|
||||
void MyFrame::LoadFile(wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
char *s = wxFileSelector("Load text file", NULL, NULL, NULL, "*.txt");
|
||||
char *s = wxFileSelector("Load text file", (const char *) NULL, (const char *) NULL, (const char *) NULL, "*.txt");
|
||||
if (s)
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
@@ -187,7 +187,7 @@ void MyFrame::Quit(wxCommandEvent& WXUNUSED(event) )
|
||||
|
||||
void MyFrame::TestSizers(wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
SizerFrame *newFrame = new SizerFrame(NULL, "Sizer Test Frame", 50, 50, 500, 500);
|
||||
SizerFrame *newFrame = new SizerFrame((MyFrame *) NULL, (char *) "Sizer Test Frame", 50, 50, 500, 500);
|
||||
newFrame->Show(TRUE);
|
||||
}
|
||||
|
||||
|
@@ -58,7 +58,7 @@ IMPLEMENT_APP(MyApp)
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
// Create the main frame window
|
||||
MyFrame *frame = new MyFrame(NULL, "wxListCtrl Test", 50, 50, 450, 340);
|
||||
MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "wxListCtrl Test", 50, 50, 450, 340);
|
||||
|
||||
// This reduces flicker effects - even better would be to define OnEraseBackground
|
||||
// to do nothing. When the list control's scrollbars are show or hidden, the
|
||||
@@ -175,8 +175,8 @@ bool MyApp::OnInit(void)
|
||||
MyFrame::MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h):
|
||||
wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h))
|
||||
{
|
||||
m_listCtrl = NULL;
|
||||
m_logWindow = NULL;
|
||||
m_listCtrl = (MyListCtrl *) NULL;
|
||||
m_logWindow = (wxTextCtrl *) NULL;
|
||||
}
|
||||
|
||||
MyFrame::~MyFrame(void)
|
||||
@@ -203,8 +203,8 @@ void MyFrame::OnListView(wxCommandEvent& WXUNUSED(event))
|
||||
m_logWindow->Clear();
|
||||
m_listCtrl->DeleteAllItems();
|
||||
m_listCtrl->SetSingleStyle(wxLC_LIST);
|
||||
m_listCtrl->SetImageList(NULL, wxIMAGE_LIST_NORMAL);
|
||||
m_listCtrl->SetImageList(NULL, wxIMAGE_LIST_SMALL);
|
||||
m_listCtrl->SetImageList((wxImageList *) NULL, wxIMAGE_LIST_NORMAL);
|
||||
m_listCtrl->SetImageList((wxImageList *) NULL, wxIMAGE_LIST_SMALL);
|
||||
|
||||
for ( int i=0; i < 30; i++)
|
||||
{
|
||||
@@ -219,7 +219,7 @@ void MyFrame::OnReportView(wxCommandEvent& WXUNUSED(event))
|
||||
m_logWindow->Clear();
|
||||
m_listCtrl->DeleteAllItems();
|
||||
m_listCtrl->SetSingleStyle(wxLC_REPORT);
|
||||
m_listCtrl->SetImageList(NULL, wxIMAGE_LIST_NORMAL);
|
||||
m_listCtrl->SetImageList((wxImageList *) NULL, wxIMAGE_LIST_NORMAL);
|
||||
m_listCtrl->SetImageList(wxGetApp().m_imageListSmall, wxIMAGE_LIST_SMALL);
|
||||
|
||||
m_listCtrl->InsertColumn(0, "Column 1", wxLIST_FORMAT_LEFT, 140);
|
||||
|
@@ -38,7 +38,7 @@
|
||||
|
||||
#include "mdi.h"
|
||||
|
||||
MyFrame *frame = NULL;
|
||||
MyFrame *frame = (MyFrame *) NULL;
|
||||
wxList my_children;
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
@@ -54,7 +54,7 @@ bool MyApp::OnInit(void)
|
||||
{
|
||||
// Create the main frame window
|
||||
|
||||
frame = new MyFrame(NULL, -1, "MDI Demo", wxPoint(0, 0), wxSize(500, 400),
|
||||
frame = new MyFrame((wxFrame *) NULL, -1, (char *) "MDI Demo", wxPoint(0, 0), wxSize(500, 400),
|
||||
wxDEFAULT_FRAME | wxHSCROLL | wxVSCROLL);
|
||||
|
||||
// Give it an icon (this is ignored in MDI mode: uses resources)
|
||||
@@ -274,7 +274,7 @@ MyChild::MyChild(wxMDIParentFrame *parent, const wxString& title, const wxPoint&
|
||||
const long style):
|
||||
wxMDIChildFrame(parent, -1, title, pos, size, style)
|
||||
{
|
||||
canvas = NULL;
|
||||
canvas = (MyCanvas *) NULL;
|
||||
my_children.Append(this);
|
||||
}
|
||||
|
||||
@@ -330,24 +330,24 @@ void MyFrame::InitToolBar(wxToolBar* toolBar)
|
||||
#endif
|
||||
int currentX = 5;
|
||||
|
||||
toolBar->AddTool(0, *(bitmaps[0]), wxNullBitmap, FALSE, currentX, -1, NULL, "New file");
|
||||
toolBar->AddTool(0, *(bitmaps[0]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "New file");
|
||||
currentX += width + 5;
|
||||
toolBar->AddTool(1, *bitmaps[1], wxNullBitmap, FALSE, currentX, -1, NULL, "Open file");
|
||||
toolBar->AddTool(1, *bitmaps[1], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Open file");
|
||||
currentX += width + 5;
|
||||
toolBar->AddTool(2, *bitmaps[2], wxNullBitmap, FALSE, currentX, -1, NULL, "Save file");
|
||||
toolBar->AddTool(2, *bitmaps[2], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Save file");
|
||||
currentX += width + 5;
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddTool(3, *bitmaps[3], wxNullBitmap, FALSE, currentX, -1, NULL, "Copy");
|
||||
toolBar->AddTool(3, *bitmaps[3], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Copy");
|
||||
currentX += width + 5;
|
||||
toolBar->AddTool(4, *bitmaps[4], wxNullBitmap, FALSE, currentX, -1, NULL, "Cut");
|
||||
toolBar->AddTool(4, *bitmaps[4], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Cut");
|
||||
currentX += width + 5;
|
||||
toolBar->AddTool(5, *bitmaps[5], wxNullBitmap, FALSE, currentX, -1, NULL, "Paste");
|
||||
toolBar->AddTool(5, *bitmaps[5], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Paste");
|
||||
currentX += width + 5;
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddTool(6, *bitmaps[6], wxNullBitmap, FALSE, currentX, -1, NULL, "Print");
|
||||
toolBar->AddTool(6, *bitmaps[6], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Print");
|
||||
currentX += width + 5;
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddTool(7, *bitmaps[7], wxNullBitmap, TRUE, currentX, -1, NULL, "Help");
|
||||
toolBar->AddTool(7, *bitmaps[7], wxNullBitmap, TRUE, currentX, -1, (wxObject *) NULL, "Help");
|
||||
|
||||
toolBar->Realize();
|
||||
|
||||
|
@@ -58,7 +58,7 @@ IMPLEMENT_APP(MyApp)
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
// Create the main frame window
|
||||
MyFrame *frame = new MyFrame(NULL);
|
||||
MyFrame *frame = new MyFrame((wxFrame *) NULL);
|
||||
|
||||
// Give it an icon
|
||||
#ifdef wx_msw
|
||||
|
@@ -66,7 +66,7 @@ IMPLEMENT_APP (MyApp)
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
// Create the main frame window
|
||||
MyFrame *frame = new MyFrame(NULL, "Minimal wxWindows App", 50, 50, 450, 340);
|
||||
MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "Minimal wxWindows App", 50, 50, 450, 340);
|
||||
|
||||
// Give it an icon
|
||||
#ifdef __WXMSW__
|
||||
|
@@ -26,8 +26,8 @@
|
||||
|
||||
#include "pngdemo.h"
|
||||
|
||||
MyFrame *frame = NULL;
|
||||
wxBitmap *g_TestBitmap = NULL;
|
||||
MyFrame *frame = (MyFrame *) NULL;
|
||||
wxBitmap *g_TestBitmap = (wxBitmap *) NULL;
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
|
||||
@@ -42,7 +42,7 @@ bool MyApp::OnInit(void)
|
||||
#endif
|
||||
|
||||
// Create the main frame window
|
||||
frame = new MyFrame(NULL, "wxPNGBitmap Demo", wxPoint(0, 0), wxSize(300, 300));
|
||||
frame = new MyFrame((wxFrame *) NULL, "wxPNGBitmap Demo", wxPoint(0, 0), wxSize(300, 300));
|
||||
|
||||
// Give it a status line
|
||||
frame->CreateStatusBar(2);
|
||||
@@ -86,7 +86,7 @@ END_EVENT_TABLE()
|
||||
MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size):
|
||||
wxFrame(frame, -1, title, pos, size)
|
||||
{
|
||||
canvas = NULL;
|
||||
canvas = (MyCanvas *) NULL;
|
||||
}
|
||||
|
||||
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||
@@ -103,7 +103,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||
void MyFrame::OnLoadFile(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
// Show file selector.
|
||||
char *f = wxFileSelector("Open Image", NULL, NULL,"png",
|
||||
char *f = wxFileSelector("Open Image", (const char *) NULL, (const char *) NULL,"png",
|
||||
"PNG files (*.png)|*.png");
|
||||
|
||||
if (!f)
|
||||
@@ -115,7 +115,7 @@ void MyFrame::OnLoadFile(wxCommandEvent& WXUNUSED(event))
|
||||
if (!g_TestBitmap->Ok())
|
||||
{
|
||||
delete g_TestBitmap;
|
||||
g_TestBitmap = NULL;
|
||||
g_TestBitmap = (wxBitmap *) NULL;
|
||||
}
|
||||
|
||||
canvas->Refresh();
|
||||
|
@@ -39,7 +39,7 @@
|
||||
#include "printing.h"
|
||||
|
||||
// Declare a frame
|
||||
MyFrame *frame = NULL;
|
||||
MyFrame *frame = (MyFrame *) NULL;
|
||||
int orientation = wxPORTRAIT;
|
||||
|
||||
// Main proc
|
||||
@@ -75,7 +75,7 @@ bool MyApp::OnInit(void)
|
||||
labelFont = new wxFont(12, wxROMAN, wxITALIC, wxBOLD);
|
||||
|
||||
// Create the main frame window
|
||||
frame = new MyFrame(NULL, "wxWindows Printing Demo", wxPoint(0, 0), wxSize(400, 400));
|
||||
frame = new MyFrame((wxFrame *) NULL, (char *) "wxWindows Printing Demo", wxPoint(0, 0), wxSize(400, 400));
|
||||
|
||||
// Give it a status line
|
||||
frame->CreateStatusBar(2);
|
||||
@@ -156,7 +156,7 @@ END_EVENT_TABLE()
|
||||
MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size):
|
||||
wxFrame(frame, -1, title, pos, size)
|
||||
{
|
||||
canvas = NULL;
|
||||
canvas = (MyCanvas *) NULL;
|
||||
}
|
||||
|
||||
void MyFrame::OnExit(wxCommandEvent& WXUNUSED(event))
|
||||
@@ -531,7 +531,7 @@ void MyPrintout::DrawPageTwo(wxDC *dc)
|
||||
// Writes a header on a page. Margin units are in millimetres.
|
||||
bool WritePageHeader(wxPrintout *printout, wxDC *dc, char *text, float mmToLogical)
|
||||
{
|
||||
static wxFont *headerFont = NULL;
|
||||
static wxFont *headerFont = (wxFont *) NULL;
|
||||
if (!headerFont)
|
||||
{
|
||||
headerFont = wxTheFontList->FindOrCreateFont(16, wxSWISS, wxNORMAL, wxBOLD);
|
||||
|
@@ -56,7 +56,7 @@ static char *menu1 = NULL;
|
||||
#endif
|
||||
|
||||
// Declare two frames
|
||||
MyFrame *frame = NULL;
|
||||
MyFrame *frame = (MyFrame *) NULL;
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
|
||||
@@ -86,7 +86,7 @@ bool MyApp::OnInit(void)
|
||||
#endif
|
||||
|
||||
// Create the main frame window
|
||||
frame = new MyFrame(NULL, -1, "wxWindows Resource Sample", wxPoint(0, 0), wxSize(300, 250));
|
||||
frame = new MyFrame((wxFrame *) NULL, -1, (char *) "wxWindows Resource Sample", wxPoint(0, 0), wxSize(300, 250));
|
||||
|
||||
// Give it a status line
|
||||
frame->CreateStatusBar(2);
|
||||
@@ -144,7 +144,7 @@ END_EVENT_TABLE()
|
||||
MyFrame::MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size):
|
||||
wxFrame(parent, id, title, pos, size)
|
||||
{
|
||||
panel = NULL;
|
||||
panel = (wxWindow *) NULL;
|
||||
}
|
||||
|
||||
void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
|
||||
|
@@ -87,7 +87,7 @@ IMPLEMENT_APP(MyApp)
|
||||
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
MyFrame* frame = new MyFrame(NULL, "wxSplitterWindow Example", wxPoint(50, 50), wxSize(400, 300));
|
||||
MyFrame* frame = new MyFrame((wxFrame *) NULL, (char *) "wxSplitterWindow Example", wxPoint(50, 50), wxSize(400, 300));
|
||||
|
||||
// Show the frame
|
||||
frame->Show(TRUE);
|
||||
|
@@ -24,14 +24,14 @@
|
||||
#include "test.h"
|
||||
|
||||
// Declare two frames
|
||||
MyDialog *dialog = NULL;
|
||||
MyDialog *dialog = (MyDialog *) NULL;
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
// Create the main frame window
|
||||
dialog = new MyDialog(NULL, -1, "Tabbed Dialog", wxPoint(-1, -1), wxSize(365, 390), wxDIALOG_MODAL|wxDEFAULT_DIALOG_STYLE);
|
||||
dialog = new MyDialog((wxFrame *) NULL, -1, (char *) "Tabbed Dialog", wxPoint(-1, -1), wxSize(365, 390), wxDIALOG_MODAL|wxDEFAULT_DIALOG_STYLE);
|
||||
|
||||
dialog->ShowModal();
|
||||
|
||||
|
@@ -117,7 +117,7 @@ IMPLEMENT_APP (MyApp)
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
// Create the main frame window
|
||||
MyFrame *frame = new MyFrame(NULL, "Minimal wxWindows App", 50, 50, 450, 340);
|
||||
MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "Minimal wxWindows App", 50, 50, 450, 340);
|
||||
|
||||
// Make a menubar
|
||||
wxMenu *file_menu = new wxMenu;
|
||||
|
@@ -44,7 +44,7 @@ IMPLEMENT_APP(MyApp)
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
// Create the main frame window
|
||||
MyFrame* frame = new MyFrame(NULL, -1, "wxToolBar Sample",
|
||||
MyFrame* frame = new MyFrame((wxFrame *) NULL, -1, (const wxString) "wxToolBar Sample",
|
||||
wxPoint(100, 100), wxSize(450, 300));
|
||||
|
||||
// Give it a status line
|
||||
@@ -124,24 +124,24 @@ bool MyApp::InitToolbar(wxToolBar* toolBar)
|
||||
#endif
|
||||
int currentX = 5;
|
||||
|
||||
toolBar->AddTool(wxID_NEW, *(toolBarBitmaps[0]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "New file");
|
||||
toolBar->AddTool(wxID_NEW, *(toolBarBitmaps[0]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "New file");
|
||||
currentX += width + 5;
|
||||
toolBar->AddTool(wxID_OPEN, *(toolBarBitmaps[1]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Open file");
|
||||
toolBar->AddTool(wxID_OPEN, *(toolBarBitmaps[1]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "Open file");
|
||||
currentX += width + 5;
|
||||
toolBar->AddTool(wxID_SAVE, *(toolBarBitmaps[2]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Save file");
|
||||
toolBar->AddTool(wxID_SAVE, *(toolBarBitmaps[2]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "Save file");
|
||||
currentX += width + 5;
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddTool(wxID_COPY, *(toolBarBitmaps[3]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Copy");
|
||||
toolBar->AddTool(wxID_COPY, *(toolBarBitmaps[3]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "Copy");
|
||||
currentX += width + 5;
|
||||
toolBar->AddTool(wxID_CUT, *(toolBarBitmaps[4]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Cut");
|
||||
toolBar->AddTool(wxID_CUT, *(toolBarBitmaps[4]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "Cut");
|
||||
currentX += width + 5;
|
||||
toolBar->AddTool(wxID_PASTE, *(toolBarBitmaps[5]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Paste");
|
||||
toolBar->AddTool(wxID_PASTE, *(toolBarBitmaps[5]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "Paste");
|
||||
currentX += width + 5;
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddTool(wxID_PRINT, *(toolBarBitmaps[6]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Print");
|
||||
toolBar->AddTool(wxID_PRINT, *(toolBarBitmaps[6]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "Print");
|
||||
currentX += width + 5;
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddTool(wxID_HELP, *(toolBarBitmaps[7]), wxNullBitmap, FALSE, currentX, -1, NULL, "Help");
|
||||
toolBar->AddTool(wxID_HELP, *(toolBarBitmaps[7]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Help");
|
||||
|
||||
toolBar->Realize();
|
||||
|
||||
|
@@ -59,7 +59,7 @@ IMPLEMENT_APP(MyApp)
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
// Create the main frame window
|
||||
MyFrame *frame = new MyFrame(NULL, "wxTreeCtrl Test", 50, 50, 450, 340);
|
||||
MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "wxTreeCtrl Test", 50, 50, 450, 340);
|
||||
|
||||
// This reduces flicker effects - even better would be to define OnEraseBackground
|
||||
// to do nothing. When the tree control's scrollbars are show or hidden, the
|
||||
@@ -157,8 +157,8 @@ bool MyApp::OnInit(void)
|
||||
MyFrame::MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h):
|
||||
wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h))
|
||||
{
|
||||
m_treeCtrl = NULL;
|
||||
m_logWindow = NULL;
|
||||
m_treeCtrl = (MyTreeCtrl *) NULL;
|
||||
m_logWindow = (wxTextCtrl *) NULL;
|
||||
}
|
||||
|
||||
MyFrame::~MyFrame(void)
|
||||
|
@@ -41,7 +41,7 @@ MyData g_data;
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
// Create the main frame window
|
||||
MyFrame *frame = new MyFrame(NULL, "Validation Test", 50, 50, 300, 250);
|
||||
MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "Validation Test", 50, 50, 300, 250);
|
||||
|
||||
// Give it an icon
|
||||
#ifdef __WXMSW__
|
||||
|
Reference in New Issue
Block a user