DbGridFrame::DbGridFrame(wxWindow *parent)
: wxFrame (parent, -1, wxT("Database Table"),
- wxDefaultPosition, wxSize(400, 325))
+ wxDefaultPosition, wxSize(400, 325))
{
initialized = FALSE;
}
class DbGridFrame : public wxFrame
{
public:
- bool initialized;
+ bool initialized;
- DbGridFrame(wxWindow *parent);
+ DbGridFrame(wxWindow *parent);
- void OnCloseWindow(wxCloseEvent& event);
- bool Initialize();
+ void OnCloseWindow(wxCloseEvent& event);
+ bool Initialize();
- DECLARE_EVENT_TABLE()
+ DECLARE_EVENT_TABLE()
};
#endif
widgetPtrsSet = TRUE;
// Query the lookup table and display the result set
- lookup = new Clookup(tableName, colName, pDb, defDir);
+ lookup = new Clookup(tableName, colName, pDb, defDir);
if (!lookup)
{
wxMessageBox(wxT("Error allocating memory for 'Clookup'object."),wxT("Error..."));
widgetPtrsSet = TRUE;
// Query the lookup table and display the result set
- lookup2 = new Clookup2(tableName, dispCol1, dispCol2, pDb, defDir);
+ lookup2 = new Clookup2(tableName, dispCol1, dispCol2, pDb, defDir);
if (!lookup2)
{
wxMessageBox(wxT("Error allocating memory for 'Clookup2' object."),wxT("Error..."));
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
DoodleLine *line = (DoodleLine *)node->Data();
stream << line->x1 << " " <<
line->y1 << " " <<
- line->x2 << " " <<
- line->y2 << "\n";
+ line->x2 << " " <<
+ line->y2 << "\n";
node = node->Next();
}
DoodleLine *line = (DoodleLine *)node->Data();
text_stream << line->x1 << " " <<
line->y1 << " " <<
- line->x2 << " " <<
- line->y2 << "\n";
+ line->x2 << " " <<
+ line->y2 << "\n";
node = node->Next();
}
DoodleLine *line = new DoodleLine;
stream >> line->x1 >>
line->y1 >>
- line->x2 >>
- line->y2;
+ line->x2 >>
+ line->y2;
lines.Append(line);
}
DoodleLine *line = new DoodleLine;
text_stream >> line->x1 >>
line->y1 >>
- line->x2 >>
- line->y2;
+ line->x2 >>
+ line->y2;
lines.Append(line);
}
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
{
wxString filename;
filename.Printf(wxT("%s%d.png"), (const wxChar*)rootName, i);
- /* For some reason under wxX11, the 2nd LoadFile in this loop fails, with
- a BadMatch inside CreateFromImage (inside ConvertToBitmap). This happens even if you copy
- the first file over the second file. */
+ /* For some reason under wxX11, the 2nd LoadFile in this loop fails, with
+ a BadMatch inside CreateFromImage (inside ConvertToBitmap). This happens even if you copy
+ the first file over the second file. */
if (image.LoadFile(filename, wxBITMAP_TYPE_PNG))
{
DragShape* newShape = new DragShape(image.ConvertToBitmap());
wxSize client_size = GetClientSize();
wxLogDebug( "size %d %d client_size %d %d", size.x, size.y, client_size.x, client_size.y );
#endif
-
+
+ int i;
dc.SetPen( *wxWHITE_PEN );
- for (int i = 0; i < 20; i += 2)
+ for (i = 0; i < 20; i += 2)
dc.DrawLine( i,i, i+100,i );
dc.SetPen( *wxWHITE_PEN );
- for (int i = 200; i < 220; i += 2)
+ for (i = 200; i < 220; i += 2)
dc.DrawLine( i-200,i, i-100,i );
wxRegion region( 110, 110, 80, 80 );
/*
- * File: grid.cpp
- * Purpose: wxGrid test
- * Author: Julian Smart
- * Created: 1995
- * Updated:
+ * File: grid.cpp
+ * Purpose: wxGrid test
+ * Author: Julian Smart
+ * Created: 1995
+ * Updated:
* Copyright: (c) 1995, AIAI, University of Edinburgh
*/
// Define a new application type
class MyApp: public wxApp
-{ public:
- bool OnInit(void);
+{
+public:
+ virtual bool OnInit(void);
+ virtual int OnExit();
};
bool MyApp::OnInit(void)
{
#ifdef __WXMSW__
- cellBitmap1 = new wxBitmap("bitmap1");
- cellBitmap2 = new wxBitmap("bitmap2");
+ cellBitmap1 = new wxBitmap("bitmap1");
+ cellBitmap2 = new wxBitmap("bitmap2");
#endif
- // Create the main frame window
- MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "wxGrid Sample", wxPoint(50, 50), wxSize(450, 300));
-
- // Give it an icon
+ // Create the main frame window
+ MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "wxGrid Sample", wxPoint(50, 50), wxSize(450, 300));
+
+ // Give it an icon
#ifdef __WXMSW__
- frame->SetIcon(wxIcon("mondrian"));
+ frame->SetIcon(wxIcon("mondrian"));
#endif
- // Make a menubar
- wxMenu *file_menu = new wxMenu;
- file_menu->Append(GRID_QUIT, "E&xit");
-
- wxMenu *settings_menu = new wxMenu;
- settings_menu->Append(GRID_TOGGLE_EDITABLE, "&Toggle editable");
- settings_menu->Append(GRID_TOGGLE_EDITINPLACE, "&Toggle edit in place");
- settings_menu->Append(GRID_TOGGLE_ROW_LABEL, "Toggle ro&w label");
- settings_menu->Append(GRID_TOGGLE_COL_LABEL, "Toggle co&l label");
- settings_menu->Append(GRID_TOGGLE_DIVIDERS, "Toggle ÷rs");
- settings_menu->AppendSeparator();
- settings_menu->Append(GRID_LEFT_CELL, "&Left cell alignment ");
- settings_menu->Append(GRID_CENTRE_CELL, "&Centre cell alignment ");
- settings_menu->Append(GRID_RIGHT_CELL, "&Right cell alignment ");
- settings_menu->AppendSeparator();
- settings_menu->Append(GRID_COLOUR_LABEL_BACKGROUND, "Choose a label &background colour");
- settings_menu->Append(GRID_COLOUR_LABEL_TEXT, "Choose a label fore&ground colour");
- settings_menu->Append(GRID_NORMAL_LABEL_COLOURING, "&Normal label colouring");
- settings_menu->AppendSeparator();
- settings_menu->Append(GRID_COLOUR_CELL_BACKGROUND, "Choo&se a cell &background colour");
- settings_menu->Append(GRID_COLOUR_CELL_TEXT, "Choose &a cell foreground colour");
- settings_menu->Append(GRID_NORMAL_CELL_COLOURING, "N&ormal cell colouring");
-
- wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, "&File");
- menu_bar->Append(settings_menu, "&Settings");
- frame->SetMenuBar(menu_bar);
-
- // Make a grid
- frame->grid = new wxGrid(frame, 0, 0, 400, 400);
-
- frame->grid->CreateGrid(10, 8);
- frame->grid->SetColumnWidth(3, 200);
- frame->grid->SetRowHeight(4, 45);
- frame->grid->SetCellValue("First cell", 0, 0);
- frame->grid->SetCellValue("Another cell", 1, 1);
- frame->grid->SetCellValue("Yet another cell", 2, 2);
- frame->grid->SetCellTextFont(wxFont(10, wxROMAN, wxITALIC, wxNORMAL), 0, 0);
- frame->grid->SetCellTextColour(*wxRED, 1, 1);
- frame->grid->SetCellBackgroundColour(*wxCYAN, 2, 2);
- if (cellBitmap1 && cellBitmap2)
- {
- frame->grid->SetCellAlignment(wxCENTRE, 5, 0);
- frame->grid->SetCellAlignment(wxCENTRE, 6, 0);
- frame->grid->SetCellBitmap(cellBitmap1, 5, 0);
- frame->grid->SetCellBitmap(cellBitmap2, 6, 0);
- }
-
- frame->grid->UpdateDimensions();
-
- // Show the frame
- frame->Show(TRUE);
-
- SetTopWindow(frame);
- return TRUE;
+ // Make a menubar
+ wxMenu *file_menu = new wxMenu;
+ file_menu->Append(GRID_QUIT, "E&xit");
+
+ wxMenu *settings_menu = new wxMenu;
+ settings_menu->Append(GRID_TOGGLE_EDITABLE, "&Toggle editable");
+ settings_menu->Append(GRID_TOGGLE_EDITINPLACE, "&Toggle edit in place");
+ settings_menu->Append(GRID_TOGGLE_ROW_LABEL, "Toggle ro&w label");
+ settings_menu->Append(GRID_TOGGLE_COL_LABEL, "Toggle co&l label");
+ settings_menu->Append(GRID_TOGGLE_DIVIDERS, "Toggle ÷rs");
+ settings_menu->AppendSeparator();
+ settings_menu->Append(GRID_LEFT_CELL, "&Left cell alignment ");
+ settings_menu->Append(GRID_CENTRE_CELL, "&Centre cell alignment ");
+ settings_menu->Append(GRID_RIGHT_CELL, "&Right cell alignment ");
+ settings_menu->AppendSeparator();
+ settings_menu->Append(GRID_COLOUR_LABEL_BACKGROUND, "Choose a label &background colour");
+ settings_menu->Append(GRID_COLOUR_LABEL_TEXT, "Choose a label fore&ground colour");
+ settings_menu->Append(GRID_NORMAL_LABEL_COLOURING, "&Normal label colouring");
+ settings_menu->AppendSeparator();
+ settings_menu->Append(GRID_COLOUR_CELL_BACKGROUND, "Choo&se a cell &background colour");
+ settings_menu->Append(GRID_COLOUR_CELL_TEXT, "Choose &a cell foreground colour");
+ settings_menu->Append(GRID_NORMAL_CELL_COLOURING, "N&ormal cell colouring");
+
+ wxMenuBar *menu_bar = new wxMenuBar;
+ menu_bar->Append(file_menu, "&File");
+ menu_bar->Append(settings_menu, "&Settings");
+ frame->SetMenuBar(menu_bar);
+
+ // Make a grid
+ frame->grid = new wxGrid(frame, 0, 0, 400, 400);
+
+ frame->grid->CreateGrid(10, 8);
+ frame->grid->SetColumnWidth(3, 200);
+ frame->grid->SetRowHeight(4, 45);
+ frame->grid->SetCellValue("First cell", 0, 0);
+ frame->grid->SetCellValue("Another cell", 1, 1);
+ frame->grid->SetCellValue("Yet another cell", 2, 2);
+ frame->grid->SetCellTextFont(wxFont(10, wxROMAN, wxITALIC, wxNORMAL), 0, 0);
+ frame->grid->SetCellTextColour(*wxRED, 1, 1);
+ frame->grid->SetCellBackgroundColour(*wxCYAN, 2, 2);
+ if (cellBitmap1 && cellBitmap2)
+ {
+ frame->grid->SetCellAlignment(wxCENTRE, 5, 0);
+ frame->grid->SetCellAlignment(wxCENTRE, 6, 0);
+ frame->grid->SetCellBitmap(cellBitmap1, 5, 0);
+ frame->grid->SetCellBitmap(cellBitmap2, 6, 0);
+ }
+
+ frame->grid->UpdateDimensions();
+
+ // Show the frame
+ frame->Show(TRUE);
+
+ SetTopWindow(frame);
+ return TRUE;
+}
+
+int MyApp::OnExit()
+{
+ if (cellBitmap1)
+ {
+ delete cellBitmap1;
+ cellBitmap1 = (wxBitmap *) NULL;
+ }
+
+ if (cellBitmap2)
+ {
+ delete cellBitmap2;
+ cellBitmap1 = (wxBitmap *) NULL;
+ }
+
+ // exit code is 0, everything is ok
+ return 0;
}
+
// My frame constructor
-MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size):
- wxFrame(frame, -1, title, pos, size)
+MyFrame::MyFrame(wxFrame *frame, const wxString& title,
+ const wxPoint& pos, const wxSize& size):
+ wxFrame(frame, -1, title, pos, size)
{
- grid = (wxGrid*) NULL;
+ grid = (wxGrid*) NULL;
}
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
- EVT_MENU(GRID_TOGGLE_EDITABLE, MyFrame::ToggleEditable)
- EVT_MENU(GRID_TOGGLE_EDITINPLACE, MyFrame::ToggleEditInPlace)
- EVT_MENU(GRID_TOGGLE_ROW_LABEL, MyFrame::ToggleRowLabel)
- EVT_MENU(GRID_TOGGLE_COL_LABEL, MyFrame::ToggleColLabel)
- EVT_MENU(GRID_TOGGLE_DIVIDERS, MyFrame::ToggleDividers)
- EVT_MENU(GRID_LEFT_CELL, MyFrame::LeftCell)
- EVT_MENU(GRID_CENTRE_CELL, MyFrame::CentreCell)
- EVT_MENU(GRID_RIGHT_CELL, MyFrame::RightCell)
- EVT_MENU(GRID_COLOUR_LABEL_BACKGROUND, MyFrame::ColourLabelBackground)
- EVT_MENU(GRID_COLOUR_LABEL_TEXT, MyFrame::ColourLabelText)
- EVT_MENU(GRID_NORMAL_LABEL_COLOURING, MyFrame::NormalLabelColouring)
- EVT_MENU(GRID_COLOUR_CELL_BACKGROUND, MyFrame::ColourCellBackground)
- EVT_MENU(GRID_COLOUR_CELL_TEXT, MyFrame::ColourCellText)
- EVT_MENU(GRID_NORMAL_CELL_COLOURING, MyFrame::NormalCellColouring)
- EVT_MENU(GRID_QUIT, MyFrame::Quit)
+ EVT_MENU(GRID_TOGGLE_EDITABLE, MyFrame::ToggleEditable)
+ EVT_MENU(GRID_TOGGLE_EDITINPLACE, MyFrame::ToggleEditInPlace)
+ EVT_MENU(GRID_TOGGLE_ROW_LABEL, MyFrame::ToggleRowLabel)
+ EVT_MENU(GRID_TOGGLE_COL_LABEL, MyFrame::ToggleColLabel)
+ EVT_MENU(GRID_TOGGLE_DIVIDERS, MyFrame::ToggleDividers)
+ EVT_MENU(GRID_LEFT_CELL, MyFrame::LeftCell)
+ EVT_MENU(GRID_CENTRE_CELL, MyFrame::CentreCell)
+ EVT_MENU(GRID_RIGHT_CELL, MyFrame::RightCell)
+ EVT_MENU(GRID_COLOUR_LABEL_BACKGROUND, MyFrame::ColourLabelBackground)
+ EVT_MENU(GRID_COLOUR_LABEL_TEXT, MyFrame::ColourLabelText)
+ EVT_MENU(GRID_NORMAL_LABEL_COLOURING, MyFrame::NormalLabelColouring)
+ EVT_MENU(GRID_COLOUR_CELL_BACKGROUND, MyFrame::ColourCellBackground)
+ EVT_MENU(GRID_COLOUR_CELL_TEXT, MyFrame::ColourCellText)
+ EVT_MENU(GRID_NORMAL_CELL_COLOURING, MyFrame::NormalCellColouring)
+ EVT_MENU(GRID_QUIT, MyFrame::Quit)
END_EVENT_TABLE()
void MyFrame::ToggleEditable(wxCommandEvent& WXUNUSED(event))
{
- grid->SetEditable(!grid->GetEditable());
- grid->Refresh();
+ grid->SetEditable(!grid->GetEditable());
+ grid->Refresh();
}
void MyFrame::ToggleEditInPlace(wxCommandEvent& WXUNUSED(event))
{
- grid->SetEditInPlace(!grid->GetEditInPlace());
- grid->Refresh();
+ grid->SetEditInPlace(!grid->GetEditInPlace());
+ grid->Refresh();
}
void MyFrame::ToggleRowLabel(wxCommandEvent& WXUNUSED(event))
{
- if (grid->GetLabelSize(wxVERTICAL) > 0)
+ if (grid->GetLabelSize(wxVERTICAL) > 0)
grid->SetLabelSize(wxVERTICAL, 0);
- else
+ else
grid->SetLabelSize(wxVERTICAL, 40);
- grid->Refresh();
+
+ grid->Refresh();
}
void MyFrame::ToggleColLabel(wxCommandEvent& WXUNUSED(event))
{
- if (grid->GetLabelSize(wxHORIZONTAL) > 0)
+ if (grid->GetLabelSize(wxHORIZONTAL) > 0)
grid->SetLabelSize(wxHORIZONTAL, 0);
- else
+ else
grid->SetLabelSize(wxHORIZONTAL, 20);
+
grid->Refresh();
}
void MyFrame::ToggleDividers(wxCommandEvent& WXUNUSED(event))
{
- if (!grid->GetDividerPen().Ok())
+ if (!grid->GetDividerPen().Ok())
grid->SetDividerPen(wxPen(wxT("LIGHT GREY"), 1, wxSOLID));
- else
+ else
grid->SetDividerPen(wxNullPen);
- grid->Refresh();
+
+grid->Refresh();
}
void MyFrame::LeftCell(wxCommandEvent& WXUNUSED(event))
{
- grid->SetCellAlignment(wxLEFT);
- grid->Refresh();
+ grid->SetCellAlignment(wxLEFT);
+ grid->Refresh();
}
void MyFrame::CentreCell(wxCommandEvent& WXUNUSED(event))
{
- grid->SetCellAlignment(wxCENTRE);
- grid->Refresh();
+ grid->SetCellAlignment(wxCENTRE);
+ grid->Refresh();
}
void MyFrame::RightCell(wxCommandEvent& WXUNUSED(event))
{
- grid->SetCellAlignment(wxRIGHT);
- grid->Refresh();
+ grid->SetCellAlignment(wxRIGHT);
+ grid->Refresh();
}
void MyFrame::ColourLabelBackground(wxCommandEvent& WXUNUSED(event))
{
- wxColourData data;
- data.SetChooseFull(TRUE);
- wxColourDialog dialog(this, &data);
- if (dialog.ShowModal() != wxID_CANCEL)
- {
+ wxColourData data;
+ data.SetChooseFull(TRUE);
+ wxColourDialog dialog(this, &data);
+ if (dialog.ShowModal() != wxID_CANCEL)
+ {
wxColourData retData = dialog.GetColourData();
wxColour col = retData.GetColour();
grid->SetLabelBackgroundColour(col);
grid->Refresh();
- }
+ }
}
void MyFrame::ColourLabelText(wxCommandEvent& WXUNUSED(event))
{
- wxColourData data;
- data.SetChooseFull(TRUE);
- wxColourDialog dialog(this, &data);
- if (dialog.ShowModal() != wxID_CANCEL)
- {
+ wxColourData data;
+ data.SetChooseFull(TRUE);
+ wxColourDialog dialog(this, &data);
+ if (dialog.ShowModal() != wxID_CANCEL)
+ {
wxColourData retData = dialog.GetColourData();
wxColour col = retData.GetColour();
grid->SetLabelTextColour(col);
grid->Refresh();
- }
+ }
}
void MyFrame::NormalLabelColouring(wxCommandEvent& WXUNUSED(event))
{
- grid->SetLabelBackgroundColour(*wxLIGHT_GREY);
- grid->SetLabelTextColour(*wxBLACK);
- grid->Refresh();
+ grid->SetLabelBackgroundColour(*wxLIGHT_GREY);
+ grid->SetLabelTextColour(*wxBLACK);
+ grid->Refresh();
}
void MyFrame::ColourCellBackground(wxCommandEvent& WXUNUSED(event))
{
- wxColourData data;
- data.SetChooseFull(TRUE);
- wxColourDialog dialog(this, &data);
- if (dialog.ShowModal() != wxID_CANCEL)
- {
+ wxColourData data;
+ data.SetChooseFull(TRUE);
+ wxColourDialog dialog(this, &data);
+ if (dialog.ShowModal() != wxID_CANCEL)
+ {
wxColourData retData = dialog.GetColourData();
wxColour col = retData.GetColour();
grid->SetCellBackgroundColour(col);
grid->Refresh();
- }
+ }
}
void MyFrame::ColourCellText(wxCommandEvent& WXUNUSED(event))
{
- wxColourData data;
- data.SetChooseFull(TRUE);
- wxColourDialog dialog(this, &data);
- if (dialog.ShowModal() != wxID_CANCEL)
- {
+ wxColourData data;
+ data.SetChooseFull(TRUE);
+ wxColourDialog dialog(this, &data);
+ if (dialog.ShowModal() != wxID_CANCEL)
+ {
wxColourData retData = dialog.GetColourData();
wxColour col = retData.GetColour();
grid->SetCellTextColour(col);
grid->Refresh();
- }
+ }
}
void MyFrame::NormalCellColouring(wxCommandEvent& WXUNUSED(event))
{
- grid->SetCellBackgroundColour(*wxWHITE);
- grid->SetCellTextColour(*wxBLACK);
- grid->Refresh();
+ grid->SetCellBackgroundColour(*wxWHITE);
+ grid->SetCellTextColour(*wxBLACK);
+ grid->Refresh();
}
void MyFrame::Quit(wxCommandEvent& WXUNUSED(event))
{
- this->Close(TRUE);
+ this->Close(TRUE);
}
// Ensure that the grid's edit control always has the focus.
void MyFrame::OnActivate(wxActivateEvent& event)
{
- if (grid) grid->OnActivate(event.GetActive());
+ if (grid) grid->OnActivate(event.GetActive());
}
ret = help.AddBook("helpfiles/testing.hhp");
#endif
if (! ret)
- wxMessageBox("Failed adding book helpfiles/testing.hhp");
+ wxMessageBox("Failed adding book helpfiles/testing.hhp");
#ifdef __WXMAC__
ret = help.AddBook(":helpfiles:another.hhp");
#else
ret = help.AddBook("helpfiles/another.hhp");
#endif
if (! ret)
- wxMessageBox("Failed adding book helpfiles/another.hhp");
+ wxMessageBox("Failed adding book helpfiles/another.hhp");
}
class MyFrame : public wxFrame
{
public:
- // ctor(s)
+ // ctor and dtor
MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
+ virtual ~MyFrame();
// event handlers (these functions should _not_ be virtual)
void OnQuit(wxCommandEvent& event);
m_Prn -> SetHeader(m_Name + "(@PAGENUM@/@PAGESCNT@)<hr>", wxPAGE_ALL);
}
+// frame destructor
+MyFrame::~MyFrame()
+{
+ delete m_Prn;
+ m_Prn = (wxHtmlEasyPrinting *) NULL;
+}
+
// event handlers
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
- delete m_Prn;
// TRUE is to force the frame to close
Close(TRUE);
}
{
m_Name = dialog.GetPath();
m_Html -> LoadPage(m_Name);
- m_Prn -> SetHeader(m_Name + "(@PAGENUM@/@PAGESCNT@)<hr>", wxPAGE_ALL);
+ m_Prn -> SetHeader(m_Name + "(@PAGENUM@/@PAGESCNT@)<hr>", wxPAGE_ALL);
}
}
#if wxUSE_GIF
image.Destroy();
- if ( !image.LoadFile( dir + wxString("horse.gif")) )
+ if ( !image.LoadFile( dir + wxString("horse.gif")))
+ //if ( !image.LoadFile( wxString("\\slidbar.gif"), wxBITMAP_TYPE_GIF, -2) )
wxLogError(wxT("Can't load GIF image"));
else
my_horse_gif = new wxBitmap( image );
delete my_horse_ico32;
delete my_horse_ico16;
delete my_horse_ico;
+ delete my_horse_cur;
delete my_smile_xbm;
delete my_square;
delete my_anti;
wxListBox *the_list = NULL;
MyConnection *the_connection = NULL;
-MyClient *my_client ;
+MyClient *my_client;
// ============================================================================
// implementation
if (the_connection)
{
the_connection->Disconnect();
+ delete the_connection;
+ the_connection = NULL;
}
// will delete the connection too
+ // Update: Seems it didn't delete the_connection, because there's a leak.
+ // Deletion is now explicitly done a few lines up.
delete my_client;
+
+
return 0;
}
{
}
-MyConnection::~MyConnection()
-{
- the_connection = NULL;
-}
-
bool MyConnection::OnAdvise(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format)
{
if (the_list)
{
public:
MyConnection();
- ~MyConnection();
bool OnAdvise(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format);
bool OnDisconnect();
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
}
BEGIN_EVENT_TABLE(MyCanvas, wxScrolledWindow)
- EVT_JOYSTICK_EVENTS(MyCanvas::OnJoystickEvent)
+ EVT_JOYSTICK_EVENTS(MyCanvas::OnJoystickEvent)
END_EVENT_TABLE()
// Define a constructor for my canvas
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// Define a new application
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// Define a new application
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
//
CMainWindow::CMainWindow()
{
- LoadAccelTable( "MainAccelTable" );
- Create( NULL, "Hello Foundation Application",
- WS_OVERLAPPEDWINDOW, rectDefault, NULL, "MainMenu" );
+ LoadAccelTable( "MainAccelTable" );
+ Create( NULL, "Hello Foundation Application",
+ WS_OVERLAPPEDWINDOW, rectDefault, NULL, "MainMenu" );
}
// OnPaint:
//
void CMainWindow::OnPaint()
{
- CString s = "Hello, Windows!";
- CPaintDC dc( this );
- CRect rect;
-
- GetClientRect( rect );
- dc.SetTextAlign( TA_BASELINE | TA_CENTER );
- dc.SetTextColor( ::GetSysColor( COLOR_WINDOWTEXT ) );
- dc.SetBkMode(TRANSPARENT);
- dc.TextOut( ( rect.right / 2 ), ( rect.bottom / 2 ),
- s, s.GetLength() );
+ CString s = "Hello, Windows!";
+ CPaintDC dc( this );
+ CRect rect;
+
+ GetClientRect( rect );
+ dc.SetTextAlign( TA_BASELINE | TA_CENTER );
+ dc.SetTextColor( ::GetSysColor( COLOR_WINDOWTEXT ) );
+ dc.SetBkMode(TRANSPARENT);
+ dc.TextOut( ( rect.right / 2 ), ( rect.bottom / 2 ),
+ s, s.GetLength() );
}
// OnAbout:
//
void CMainWindow::OnAbout()
{
- CDialog about( "AboutBox", this );
- about.DoModal();
+ CDialog about( "AboutBox", this );
+ about.DoModal();
}
void CMainWindow::OnTest()
// receive no arguments and are void of return type, e.g., "void OnAbout()".
//
BEGIN_MESSAGE_MAP( CMainWindow, CFrameWnd )
- //{{AFX_MSG_MAP( CMainWindow )
- ON_WM_PAINT()
- ON_COMMAND( IDM_ABOUT, OnAbout )
- ON_COMMAND( IDM_TEST, OnTest )
- //}}AFX_MSG_MAP
+ //{{AFX_MSG_MAP( CMainWindow )
+ ON_WM_PAINT()
+ ON_COMMAND( IDM_ABOUT, OnAbout )
+ ON_COMMAND( IDM_TEST, OnTest )
+ //}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//
BOOL CTheApp::InitInstance()
{
- TRACE( "HELLO WORLD\n" );
+ TRACE( "HELLO WORLD\n" );
- SetDialogBkColor(); // hook gray dialogs (was default in MFC V1)
+ SetDialogBkColor(); // hook gray dialogs (was default in MFC V1)
wxEntry((WXHINSTANCE) m_hInstance, (WXHINSTANCE) m_hPrevInstance, m_lpCmdLine, m_nCmdShow, FALSE);
/*
- m_pMainWnd = new CMainWindow();
- m_pMainWnd->ShowWindow( m_nCmdShow );
- m_pMainWnd->UpdateWindow();
+ m_pMainWnd = new CMainWindow();
+ m_pMainWnd->ShowWindow( m_nCmdShow );
+ m_pMainWnd->UpdateWindow();
*/
if (wxTheApp && wxTheApp->GetTopWindow())
m_pMainWnd = new CDummyWindow((HWND) wxTheApp->GetTopWindow()->GetHWND());
}
- return TRUE;
+ return TRUE;
}
int CTheApp::ExitInstance()
class CMainWindow : public CFrameWnd
{
public:
- CMainWindow();
+ CMainWindow();
- //{{AFX_MSG( CMainWindow )
- afx_msg void OnPaint();
- afx_msg void OnAbout();
- afx_msg void OnTest();
- //}}AFX_MSG
+ //{{AFX_MSG( CMainWindow )
+ afx_msg void OnPaint();
+ afx_msg void OnAbout();
+ afx_msg void OnTest();
+ //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
+ DECLARE_MESSAGE_MAP()
};
// A dummy CWnd pointing to a wxWindow's HWND
class CTheApp : public CWinApp
{
public:
- BOOL InitInstance();
+ BOOL InitInstance();
int ExitInstance();
// Override this to provide wxWindows message loop
// Created: 23/07/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Robert Roebling
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/minifram.h"
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
}
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
- EVT_MENU(RESOURCE_QUIT, MyFrame::OnQuit)
- EVT_MENU(RESOURCE_TEST1, MyFrame::OnTest1)
+ EVT_MENU(RESOURCE_QUIT, MyFrame::OnQuit)
+ EVT_MENU(RESOURCE_TEST1, MyFrame::OnTest1)
END_EVENT_TABLE()
// Define my frame constructor
void MyFrame::OnQuit(wxCommandEvent& event)
{
- Close(TRUE);
+ Close(TRUE);
}
void MyFrame::OnTest1(wxCommandEvent& event)
}
BEGIN_EVENT_TABLE(MyDialog, wxDialog)
- EVT_BUTTON(wxID_OK, MyDialog::OnOk)
- EVT_BUTTON(wxID_CANCEL, MyDialog::OnCancel)
+ EVT_BUTTON(wxID_OK, MyDialog::OnOk)
+ EVT_BUTTON(wxID_CANCEL, MyDialog::OnCancel)
END_EVENT_TABLE()
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#ifndef WX_PRECOMP
#include "wx/wx.h"
- #include "wx/colordlg.h"
- #include "wx/fontdlg.h"
#endif
+#include "wx/colordlg.h"
+#include "wx/fontdlg.h"
+
#include "wx/grid.h"
#include "wx/generic/gridctrl.h"
for ( int n = 0; n < grid->GetNumberRows(); )
if ( grid->IsInSelection( n , 0 ) )
grid->DeleteRows( n, 1 );
- else
- n++;
+ else
+ n++;
grid->EndBatch();
}
}
for ( int n = 0; n < grid->GetNumberCols(); )
if ( grid->IsInSelection( 0 , n ) )
grid->DeleteCols( n, 1 );
- else
- n++;
+ else
+ n++;
grid->EndBatch();
}
}
if ( (ev.GetCol() == 4) &&
(ev.GetRow() == 0) &&
- (wxMessageBox(_T("Are you sure you wish to edit this cell"),
- _T("Checking"),wxYES_NO) == wxNO ) ) {
+ (wxMessageBox(_T("Are you sure you wish to edit this cell"),
+ _T("Checking"),wxYES_NO) == wxNO ) ) {
- ev.Veto();
- return;
+ ev.Veto();
+ return;
}
-
-
+
wxLogMessage( wxT("Cell editor shown.") );
ev.Skip();
if ( (ev.GetCol() == 4) &&
(ev.GetRow() == 0) &&
- (wxMessageBox(_T("Are you sure you wish to finish editing this cell"),
- _T("Checking"),wxYES_NO) == wxNO ) ) {
+ (wxMessageBox(_T("Are you sure you wish to finish editing this cell"),
+ _T("Checking"),wxYES_NO) == wxNO ) ) {
- ev.Veto();
- return;
+ ev.Veto();
+ return;
}
wxLogMessage( wxT("Cell editor hidden.") );
{
wxMessageBox("Please ensure Excel is running, then press OK.\nThe active cell should then say 'wxWindows automation test!' in bold.");
- wxAutomationObject excelObject, rangeObject;
- if (!excelObject.GetInstance("Excel.Application"))
- {
+ wxAutomationObject excelObject, rangeObject;
+ if (!excelObject.GetInstance("Excel.Application"))
+ {
if (!excelObject.CreateInstance("Excel.Application"))
{
- wxMessageBox("Could not create Excel object.");
- return;
+ wxMessageBox("Could not create Excel object.");
+ return;
}
- }
- if (!excelObject.PutProperty("ActiveCell.Value", "wxWindows automation test!"))
- {
- wxMessageBox("Could not set active cell value.");
- return;
- }
+ }
+ if (!excelObject.PutProperty("ActiveCell.Value", "wxWindows automation test!"))
+ {
+ wxMessageBox("Could not set active cell value.");
+ return;
+ }
#ifdef HAVE_BOOL
- if (!excelObject.PutProperty("ActiveCell.Font.Bold", wxVariant((bool) TRUE)) )
- {
- wxMessageBox("Could not put Bold property to active cell.");
- return;
- }
+ if (!excelObject.PutProperty("ActiveCell.Font.Bold", wxVariant((bool) TRUE)) )
+ {
+ wxMessageBox("Could not put Bold property to active cell.");
+ return;
+ }
#endif
}
wxGLCanvas::OnSize(event);
// set GL viewport (not called by wxGLCanvas::OnSize on all platforms...)
- int w, h;
- GetClientSize(&w, &h);
+ int w, h;
+ GetClientSize(&w, &h);
#ifndef __WXMOTIF__
if (GetContext())
#endif
Action( m_Key, m_LastTime-m_StartTime, currTime-m_StartTime );
#if defined(__WXMAC__) && !defined(__DARWIN__)
- m_LastRedraw = currTime; // wxStopWatch() doesn't work on Mac...
+ m_LastRedraw = currTime; // wxStopWatch() doesn't work on Mac...
#else
m_LastRedraw = wxStopWatch(&m_secbase) - m_gsynct;
#endif
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CUBE_H_
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
numverts = 0;
while (!feof(f) && numverts<MAXVERTS) {
fscanf( f, "%f %f %f %f %f %f",
- &verts[numverts][0], &verts[numverts][1], &verts[numverts][2],
- &norms[numverts][0], &norms[numverts][1], &norms[numverts][2] );
+ &verts[numverts][0], &verts[numverts][1], &verts[numverts][2],
+ &norms[numverts][0], &norms[numverts][1], &norms[numverts][2] );
numverts++;
}
numverts--;
int *gl_attrib = NULL;
#else
int gl_attrib[20] = { WX_GL_RGBA, WX_GL_MIN_RED, 1, WX_GL_MIN_GREEN, 1,
- WX_GL_MIN_BLUE, 1, WX_GL_DEPTH_SIZE, 1,
- WX_GL_DOUBLEBUFFER,
+ WX_GL_MIN_BLUE, 1, WX_GL_DEPTH_SIZE, 1,
+ WX_GL_DOUBLEBUFFER,
# ifdef __WXMAC__
- GL_NONE };
+ GL_NONE };
# else
- None };
+ None };
# endif
#endif
wxGLCanvas::OnSize(event);
// set GL viewport (not called by wxGLCanvas::OnSize on all platforms...)
- int w, h;
- GetClientSize(&w, &h);
+ int w, h;
+ GetClientSize(&w, &h);
#ifndef __WXMOTIF__
if (GetContext())
#endif
{
- SetCurrent();
+ SetCurrent();
glViewport(0, 0, (GLint) w, (GLint) h);
}
}
{
switch(event.KeyCode()) {
case WXK_ESCAPE:
- exit(0);
+ exit(0);
case WXK_LEFT:
- yrot -= 15.0;
- break;
+ yrot -= 15.0;
+ break;
case WXK_RIGHT:
- yrot += 15.0;
- break;
+ yrot += 15.0;
+ break;
case WXK_UP:
- xrot += 15.0;
- break;
+ xrot += 15.0;
+ break;
case WXK_DOWN:
- xrot -= 15.0;
- break;
+ xrot -= 15.0;
+ break;
case 's': case 'S':
- smooth = !smooth;
- if (smooth) {
- glShadeModel(GL_SMOOTH);
- } else {
- glShadeModel(GL_FLAT);
- }
- break;
+ smooth = !smooth;
+ if (smooth) {
+ glShadeModel(GL_SMOOTH);
+ } else {
+ glShadeModel(GL_FLAT);
+ }
+ break;
case 'l': case 'L':
- lighting = !lighting;
- if (lighting) {
- glEnable(GL_LIGHTING);
- } else {
- glDisable(GL_LIGHTING);
- }
- break;
+ lighting = !lighting;
+ if (lighting) {
+ glEnable(GL_LIGHTING);
+ } else {
+ glDisable(GL_LIGHTING);
+ }
+ break;
default:
{
event.Skip();
- return;
+ return;
}
}
//printf("%f %f %d\n", event.GetX(), event.GetY(), (int)event.LeftIsDown());
if(event.LeftIsDown()) {
- if(!dragging) {
- dragging = 1;
- } else {
- yrot += (event.GetX() - last_x)*1.0;
- xrot += (event.GetY() - last_y)*1.0;
- Refresh(FALSE);
- }
- last_x = event.GetX();
- last_y = event.GetY();
+ if(!dragging) {
+ dragging = 1;
+ } else {
+ yrot += (event.GetX() - last_x)*1.0;
+ xrot += (event.GetY() - last_y)*1.0;
+ Refresh(FALSE);
+ }
+ last_x = event.GetX();
+ last_y = event.GetY();
} else
- dragging = 0;
+ dragging = 0;
}
void TestGLCanvas::OnEraseBackground(wxEraseEvent& event)
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ISOSURF_H_
#endif
#define MK_ID(a,b,c,d) ((((wxUint32)(a))<<24)| \
- (((wxUint32)(b))<<16)| \
- (((wxUint32)(c))<< 8)| \
- (((wxUint32)(d)) ))
+ (((wxUint32)(b))<<16)| \
+ (((wxUint32)(c))<< 8)| \
+ (((wxUint32)(d)) ))
#define ID_FORM MK_ID('F','O','R','M')
#define ID_LWOB MK_ID('L','W','O','B')
det_cnt = read_short(f);
nbytes -= 2;
while (det_cnt-- > 0) {
- int cnt = read_short(f);
- fseek(f, cnt*2+2, SEEK_CUR);
- nbytes -= cnt*2+2;
+ int cnt = read_short(f);
+ fseek(f, cnt*2+2, SEEK_CUR);
+ nbytes -= cnt*2+2;
}
}
face->material -= 1;
prev_index_cnt = face->index_cnt;
switch (face->index_cnt) {
case 3:
- glBegin(GL_TRIANGLES);
- break;
+ glBegin(GL_TRIANGLES);
+ break;
case 4:
- glBegin(GL_QUADS);
- break;
+ glBegin(GL_QUADS);
+ break;
default:
- glBegin(GL_POLYGON);
+ glBegin(GL_POLYGON);
}
}
if (prev_material != face->material) {
prev_material = face->material;
glColor3f(lw_object->material[face->material].r,
- lw_object->material[face->material].g,
- lw_object->material[face->material].b);
+ lw_object->material[face->material].g,
+ lw_object->material[face->material].b);
}
/* update normal if necessary */
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
wxGLCanvas::OnSize(event);
// set GL viewport (not called by wxGLCanvas::OnSize on all platforms...)
- int w, h;
- GetClientSize(&w, &h);
+ int w, h;
+ GetClientSize(&w, &h);
#ifndef __WXMOTIF__
if (GetContext())
#endif
/* drag in progress, simulate trackball */
float spin_quat[4];
trackball(spin_quat,
- (2.0*info.beginx - sz.x) / sz.x,
- ( sz.y - 2.0*info.beginy) / sz.y,
- ( 2.0*event.GetX() - sz.x) / sz.x,
- ( sz.y - 2.0*event.GetY()) / sz.y);
-
+ (2.0*info.beginx - sz.x) / sz.x,
+ ( sz.y - 2.0*info.beginy) / sz.y,
+ ( 2.0*event.GetX() - sz.x) / sz.x,
+ ( sz.y - 2.0*event.GetY()) / sz.y);
+
add_quats( spin_quat, info.quat, info.quat );
-
+
/* orientation has changed, redraw mesh */
- Refresh(FALSE);
+ Refresh(FALSE);
}
-
+
info.beginx = event.GetX();
info.beginy = event.GetY();
}
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_PENGUIN_H_
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
canvas = (MyCanvas *) NULL;
}
+// frame destructor
+MyFrame::~MyFrame()
+{
+ if (g_TestBitmap)
+ {
+ delete g_TestBitmap;
+ g_TestBitmap = (wxBitmap *) NULL;
+ }
+}
+
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
Close(TRUE);
void MyFrame::OnLoadFile(wxCommandEvent& WXUNUSED(event))
{
- // Show file selector.
- wxString f = wxFileSelector(wxT("Open Image"), (const wxChar *) NULL,
+ // Show file selector.
+ wxString f = wxFileSelector(wxT("Open Image"), (const wxChar *) NULL,
(const wxChar *) NULL, wxT("png"),
wxT("PNG files (*.png)|*.png"));
- if (f == "")
- return;
+ if (f == "")
+ return;
if ( g_TestBitmap )
delete g_TestBitmap;
+
g_TestBitmap = new wxBitmap(f, wxBITMAP_TYPE_PNG);
if (!g_TestBitmap->Ok())
{
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
public:
MyCanvas *canvas;
MyFrame(wxFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size);
+ virtual ~MyFrame();
void OnActivate(bool) {}
void OnLoadFile(wxCommandEvent& event);
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
void MyApp::PropertyListTest(bool useDialog)
{
- if (m_childWindow)
- return;
-
- wxPropertySheet *sheet = new wxPropertySheet;
-
- sheet->AddProperty(new wxProperty("fred", 1.0, "real"));
- sheet->AddProperty(new wxProperty("tough choice", (bool)TRUE, "bool"));
- sheet->AddProperty(new wxProperty("ian", (long)45, "integer", new wxIntegerListValidator(-50, 50)));
- sheet->AddProperty(new wxProperty("bill", 25.0, "real", new wxRealListValidator(0.0, 100.0)));
- sheet->AddProperty(new wxProperty("julian", "one", "string"));
- sheet->AddProperty(new wxProperty("bitmap", "none", "string", new wxFilenameListValidator("Select a bitmap file", "*.bmp")));
- wxStringList *strings = new wxStringList(wxT("one"), wxT("two"), wxT("three"), NULL);
- sheet->AddProperty(new wxProperty("constrained", "one", "string", new wxStringListValidator(strings)));
-
- wxStringList *strings2 = new wxStringList(wxT("earth"), wxT("fire"), wxT("wind"), wxT("water"), NULL);
- sheet->AddProperty(new wxProperty("string list", strings2, "stringlist"));
-
- wxPropertyListView *view =
- new wxPropertyListView(NULL,
- wxPROP_BUTTON_OK | wxPROP_BUTTON_CANCEL |
- wxPROP_BUTTON_CHECK_CROSS|wxPROP_DYNAMIC_VALUE_FIELD|wxPROP_PULLDOWN|wxPROP_SHOWVALUES);
-
- wxDialog *propDialog = NULL;
- wxPropertyListFrame *propFrame = NULL;
- if (useDialog)
- {
- propDialog = new PropListDialog(view, NULL, "Property Sheet Test",
- wxPoint(-1, -1), wxSize(400, 500), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODELESS);
- m_childWindow = propDialog;
- }
- else
- {
- propFrame = new PropListFrame(view, NULL, "Property Sheet Test", wxPoint(-1, -1), wxSize(400, 500));
- m_childWindow = propFrame;
- }
-
- view->AddRegistry(&myListValidatorRegistry);
-
- if (useDialog)
- {
- view->ShowView(sheet, (wxPanel *)propDialog);
- propDialog->Centre(wxBOTH);
- propDialog->Show(TRUE);
- }
- else
- {
- propFrame->Initialize();
- view->ShowView(sheet, propFrame->GetPropertyPanel());
-
- propFrame->Centre(wxBOTH);
- propFrame->Show(TRUE);
- }
+ if (m_childWindow)
+ return;
+
+ wxPropertySheet *sheet = new wxPropertySheet;
+
+ sheet->AddProperty(new wxProperty("fred", 1.0, "real"));
+ sheet->AddProperty(new wxProperty("tough choice", (bool)TRUE, "bool"));
+ sheet->AddProperty(new wxProperty("ian", (long)45, "integer", new wxIntegerListValidator(-50, 50)));
+ sheet->AddProperty(new wxProperty("bill", 25.0, "real", new wxRealListValidator(0.0, 100.0)));
+ sheet->AddProperty(new wxProperty("julian", "one", "string"));
+ sheet->AddProperty(new wxProperty("bitmap", "none", "string", new wxFilenameListValidator("Select a bitmap file", "*.bmp")));
+ wxStringList *strings = new wxStringList(wxT("one"), wxT("two"), wxT("three"), NULL);
+ sheet->AddProperty(new wxProperty("constrained", "one", "string", new wxStringListValidator(strings)));
+
+ wxStringList *strings2 = new wxStringList(wxT("earth"), wxT("fire"), wxT("wind"), wxT("water"), NULL);
+ sheet->AddProperty(new wxProperty("string list", strings2, "stringlist"));
+
+ wxPropertyListView *view = new wxPropertyListView
+ (
+ NULL,
+ wxPROP_BUTTON_OK | wxPROP_BUTTON_CANCEL | wxPROP_BUTTON_CHECK_CROSS
+ |wxPROP_DYNAMIC_VALUE_FIELD|wxPROP_PULLDOWN|wxPROP_SHOWVALUES
+ );
+
+ wxDialog *propDialog = NULL;
+ wxPropertyListFrame *propFrame = NULL;
+ if (useDialog)
+ {
+ propDialog = new PropListDialog(view, NULL, "Property Sheet Test",
+ wxPoint(-1, -1), wxSize(400, 500), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODELESS);
+ m_childWindow = propDialog;
+ }
+ else
+ {
+ propFrame = new PropListFrame(view, NULL, "Property Sheet Test", wxPoint(-1, -1), wxSize(400, 500));
+ m_childWindow = propFrame;
+ }
+
+ view->AddRegistry(&myListValidatorRegistry);
+
+ if (useDialog)
+ {
+ view->ShowView(sheet, (wxPanel *)propDialog);
+ propDialog->Centre(wxBOTH);
+ propDialog->Show(TRUE);
+ }
+ else
+ {
+ propFrame->Initialize();
+ view->ShowView(sheet, propFrame->GetPropertyPanel());
+
+ propFrame->Centre(wxBOTH);
+ propFrame->Show(TRUE);
+ }
}
void MyApp::PropertyFormTest(bool useDialog)
{
- if (m_childWindow)
- return;
-
- wxPropertySheet *sheet = new wxPropertySheet;
-
- sheet->AddProperty(new wxProperty("fred", 25.0, "real", new wxRealFormValidator(0.0, 100.0)));
- sheet->AddProperty(new wxProperty("tough choice", (bool)TRUE, "bool"));
- sheet->AddProperty(new wxProperty("ian", (long)45, "integer", new wxIntegerFormValidator(-50, 50)));
- sheet->AddProperty(new wxProperty("julian", "one", "string"));
- wxStringList *strings = new wxStringList(wxT("one"), wxT("two"), wxT("three"), NULL);
- sheet->AddProperty(new wxProperty("constrained", "one", "string", new wxStringFormValidator(strings)));
-
- wxPropertyFormView *view = new wxPropertyFormView(NULL);
-
- wxDialog *propDialog = NULL;
- wxPropertyFormFrame *propFrame = NULL;
- if (useDialog)
- {
- propDialog = new PropFormDialog(view, NULL, "Property Form Test",
- wxPoint(-1, -1), wxSize(380, 250), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL);
- m_childWindow = propDialog;
- }
- else
- {
- propFrame = new PropFormFrame(view, NULL, "Property Form Test", wxPoint(-1,
- -1), wxSize(380, 250));
- propFrame->Initialize();
- m_childWindow = propFrame;
- }
-
- // BCC32 does not like ?:
- wxWindow *panel ;
- if ( propDialog )
- {
- panel = propDialog ;
- }
- else
- {
- panel = propFrame->GetPropertyPanel() ;
- }
-
- wxLayoutConstraints* c;
+ if (m_childWindow)
+ return;
+
+ wxPropertySheet *sheet = new wxPropertySheet;
+
+ sheet->AddProperty(new wxProperty("fred", 25.0, "real", new wxRealFormValidator(0.0, 100.0)));
+ sheet->AddProperty(new wxProperty("tough choice", (bool)TRUE, "bool"));
+ sheet->AddProperty(new wxProperty("ian", (long)45, "integer", new wxIntegerFormValidator(-50, 50)));
+ sheet->AddProperty(new wxProperty("julian", "one", "string"));
+ wxStringList *strings = new wxStringList(wxT("one"), wxT("two"), wxT("three"), NULL);
+ sheet->AddProperty(new wxProperty("constrained", "one", "string", new wxStringFormValidator(strings)));
+
+ wxPropertyFormView *view = new wxPropertyFormView(NULL);
+
+ wxDialog *propDialog = NULL;
+ wxPropertyFormFrame *propFrame = NULL;
+
+ if (useDialog)
+ {
+ propDialog = new PropFormDialog(view, NULL, "Property Form Test",
+ wxPoint(-1, -1), wxSize(380, 250), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL);
+ m_childWindow = propDialog;
+ }
+ else
+ {
+ propFrame = new PropFormFrame(view, NULL, "Property Form Test",
+ wxPoint(-1, -1), wxSize(380, 250));
+ propFrame->Initialize();
+ m_childWindow = propFrame;
+ }
+
+ // BCC32 does not like ?:
+ wxWindow *panel ;
+ if ( propDialog )
+ {
+ panel = propDialog;
+ }
+ else
+ {
+ panel = propFrame->GetPropertyPanel() ;
+ }
+
+ wxLayoutConstraints* c;
#if 0
- if (!propDialog)
- {
- c = new wxLayoutConstraints;
- c->left.SameAs(m_childWindow, wxLeft, 4);
- c->right.SameAs(m_childWindow, wxRight, 4);
- c->top.SameAs(m_childWindow, wxTop, 4);
- c->bottom.SameAs(m_childWindow, wxBottom, 40);
+ if (!propDialog)
+ {
+ c = new wxLayoutConstraints;
+ c->left.SameAs(m_childWindow, wxLeft, 4);
+ c->right.SameAs(m_childWindow, wxRight, 4);
+ c->top.SameAs(m_childWindow, wxTop, 4);
+ c->bottom.SameAs(m_childWindow, wxBottom, 40);
- panel->SetConstraints(c);
- }
+ panel->SetConstraints(c);
+ }
#endif
- // Add items to the panel
- wxButton *okButton = new wxButton(panel, wxID_OK, "OK", wxPoint(-1, -1),
- wxSize(80, 26), 0, wxDefaultValidator, "ok");
- wxButton *cancelButton = new wxButton(panel, wxID_CANCEL, "Cancel", wxPoint(-1, -1),
- wxSize(80, 26), 0, wxDefaultValidator, "cancel");
- wxButton *updateButton = new wxButton(panel, wxID_PROP_UPDATE, "Update", wxPoint(-1, -1),
- wxSize(80, 26), 0, wxDefaultValidator, "update");
- wxButton *revertButton = new wxButton(panel, wxID_PROP_REVERT, "Revert", wxPoint(-1, -1),
- wxSize(80, 26), 0, wxDefaultValidator, "revert");
-
- c = new wxLayoutConstraints;
- c->right.SameAs(panel, wxRight, 4);
- c->bottom.SameAs(panel, wxBottom, 4);
- c->height.AsIs();
- c->width.AsIs();
- revertButton->SetConstraints(c);
-
- c = new wxLayoutConstraints;
- c->right.SameAs(revertButton, wxLeft, 4);
- c->bottom.SameAs(panel, wxBottom, 4);
- c->height.AsIs();
- c->width.AsIs();
- updateButton->SetConstraints(c);
-
- c = new wxLayoutConstraints;
- c->right.SameAs(updateButton, wxLeft, 4);
- c->bottom.SameAs(panel, wxBottom, 4);
- c->height.AsIs();
- c->width.AsIs();
- cancelButton->SetConstraints(c);
-
- c = new wxLayoutConstraints;
- c->right.SameAs(cancelButton, wxLeft, 4);
- c->bottom.SameAs(panel, wxBottom, 4);
- c->height.AsIs();
- c->width.AsIs();
- okButton->SetConstraints(c);
-
- // The name of this text item matches the "fred" property
- wxTextCtrl *text = new wxTextCtrl(panel, -1, "Fred", wxPoint(-1, -1), wxSize(
+ // Add items to the panel
+ wxButton *okButton = new wxButton(panel, wxID_OK, "OK", wxPoint(-1, -1),
+ wxSize(80, 26), 0, wxDefaultValidator, "ok");
+ wxButton *cancelButton = new wxButton(panel, wxID_CANCEL, "Cancel", wxPoint(-1, -1),
+ wxSize(80, 26), 0, wxDefaultValidator, "cancel");
+ wxButton *updateButton = new wxButton(panel, wxID_PROP_UPDATE, "Update", wxPoint(-1, -1),
+ wxSize(80, 26), 0, wxDefaultValidator, "update");
+ wxButton *revertButton = new wxButton(panel, wxID_PROP_REVERT, "Revert", wxPoint(-1, -1),
+ wxSize(80, 26), 0, wxDefaultValidator, "revert");
+
+ c = new wxLayoutConstraints;
+ c->right.SameAs(panel, wxRight, 4);
+ c->bottom.SameAs(panel, wxBottom, 4);
+ c->height.AsIs();
+ c->width.AsIs();
+ revertButton->SetConstraints(c);
+
+ c = new wxLayoutConstraints;
+ c->right.SameAs(revertButton, wxLeft, 4);
+ c->bottom.SameAs(panel, wxBottom, 4);
+ c->height.AsIs();
+ c->width.AsIs();
+ updateButton->SetConstraints(c);
+
+ c = new wxLayoutConstraints;
+ c->right.SameAs(updateButton, wxLeft, 4);
+ c->bottom.SameAs(panel, wxBottom, 4);
+ c->height.AsIs();
+ c->width.AsIs();
+ cancelButton->SetConstraints(c);
+
+ c = new wxLayoutConstraints;
+ c->right.SameAs(cancelButton, wxLeft, 4);
+ c->bottom.SameAs(panel, wxBottom, 4);
+ c->height.AsIs();
+ c->width.AsIs();
+ okButton->SetConstraints(c);
+
+ // The name of this text item matches the "fred" property
+ wxTextCtrl *text = new wxTextCtrl(panel, -1, "Fred", wxPoint(-1, -1), wxSize(
200, -1), 0, wxDefaultValidator, "fred");
-
- c = new wxLayoutConstraints;
- c->left.SameAs(panel, wxLeft, 4);
- c->top.SameAs(panel, wxTop, 4);
- c->height.AsIs();
- c->width.AsIs();
- text->SetConstraints(c);
-
- wxCheckBox *checkBox = new wxCheckBox(panel, -1, "Yes or no", wxPoint(-1, -1),
- wxSize(-1, -1), 0, wxDefaultValidator, "tough choice");
-
- c = new wxLayoutConstraints;
- c->left.SameAs(text, wxRight, 20);
- c->top.SameAs(panel, wxTop, 4);
- c->height.AsIs();
- c->width.AsIs();
- checkBox->SetConstraints(c);
-
+
+ c = new wxLayoutConstraints;
+ c->left.SameAs(panel, wxLeft, 4);
+ c->top.SameAs(panel, wxTop, 4);
+ c->height.AsIs();
+ c->width.AsIs();
+ text->SetConstraints(c);
+
+ wxCheckBox *checkBox = new wxCheckBox(panel, -1, "Yes or no", wxPoint(-1, -1),
+ wxSize(-1, -1), 0, wxDefaultValidator, "tough choice");
+
+ c = new wxLayoutConstraints;
+ c->left.SameAs(text, wxRight, 20);
+ c->top.SameAs(panel, wxTop, 4);
+ c->height.AsIs();
+ c->width.AsIs();
+ checkBox->SetConstraints(c);
+
wxSlider *slider = new wxSlider(panel, -1, -50, 50, 150, wxPoint(-1, -1),
wxSize(200,10), 0, wxDefaultValidator, "ian");
- c = new wxLayoutConstraints;
- c->left.SameAs(panel, wxLeft, 4);
- c->top.SameAs(text, wxBottom, 10);
- c->height.AsIs();
- c->width.AsIs();
- slider->SetConstraints(c);
-
- wxListBox *listBox = new wxListBox(panel, -1, wxPoint(-1, -1), wxSize(200, 100),
- 0, NULL, 0, wxDefaultValidator, "constrained");
-
- c = new wxLayoutConstraints;
- c->left.SameAs(panel, wxLeft, 4);
- c->top.SameAs(slider, wxBottom, 10);
- c->height.AsIs();
- c->width.AsIs();
- listBox->SetConstraints(c);
-
- view->AddRegistry(&myFormValidatorRegistry);
-
- panel->SetAutoLayout(TRUE);
-
- view->ShowView(sheet, panel);
- view->AssociateNames();
- view->TransferToDialog();
-
- if (useDialog) {
- propDialog->Layout();
- propDialog->Centre(wxBOTH);
- propDialog->Show(TRUE);
- } else {
- // panel->Layout();
- propFrame->Centre(wxBOTH);
- propFrame->Show(TRUE);
- }
+ c = new wxLayoutConstraints;
+ c->left.SameAs(panel, wxLeft, 4);
+ c->top.SameAs(text, wxBottom, 10);
+ c->height.AsIs();
+ c->width.AsIs();
+ slider->SetConstraints(c);
+
+ wxListBox *listBox = new wxListBox(panel, -1, wxPoint(-1, -1),
+ wxSize(200, 100), 0, NULL, 0, wxDefaultValidator, "constrained");
+
+ c = new wxLayoutConstraints;
+ c->left.SameAs(panel, wxLeft, 4);
+ c->top.SameAs(slider, wxBottom, 10);
+ c->height.AsIs();
+ c->width.AsIs();
+ listBox->SetConstraints(c);
+
+ view->AddRegistry(&myFormValidatorRegistry);
+
+ panel->SetAutoLayout(TRUE);
+
+ view->ShowView(sheet, panel);
+ view->AssociateNames();
+ view->TransferToDialog();
+
+ if (useDialog) {
+ propDialog->Layout();
+ propDialog->Centre(wxBOTH);
+ propDialog->Show(TRUE);
+ }
+ else
+ {
+ // panel->Layout();
+ propFrame->Centre(wxBOTH);
+ propFrame->Show(TRUE);
+ }
}
BEGIN_EVENT_TABLE(PropListFrame, wxPropertyListFrame)
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
}
BEGIN_EVENT_TABLE(MyPanel, wxPanel)
- EVT_LEFT_DOWN( MyPanel::OnClick)
+ EVT_LEFT_DOWN( MyPanel::OnClick)
END_EVENT_TABLE()
MyPanel::MyPanel( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
- EVT_MENU(RESOURCE_ABOUT, MyFrame::OnAbout)
- EVT_MENU(RESOURCE_QUIT, MyFrame::OnQuit)
- EVT_MENU(RESOURCE_TESTDIALOG, MyFrame::OnTestDialog)
+ EVT_MENU(RESOURCE_ABOUT, MyFrame::OnAbout)
+ EVT_MENU(RESOURCE_QUIT, MyFrame::OnQuit)
+ EVT_MENU(RESOURCE_TESTDIALOG, MyFrame::OnTestDialog)
END_EVENT_TABLE()
// Define my frame constructor
void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
{
- Close(TRUE);
+ Close(TRUE);
}
void MyFrame::OnTestDialog(wxCommandEvent& WXUNUSED(event) )
}
BEGIN_EVENT_TABLE(MyDialog, wxDialog)
- // EVT_BUTTON(RESOURCE_OK, MyDialog::OnOk)
- EVT_BUTTON(ID_BUTTON109, MyDialog::OnCancel)
+ //EVT_BUTTON(RESOURCE_OK, MyDialog::OnOk)
+ EVT_BUTTON(ID_BUTTON109, MyDialog::OnCancel)
END_EVENT_TABLE()
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
###############################################################################
-Project: "treectrl"=.\treectrl\treectrl.dsp - Package Owner=<4>
+Project: "treetest"=.\treectrl\treetest.dsp - Package Owner=<4>
Package=<5>
{{{
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
// Define my frame constructor
MyFrame::MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size,
- const long style):
+ const long style):
wxMDIParentFrame(parent, id, title, pos, size, style)
{
// Create some dummy layout windows
}
BEGIN_EVENT_TABLE(MyCanvas, wxScrolledWindow)
- EVT_MOUSE_EVENTS(MyCanvas::OnEvent)
+ EVT_MOUSE_EVENTS(MyCanvas::OnEvent)
END_EVENT_TABLE()
// Define a constructor for my canvas
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#include "wx/toolbar.h"
(0-scroll_x < size_x) && (0-scroll_y < size_y))
{
// Has the region on screen been exposed?
- if (IsExposed(0,0,100,25))
- {
- wxLogMessage( wxT("Redraw first cell") );
+ if (IsExposed(0,0,100,25))
+ {
+ wxLogMessage( wxT("Redraw first cell") );
dc.DrawRectangle( 0, 0, 100, 25 );
- dc.DrawText( "First Cell", 5, 5 );
- }
+ dc.DrawText( "First Cell", 5, 5 );
+ }
}
(200-scroll_x < size_x) && (0-scroll_y < size_y))
{
// Has the region on screen been exposed?
- if (IsExposed(200,0,100,25))
- {
- wxLogMessage( wxT("Redraw second cell") );
+ if (IsExposed(200,0,100,25))
+ {
+ wxLogMessage( wxT("Redraw second cell") );
dc.DrawRectangle( 200, 0, 100, 25 );
- dc.DrawText( "Second Cell", 205, 5 );
- }
+ dc.DrawText( "Second Cell", 205, 5 );
+ }
}
}
void MyFrame::OnUpdateStatusBarToggle(wxUpdateUIEvent& event)
{
- event.Check(GetStatusBar() != 0);
+ event.Check(GetStatusBar() != 0);
}
void MyFrame::OnStatusBarToggle(wxCommandEvent& WXUNUSED(event))
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Define a new application
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
class MyTaskBarIcon: public wxTaskBarIcon
{
public:
- MyTaskBarIcon() {};
+ MyTaskBarIcon() {};
virtual void OnMouseMove(wxEvent&);
virtual void OnLButtonDown(wxEvent&);
#include "treelay.h"
-wxTreeLayoutStored *myTree = NULL;
+wxTreeLayoutStored *myTree = (wxTreeLayoutStored *) NULL;
// A macro needed for some compilers (AIX) that need 'main' to be defined
// in the application itself.
return TRUE;
}
+int MyApp::OnExit()
+{
+ if (myTree)
+ {
+ delete myTree;
+ myTree = (wxTreeLayoutStored *) NULL;
+ }
+
+ return 0;
+}
+
void MyApp::TreeTest(wxTreeLayoutStored& tree, wxDC& dc)
{
tree.Initialize(200);
// Define a new application
class MyApp: public wxApp
{
- public:
- bool OnInit();
+public:
+ virtual bool OnInit();
+ virtual int OnExit();
void TreeTest(wxTreeLayoutStored& tree, wxDC& dc);
};
case wxSTREAM_READ_ERROR: textCtrl.WriteText( "wxSTREAM_READ_ERROR\n" ); break;
case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
default: textCtrl.WriteText( "Huh?\n" ); break;
- }
+ }
}
textCtrl.WriteText( "\n" );
{
unsigned long n;
event.Enable(m_textDelete->GetValue().ToULong(&n) &&
- (n < (unsigned)m_combobox->GetCount()));
+ (n < (unsigned)m_combobox->GetCount()));
}
}
void ComboboxWidgetsPage::OnComboText(wxCommandEvent& event)
{
if (!m_combobox)
- return;
-
+ return;
+
wxString s = event.GetString();
wxASSERT_MSG( s == m_combobox->GetValue(),
void MyFrame::OnRunWizard(wxCommandEvent& WXUNUSED(event))
{
wxWizard *wizard = new wxWizard(this, -1,
- "Absolutely Useless Wizard",
- wxBITMAP(wiztest));
-
+ "Absolutely Useless Wizard",
+ wxBITMAP(wiztest));
+
// a wizard page may be either an object of predefined class
wxWizardPageSimple *page1 = new wxWizardPageSimple(wizard);
wxStaticText *text = new wxStaticText(page1, -1,