Removed selection box code

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4210 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matthew Wilber
2003-08-02 16:37:20 +00:00
parent 6285166900
commit 81f20b17b4
2 changed files with 4 additions and 95 deletions
+4 -84
View File
@@ -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();
}
}
-11
View File
@@ -7,8 +7,6 @@
#include <View.h>
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;
};