Implemented Archive() and unarchiving constructor. Removed bad linefeeds.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11234 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2005-02-03 15:50:41 +00:00
parent 8f8871f95b
commit 859c5ac301
2 changed files with 22 additions and 15 deletions

View File

@ -9,7 +9,7 @@
static property_info // TODO: Finish this
sPropertyInfo[] = {
sPropertyInfo[] = {
{0}
};
@ -227,7 +227,7 @@ BChannelControl::SetChannelCount(int32 channel_count)
{
if (channel_count < 0 || channel_count >= MaxChannelCount())
return B_BAD_VALUE;
// TODO: Currently we only grow the buffer. Test what BeOS does
if (channel_count > fChannelCount) {
int32 *newMin = new int32[channel_count];
@ -316,7 +316,6 @@ status_t
BChannelControl::SetLimitsFor(int32 fromChannel, int32 channelCount,
const int32 *minimum, const int32 *maximum)
{
return B_ERROR;
}
@ -348,7 +347,7 @@ BChannelControl::SetLimitLabels(const char *minLabel, const char *maxLabel)
{
if (minLabel != fMinLabel)
fMinLabel = minLabel;
if (maxLabel != fMaxLabel)
fMaxLabel = maxLabel;
@ -411,8 +410,8 @@ BChannelControl::StuffValues(int32 fromChannel, int32 channelCount,
|| fromChannel + channelCount >= fChannelCount)
return B_BAD_INDEX;
for (int32 i = 0; i < channelCount; i++) {
if (inValues[i] <= fChannelMax[fromChannel + i]
for (int32 i = 0; i < channelCount; i++) {
if (inValues[i] <= fChannelMax[fromChannel + i]
&& inValues[i] >= fChannelMin[fromChannel + i])
fChannelValues[fromChannel + i] = inValues[i];

View File

@ -48,7 +48,11 @@ BChannelSlider::BChannelSlider(BRect area, const char *name, const char *label,
BChannelSlider::BChannelSlider(BMessage *archive)
: BChannelControl(archive)
{
// TODO: Implement
InitData();
orientation orient;
if (archive->FindInt32("_orient", (int32 *)&orient) == B_OK)
SetOrientation(orient);
}
@ -71,8 +75,11 @@ BChannelSlider::Instantiate(BMessage *archive)
status_t
BChannelSlider::Archive(BMessage *into, bool deep) const
{
// TODO: Implement
return B_ERROR;
status_t status = BChannelControl::Archive(into, deep);
if (status == B_OK)
status = into->AddInt32("_orient", (int32)Orientation());
return status;
}
@ -166,7 +173,6 @@ BChannelSlider::Draw(BRect updateRect)
void
BChannelSlider::MouseDown(BPoint where)
{
// TODO: Implement
}
@ -281,7 +287,9 @@ BChannelSlider::DrawChannel(BView *into, int32 channel, BRect area, bool pressed
void
BChannelSlider::DrawGroove(BView *into, int32 channel, BPoint topLeft, BPoint bottomRight)
{
// TODO: Implement
// TODO: Draw the real thing
ASSERT(into != NULL);
into->StrokeRect(BRect(topLeft, bottomRight), B_SOLID_HIGH);
}
@ -289,7 +297,7 @@ void
BChannelSlider::DrawThumb(BView *into, int32 channel, BPoint where, bool pressed)
{
ASSERT(into != NULL);
const BBitmap *thumb = ThumbFor(channel, pressed);
if (thumb == NULL)
return;
@ -318,7 +326,6 @@ BChannelSlider::DrawThumb(BView *into, int32 channel, BPoint where, bool pressed
const BBitmap *
BChannelSlider::ThumbFor(int32 channel, bool pressed)
{
// TODO: Implement
return NULL;
}
@ -438,7 +445,8 @@ BChannelSlider::UpdateFontDimens()
void
BChannelSlider::DrawThumbs()
{
{
}
@ -464,7 +472,7 @@ BChannelSlider::Redraw()
void
BChannelSlider::MouseMovedCommon(BPoint , BPoint )
BChannelSlider::MouseMovedCommon(BPoint point, BPoint point2)
{
// TODO: Implement
}