- wxClientDC dc(this);
- PrepareDC(dc);
- m_owner->PrepareDC(dc);
-
- wxPoint pos = event.GetPosition();
- long x = dc.DeviceToLogicalX( pos.x );
- long y = dc.DeviceToLogicalY( pos.y );
- wxString str;
- str.Printf( wxT("Current mouse position: %d,%d"), (int)x, (int)y );
- m_owner->SetStatusText( str );
+ {
+ wxClientDC dc(this);
+ PrepareDC(dc);
+ m_owner->PrepareDC(dc);
+
+ wxPoint pos = event.GetPosition();
+ long x = dc.DeviceToLogicalX( pos.x );
+ long y = dc.DeviceToLogicalY( pos.y );
+ wxString str;
+ str.Printf( wxT("Current mouse position: %d,%d"), (int)x, (int)y );
+ m_owner->SetStatusText( str );
+ }
+
+ if ( m_rubberBand )
+ {
+ int x,y, xx, yy ;
+ event.GetPosition(&x,&y);
+ CalcUnscrolledPosition( x, y, &xx, &yy );
+ m_currentpoint = wxPoint( xx , yy ) ;
+ wxRect newrect ( m_anchorpoint , m_currentpoint ) ;
+
+ wxClientDC dc( this ) ;
+ PrepareDC( dc ) ;
+
+ wxDCOverlay overlaydc( m_overlay, &dc );
+ overlaydc.Clear();
+#ifdef __WXMAC__
+ dc.SetPen( *wxGREY_PEN );
+ dc.SetBrush( wxColour( 192,192,192,64 ) );
+#else
+ dc.SetPen( wxPen( *wxLIGHT_GREY, 2, wxSOLID ) );
+ dc.SetBrush( *wxTRANSPARENT_BRUSH );
+#endif
+ dc.DrawRectangle( newrect );
+ }