X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aaa6d89a0d0810b001a9217df913b9b74b883c8d..3d7a1b394baa3255d084c877b5caae4b29720a12:/src/mac/carbon/checklst.cpp?ds=inline diff --git a/src/mac/carbon/checklst.cpp b/src/mac/carbon/checklst.cpp index 87906f151a..d58ae07392 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(); + wxMacDataBrowserCheckListControl() {} + virtual ~wxMacDataBrowserCheckListControl(); - virtual wxMacListBoxItem* CreateItem(); + 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() { } @@ -93,7 +97,7 @@ bool wxCheckListBox::Create( InsertItems( n , choices , 0 ); // Needed because it is a wxControlWithItems - SetBestSize( size ); + SetInitialSize( size ); return true; } @@ -124,7 +128,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; @@ -174,7 +179,7 @@ public : m_isChecked = false; } - ~wxMacCheckListBoxItem() + virtual ~wxMacCheckListBoxItem() { } @@ -249,21 +254,21 @@ protected : bool m_isChecked; }; -wxMacListBoxItem* wxMacDataBrowserCheckListControl::CreateItem() +wxMacDataItem* wxMacDataBrowserCheckListControl::CreateItem() { return new wxMacCheckListBoxItem(); } 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(); }