}
#if USE_HICOMBOBOX
static const EventTypeSpec eventList[] =
{
{ kEventClassTextField , kEventTextAccepted } ,
}
#if USE_HICOMBOBOX
static const EventTypeSpec eventList[] =
{
{ kEventClassTextField , kEventTextAccepted } ,
static pascal OSStatus wxMacComboBoxEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
{
static pascal OSStatus wxMacComboBoxEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
{
// This will invoke the dialog default action, such
// as the clicking the default button.
// 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() )
if ( def && def->IsEnabled() )
{
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() );
event.SetEventObject(def);
def->Command(event);
if ( def && def->IsEnabled() )
{
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() );
event.SetEventObject(def);
def->Command(event);
#endif
if ( !wxControl::Create(parent, id, wxDefaultPosition, wxDefaultSize, style ,
wxDefaultValidator, name) )
#endif
if ( !wxControl::Create(parent, id, wxDefaultPosition, wxDefaultSize, style ,
wxDefaultValidator, name) )
//hiRect.size.height = bounds.bottom - bounds.top;
//printf("left = %d, right = %d, top = %d, bottom = %d\n", bounds.left, bounds.right, bounds.top, bounds.bottom);
//printf("x = %d, y = %d, width = %d, height = %d\n", hibounds.origin.x, hibounds.origin.y, hibounds.size.width, hibounds.size.height);
//hiRect.size.height = bounds.bottom - bounds.top;
//printf("left = %d, right = %d, top = %d, bottom = %d\n", bounds.left, bounds.right, bounds.top, bounds.bottom);
//printf("x = %d, y = %d, width = %d, height = %d\n", hibounds.origin.x, hibounds.origin.y, hibounds.size.width, hibounds.size.height);
- m_peer = new wxMacControl(this) ;
- verify_noerr( HIComboBoxCreate( &hiRect, CFSTR(""), NULL, NULL, kHIComboBoxStandardAttributes, *m_peer ) );
+ m_peer = new wxMacControl(this);
+ verify_noerr( HIComboBoxCreate( &hiRect, CFSTR(""), NULL, NULL, kHIComboBoxStandardAttributes, m_peer->GetControlRefAddr() ) );
- SetControl32BitMinimum( *m_peer , 0 ) ;
- SetControl32BitMaximum( *m_peer , 100) ;
+ m_peer->SetMinimum( 0 );
+ m_peer->SetMaximum( 100);
- EventHandlerRef comboEventHandler ;
- InstallControlEventHandler( *m_peer, GetwxMacComboBoxEventHandlerUPP(),
+ EventHandlerRef comboEventHandler;
+ InstallControlEventHandler( m_peer->GetControlRef(), GetwxMacComboBoxEventHandlerUPP(),
GetEventTypeCount(eventList), eventList, this,
(EventHandlerRef *)&comboEventHandler);
#else
m_choice = new wxComboBoxChoice(this, style );
GetEventTypeCount(eventList), eventList, this,
(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 ) );
}
}
DoSetSize(pos.x, pos.y, csize.x, csize.y);
}
}
DoSetSize(pos.x, pos.y, csize.x, csize.y);
- HIComboBoxAppendTextItem( *m_peer, wxMacCFStringHolder( item, m_font.GetEncoding() ), &outIndex );
- //SetControl32BitMaximum( *m_peer, GetCount() );
+ HIComboBoxAppendTextItem( m_peer->GetControlRef(), wxMacCFStringHolder( item, m_font.GetEncoding() ), &outIndex );
+ //SetControl32BitMaximum( m_peer->GetControlRef(), GetCount() );
- HIComboBoxInsertTextItemAtIndex( *m_peer, (CFIndex)pos, wxMacCFStringHolder(item, m_font.GetEncoding()) );
+ HIComboBoxInsertTextItemAtIndex( m_peer->GetControlRef(), (CFIndex)pos, wxMacCFStringHolder(item, m_font.GetEncoding()) );
- for ( CFIndex i = GetCount() - 1 ; i >= 0 ; ++ i )
- verify_noerr( HIComboBoxRemoveItemAtIndex( *m_peer, i ) );
+ for ( CFIndex i = GetCount() - 1; i >= 0; ++ i )
+ verify_noerr( HIComboBoxRemoveItemAtIndex( m_peer->GetControlRef(), i ) );