+ m_noItems = 0 ; // this will be increased by our append command
+ m_selected = 0;
+
+ Rect bounds ;
+ Str255 title ;
+
+ MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
+
+ ListDefSpec listDef;
+ listDef.defType = kListDefUserProcType;
+ if ( macListDefUPP == NULL )
+ {
+ macListDefUPP = NewListDefUPP( wxMacListDefinition );
+ }
+ listDef.u.userProc = macListDefUPP ;
+#if TARGET_CARBON
+ Size asize;
+
+
+ CreateListBoxControl( parent->MacGetRootWindow(), &bounds, false, 0, 1, false, true,
+ 14, 14, false, &listDef, &m_macControl );
+
+ GetControlData(m_macControl, kControlNoPart, kControlListBoxListHandleTag,
+ sizeof(ListHandle), (Ptr) &m_macList, &asize);
+
+ SetControlReference(m_macControl, (long) this);
+ SetControlVisibility(m_macControl, false, false);
+
+#else
+ long result ;
+
+ m_macControl = ::NewControl( parent->MacGetRootWindow() , &bounds , title , false ,
+ kwxMacListWithVerticalScrollbar , 0 , 0,
+ kControlListBoxProc , (long) this ) ;
+ ::GetControlData( m_macControl , kControlNoPart , kControlListBoxListHandleTag ,
+ sizeof( ListHandle ) , (char*) &m_macList , &result ) ;
+
+ HLock( (Handle) m_macList ) ;
+ ldefHandle ldef ;
+ ldef = (ldefHandle) NewHandle( sizeof(ldefRec) ) ;
+ if ( (**m_macList).listDefProc != NULL )
+ {
+ (**ldef).instruction = 0x4EF9; /* JMP instruction */
+ (**ldef).function = (void(*)()) listDef.u.userProc;
+ (**m_macList).listDefProc = (Handle) ldef ;
+ }
+
+ Point pt = (**m_macList).cellSize ;
+ pt.v = 14 ;
+ LCellSize( pt , m_macList ) ;
+
+ LAddColumn( 1 , 0 , m_macList ) ;
+#endif
+ OptionBits options = 0;
+ if ( style & wxLB_MULTIPLE )
+ {
+ options += lNoExtend ;
+ }
+ else if ( style & wxLB_EXTENDED )
+ {
+ options += lExtendDrag ;
+ }
+ else
+ {
+ options = lOnlyOne ;
+ }
+ SetListSelectionFlags(m_macList, options);
+
+ MacPostControlCreate() ;
+
+ for ( int i = 0 ; i < n ; i++ )
+ {
+ Append( choices[i] ) ;
+ }
+
+ LSetDrawingMode( true , m_macList ) ;