BOptionPopUp: move mennu setup to AttachedToWindow
* There is no need to delay this to AllAttached * Apps may want to override the SetDivider, and doing it as late as AllAttached can be annoying. Fixes #10734.
This commit is contained in:
@@ -40,6 +40,7 @@ public:
|
|||||||
int32 index);
|
int32 index);
|
||||||
|
|
||||||
virtual void AllAttached();
|
virtual void AllAttached();
|
||||||
|
virtual void AttachedToWindow();
|
||||||
virtual void MessageReceived(BMessage* message);
|
virtual void MessageReceived(BMessage* message);
|
||||||
virtual void SetLabel(const char* text);
|
virtual void SetLabel(const char* text);
|
||||||
virtual void SetValue(int32 value);
|
virtual void SetValue(int32 value);
|
||||||
|
|||||||
@@ -184,11 +184,18 @@ BOptionPopUp::AddOptionAt(const char* name, int32 value, int32 index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Called to take special actions when the child views are attached.
|
// BeOS R5 compatibility, do not remove
|
||||||
It's used to set correctly the divider for the BMenuField.
|
|
||||||
*/
|
|
||||||
void
|
void
|
||||||
BOptionPopUp::AllAttached()
|
BOptionPopUp::AllAttached()
|
||||||
|
{
|
||||||
|
BOptionControl::AllAttached();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief Sets the divider for the BMenuField and target the menu items to ourselves.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
BOptionPopUp::AttachedToWindow()
|
||||||
{
|
{
|
||||||
BMenu* menu = fMenuField->Menu();
|
BMenu* menu = fMenuField->Menu();
|
||||||
if (menu != NULL) {
|
if (menu != NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user