- m_noItems = 0;
- m_selected = 0;
-}
-
-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 ; // this will be increased by our append command
- m_selected = 0;
-
- Rect bounds ;
- Str255 title ;
- m_macHorizontalBorder = 5 ; // additional pixels around the real control
- m_macVerticalBorder = 5 ;
-
- MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
-
- m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , kwxMacListWithVerticalScrollbar , 0 , 0,
- kControlListBoxProc , (long) this ) ;
-
- long result ;
- UMAGetControlData( m_macControl , kControlNoPart , kControlListBoxListHandleTag , sizeof( ListHandle ) , (char*) &m_macList , &result ) ;
-
- NewExtLDEFInfo( m_macList , MacDrawStringCell , (long) this ) ;
- (**m_macList).selFlags = 0 ;
- if ( style & wxLB_MULTIPLE )
- {
- (**m_macList).selFlags += lNoExtend ;
- }
- else if ( style & wxLB_EXTENDED )
- {
- (**m_macList).selFlags += lExtendDrag ;
- }
- else
- {
- (**m_macList).selFlags = lOnlyOne ;
- }
- Point pt = (**m_macList).cellSize ;
- pt.v = 14 ;
- LCellSize( pt , m_macList ) ;
-
- LAddColumn( 1 , 0 , m_macList ) ;
-
- MacPostControlCreate() ;
-
- ControlFontStyleRec controlstyle ;
- controlstyle.flags = kControlUseFontMask + kControlUseSizeMask ;
- //controlstyle.font = kControlFontSmallSystemFont ;
- controlstyle.font = kFontIDMonaco ;
- controlstyle.size = 9 ;
- ::UMASetControlFontStyle( m_macControl , &controlstyle ) ;
-
- for ( int i = 0 ; i < n ; i++ )
- {
- Append( choices[i] ) ;
- }
-
- LSetDrawingMode( true , m_macList ) ;
-
- return TRUE;
-}
-
-wxListBox::~wxListBox()
-{
- Free() ;
- DisposeExtLDEFInfo( m_macList ) ;