+void MyCanvas::OnMouseDown( wxMouseEvent &event )
+{
+ if (event.LeftDown())
+ {
+ wxPoint pt( event.GetPosition() );
+ int x,y;
+ CalcUnscrolledPosition( pt.x, pt.y, &x, &y );
+ wxLogMessage( "Mouse down event at: %d %d, scrolled: %d %d", pt.x, pt.y, x, y );
+ }
+
+ if (event.LeftIsDown() &&
+ event.LeftDown())
+ {
+ wxLogMessage( "Error: both LeftDown() and LeftIsDown() are TRUE!" );
+ }
+}
+
+void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
+{
+ wxPaintDC dc( this );
+ PrepareDC( dc );
+
+ dc.DrawText( "Press mouse button to test calculations!", 160, 50 );
+
+ dc.DrawText( "Some text", 140, 140 );
+
+ dc.DrawRectangle( 100, 160, 200, 200 );
+}
+
+void MyCanvas::OnQueryPosition( wxCommandEvent &WXUNUSED(event) )
+{
+ wxPoint pt( m_button->GetPosition() );
+ wxLogMessage( "Position of ""Query position"" is %d %d", pt.x, pt.y );
+ pt = ClientToScreen( pt );
+ wxLogMessage( "Position of ""Query position"" on screen is %d %d", pt.x, pt.y );
+}
+