#endif
// for all others, include the necessary headers (this file is usually all you
-// need because it includes almost all "standard" wxWindows headers
+// need because it includes almost all "standard" wxWindows headers)
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
// ----------------------------------------------------------------------------
-// ressources
+// resources
// ----------------------------------------------------------------------------
// the application icon
#if defined(__WXGTK__) || defined(__WXMOTIF__)
MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
// event handlers (these functions should _not_ be virtual)
+ void OnPaint(wxPaintEvent& event)
+ {
+ wxPaintDC dc(this);
+ dc.DrawRectangle(20, 20, 100, 100);
+ dc.SetPen(*wxRED_PEN);
+ dc.SetDeviceOrigin(20, 20);
+ dc.SetClippingRegion(0, 0, 100, 100);
+ dc.DrawLine(0, 0, 1000, 1000);
+ }
+
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
// handlers) which process them. It can be also done at run-time, but for the
// simple menu events like this the static method is much simpler.
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
+ EVT_PAINT(MyFrame::OnPaint)
EVT_MENU(Minimal_Quit, MyFrame::OnQuit)
EVT_MENU(Minimal_About, MyFrame::OnAbout)
END_EVENT_TABLE()
// the application class
// ----------------------------------------------------------------------------
-// `Main program' equivalent: the program execution "starts" here
+// 'Main program' equivalent: the program execution "starts" here
bool MyApp::OnInit()
{
// create the main application window