Implemented some more BChannelControl methods. It's almost fully functional. BChannelSlider won't crash if ThumbFor() returns NULL.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11211 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2005-02-02 09:34:06 +00:00
parent f9c5546a16
commit fd873802ab
2 changed files with 50 additions and 10 deletions
+5 -2
View File
@@ -79,7 +79,7 @@ BChannelSlider::Archive(BMessage *into, bool deep) const
orientation
BChannelSlider::Orientation() const
{
return fVertical ? B_VERTICAL : B_HORIZONTAL;
return Vertical() ? B_VERTICAL : B_HORIZONTAL;
}
@@ -291,7 +291,9 @@ BChannelSlider::DrawThumb(BView *into, int32 channel, BPoint where, bool pressed
ASSERT(into != NULL);
const BBitmap *thumb = ThumbFor(channel, pressed);
if (thumb == NULL)
return;
BRect bitmapBounds = thumb->Bounds();
where.x -= bitmapBounds.right / 2;
where.y -= bitmapBounds.bottom / 2;
@@ -397,6 +399,7 @@ BChannelSlider::InitData()
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
// TODO: Set initial values ?
// actually, looks like initial values are set on MouseDown()/MouseMoved()
}