Mouse: minor cleanup.

* Removed no longer used class members.
* Synchronized implementation and declaration order.
This commit is contained in:
Axel Dörfler
2015-01-23 21:00:34 +01:00
parent 637cd3124e
commit 9b2f561908
2 changed files with 48 additions and 49 deletions
+35 -36
View File
@@ -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.
*
* 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
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
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
MouseView::Draw(BRect updateFrame)
{
@@ -300,26 +322,3 @@ MouseView::_ConvertFromVisualOrder(int32 i)
return 1;
}
}
void
MouseView::SetMouseType(int32 type)
{
fType = type;
Invalidate();
}
void
MouseView::MouseMapUpdated()
{
Invalidate();
}
void
MouseView::UpdateFromSettings()
{
SetMouseType(fSettings.MouseType());
}
+13 -13
View File
@@ -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.
*
* Authors:
@@ -20,31 +20,31 @@ class MouseSettings;
class MouseView : public BView {
public:
MouseView(const MouseSettings &settings);
MouseView(const MouseSettings& settings);
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 MouseMapUpdated();
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:
int32 _ConvertFromVisualOrder(int32 button);
int32 _ConvertFromVisualOrder(int32 button);
typedef BView inherited;
private:
typedef BView inherited;
const MouseSettings &fSettings;
BBitmap *fMouseBitmap, *fMouseDownBitmap;
BRect fMouseDownBounds;
const MouseSettings& fSettings;
int32 fType;
uint32 fButtons;
uint32 fOldButtons;
};
#endif /* MOUSE_VIEW_H */