- ListDefSpec listDef;
- listDef.defType = kListDefUserProcType;
- if ( macListDefUPP == NULL )
- {
- macListDefUPP = NewListDefUPP( wxMacListDefinition );
- }
- listDef.u.userProc = macListDefUPP ;
-
- Str255 fontName ;
- SInt16 fontSize ;
- Style fontStyle ;
- SInt16 fontNum ;
-#if TARGET_CARBON
- GetThemeFont(kThemeViewsFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ;
-#else
- GetFontName( kFontIDMonaco , fontName ) ;
- fontSize = 9 ;
- fontStyle = normal ;
-#endif
- CopyPascalStringToC( fontName , (char*) fontName ) ;
- SetFont( wxFont (fontSize, wxSWISS, wxNORMAL, wxNORMAL , false , fontName ) ) ;
-#if TARGET_CARBON
- Size asize;
-
-
- CreateListBoxControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, false, 0, 1, (style & wxLB_HSCROLL), true,
- kwxMacListItemHeight, kwxMacListItemHeight, false, &listDef, (ControlRef *)&m_macControl );
-
- GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag,
- sizeof(ListHandle), (Ptr) &m_macList, &asize);
-
- SetControlReference( (ControlHandle) m_macControl, (long) this);
- SetControlVisibility( (ControlHandle) m_macControl, false, false);
-
-#else
-
- long result ;
- wxStAppResource resload ;
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false ,
- (style & wxLB_HSCROLL) ? kwxMacListWithVerticalAndHorizontalScrollbar : kwxMacListWithVerticalScrollbar ,
- 0 , 0, kControlListBoxProc , (long) this ) ;
- ::GetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlListBoxListHandleTag ,
- sizeof( ListHandle ) , (char*) &m_macList , &result ) ;
-
- HLock( (Handle) m_macList ) ;
- ldefHandle ldef ;
- ldef = (ldefHandle) NewHandle( sizeof(ldefRec) ) ;
- if ( (**(ListHandle)m_macList).listDefProc != NULL )
- {
- (**ldef).instruction = 0x4EF9; /* JMP instruction */
- (**ldef).function = (void(*)()) listDef.u.userProc;
- (**(ListHandle)m_macList).listDefProc = (Handle) ldef ;
- }