Added layout friendly constructor (untested).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27407 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -27,12 +27,15 @@
|
|||||||
|
|
||||||
|
|
||||||
class BScrollBar : public BView {
|
class BScrollBar : public BView {
|
||||||
public:
|
public:
|
||||||
BScrollBar(BRect frame, const char *name, BView *target,
|
BScrollBar(BRect frame, const char* name,
|
||||||
|
BView* target, float min, float max,
|
||||||
|
orientation direction);
|
||||||
|
BScrollBar(const char* name, BView* target,
|
||||||
float min, float max, orientation direction);
|
float min, float max, orientation direction);
|
||||||
BScrollBar(BMessage *data);
|
BScrollBar(BMessage* data);
|
||||||
virtual ~BScrollBar();
|
virtual ~BScrollBar();
|
||||||
static BArchivable *Instantiate(BMessage *data);
|
static BArchivable *Instantiate(BMessage* data);
|
||||||
virtual status_t Archive(BMessage *data, bool deep = true) const;
|
virtual status_t Archive(BMessage *data, bool deep = true) const;
|
||||||
|
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
|
|||||||
@@ -207,6 +207,31 @@ BScrollBar::BScrollBar(BRect frame, const char* name, BView *target,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BScrollBar::BScrollBar(const char* name, BView *target,
|
||||||
|
float min, float max, orientation direction)
|
||||||
|
: BView(name, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_FRAME_EVENTS),
|
||||||
|
fMin(min),
|
||||||
|
fMax(max),
|
||||||
|
fSmallStep(1),
|
||||||
|
fLargeStep(10),
|
||||||
|
fValue(0),
|
||||||
|
fProportion(0.0),
|
||||||
|
fTarget(NULL),
|
||||||
|
fOrientation(direction),
|
||||||
|
fTargetName(NULL)
|
||||||
|
{
|
||||||
|
SetViewColor(B_TRANSPARENT_COLOR);
|
||||||
|
|
||||||
|
fPrivateData = new BScrollBar::Private(this);
|
||||||
|
|
||||||
|
SetTarget(target);
|
||||||
|
SetEventMask(B_NO_POINTER_HISTORY);
|
||||||
|
|
||||||
|
_UpdateThumbFrame();
|
||||||
|
_UpdateArrowButtons();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BScrollBar::BScrollBar(BMessage* data)
|
BScrollBar::BScrollBar(BMessage* data)
|
||||||
: BView(data),
|
: BView(data),
|
||||||
fTarget(NULL),
|
fTarget(NULL),
|
||||||
@@ -1108,9 +1133,9 @@ BScrollBar::PreferredSize()
|
|||||||
{
|
{
|
||||||
BSize preferredSize = _MinSize();
|
BSize preferredSize = _MinSize();
|
||||||
if (fOrientation == B_HORIZONTAL)
|
if (fOrientation == B_HORIZONTAL)
|
||||||
preferredSize.width = 2 * preferredSize.width;
|
preferredSize.width *= 2;
|
||||||
else
|
else
|
||||||
preferredSize.height = 2 * preferredSize.height;
|
preferredSize.height *= 2;
|
||||||
return BLayoutUtils::ComposeSize(ExplicitPreferredSize(), preferredSize);
|
return BLayoutUtils::ComposeSize(ExplicitPreferredSize(), preferredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user