* Recognized any values instead of just boolean ones. This fixes bug #186.
* Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16545 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
BCheckBox::BCheckBox(BRect frame, const char *name, const char *label,
|
BCheckBox::BCheckBox(BRect frame, const char *name, const char *label,
|
||||||
BMessage *message, uint32 resizingMode, uint32 flags)
|
BMessage *message, uint32 resizingMode, uint32 flags)
|
||||||
: BControl(frame, name, label, message, resizingMode, flags),
|
: BControl(frame, name, label, message, resizingMode, flags),
|
||||||
fOutlined(false)
|
fOutlined(false)
|
||||||
{
|
{
|
||||||
// Resize to minimum height if needed
|
// Resize to minimum height if needed
|
||||||
font_height fontHeight;
|
font_height fontHeight;
|
||||||
@@ -33,8 +33,8 @@ BCheckBox::~BCheckBox()
|
|||||||
|
|
||||||
|
|
||||||
BCheckBox::BCheckBox(BMessage *archive)
|
BCheckBox::BCheckBox(BMessage *archive)
|
||||||
: BControl(archive),
|
: BControl(archive),
|
||||||
fOutlined(false)
|
fOutlined(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,8 +44,8 @@ BCheckBox::Instantiate(BMessage *archive)
|
|||||||
{
|
{
|
||||||
if (validate_instantiation(archive, "BCheckBox"))
|
if (validate_instantiation(archive, "BCheckBox"))
|
||||||
return new BCheckBox(archive);
|
return new BCheckBox(archive);
|
||||||
else
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -334,6 +334,9 @@ BCheckBox::DetachedFromWindow()
|
|||||||
void
|
void
|
||||||
BCheckBox::SetValue(int32 value)
|
BCheckBox::SetValue(int32 value)
|
||||||
{
|
{
|
||||||
|
value = value ? B_CONTROL_ON : B_CONTROL_OFF;
|
||||||
|
// we only accept boolean values
|
||||||
|
|
||||||
if (value != Value()) {
|
if (value != Value()) {
|
||||||
BControl::SetValueNoUpdate(value);
|
BControl::SetValueNoUpdate(value);
|
||||||
Invalidate(_CheckBoxFrame());
|
Invalidate(_CheckBoxFrame());
|
||||||
@@ -391,8 +394,7 @@ BCheckBox::FrameResized(float width, float height)
|
|||||||
|
|
||||||
BHandler *
|
BHandler *
|
||||||
BCheckBox::ResolveSpecifier(BMessage *message, int32 index,
|
BCheckBox::ResolveSpecifier(BMessage *message, int32 index,
|
||||||
BMessage *specifier, int32 what,
|
BMessage *specifier, int32 what, const char *property)
|
||||||
const char *property)
|
|
||||||
{
|
{
|
||||||
return BControl::ResolveSpecifier(message, index, specifier, what, property);
|
return BControl::ResolveSpecifier(message, index, specifier, what, property);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user