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:
@@ -17,16 +17,13 @@
|
|||||||
ShowImageView::ShowImageView(BRect r, const char* name, uint32 resizingMode, uint32 flags)
|
ShowImageView::ShowImageView(BRect r, const char* name, uint32 resizingMode, uint32 flags)
|
||||||
: BView(r, name, resizingMode, flags), m_pBitmap(NULL)
|
: BView(r, name, resizingMode, flags), m_pBitmap(NULL)
|
||||||
{
|
{
|
||||||
Selecting = false;
|
|
||||||
Selected = false;
|
|
||||||
PointOn = false;
|
|
||||||
|
|
||||||
SetViewColor( ui_color( B_PANEL_BACKGROUND_COLOR ) );
|
SetViewColor( ui_color( B_PANEL_BACKGROUND_COLOR ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
ShowImageView::~ShowImageView()
|
ShowImageView::~ShowImageView()
|
||||||
{
|
{
|
||||||
delete m_pBitmap;
|
delete m_pBitmap;
|
||||||
|
m_pBitmap = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShowImageView::SetBitmap(BBitmap* pBitmap)
|
void ShowImageView::SetBitmap(BBitmap* pBitmap)
|
||||||
@@ -50,14 +47,6 @@ void ShowImageView::Draw(BRect updateRect)
|
|||||||
if ( m_pBitmap )
|
if ( m_pBitmap )
|
||||||
{
|
{
|
||||||
DrawBitmap( m_pBitmap, updateRect, updateRect );
|
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)
|
void ShowImageView::MessageReceived(BMessage* msg)
|
||||||
{
|
{
|
||||||
switch (msg->what) {
|
switch (msg->what) {
|
||||||
default:
|
default:
|
||||||
BView::MessageReceived(msg);
|
BView::MessageReceived(msg);
|
||||||
break;
|
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
|
|
||||||
#include <View.h>
|
#include <View.h>
|
||||||
|
|
||||||
class OffscreenView;
|
|
||||||
|
|
||||||
class ShowImageView : public BView
|
class ShowImageView : public BView
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -23,20 +21,11 @@ public:
|
|||||||
virtual void FrameResized(float width, float height);
|
virtual void FrameResized(float width, float height);
|
||||||
virtual void MessageReceived(BMessage* message);
|
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();
|
void FixupScrollBars();
|
||||||
|
|
||||||
BMenuBar* pBar;
|
BMenuBar* pBar;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool Selecting, Selected, PointOn;
|
|
||||||
|
|
||||||
BRect SelectedRect, LastPoint, PointRecOn;
|
|
||||||
BPoint IniPoint, EndPoint;
|
|
||||||
|
|
||||||
BBitmap* m_pBitmap;
|
BBitmap* m_pBitmap;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user