ControlActionUPP GetwxMacLiveScrollbarActionProc();
-class wxMacControl
+class wxMacControl : public wxObject
{
public :
wxMacControl( wxWindow* peer , bool isRootControl = false );
wxMacControl( wxWindow* peer , ControlRef control );
wxMacControl( wxWindow* peer , WXWidget control );
+ wxMacControl() ;
virtual ~wxMacControl();
void Init();
wxWindow* m_peer;
bool m_needsFocusRect;
bool m_isRootControl;
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxMacControl)
};
// ============================================================================
{
public :
wxMacDataBrowserControl( wxWindow* peer, const wxPoint& pos, const wxSize& size, long style);
+ wxMacDataBrowserControl() {}
OSStatus SetCallbacks( const DataBrowserCallbacks *callbacks );
virtual Boolean CompareItems(DataBrowserItemID itemOneID,
DataBrowserItemID itemTwoID,
DataBrowserPropertyID sortProperty) = 0;
+ DECLARE_ABSTRACT_CLASS(wxMacDataBrowserControl)
};
// ============================================================================
{
public :
wxMacDataItemBrowserControl( wxWindow* peer , const wxPoint& pos, const wxSize& size, long style);
-
+ wxMacDataItemBrowserControl() {}
// create a list item (can be a subclass of wxMacListBoxItem)
virtual wxMacDataItem* CreateItem();
private :
bool m_suppressSelection;
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxMacDataItemBrowserControl)
};
class wxMacDataItemBrowserSelectionSuppressor
{
public:
wxMacDataBrowserListControl( wxWindow *peer, const wxPoint& pos, const wxSize& size, long style );
+ wxMacDataBrowserListControl() {}
virtual ~wxMacDataBrowserListControl();
virtual wxMacDataItem* CreateItem();
wxWindow * GetPeer() const;
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxMacDataBrowserListControl)
};
// ============================================================================
{
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()
{
}
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;
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();
}
wxMacListControl* wxListBox::GetPeer() const
{
- return dynamic_cast<wxMacListControl*>(m_peer);
+ wxMacDataBrowserListControl *lb = wxDynamicCast(m_peer,wxMacDataBrowserListControl);
+ return lb ? wx_static_cast(wxMacListControl*,lb) : 0 ;
}
bool wxListBox::Create(
DataBrowserItemNotification message,
DataBrowserItemDataRef itemData ) const
{
- wxMacDataBrowserListControl *lb = dynamic_cast<wxMacDataBrowserListControl*>(owner);
+ wxMacDataBrowserListControl *lb = wxDynamicCast(owner,wxMacDataBrowserListControl);
// we want to depend on as little as possible to make sure tear-down of controls is safe
}
}
+IMPLEMENT_DYNAMIC_CLASS( wxMacDataBrowserListControl , wxMacDataItemBrowserControl )
+
wxMacDataBrowserListControl::wxMacDataBrowserListControl( wxWindow *peer, const wxPoint& pos, const wxSize& size, long style)
: wxMacDataItemBrowserControl( peer, pos, size, style )
{
{
public:
wxMacDataBrowserListCtrlControl( wxWindow *peer, const wxPoint& pos, const wxSize& size, long style );
+ wxMacDataBrowserListCtrlControl() {}
virtual ~wxMacDataBrowserListCtrlControl();
// create a list item (can be a subclass of wxMacListBoxItem)
wxClientDataType m_clientDataItemsType;
bool m_isVirtual;
-
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxMacDataBrowserListCtrlControl)
};
class wxMacListCtrlEventDelegate : public wxEvtHandler
wxMacListControl* wxListCtrl::GetPeer() const
{
- return dynamic_cast<wxMacListControl*>(m_peer);
+ wxMacDataBrowserListCtrlControl *lb = wxDynamicCast(m_peer,wxMacDataBrowserListCtrlControl);
+ return lb ? wx_static_cast(wxMacListControl*,lb) : 0 ;
}
// ----------------------------------------------------------------------------
DataBrowserItemDataRef itemData ) const
{
- wxMacDataBrowserListCtrlControl *lb = dynamic_cast<wxMacDataBrowserListCtrlControl*>(owner);
+ wxMacDataBrowserListCtrlControl *lb = wxDynamicCast(owner, wxMacDataBrowserListCtrlControl);
// we want to depend on as little as possible to make sure tear-down of controls is safe
if ( message == kDataBrowserItemRemoved)
}
+IMPLEMENT_DYNAMIC_CLASS(wxMacDataBrowserListCtrlControl, wxMacDataItemBrowserControl )
+
wxMacDataBrowserListCtrlControl::wxMacDataBrowserListCtrlControl( wxWindow *peer, const wxPoint& pos, const wxSize& size, long style)
: wxMacDataItemBrowserControl( peer, pos, size, style )
{
Boolean *shrinkToFit)
{
Boolean result = false;
- wxMacDataBrowserListCtrlControl* ctl = dynamic_cast<wxMacDataBrowserListCtrlControl*>( wxMacControl::GetReferenceFromNativeControl( browser ) );
+ wxMacDataBrowserListCtrlControl* ctl = wxDynamicCast(wxMacControl::GetReferenceFromNativeControl( browser ), wxMacDataBrowserListCtrlControl);
if ( ctl != 0 )
{
result = ctl->ConfirmEditText(itemID, property, theString, maxEditTextRect, shrinkToFit);
SInt16 gdDepth,
Boolean colorDevice)
{
- wxMacDataBrowserListCtrlControl* ctl = dynamic_cast<wxMacDataBrowserListCtrlControl*>( wxMacControl::GetReferenceFromNativeControl( browser ) );
+ wxMacDataBrowserListCtrlControl* ctl = wxDynamicCast(wxMacControl::GetReferenceFromNativeControl( browser ), wxMacDataBrowserListCtrlControl);
if ( ctl != 0 )
{
ctl->DrawItem(itemID, property, itemState, itemRect, gdDepth, colorDevice);
wxASSERT_MSG( dataItem, _T("could not obtain wxMacDataItem for row in MacSetColumnInfo. Is row a valid wxListCtrl row?") );
if (item)
{
- wxMacListCtrlItem* listItem = dynamic_cast<wxMacListCtrlItem*>(dataItem);
+ wxMacListCtrlItem* listItem = wx_static_cast(wxMacListCtrlItem*,dataItem);
bool hasInfo = listItem->HasColumnInfo( column );
listItem->SetColumnInfo( column, item );
UpdateState(dataItem, item);
// CS should this guard against dataItem = 0 ? , as item is not a pointer if (item) is not appropriate
//if (item)
{
- wxMacListCtrlItem* listItem = dynamic_cast<wxMacListCtrlItem*>(dataItem);
+ wxMacListCtrlItem* listItem =wx_static_cast(wxMacListCtrlItem*,dataItem);
if (!listItem->HasColumnInfo( column ))
return;
// Control Access Support
// ----------------------------------------------------------------------------
+IMPLEMENT_DYNAMIC_CLASS( wxMacControl , wxObject )
+
+wxMacControl::wxMacControl()
+{
+ Init();
+}
+
wxMacControl::wxMacControl(wxWindow* peer , bool isRootControl )
{
Init();
// basing on DataBrowserItemIDs
//
+IMPLEMENT_ABSTRACT_CLASS( wxMacDataBrowserControl , wxMacControl )
+
pascal void wxMacDataBrowserControl::DataBrowserItemNotificationProc(
ControlRef browser,
DataBrowserItemID itemID,
DataBrowserItemNotification message,
DataBrowserItemDataRef itemData )
{
- wxMacDataBrowserControl* ctl = dynamic_cast<wxMacDataBrowserControl*>( wxMacControl::GetReferenceFromNativeControl( browser ) );
+ wxMacDataBrowserControl* ctl = wxDynamicCast(wxMacControl::GetReferenceFromNativeControl( browser ), wxMacDataBrowserControl);
if ( ctl != 0 )
{
ctl->ItemNotification(itemID, message, itemData);
Boolean changeValue )
{
OSStatus err = errDataBrowserPropertyNotSupported;
- wxMacDataBrowserControl* ctl = dynamic_cast<wxMacDataBrowserControl*>( wxMacControl::GetReferenceFromNativeControl( browser ) );
+ wxMacDataBrowserControl* ctl = wxDynamicCast(wxMacControl::GetReferenceFromNativeControl( browser ), wxMacDataBrowserControl);
if ( ctl != 0 )
{
err = ctl->GetSetItemData(itemID, property, itemData, changeValue);
DataBrowserItemID itemTwoID,
DataBrowserPropertyID sortProperty)
{
- wxMacDataBrowserControl* ctl = dynamic_cast<wxMacDataBrowserControl*>( wxMacControl::GetReferenceFromNativeControl( browser ) );
+ wxMacDataBrowserControl* ctl = wxDynamicCast(wxMacControl::GetReferenceFromNativeControl( browser ), wxMacDataBrowserControl);
if ( ctl != 0 )
{
return ctl->CompareItems(itemOneID, itemTwoID, sortProperty);
const wxMacDataItem* rhs,
DataBrowserPropertyID sortProperty) const
{
- const wxMacDataItem* otherItem = dynamic_cast<const wxMacDataItem*>(rhs);
+ const wxMacDataItem* otherItem = wx_const_cast(wxMacDataItem*,rhs);
bool retval = false;
if ( sortProperty == m_colId ){
{
}
+IMPLEMENT_DYNAMIC_CLASS( wxMacDataItemBrowserControl , wxMacDataBrowserControl )
wxMacDataItemBrowserControl::wxMacDataItemBrowserControl( wxWindow* peer , const wxPoint& pos, const wxSize& size, long style) :
wxMacDataBrowserControl( peer, pos, size, style )