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:
Adrien Destugues
2014-11-27 09:00:23 +01:00
parent 0340e4b336
commit 3d06e082bc
2 changed files with 13 additions and 5 deletions
+1
View File
@@ -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);
+10 -3
View File
@@ -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) {