// This will invoke the dialog default action, such
// as the clicking the default button.
- wxWindow *parent = GetParent();
- while( parent && !parent->IsTopLevel() && parent->GetDefaultItem() == NULL ) {
- parent = parent->GetParent();
- }
- if ( parent && parent->GetDefaultItem() )
+ wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
+ if ( tlw && tlw->GetDefaultItem() )
{
- wxButton *def = wxDynamicCast(parent->GetDefaultItem(),
- wxButton);
+ wxButton *def = wxDynamicCast(tlw->GetDefaultItem(), wxButton);
if ( def && def->IsEnabled() )
{
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() );
(EventHandlerRef *)&comboEventHandler);
#else
m_choice = new wxComboBoxChoice(this, style );
-
- m_choice = new wxComboBoxChoice(this, style );
- m_choice->SetSizeHints( wxSize( POPUPWIDTH , POPUPHEIGHT ) );
+ m_choice->SetMinSize( wxSize( POPUPWIDTH , POPUPHEIGHT ) );
wxSize csize = size;
if ( style & wxCB_READONLY )
{
m_choice->DoAppend( choices[ i ] );
}
- SetBestSize(csize); // Needed because it is a wxControlWithItems
+ SetInitialSize(csize); // Needed because it is a wxControlWithItems
#endif
return true;