#include "wx/mac/uma.h"
-#ifndef __DARWIN__
-#include <Appearance.h>
-#endif
-
IMPLEMENT_DYNAMIC_CLASS(wxCheckListBox, wxListBox)
BEGIN_EVENT_TABLE(wxCheckListBox, wxListBox)
{
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()
{
}
// this will be increased by our Append command
wxMacDataBrowserCheckListControl* control = new wxMacDataBrowserCheckListControl( this, pos, size, style );
- control->SetClientDataType( m_clientDataItemsType );
+ // TODO CHECK control->SetClientDataType( m_clientDataItemsType );
m_peer = control;
MacPostControlCreate(pos,size);
InsertItems( n , choices , 0 );
// Needed because it is a wxControlWithItems
- SetBestSize( size );
+ SetInitialSize( size );
return true;
}
wxMacCheckListControl* wxCheckListBox::GetPeer() const
{
- return dynamic_cast<wxMacCheckListControl*>(m_peer);
+ wxMacDataBrowserCheckListControl *lb = wxDynamicCast(m_peer,wxMacDataBrowserCheckListControl);
+ return lb ? wx_static_cast(wxMacCheckListControl*,lb) : 0 ;
}
const short kCheckboxColumnId = 1026;
m_isChecked = false;
}
- ~wxMacCheckListBoxItem()
+ virtual ~wxMacCheckListBoxItem()
{
}
wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, checklist->GetId() );
event.SetInt( owner->GetLineFromItem( this ) );
event.SetEventObject( checklist );
- checklist->GetEventHandler()->ProcessEvent( event );
+ checklist->HandleWindowEvent( event );
}
break;
bool m_isChecked;
};
-wxMacListBoxItem* wxMacDataBrowserCheckListControl::CreateItem()
+wxMacDataItem* wxMacDataBrowserCheckListControl::CreateItem()
{
return new wxMacCheckListBoxItem();
}
void wxMacDataBrowserCheckListControl::MacCheck( unsigned int n, bool bCheck)
{
- wxMacCheckListBoxItem* item = dynamic_cast<wxMacCheckListBoxItem*>( 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<wxMacCheckListBoxItem*>( GetItemFromLine( n ) );
+ wxMacCheckListBoxItem * item = wx_static_cast( wxMacCheckListBoxItem*, GetItemFromLine( n ) );
return item->IsChecked();
}