1998-09-07 09:27:34 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: sashtest.cpp
|
|
|
|
// Purpose: Layout/sash sample
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 04/01/98
|
|
|
|
// RCS-ID: $Id$
|
2003-03-17 11:55:54 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2002-03-17 14:16:03 +00:00
|
|
|
// Licence: wxWindows license
|
1998-09-07 09:27:34 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
// 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"
|
|
|
|
#include "wx/mdi.h"
|
|
|
|
#endif
|
|
|
|
|
2002-01-19 14:50:37 +00:00
|
|
|
#include "wx/toolbar.h"
|
|
|
|
#include "wx/laywin.h"
|
1998-09-07 09:27:34 +00:00
|
|
|
|
|
|
|
#include "sashtest.h"
|
|
|
|
|
|
|
|
MyFrame *frame = NULL;
|
|
|
|
wxList my_children;
|
|
|
|
|
|
|
|
IMPLEMENT_APP(MyApp)
|
|
|
|
|
|
|
|
// For drawing lines in a canvas
|
|
|
|
long xpos = -1;
|
|
|
|
long ypos = -1;
|
|
|
|
|
|
|
|
int winNumber = 1;
|
|
|
|
|
|
|
|
// Initialise this in OnInit, not statically
|
|
|
|
bool MyApp::OnInit(void)
|
|
|
|
{
|
|
|
|
// Create the main frame window
|
|
|
|
|
2004-06-03 10:32:41 +00:00
|
|
|
frame = new MyFrame(NULL, wxID_ANY, _T("Sash Demo"), wxPoint(0, 0), wxSize(500, 400),
|
2001-06-16 01:17:55 +00:00
|
|
|
wxDEFAULT_FRAME_STYLE |
|
|
|
|
wxNO_FULL_REPAINT_ON_RESIZE |
|
|
|
|
wxHSCROLL | wxVSCROLL);
|
1998-09-07 09:27:34 +00:00
|
|
|
|
|
|
|
// Give it an icon (this is ignored in MDI mode: uses resources)
|
|
|
|
#ifdef __WXMSW__
|
2002-12-15 17:25:36 +00:00
|
|
|
frame->SetIcon(wxIcon(_T("sashtest_icn")));
|
1998-09-07 09:27:34 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// Make a menubar
|
|
|
|
wxMenu *file_menu = new wxMenu;
|
|
|
|
|
2002-12-15 17:25:36 +00:00
|
|
|
file_menu->Append(SASHTEST_NEW_WINDOW, _T("&New window"));
|
|
|
|
file_menu->Append(SASHTEST_TOGGLE_WINDOW, _T("&Toggle window"));
|
|
|
|
file_menu->Append(SASHTEST_QUIT, _T("&Exit"));
|
1998-09-07 09:27:34 +00:00
|
|
|
|
|
|
|
wxMenu *help_menu = new wxMenu;
|
2002-12-15 17:25:36 +00:00
|
|
|
help_menu->Append(SASHTEST_ABOUT, _T("&About"));
|
1998-09-07 09:27:34 +00:00
|
|
|
|
|
|
|
wxMenuBar *menu_bar = new wxMenuBar;
|
|
|
|
|
2002-12-15 17:25:36 +00:00
|
|
|
menu_bar->Append(file_menu, _T("&File"));
|
|
|
|
menu_bar->Append(help_menu, _T("&Help"));
|
1998-09-07 09:27:34 +00:00
|
|
|
|
|
|
|
// Associate the menu bar with the frame
|
|
|
|
frame->SetMenuBar(menu_bar);
|
|
|
|
|
2004-07-19 15:36:01 +00:00
|
|
|
#if wxUSE_STATUSBAR
|
1998-09-07 09:27:34 +00:00
|
|
|
frame->CreateStatusBar();
|
2004-07-19 15:36:01 +00:00
|
|
|
#endif // wxUSE_STATUSBAR
|
1998-09-07 09:27:34 +00:00
|
|
|
|
2004-06-03 10:32:41 +00:00
|
|
|
frame->Show(true);
|
1998-09-07 09:27:34 +00:00
|
|
|
|
|
|
|
SetTopWindow(frame);
|
|
|
|
|
2004-06-03 10:32:41 +00:00
|
|
|
return true;
|
1998-09-07 09:27:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
BEGIN_EVENT_TABLE(MyFrame, wxMDIParentFrame)
|
|
|
|
EVT_MENU(SASHTEST_ABOUT, MyFrame::OnAbout)
|
|
|
|
EVT_MENU(SASHTEST_NEW_WINDOW, MyFrame::OnNewWindow)
|
|
|
|
EVT_SIZE(MyFrame::OnSize)
|
|
|
|
EVT_MENU(SASHTEST_QUIT, MyFrame::OnQuit)
|
|
|
|
EVT_MENU(SASHTEST_TOGGLE_WINDOW, MyFrame::OnToggleWindow)
|
|
|
|
EVT_SASH_DRAGGED_RANGE(ID_WINDOW_TOP, ID_WINDOW_BOTTOM, MyFrame::OnSashDrag)
|
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
|
|
|
|
|
|
|
// Define my frame constructor
|
|
|
|
MyFrame::MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size,
|
2002-03-17 14:16:03 +00:00
|
|
|
const long style):
|
1998-09-07 09:27:34 +00:00
|
|
|
wxMDIParentFrame(parent, id, title, pos, size, style)
|
|
|
|
{
|
|
|
|
// Create some dummy layout windows
|
|
|
|
|
|
|
|
// A window like a toolbar
|
2001-06-16 01:17:55 +00:00
|
|
|
wxSashLayoutWindow* win =
|
|
|
|
new wxSashLayoutWindow(this, ID_WINDOW_TOP,
|
|
|
|
wxDefaultPosition, wxSize(200, 30),
|
|
|
|
wxNO_BORDER | wxSW_3D | wxCLIP_CHILDREN);
|
|
|
|
|
1998-09-07 09:27:34 +00:00
|
|
|
win->SetDefaultSize(wxSize(1000, 30));
|
|
|
|
win->SetOrientation(wxLAYOUT_HORIZONTAL);
|
|
|
|
win->SetAlignment(wxLAYOUT_TOP);
|
|
|
|
win->SetBackgroundColour(wxColour(255, 0, 0));
|
2004-06-03 10:32:41 +00:00
|
|
|
win->SetSashVisible(wxSASH_BOTTOM, true);
|
1998-09-07 09:27:34 +00:00
|
|
|
|
|
|
|
m_topWindow = win;
|
|
|
|
|
|
|
|
// A window like a statusbar
|
2001-06-16 01:17:55 +00:00
|
|
|
win = new wxSashLayoutWindow(this, ID_WINDOW_BOTTOM,
|
|
|
|
wxDefaultPosition, wxSize(200, 30),
|
|
|
|
wxNO_BORDER | wxSW_3D | wxCLIP_CHILDREN);
|
1998-09-07 09:27:34 +00:00
|
|
|
win->SetDefaultSize(wxSize(1000, 30));
|
|
|
|
win->SetOrientation(wxLAYOUT_HORIZONTAL);
|
|
|
|
win->SetAlignment(wxLAYOUT_BOTTOM);
|
|
|
|
win->SetBackgroundColour(wxColour(0, 0, 255));
|
2004-06-03 10:32:41 +00:00
|
|
|
win->SetSashVisible(wxSASH_TOP, true);
|
1998-09-07 09:27:34 +00:00
|
|
|
|
|
|
|
m_bottomWindow = win;
|
|
|
|
|
|
|
|
// A window to the left of the client window
|
2001-06-16 01:17:55 +00:00
|
|
|
win = new wxSashLayoutWindow(this, ID_WINDOW_LEFT1,
|
|
|
|
wxDefaultPosition, wxSize(200, 30),
|
|
|
|
wxNO_BORDER | wxSW_3D | wxCLIP_CHILDREN);
|
1998-09-07 09:27:34 +00:00
|
|
|
win->SetDefaultSize(wxSize(120, 1000));
|
|
|
|
win->SetOrientation(wxLAYOUT_VERTICAL);
|
|
|
|
win->SetAlignment(wxLAYOUT_LEFT);
|
|
|
|
win->SetBackgroundColour(wxColour(0, 255, 0));
|
2004-06-03 10:32:41 +00:00
|
|
|
win->SetSashVisible(wxSASH_RIGHT, true);
|
1998-09-07 09:27:34 +00:00
|
|
|
win->SetExtraBorderSize(10);
|
|
|
|
|
2005-08-23 15:54:39 +00:00
|
|
|
wxTextCtrl* textWindow = new wxTextCtrl(win, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
|
1998-09-07 09:27:34 +00:00
|
|
|
wxTE_MULTILINE|wxSUNKEN_BORDER);
|
|
|
|
// wxTE_MULTILINE|wxNO_BORDER);
|
2002-12-15 17:25:36 +00:00
|
|
|
textWindow->SetValue(_T("A help window"));
|
1998-09-07 09:27:34 +00:00
|
|
|
|
|
|
|
m_leftWindow1 = win;
|
|
|
|
|
|
|
|
// Another window to the left of the client window
|
2001-06-16 01:17:55 +00:00
|
|
|
win = new wxSashLayoutWindow(this, ID_WINDOW_LEFT2,
|
|
|
|
wxDefaultPosition, wxSize(200, 30),
|
2001-06-16 01:22:07 +00:00
|
|
|
wxNO_BORDER | wxSW_3D | wxCLIP_CHILDREN);
|
1998-09-07 09:27:34 +00:00
|
|
|
win->SetDefaultSize(wxSize(120, 1000));
|
|
|
|
win->SetOrientation(wxLAYOUT_VERTICAL);
|
|
|
|
win->SetAlignment(wxLAYOUT_LEFT);
|
|
|
|
win->SetBackgroundColour(wxColour(0, 255, 255));
|
2004-06-03 10:32:41 +00:00
|
|
|
win->SetSashVisible(wxSASH_RIGHT, true);
|
1998-09-07 09:27:34 +00:00
|
|
|
|
|
|
|
m_leftWindow2 = win;
|
|
|
|
}
|
|
|
|
|
1998-09-12 22:11:40 +00:00
|
|
|
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
1998-09-07 09:27:34 +00:00
|
|
|
{
|
2004-06-03 10:32:41 +00:00
|
|
|
Close(true);
|
1998-09-07 09:27:34 +00:00
|
|
|
}
|
|
|
|
|
1998-09-12 22:11:40 +00:00
|
|
|
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
1998-09-07 09:27:34 +00:00
|
|
|
{
|
2004-05-25 11:20:37 +00:00
|
|
|
(void)wxMessageBox(_T("wxWidgets 2.0 Sash Demo\nAuthor: Julian Smart (c) 1998"), _T("About Sash Demo"));
|
1998-09-07 09:27:34 +00:00
|
|
|
}
|
|
|
|
|
1998-09-12 22:11:40 +00:00
|
|
|
void MyFrame::OnToggleWindow(wxCommandEvent& WXUNUSED(event))
|
1998-09-07 09:27:34 +00:00
|
|
|
{
|
|
|
|
if (m_leftWindow1->IsShown())
|
|
|
|
{
|
2004-06-03 10:32:41 +00:00
|
|
|
m_leftWindow1->Show(false);
|
1998-09-07 09:27:34 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-06-03 10:32:41 +00:00
|
|
|
m_leftWindow1->Show(true);
|
1998-09-07 09:27:34 +00:00
|
|
|
}
|
2005-08-23 15:54:39 +00:00
|
|
|
#if wxUSE_MDI_ARCHITECTURE
|
1998-09-07 09:27:34 +00:00
|
|
|
wxLayoutAlgorithm layout;
|
|
|
|
layout.LayoutMDIFrame(this);
|
2005-08-23 15:54:39 +00:00
|
|
|
#endif // wxUSE_MDI_ARCHITECTURE
|
1998-09-07 09:27:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MyFrame::OnSashDrag(wxSashEvent& event)
|
|
|
|
{
|
|
|
|
if (event.GetDragStatus() == wxSASH_STATUS_OUT_OF_RANGE)
|
|
|
|
return;
|
|
|
|
|
|
|
|
switch (event.GetId())
|
|
|
|
{
|
|
|
|
case ID_WINDOW_TOP:
|
|
|
|
{
|
|
|
|
m_topWindow->SetDefaultSize(wxSize(1000, event.GetDragRect().height));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case ID_WINDOW_LEFT1:
|
|
|
|
{
|
|
|
|
m_leftWindow1->SetDefaultSize(wxSize(event.GetDragRect().width, 1000));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case ID_WINDOW_LEFT2:
|
|
|
|
{
|
|
|
|
m_leftWindow2->SetDefaultSize(wxSize(event.GetDragRect().width, 1000));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case ID_WINDOW_BOTTOM:
|
|
|
|
{
|
|
|
|
m_bottomWindow->SetDefaultSize(wxSize(1000, event.GetDragRect().height));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2005-08-23 15:54:39 +00:00
|
|
|
|
|
|
|
#if wxUSE_MDI_ARCHITECTURE
|
1998-09-07 09:27:34 +00:00
|
|
|
wxLayoutAlgorithm layout;
|
|
|
|
layout.LayoutMDIFrame(this);
|
2005-08-23 15:54:39 +00:00
|
|
|
#endif // wxUSE_MDI_ARCHITECTURE
|
1998-09-07 09:27:34 +00:00
|
|
|
|
|
|
|
// Leaves bits of itself behind sometimes
|
|
|
|
GetClientWindow()->Refresh();
|
|
|
|
}
|
|
|
|
|
1998-09-12 22:11:40 +00:00
|
|
|
void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event))
|
1998-09-07 09:27:34 +00:00
|
|
|
{
|
|
|
|
// Make another frame, containing a canvas
|
2002-12-15 17:25:36 +00:00
|
|
|
MyChild *subframe = new MyChild(frame, _T("Canvas Frame"),
|
2001-06-16 01:17:55 +00:00
|
|
|
wxPoint(10, 10), wxSize(300, 300),
|
|
|
|
wxDEFAULT_FRAME_STYLE |
|
|
|
|
wxNO_FULL_REPAINT_ON_RESIZE);
|
1998-09-07 09:27:34 +00:00
|
|
|
|
2002-12-15 17:25:36 +00:00
|
|
|
subframe->SetTitle(wxString::Format(_T("Canvas Frame %d"), winNumber));
|
1998-09-07 09:27:34 +00:00
|
|
|
winNumber ++;
|
|
|
|
|
|
|
|
// Give it an icon (this is ignored in MDI mode: uses resources)
|
|
|
|
#ifdef __WXMSW__
|
2002-12-15 17:25:36 +00:00
|
|
|
subframe->SetIcon(wxIcon(_T("sashtest_icn")));
|
1998-09-07 09:27:34 +00:00
|
|
|
#endif
|
|
|
|
|
2004-07-19 15:36:01 +00:00
|
|
|
#if wxUSE_STATUSBAR
|
1998-09-07 09:27:34 +00:00
|
|
|
// Give it a status line
|
|
|
|
subframe->CreateStatusBar();
|
2004-07-19 15:36:01 +00:00
|
|
|
#endif // wxUSE_STATUSBAR
|
1998-09-07 09:27:34 +00:00
|
|
|
|
|
|
|
// Make a menubar
|
|
|
|
wxMenu *file_menu = new wxMenu;
|
|
|
|
|
2002-12-15 17:25:36 +00:00
|
|
|
file_menu->Append(SASHTEST_NEW_WINDOW, _T("&New window"));
|
|
|
|
file_menu->Append(SASHTEST_CHILD_QUIT, _T("&Close child"));
|
|
|
|
file_menu->Append(SASHTEST_QUIT, _T("&Exit"));
|
1998-09-07 09:27:34 +00:00
|
|
|
|
|
|
|
wxMenu *option_menu = new wxMenu;
|
|
|
|
|
|
|
|
// Dummy option
|
2002-12-15 17:25:36 +00:00
|
|
|
option_menu->Append(SASHTEST_REFRESH, _T("&Refresh picture"));
|
1998-09-07 09:27:34 +00:00
|
|
|
|
|
|
|
wxMenu *help_menu = new wxMenu;
|
2002-12-15 17:25:36 +00:00
|
|
|
help_menu->Append(SASHTEST_ABOUT, _T("&About"));
|
1998-09-07 09:27:34 +00:00
|
|
|
|
|
|
|
wxMenuBar *menu_bar = new wxMenuBar;
|
|
|
|
|
2002-12-15 17:25:36 +00:00
|
|
|
menu_bar->Append(file_menu, _T("&File"));
|
|
|
|
menu_bar->Append(option_menu, _T("&Options"));
|
|
|
|
menu_bar->Append(help_menu, _T("&Help"));
|
1998-09-07 09:27:34 +00:00
|
|
|
|
|
|
|
// Associate the menu bar with the frame
|
|
|
|
subframe->SetMenuBar(menu_bar);
|
|
|
|
|
|
|
|
int width, height;
|
|
|
|
subframe->GetClientSize(&width, &height);
|
|
|
|
MyCanvas *canvas = new MyCanvas(subframe, wxPoint(0, 0), wxSize(width, height));
|
|
|
|
canvas->SetCursor(wxCursor(wxCURSOR_PENCIL));
|
|
|
|
subframe->canvas = canvas;
|
|
|
|
|
|
|
|
// Give it scrollbars
|
|
|
|
canvas->SetScrollbars(20, 20, 50, 50);
|
|
|
|
|
2004-06-03 10:32:41 +00:00
|
|
|
subframe->Show(true);
|
1998-09-07 09:27:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
BEGIN_EVENT_TABLE(MyCanvas, wxScrolledWindow)
|
2002-03-17 14:16:03 +00:00
|
|
|
EVT_MOUSE_EVENTS(MyCanvas::OnEvent)
|
1998-09-07 09:27:34 +00:00
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
|
|
|
// Define a constructor for my canvas
|
2001-06-16 01:17:55 +00:00
|
|
|
MyCanvas::MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size)
|
2004-06-03 10:32:41 +00:00
|
|
|
: wxScrolledWindow(parent, wxID_ANY, pos, size,
|
2001-06-16 01:17:55 +00:00
|
|
|
wxSUNKEN_BORDER | wxNO_FULL_REPAINT_ON_RESIZE)
|
1998-09-07 09:27:34 +00:00
|
|
|
{
|
2000-07-15 19:51:35 +00:00
|
|
|
SetBackgroundColour(* wxWHITE);
|
1998-09-07 09:27:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Define the repainting behaviour
|
|
|
|
void MyCanvas::OnDraw(wxDC& dc)
|
|
|
|
{
|
2005-08-23 15:54:39 +00:00
|
|
|
dc.SetFont(*wxSWISS_FONT);
|
|
|
|
dc.SetPen(*wxGREEN_PEN);
|
|
|
|
dc.DrawLine(0, 0, 200, 200);
|
|
|
|
dc.DrawLine(200, 0, 0, 200);
|
1998-09-07 09:27:34 +00:00
|
|
|
|
2005-08-23 15:54:39 +00:00
|
|
|
dc.SetBrush(*wxCYAN_BRUSH);
|
|
|
|
dc.SetPen(*wxRED_PEN);
|
|
|
|
dc.DrawRectangle(100, 100, 100, 50);
|
|
|
|
dc.DrawRoundedRectangle(150, 150, 100, 50, 20);
|
1998-09-07 09:27:34 +00:00
|
|
|
|
2005-08-23 15:54:39 +00:00
|
|
|
dc.DrawEllipse(250, 250, 100, 50);
|
2000-03-16 01:04:50 +00:00
|
|
|
#if wxUSE_SPLINES
|
2005-08-23 15:54:39 +00:00
|
|
|
dc.DrawSpline(50, 200, 50, 100, 200, 10);
|
2000-03-16 01:04:50 +00:00
|
|
|
#endif // wxUSE_SPLINES
|
2005-08-23 15:54:39 +00:00
|
|
|
dc.DrawLine(50, 230, 200, 230);
|
|
|
|
dc.DrawText(_T("This is a test string"), 50, 230);
|
|
|
|
|
|
|
|
wxPoint points[3];
|
|
|
|
points[0].x = 200; points[0].y = 300;
|
|
|
|
points[1].x = 100; points[1].y = 400;
|
|
|
|
points[2].x = 300; points[2].y = 400;
|
|
|
|
|
|
|
|
dc.DrawPolygon(3, points);
|
1998-09-07 09:27:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// This implements a tiny doodling program! Drag the mouse using
|
|
|
|
// the left button.
|
|
|
|
void MyCanvas::OnEvent(wxMouseEvent& event)
|
|
|
|
{
|
|
|
|
wxClientDC dc(this);
|
|
|
|
PrepareDC(dc);
|
|
|
|
|
|
|
|
wxPoint pt(event.GetLogicalPosition(dc));
|
|
|
|
|
|
|
|
if (xpos > -1 && ypos > -1 && event.Dragging())
|
|
|
|
{
|
|
|
|
dc.SetPen(*wxBLACK_PEN);
|
|
|
|
dc.DrawLine(xpos, ypos, pt.x, pt.y);
|
|
|
|
}
|
|
|
|
xpos = pt.x;
|
|
|
|
ypos = pt.y;
|
|
|
|
}
|
|
|
|
|
1998-09-12 22:11:40 +00:00
|
|
|
void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event))
|
1998-09-07 09:27:34 +00:00
|
|
|
{
|
2005-08-23 15:54:39 +00:00
|
|
|
#if wxUSE_MDI_ARCHITECTURE
|
1998-09-07 09:27:34 +00:00
|
|
|
wxLayoutAlgorithm layout;
|
|
|
|
layout.LayoutMDIFrame(this);
|
2005-08-23 15:54:39 +00:00
|
|
|
#endif // wxUSE_MDI_ARCHITECTURE
|
1998-09-07 09:27:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Note that SASHTEST_NEW_WINDOW and SASHTEST_ABOUT commands get passed
|
|
|
|
// to the parent window for processing, so no need to
|
|
|
|
// duplicate event handlers here.
|
|
|
|
|
|
|
|
BEGIN_EVENT_TABLE(MyChild, wxMDIChildFrame)
|
|
|
|
EVT_MENU(SASHTEST_CHILD_QUIT, MyChild::OnQuit)
|
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
|
|
|
MyChild::MyChild(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size,
|
|
|
|
const long style):
|
2004-06-03 10:32:41 +00:00
|
|
|
wxMDIChildFrame(parent, wxID_ANY, title, pos, size, style)
|
1998-09-07 09:27:34 +00:00
|
|
|
{
|
|
|
|
canvas = NULL;
|
|
|
|
my_children.Append(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
MyChild::~MyChild(void)
|
|
|
|
{
|
|
|
|
my_children.DeleteObject(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MyChild::OnQuit(wxCommandEvent& WXUNUSED(event))
|
|
|
|
{
|
2004-06-03 10:32:41 +00:00
|
|
|
Close(true);
|
1998-09-07 09:27:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MyChild::OnActivate(wxActivateEvent& event)
|
|
|
|
{
|
|
|
|
if (event.GetActive() && canvas)
|
|
|
|
canvas->SetFocus();
|
|
|
|
}
|