* drawing is on the road to perfection

* uses another virtual to implement WindowActivated() and draw itself in
  disabled look just like in R5
* fixed _ButtonRectFor() off by one errors
* tiny problems remain when clicking on the ScrollBar (it is shifted)
* the _ValueFor() might not be perfect


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14929 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2005-11-15 00:23:03 +00:00
parent a2236c14c0
commit db3c2e1e8e
2 changed files with 209 additions and 54 deletions
+16 -1
View File
@@ -24,6 +24,8 @@
#define SCROLL_BAR_MAXIMUM_KNOB_SIZE 50
#define SCROLL_BAR_MINIMUM_KNOB_SIZE 9
#define DISABLES_ON_WINDOW_DEACTIVATION 1
//----------------------------------------------------------------
//----- BScrollBar class -----------------------------------------
@@ -83,13 +85,21 @@ virtual status_t GetSupportedSuites(BMessage *data);
//----- Private or reserved -----------------------------------------
virtual status_t Perform(perform_code d, void *arg);
// NOTE: this takes up another virtual slot compared to R5
#if DISABLES_ON_WINDOW_DEACTIVATION
virtual void WindowActivated(bool active);
#endif
private:
class Private;
friend class Private;
friend status_t control_scrollbar(scroll_bar_info *info, BScrollBar *bar); // for use within the preflet
#if !DISABLES_ON_WINDOW_DEACTIVATION
virtual void _ReservedScrollBar1();
#endif
virtual void _ReservedScrollBar2();
virtual void _ReservedScrollBar3();
virtual void _ReservedScrollBar4();
@@ -103,10 +113,15 @@ virtual void _ReservedScrollBar4();
BRect _ButtonRectFor(int32 button) const;
void _UpdateTargetValue(BPoint where);
void _UpdateArrowButtons();
void _DrawDisabledBackground(BRect area,
const rgb_color& light,
const rgb_color& dark,
const rgb_color& fill);
void _DrawArrowButton(int32 direction,
bool doubleArrows,
BRect frame,
const BRect& updateRect,
bool down);
bool enabled, bool down);
float fMin;
float fMax;