void CtrlRegisterList::onPopupClick(wxCommandEvent& evt) { switch (evt.GetId()) { case ID_REGISTERLIST_DISPLAY32: maxBits = 32; SetBestSize(ClientToWindowSize(GetMinClientSize())); postEvent(debEVT_UPDATELAYOUT,0); Refresh(); break; case ID_REGISTERLIST_DISPLAY64: maxBits = 64; SetBestSize(ClientToWindowSize(GetMinClientSize())); postEvent(debEVT_UPDATELAYOUT,0); Refresh(); break; case ID_REGISTERLIST_DISPLAY128: maxBits = 128; SetBestSize(ClientToWindowSize(GetMinClientSize())); postEvent(debEVT_UPDATELAYOUT,0); Refresh(); break; default: wxMessageBox( L"Unimplemented.", L"Unimplemented.", wxICON_INFORMATION); break; } }
bool wxChoice::CreateAndInit(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], long style, const wxValidator& validator, const wxString& name) { // initialize wxControl if ( !CreateControl(parent, id, pos, size, style, validator, name) ) return false; // now create the real HWND if ( !MSWCreateControl(wxT("COMBOBOX"), wxEmptyString, pos, size) ) return false; // choice/combobox normally has "white" (depends on colour scheme, of // course) background rather than inheriting the parent's background SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); // initialize the controls contents for ( int i = 0; i < n; i++ ) { Append(choices[i]); } // and now we may finally size the control properly (if needed) SetBestSize(size); return true; }
bool wxMenuButton::Create( wxWindow* parent, wxWindowID id, const wxString &label, const wxBitmap &bitmap, const wxPoint& pos, const wxSize& size, long style, const wxValidator& val, const wxString& name) { m_style = style; long flat = style & wxMENUBUT_FLAT; wxControl::Create(parent,id,pos,size,wxNO_BORDER|wxCLIP_CHILDREN,val,name); wxControl::SetLabel(label); SetBackgroundColour(parent->GetBackgroundColour()); SetForegroundColour(parent->GetForegroundColour()); SetFont(parent->GetFont()); m_labelButton = new MenuLabelButton(this, id, label, bitmap, wxCUSTBUT_BUTTON|flat); m_dropdownButton = new MenuDropButton(this, IDD_DROPDOWN_BUTTON, wxCUSTBUT_BUTTON|flat); wxSize bestSize = DoGetBestSize(); SetSize( wxSize(size.x < 0 ? bestSize.x : size.x, size.y < 0 ? bestSize.y : size.y) ); #if (wxMINOR_VERSION<8) SetBestSize(GetSize()); #else SetInitialSize(GetSize()); #endif return TRUE; }
bool wxCustomButton::Create(wxWindow* parent, wxWindowID id, const wxString& label, const wxBitmap &bitmap, const wxPoint& pos, const wxSize& size, long style, const wxValidator& val, const wxString& name) { if (!wxControl::Create(parent,id,pos,size,wxNO_BORDER|wxCLIP_CHILDREN,val,name)) return FALSE; wxControl::SetLabel(label); wxControl::SetBackgroundColour(parent->GetBackgroundColour()); wxControl::SetForegroundColour(parent->GetForegroundColour()); wxControl::SetFont(parent->GetFont()); if (bitmap.Ok()) m_bmpLabel = bitmap; if (!SetButtonStyle(style)) return FALSE; wxSize bestSize = DoGetBestSize(); SetSize(wxSize(size.x<0 ? bestSize.x:size.x, size.y<0 ? bestSize.y:size.y)); #if (wxMINOR_VERSION<8) SetBestSize(GetSize()); #else SetInitialSize(GetSize()); #endif CalcLayout(TRUE); return TRUE; }
bool wxListBox::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], long style, const wxValidator& validator, const wxString& name) { m_noItems = 0; m_selected = 0; // initialize base class fields if ( !CreateControl(parent, id, pos, size, style, validator, name) ) return false; // create the native control if ( !MSWCreateControl(_T("LISTBOX"), wxEmptyString, pos, size) ) { // control creation failed return false; } // initialize the contents for ( int i = 0; i < n; i++ ) { Append(choices[i]); } // now we can compute our best size correctly, so do it if necessary SetBestSize(size); return true; }
bool wxGauge::Create( wxWindow *parent, wxWindowID id, int range, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name ) { m_needParent = TRUE; if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { wxFAIL_MSG( wxT("wxGauge creation failed") ); return FALSE; } m_rangeMax = range; m_widget = gtk_progress_bar_new(); if ( style & wxGA_VERTICAL ) { gtk_progress_bar_set_orientation( GTK_PROGRESS_BAR(m_widget), GTK_PROGRESS_BOTTOM_TO_TOP ); } m_parent->DoAddChild( this ); PostCreation(size); SetBestSize(size); return TRUE; }
bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, const wxPoint& pos, const wxSize& size, long style, const wxString& name) { SetName(name); m_backgroundColour = parent->GetBackgroundColour() ; m_foregroundColour = parent->GetForegroundColour() ; m_bitmap = bitmap; if ( id == -1 ) m_windowId = (int)NewControlId(); else m_windowId = id; m_windowStyle = style; bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name ); SetBestSize( size ) ; return ret; }
void wxButton::SetImageMargins(wxCoord x, wxCoord y) { m_marginBmpX = x + 2; m_marginBmpY = y + 2; SetBestSize(wxDefaultSize); }
bool wxStaticText::Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, long style, const wxString& name) { m_label = wxStripMenuCodes(label) ; if ( !wxControl::Create( parent, id, pos, size, style, wxDefaultValidator , name ) ) { return false; } SetBestSize( size ) ; return true; }
bool wxListBox::Create(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, int n, const wxString choices[], long style, const wxValidator& validator, const wxString &name) { // for compatibility accept both the new and old styles - they mean the // same thing for us if ( style & wxLB_ALWAYS_SB ) style |= wxALWAYS_SHOW_SB; // if we don't have neither multiple nor extended flag, we must have the // single selection listbox if ( !(style & (wxLB_MULTIPLE | wxLB_EXTENDED)) ) style |= wxLB_SINGLE; #if wxUSE_TWO_WINDOWS style |= wxVSCROLL|wxHSCROLL; if ((style & wxBORDER_MASK) == 0) style |= wxBORDER_SUNKEN; #endif if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) return false; SetWindow(this); m_strings = new wxArrayString; Set(n, choices); SetBestSize(size); CreateInputHandler(wxINP_HANDLER_LISTBOX); return true; }
bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name) { // the spin buttons never have the border style &= ~wxBORDER_MASK; if ( !wxSpinButtonBase::Create(parent, id, pos, size, style, wxDefaultValidator, name) ) return false; SetBestSize(size); CreateInputHandler(wxINP_HANDLER_SPINBTN); return true; }
wxComboButton(wxComboControl *combo) : wxBitmapButton(combo->GetParent(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE | wxBU_EXACTFIT) { m_combo = combo; wxBitmap bmpNormal, bmpFocus, bmpPressed, bmpDisabled; GetRenderer()->GetComboBitmaps(&bmpNormal, &bmpFocus, &bmpPressed, &bmpDisabled); SetBitmapLabel(bmpNormal); SetBitmapFocus(bmpFocus.Ok() ? bmpFocus : bmpNormal); SetBitmapSelected(bmpPressed.Ok() ? bmpPressed : bmpNormal); SetBitmapDisabled(bmpDisabled.Ok() ? bmpDisabled : bmpNormal); SetBestSize(wxDefaultSize); }
bool wxChoice::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], long style, const wxValidator& validator, const wxString& name) { m_macIsUserPane = false ; if ( !wxChoiceBase::Create(parent, id, pos, size, style, validator, name) ) return false; Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ; m_peer = new wxMacControl(this) ; verify_noerr ( CreatePopupButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , CFSTR("") , -12345 , false /* no variable width */ , 0 , 0 , 0 , m_peer->GetControlRefAddr() ) ); m_macPopUpMenuHandle = NewUniqueMenu() ; m_peer->SetData<MenuHandle>( kControlNoPart , kControlPopupButtonMenuHandleTag , (MenuHandle) m_macPopUpMenuHandle ) ; m_peer->SetValueAndRange( n > 0 ? 1 : 0 , 0 , 0 ) ; MacPostControlCreate(pos,size) ; #if !wxUSE_STL if ( style & wxCB_SORT ) { m_strings = wxArrayString(1) ; // autosort } #endif for ( int i = 0; i < n; i++ ) { Append(choices[i]); } SetBestSize(size); // Needed because it is a wxControlWithItems return true; }
bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], int majorDim, long style, const wxValidator& val, const wxString& name) { // initialize members m_majorDim = majorDim == 0 ? n : majorDim; // common initialization if ( !wxStaticBox::Create(parent, id, title, pos, size, style, name) ) return false; #if wxUSE_VALIDATORS SetValidator(val); #else wxUnusedVar(val); #endif // wxUSE_VALIDATORS/!wxUSE_VALIDATORS m_radioButtons = new wxSubwindows(n); m_radioWidth = new int[n]; m_radioHeight = new int[n]; for ( int i = 0; i < n; i++ ) { m_radioWidth[i] = m_radioHeight[i] = wxDefaultCoord; long styleBtn = BS_AUTORADIOBUTTON | WS_TABSTOP | WS_CHILD | WS_VISIBLE; if ( i == 0 ) styleBtn |= WS_GROUP; long newId = NewControlId(); HWND hwndBtn = ::CreateWindow(_T("BUTTON"), choices[i], styleBtn, 0, 0, 0, 0, // will be set in SetSize() GetHwnd(), (HMENU)newId, wxGetInstance(), NULL); if ( !hwndBtn ) { wxLogLastError(wxT("CreateWindow(radio btn)")); return false; } (*m_radioButtons)[i] = hwndBtn; SubclassRadioButton((WXHWND)hwndBtn); m_subControls.Add(newId); } // Create a dummy radio control to end the group. (void)::CreateWindow(_T("BUTTON"), wxEmptyString, WS_GROUP | BS_AUTORADIOBUTTON | WS_CHILD, 0, 0, 0, 0, GetHwnd(), (HMENU)NewControlId(), wxGetInstance(), NULL); m_radioButtons->SetFont(GetFont()); #ifdef __WXWINCE__ // Set the z-order correctly SetWindowPos(GetHwnd(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); #endif SetSelection(0); SetSize(pos.x, pos.y, size.x, size.y); // Now that we have items determine what is the best size and set it. SetBestSize(size); return true; }
bool wxGenericComboControl::Create(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) { // Set border long border = style & wxBORDER_MASK; if ( !border ) { #if defined(__WXUNIVERSAL__) border = wxBORDER_SIMPLE; #elif defined(__WXMSW__) // For XP, have 1-width custom border, for older version use sunken if ( wxUxThemeEngine::GetIfActive() ) { border = wxBORDER_NONE; m_widthCustomBorder = 1; } else border = wxBORDER_SUNKEN; #elif defined(__WXGTK__) border = wxBORDER_NONE; //m_widthCustomBorder = 2; m_widthCustomBorder = 1; #else border = wxBORDER_SIMPLE; #endif style = (style & ~(wxBORDER_MASK)) | border; } #if defined(__WXGTK__) Customize( wxCC_BUTTON_OUTSIDE_BORDER | wxCC_NO_TEXT_AUTO_SELECT ); #endif if ( style & wxCC_STD_BUTTON ) m_iFlags |= wxCC_POPUP_ON_MOUSE_UP; // create main window if ( !wxComboCtrlBase::Create(parent, id, value, pos, size, style | wxFULL_REPAINT_ON_RESIZE, wxDefaultValidator, name) ) return false; // Create textctrl, if necessary CreateTextCtrl( wxNO_BORDER, validator ); // Add keyboard input handlers for main control and textctrl InstallInputHandlers( true ); // Set background SetBackgroundStyle( wxBG_STYLE_CUSTOM ); // for double-buffering // SetBestSize should be called last SetBestSize(size); return true; }
void AISTargetQueryDialog::UpdateText() { wxString html; if( !m_pQueryTextCtl ) return; int scroll_x, scroll_y; m_pQueryTextCtl->GetViewStart(&scroll_x, &scroll_y); DimeControl( this ); wxColor bg = GetBackgroundColour(); m_pQueryTextCtl->SetBackgroundColour( bg ); SetBackgroundColour( bg ); // if( m_MMSI == 0 ) { // Faulty MMSI could be reported as 0 AIS_Target_Data *td = g_pAIS->Get_Target_Data_From_MMSI( m_MMSI ); if( td ) { if( td->b_PersistTrack ) { m_createTrkBtn->SetLabel(_("Stop Tracking")); } else { m_createTrkBtn->SetLabel(_("Record Track")); } wxFont *dFont = FontMgr::Get().GetFont( _("AISTargetQuery") ); wxString face = dFont->GetFaceName(); int sizes[7]; for( int i=-2; i<5; i++ ) { sizes[i+2] = dFont->GetPointSize() + i + (i>0?i:0); } html.Printf( _T("<html><body bgcolor=#%02x%02x%02x><center>"), bg.Red(), bg.Green(), bg.Blue() ); html << td->BuildQueryResult(); html << _T("</center></font></body></html>"); m_pQueryTextCtl->SetFonts( face, face, sizes ); wxCharBuffer buf = html.ToUTF8(); if( buf.data() ) // string OK? m_pQueryTextCtl->SetPage( html ); if(!m_bsize_set){ SetBestSize(); m_bsize_set = true; } m_createWptBtn->Enable( td->b_positionOnceValid ); m_createTrkBtn->Enable( td->b_show_track ); } // } #ifdef __WXQT__ SetColorScheme( m_colorscheme ); #endif m_pQueryTextCtl->Scroll(scroll_x, scroll_y); }
bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, const wxPoint& pos, const wxSize& size, long style, const wxValidator& wxVALIDATOR_PARAM(validator), const wxString& name) { m_bmpNormal = bitmap; SetName(name); #if wxUSE_VALIDATORS SetValidator(validator); #endif // wxUSE_VALIDATORS parent->AddChild(this); m_backgroundColour = parent->GetBackgroundColour(); m_foregroundColour = parent->GetForegroundColour(); m_windowStyle = style; if ( style & wxBU_AUTODRAW ) { m_marginX = wxDEFAULT_BUTTON_MARGIN; m_marginY = wxDEFAULT_BUTTON_MARGIN; } if (id == wxID_ANY) m_windowId = NewControlId(); else m_windowId = id; long msStyle = WS_VISIBLE | WS_TABSTOP | WS_CHILD | BS_OWNERDRAW ; if ( m_windowStyle & wxCLIP_SIBLINGS ) msStyle |= WS_CLIPSIBLINGS; #ifdef __WIN32__ if(m_windowStyle & wxBU_LEFT) msStyle |= BS_LEFT; if(m_windowStyle & wxBU_RIGHT) msStyle |= BS_RIGHT; if(m_windowStyle & wxBU_TOP) msStyle |= BS_TOP; if(m_windowStyle & wxBU_BOTTOM) msStyle |= BS_BOTTOM; #endif m_hWnd = (WXHWND) CreateWindowEx( 0, wxT("BUTTON"), wxEmptyString, msStyle, 0, 0, 0, 0, GetWinHwnd(parent), (HMENU)m_windowId, wxGetInstance(), NULL ); // Subclass again for purposes of dialog editing mode SubclassWin(m_hWnd); SetPosition(pos); SetBestSize(size); return true; }
bool wxChoice::CreateAndInit(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], long style, const wxValidator& validator, const wxString& name) { if ( !(style & wxSP_VERTICAL) ) style |= wxSP_HORIZONTAL; if ( (style & wxBORDER_MASK) == wxBORDER_DEFAULT ) style |= wxBORDER_SIMPLE; style |= wxSP_ARROW_KEYS; SetWindowStyle(style); WXDWORD exStyle = 0; WXDWORD msStyle = MSWGetStyle(GetWindowStyle(), & exStyle) ; wxSize sizeText(size), sizeBtn(size); sizeBtn.x = GetBestSpinnerSize(IsVertical(style)).x; if ( sizeText.x == wxDefaultCoord ) { // DEFAULT_ITEM_WIDTH is the default width for the text control sizeText.x = DEFAULT_ITEM_WIDTH + MARGIN_BETWEEN + sizeBtn.x; } sizeText.x -= sizeBtn.x + MARGIN_BETWEEN; if ( sizeText.x <= 0 ) { wxLogDebug(_T("not enough space for wxSpinCtrl!")); } wxPoint posBtn(pos); posBtn.x += sizeText.x + MARGIN_BETWEEN; // we must create the list control before the spin button for the purpose // of the dialog navigation: if there is a static text just before the spin // control, activating it by Alt-letter should give focus to the text // control, not the spin and the dialog navigation code will give focus to // the next control (at Windows level), not the one after it // create the text window m_hwndBuddy = (WXHWND)::CreateWindowEx ( exStyle, // sunken border _T("LISTBOX"), // window class NULL, // no window title msStyle, // style (will be shown later) pos.x, pos.y, // position 0, 0, // size (will be set later) GetHwndOf(parent), // parent (HMENU)-1, // control id wxGetInstance(), // app instance NULL // unused client data ); if ( !m_hwndBuddy ) { wxLogLastError(wxT("CreateWindow(buddy text window)")); return false; } // initialize wxControl if ( !CreateControl(parent, id, posBtn, sizeBtn, style, validator, name) ) return false; // now create the real HWND WXDWORD spiner_style = WS_VISIBLE | UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_SETBUDDYINT | UDS_EXPANDABLE; if ( !IsVertical(style) ) spiner_style |= UDS_HORZ; if ( style & wxSP_WRAP ) spiner_style |= UDS_WRAP; if ( !MSWCreateControl(UPDOWN_CLASS, spiner_style, posBtn, sizeBtn, _T(""), 0) ) return false; // subclass the text ctrl to be able to intercept some events wxSetWindowUserData(GetBuddyHwnd(), this); m_wndProcBuddy = (WXFARPROC)wxSetWindowProc(GetBuddyHwnd(), wxBuddyChoiceWndProc); // set up fonts and colours (This is nomally done in MSWCreateControl) InheritAttributes(); if (!m_hasFont) SetFont(GetDefaultAttributes().font); // set the size of the text window - can do it only now, because we // couldn't call DoGetBestSize() before as font wasn't set if ( sizeText.y <= 0 ) { int cx, cy; wxGetCharSize(GetHWND(), &cx, &cy, GetFont()); sizeText.y = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy); } SetBestSize(size); (void)::ShowWindow(GetBuddyHwnd(), SW_SHOW); // associate the list window with the spin button (void)::SendMessage(GetHwnd(), UDM_SETBUDDY, (WPARAM)GetBuddyHwnd(), 0); // do it after finishing with m_hwndBuddy creation to avoid generating // initial wxEVT_COMMAND_TEXT_UPDATED message ms_allChoiceSpins.Add(this); // initialize the controls contents for ( int i = 0; i < n; i++ ) { Append(choices[i]); } return true; }
bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], long style, const wxValidator& validator, const wxString& name) { m_macIsUserPane = FALSE ; wxASSERT_MSG( !(style & wxLB_MULTIPLE) || !(style & wxLB_EXTENDED), _T("only one of listbox selection modes can be specified") ); if ( !wxListBoxBase::Create(parent, id, pos, size, style & ~(wxHSCROLL|wxVSCROLL), validator, name) ) return false; m_noItems = 0 ; // this will be increased by our append command m_selected = 0; Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ; m_peer = new wxMacControl(this) ; verify_noerr( ::CreateDataBrowserControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds, kDataBrowserListView , m_peer->GetControlRefAddr() ) ); DataBrowserSelectionFlags options = kDataBrowserDragSelect ; if ( style & wxLB_MULTIPLE ) { options += kDataBrowserAlwaysExtendSelection + kDataBrowserCmdTogglesSelection ; } else if ( style & wxLB_EXTENDED ) { // default behaviour } else { options += kDataBrowserSelectOnlyOne ; } verify_noerr(m_peer->SetSelectionFlags( options ) ); DataBrowserListViewColumnDesc columnDesc ; columnDesc.headerBtnDesc.titleOffset = 0; columnDesc.headerBtnDesc.version = kDataBrowserListViewLatestHeaderDesc; columnDesc.headerBtnDesc.btnFontStyle.flags = kControlUseFontMask | kControlUseJustMask; columnDesc.headerBtnDesc.btnContentInfo.contentType = kControlNoContent; columnDesc.headerBtnDesc.btnFontStyle.just = teFlushDefault; columnDesc.headerBtnDesc.btnFontStyle.font = kControlFontViewSystemFont; columnDesc.headerBtnDesc.btnFontStyle.style = normal; columnDesc.headerBtnDesc.titleString = NULL ; // CFSTR( "" ); // check column columnDesc.headerBtnDesc.minimumWidth = 30 ; columnDesc.headerBtnDesc.maximumWidth = 30; columnDesc.propertyDesc.propertyID = kCheckboxColumnId; columnDesc.propertyDesc.propertyType = kDataBrowserCheckboxType; columnDesc.propertyDesc.propertyFlags = kDataBrowserPropertyIsMutable | kDataBrowserTableViewSelectionColumn | kDataBrowserDefaultPropertyFlags; verify_noerr( m_peer->AddListViewColumn( &columnDesc, kDataBrowserListViewAppendColumn) ) ; // text column columnDesc.headerBtnDesc.minimumWidth = 0; columnDesc.headerBtnDesc.maximumWidth = 10000; columnDesc.propertyDesc.propertyID = kTextColumnId; columnDesc.propertyDesc.propertyType = kDataBrowserTextType; columnDesc.propertyDesc.propertyFlags = kDataBrowserTableViewSelectionColumn #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2 | kDataBrowserListViewTypeSelectColumn #endif ; verify_noerr( m_peer->AddListViewColumn( &columnDesc, kDataBrowserListViewAppendColumn) ) ; verify_noerr( m_peer->AutoSizeListViewColumns() ) ; verify_noerr( m_peer->SetHasScrollBars( false , true ) ) ; verify_noerr( m_peer->SetTableViewHiliteStyle( kDataBrowserTableViewFillHilite ) ) ; verify_noerr( m_peer->SetListViewHeaderBtnHeight(0 ) ) ; DataBrowserCallbacks callbacks ; callbacks.version = kDataBrowserLatestCallbacks; InitDataBrowserCallbacks(&callbacks); callbacks.u.v1.itemDataCallback = NewDataBrowserItemDataUPP(ListBoxGetSetItemData); callbacks.u.v1.itemNotificationCallback = #if TARGET_API_MAC_OSX (DataBrowserItemNotificationUPP) NewDataBrowserItemNotificationWithItemUPP(DataBrowserItemNotificationProc) ; #else NewDataBrowserItemNotificationUPP(DataBrowserItemNotificationProc) ; #endif m_peer->SetCallbacks( &callbacks); #if 0 // shouldn't be necessary anymore under 10.2 m_peer->SetData( kControlNoPart, kControlDataBrowserIncludesFrameAndFocusTag, (Boolean) false ) ; m_peer->SetNeedsFocusRect( true ) ; #endif MacPostControlCreate(pos,size) ; for ( int i = 0 ; i < n ; i++ ) { Append( choices[i] ) ; } SetBestSize(size); // Needed because it is a wxControlWithItems return TRUE; }