Mouse: minor cleanup.
* Removed no longer used class members. * Synchronized implementation and declaration order.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2003-2009 Haiku Inc. All rights reserved.
|
* Copyright 2003-2015 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -102,6 +102,28 @@ MouseView::~MouseView()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
MouseView::SetMouseType(int32 type)
|
||||||
|
{
|
||||||
|
fType = type;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
MouseView::MouseMapUpdated()
|
||||||
|
{
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
MouseView::UpdateFromSettings()
|
||||||
|
{
|
||||||
|
SetMouseType(fSettings.MouseType());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MouseView::GetPreferredSize(float* _width, float* _height)
|
MouseView::GetPreferredSize(float* _width, float* _height)
|
||||||
{
|
{
|
||||||
@@ -112,6 +134,18 @@ MouseView::GetPreferredSize(float* _width, float* _height)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
MouseView::AttachedToWindow()
|
||||||
|
{
|
||||||
|
if (Parent() != NULL)
|
||||||
|
SetViewColor(Parent()->ViewColor());
|
||||||
|
else
|
||||||
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
|
UpdateFromSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MouseView::MouseUp(BPoint)
|
MouseView::MouseUp(BPoint)
|
||||||
{
|
{
|
||||||
@@ -183,18 +217,6 @@ MouseView::MouseDown(BPoint where)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
MouseView::AttachedToWindow()
|
|
||||||
{
|
|
||||||
if (Parent() != NULL)
|
|
||||||
SetViewColor(Parent()->ViewColor());
|
|
||||||
else
|
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
|
||||||
|
|
||||||
UpdateFromSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MouseView::Draw(BRect updateFrame)
|
MouseView::Draw(BRect updateFrame)
|
||||||
{
|
{
|
||||||
@@ -300,26 +322,3 @@ MouseView::_ConvertFromVisualOrder(int32 i)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
MouseView::SetMouseType(int32 type)
|
|
||||||
{
|
|
||||||
fType = type;
|
|
||||||
Invalidate();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
MouseView::MouseMapUpdated()
|
|
||||||
{
|
|
||||||
Invalidate();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
MouseView::UpdateFromSettings()
|
|
||||||
{
|
|
||||||
SetMouseType(fSettings.MouseType());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2003-2009 Haiku Inc. All rights reserved.
|
* Copyright 2003-2015 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -20,31 +20,31 @@ class MouseSettings;
|
|||||||
|
|
||||||
class MouseView : public BView {
|
class MouseView : public BView {
|
||||||
public:
|
public:
|
||||||
MouseView(const MouseSettings &settings);
|
MouseView(const MouseSettings& settings);
|
||||||
virtual ~MouseView();
|
virtual ~MouseView();
|
||||||
|
|
||||||
virtual void AttachedToWindow();
|
|
||||||
virtual void MouseDown(BPoint where);
|
|
||||||
virtual void MouseUp(BPoint where);
|
|
||||||
virtual void Draw(BRect frame);
|
|
||||||
virtual void GetPreferredSize(float *_width, float *_height);
|
|
||||||
|
|
||||||
void SetMouseType(int32 type);
|
void SetMouseType(int32 type);
|
||||||
void MouseMapUpdated();
|
void MouseMapUpdated();
|
||||||
void UpdateFromSettings();
|
void UpdateFromSettings();
|
||||||
|
|
||||||
|
virtual void GetPreferredSize(float* _width, float* _height);
|
||||||
|
virtual void AttachedToWindow();
|
||||||
|
virtual void MouseUp(BPoint where);
|
||||||
|
virtual void MouseDown(BPoint where);
|
||||||
|
virtual void Draw(BRect frame);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int32 _ConvertFromVisualOrder(int32 button);
|
int32 _ConvertFromVisualOrder(int32 button);
|
||||||
|
|
||||||
typedef BView inherited;
|
private:
|
||||||
|
typedef BView inherited;
|
||||||
|
|
||||||
const MouseSettings &fSettings;
|
const MouseSettings& fSettings;
|
||||||
BBitmap *fMouseBitmap, *fMouseDownBitmap;
|
|
||||||
BRect fMouseDownBounds;
|
|
||||||
|
|
||||||
int32 fType;
|
int32 fType;
|
||||||
uint32 fButtons;
|
uint32 fButtons;
|
||||||
uint32 fOldButtons;
|
uint32 fOldButtons;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* MOUSE_VIEW_H */
|
#endif /* MOUSE_VIEW_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user