X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/170acdc90e9f92f8b8120fa6c04acdbf45c89582..99d21c0e1f8d87570702c52dccd3ad698f0a0931:/src/mac/carbon/checklst.cpp?ds=sidebyside diff --git a/src/mac/carbon/checklst.cpp b/src/mac/carbon/checklst.cpp index 0f87743287..1374f2646c 100644 --- a/src/mac/carbon/checklst.cpp +++ b/src/mac/carbon/checklst.cpp @@ -37,14 +37,18 @@ class wxMacDataBrowserCheckListControl : public wxMacDataBrowserListControl , pu { public: wxMacDataBrowserCheckListControl( wxListBox *peer, const wxPoint& pos, const wxSize& size, long style ); + wxMacDataBrowserCheckListControl() {} virtual ~wxMacDataBrowserCheckListControl(); virtual wxMacDataItem* CreateItem(); virtual bool MacIsChecked(unsigned int n) const; virtual void MacCheck(unsigned int n, bool bCheck = true); + DECLARE_DYNAMIC_CLASS_NO_COPY(wxMacDataBrowserCheckListControl) }; +IMPLEMENT_DYNAMIC_CLASS( wxMacDataBrowserCheckListControl , wxMacDataBrowserListControl ) + void wxCheckListBox::Init() { } @@ -85,7 +89,6 @@ bool wxCheckListBox::Create( // this will be increased by our Append command wxMacDataBrowserCheckListControl* control = new wxMacDataBrowserCheckListControl( this, pos, size, style ); - control->SetClientDataType( m_clientDataItemsType ); m_peer = control; MacPostControlCreate(pos,size); @@ -124,7 +127,8 @@ void wxCheckListBox::Check(unsigned int item, bool check) wxMacCheckListControl* wxCheckListBox::GetPeer() const { - return dynamic_cast(m_peer); + wxMacDataBrowserCheckListControl *lb = wxDynamicCast(m_peer,wxMacDataBrowserCheckListControl); + return lb ? wx_static_cast(wxMacCheckListControl*,lb) : 0 ; } const short kCheckboxColumnId = 1026; @@ -256,14 +260,14 @@ wxMacDataItem* wxMacDataBrowserCheckListControl::CreateItem() void wxMacDataBrowserCheckListControl::MacCheck( unsigned int n, bool bCheck) { - wxMacCheckListBoxItem* item = dynamic_cast( GetItemFromLine( n) ); + wxMacCheckListBoxItem* item = wx_static_cast(wxMacCheckListBoxItem*, GetItemFromLine( n) ); item->Check( bCheck); UpdateItem(wxMacDataBrowserRootContainer, item , kCheckboxColumnId); } bool wxMacDataBrowserCheckListControl::MacIsChecked( unsigned int n) const { - wxMacCheckListBoxItem * item = dynamic_cast( GetItemFromLine( n ) ); + wxMacCheckListBoxItem * item = wx_static_cast( wxMacCheckListBoxItem*, GetItemFromLine( n ) ); return item->IsChecked(); }