Added layout friendly constructor to this base class.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29215 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2009-02-15 15:41:35 +00:00
parent 64eb49fd24
commit a0b1d631cc
2 changed files with 30 additions and 3 deletions

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2008 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT/X11 license.
* Copyright (C) 2008-2009 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT license.
*/
#ifndef _CHANNEL_CONTROL_H
#define _CHANNEL_CONTROL_H
@ -19,6 +19,10 @@ public:
uint32 resizeFlags
= B_FOLLOW_LEFT | B_FOLLOW_TOP,
uint32 viewFlags = B_WILL_DRAW);
BChannelControl(const char* name,
const char* label, BMessage* model,
int32 channelCount = 1,
uint32 viewFlags = B_WILL_DRAW);
BChannelControl(BMessage* archive);
virtual ~BChannelControl();

View File

@ -1,5 +1,5 @@
/*
* Copyright 2005, Haiku Inc. All Rights Reserved.
* Copyright 2005-2009, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
@ -57,6 +57,29 @@ BChannelControl::BChannelControl(BRect frame, const char *name, const char *labe
}
BChannelControl::BChannelControl(const char *name, const char *label,
BMessage *model, int32 channel_count, uint32 flags)
: BControl(name, label, model, flags),
fChannelCount(channel_count),
fCurrentChannel(0),
fChannelMin(NULL),
fChannelMax(NULL),
fChannelValues(NULL),
fMultiLabels(NULL),
fModificationMsg(NULL)
{
fChannelMin = new int32[channel_count];
memset(fChannelMin, 0, sizeof(int32) * channel_count);
fChannelMax = new int32[channel_count];
for (int32 i = 0; i < channel_count; i++)
fChannelMax[i] = 100;
fChannelValues = new int32[channel_count];
memset(fChannelValues, 0, sizeof(int32) * channel_count);
}
BChannelControl::BChannelControl(BMessage *archive)
: BControl(archive),
fChannelCount(0),