fixed message delivering
record control in media preferences for auich is now working correctly git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17530 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,31 +1,19 @@
|
|||||||
//-----------------------------------------------------------------------------
|
/*
|
||||||
// Copyright (c) 2003-2004 Stefano Ceccherini
|
* Copyright 2003-2006, Haiku, Inc.
|
||||||
//
|
* Distributed under the terms of the MIT license.
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
*
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
* Authors:
|
||||||
// to deal in the Software without restriction, including without limitation
|
* Stefano Ceccherini ([email protected])
|
||||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
* Jerome Duval
|
||||||
// and/or sell copies of the Software, and to permit persons to whom the
|
*
|
||||||
// Software is furnished to do so, subject to the following conditions:
|
* Description: An abstract base class for option controls.
|
||||||
//
|
*/
|
||||||
// The above copyright notice and this permission notice shall be included in
|
|
||||||
// all copies or substantial portions of the Software.
|
|
||||||
//
|
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
||||||
// DEALINGS IN THE SOFTWARE.
|
|
||||||
//
|
|
||||||
// File Name: OptionControl.cpp
|
|
||||||
// Description: An abstract base class for option controls.
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
#include <OptionControl.h>
|
#include <OptionControl.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Creates and initializes a BOptionControl.
|
/*! \brief Creates and initializes a BOptionControl.
|
||||||
\param frame The control's frame rectangle.
|
\param frame The control's frame rectangle.
|
||||||
\param name The control's name.
|
\param name The control's name.
|
||||||
@@ -62,8 +50,10 @@ BOptionControl::MessageReceived(BMessage *message)
|
|||||||
case B_OPTION_CONTROL_VALUE:
|
case B_OPTION_CONTROL_VALUE:
|
||||||
{
|
{
|
||||||
int32 value;
|
int32 value;
|
||||||
if (message->FindInt32("be:value", &value) == B_OK)
|
if (message->FindInt32("be:value", &value) == B_OK) {
|
||||||
SetValue(value);
|
SetValue(value);
|
||||||
|
Invoke();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ BOptionPopUp::AddOptionAt(const char *name, int32 value, int32 index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
menu->AddItem(newItem, index);
|
menu->AddItem(newItem, index);
|
||||||
|
newItem->SetTarget(this);
|
||||||
|
|
||||||
// We didnt' have any items before, so select the newly added one
|
// We didnt' have any items before, so select the newly added one
|
||||||
if (numItems == 0)
|
if (numItems == 0)
|
||||||
@@ -185,6 +186,7 @@ BOptionPopUp::AllAttached()
|
|||||||
if (menu != NULL) {
|
if (menu != NULL) {
|
||||||
float labelWidth = _mField->StringWidth(_mField->Label());
|
float labelWidth = _mField->StringWidth(_mField->Label());
|
||||||
_mField->SetDivider(labelWidth + kLabelSpace);
|
_mField->SetDivider(labelWidth + kLabelSpace);
|
||||||
|
menu->SetTargetForItems(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user