#include "wx/arrstr.h"
#include "wx/mac/uma.h"
-#include "Appearance.h"
+#include <Appearance.h>
// ============================================================================
// implementation of wxCheckListBox
ListHandle listHandle )
{
wxCheckListBox* list;
- list = (wxCheckListBox*) GetControlReference( (ControlHandle) GetListRefCon(listHandle) );
+ list = (wxCheckListBox*) GetControlReference( (ControlRef) GetListRefCon(listHandle) );
if ( list == NULL )
return ;
const wxFont& font = list->GetFont();
if ( font.Ok() )
{
- ::TextFont( font.GetMacFontNum() ) ;
- ::TextSize( font.GetMacFontSize()) ;
- ::TextFace( font.GetMacFontStyle() ) ;
+ ::TextFont( font.MacGetFontNum() ) ;
+ ::TextSize( font.MacGetFontSize()) ;
+ ::TextFace( font.MacGetFontStyle() ) ;
}
ThemeButtonDrawInfo info ;
const wxValidator& validator,
const wxString &name)
{
+ m_macIsUserPane = FALSE ;
+
if ( !wxCheckListBoxBase::Create(parent, id, pos, size,
n, choices, style, validator, name) )
return false;
const wxFont& font = GetFont();
FontInfo finfo;
- FetchFontInfo(font.GetMacFontNum(),font.GetMacFontSize(),font.GetMacFontStyle(),&finfo);
+ FetchFontInfo(font.MacGetFontNum(),font.MacGetFontSize(),font.MacGetFontStyle(),&finfo);
m_TextBaseLineOffset= finfo.leading+finfo.ascent;
m_checkBoxHeight= finfo.leading+finfo.ascent+finfo.descent;
m_checkBoxHeight= h;
}
- Rect bounds ;
- Str255 title ;
-
- MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ;
+
+ Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
ListDefSpec listDef;
listDef.defType = kListDefUserProcType;
}
listDef.u.userProc = macCheckListDefUPP ;
-#if TARGET_CARBON
Size asize;
- CreateListBoxControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, false, 0, 1, false, true,
+ CreateListBoxControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds, false, 0, 1, false, true,
m_checkBoxHeight+2, 14, false, &listDef, (ControlRef *)&m_macControl );
- GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag,
+ GetControlData( (ControlRef) m_macControl, kControlNoPart, kControlListBoxListHandleTag,
sizeof(ListHandle), (Ptr) &m_macList, &asize);
- SetControlReference( (ControlHandle) m_macControl, (long) this);
- SetControlVisibility( (ControlHandle) m_macControl, false, false);
-
-#else
+ SetControlReference( (ControlRef) m_macControl, (long) this);
+ SetControlVisibility( (ControlRef) m_macControl, false, false);
- long result ;
- wxStAppResource resload ;
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false ,
- 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 ;
- }
-
- Point pt = (**(ListHandle)m_macList).cellSize ;
- pt.v = 14 ;
- LCellSize( pt , (ListHandle)m_macList ) ;
- LAddColumn( 1 , 0 , (ListHandle)m_macList ) ;
-#endif
OptionBits options = 0;
if ( style & wxLB_MULTIPLE )
{
}
SetListSelectionFlags((ListHandle)m_macList, options);
- MacPostControlCreate() ;
+ MacPostControlCreate(pos,size) ;
for ( int i = 0 ; i < n ; i++ )
{