diff --git a/src/apps/showimage/ShowImageView.cpp b/src/apps/showimage/ShowImageView.cpp index 480940a4f4..9cec9acf58 100644 --- a/src/apps/showimage/ShowImageView.cpp +++ b/src/apps/showimage/ShowImageView.cpp @@ -17,16 +17,13 @@ ShowImageView::ShowImageView(BRect r, const char* name, uint32 resizingMode, uint32 flags) : BView(r, name, resizingMode, flags), m_pBitmap(NULL) { - Selecting = false; - Selected = false; - PointOn = false; - SetViewColor( ui_color( B_PANEL_BACKGROUND_COLOR ) ); } ShowImageView::~ShowImageView() { delete m_pBitmap; + m_pBitmap = NULL; } void ShowImageView::SetBitmap(BBitmap* pBitmap) @@ -50,14 +47,6 @@ void ShowImageView::Draw(BRect updateRect) if ( m_pBitmap ) { DrawBitmap( m_pBitmap, updateRect, updateRect ); - - if ( Selected && PointOn ) { - SetDrawingMode( B_OP_INVERT /*B_OP_ALPHA */); - - StrokeRect( BRect( IniPoint, EndPoint ), B_MIXED_COLORS ); - - SetDrawingMode(B_OP_COPY); - } } } @@ -69,9 +58,9 @@ void ShowImageView::FrameResized(float /* width */, float /* height */) void ShowImageView::MessageReceived(BMessage* msg) { switch (msg->what) { - default: - BView::MessageReceived(msg); - break; + default: + BView::MessageReceived(msg); + break; } } @@ -106,72 +95,3 @@ void ShowImageView::FixupScrollBars() } } -void ShowImageView::MouseDown( BPoint point ) -{ - if ( Selected && SelectedRect.Contains( point ) ) { - return; - } - - uint32 buttons; - - GetMouse(&point, &buttons); - - if ( buttons == B_PRIMARY_MOUSE_BUTTON ) { - - if ( Selected ) { - Selected = false; - Invalidate( BRect( IniPoint, EndPoint ) ); - } - - BRect rect(point, point); - BeginRectTracking(rect, B_TRACK_RECT_CORNER); - - IniPoint = point; - do { - snooze(30 * 1000); - GetMouse(&point, &buttons); - } while ( buttons ); - - EndRectTracking(); - - Selected = true; - - rect.SetRightBottom(point); - - EndPoint = point; - - SelectedRect = BRect( IniPoint, EndPoint ); - - Invalidate( SelectedRect ); - - PointOn = true; - - BMenuItem * pMenuCopy; - pMenuCopy = pBar->FindItem( B_COPY ); - pMenuCopy->SetEnabled( true ); - } -} - -void ShowImageView::MouseUp( BPoint point ) -{ -} - -void ShowImageView::MouseMoved( BPoint point, uint32 transit, const BMessage *message ) -{ -} - -void ShowImageView::Pulse(void) -{ - if ( Selected ) { - PushState(); - - PointOn = ! PointOn; - - SetDrawingMode( B_OP_INVERT ); - - StrokeRect( SelectedRect, B_MIXED_COLORS ); - - //SetDrawingMode(B_OP_COPY); - PopState(); - } -} diff --git a/src/apps/showimage/ShowImageView.h b/src/apps/showimage/ShowImageView.h index 58f665e69b..10a8833c6e 100644 --- a/src/apps/showimage/ShowImageView.h +++ b/src/apps/showimage/ShowImageView.h @@ -7,8 +7,6 @@ #include -class OffscreenView; - class ShowImageView : public BView { public: @@ -23,20 +21,11 @@ public: virtual void FrameResized(float width, float height); virtual void MessageReceived(BMessage* message); - virtual void MouseDown( BPoint point ); - virtual void MouseUp( BPoint point ); - virtual void MouseMoved( BPoint point, uint32 transit, const BMessage *message ); - virtual void Pulse(void); - void FixupScrollBars(); BMenuBar* pBar; private: - bool Selecting, Selected, PointOn; - - BRect SelectedRect, LastPoint, PointRecOn; - BPoint IniPoint, EndPoint; BBitmap* m_pBitmap; };