Hartwig's patch for OS X implementation of wxDataViewCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48379 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -107,6 +107,7 @@ public:
|
||||
OSStatus GetDefaultColumnWidth(UInt16 *width ) const; // returns the default column width in pixels
|
||||
OSStatus GetDefaultRowHeight (UInt16 * height ) const;
|
||||
OSStatus GetHeaderButtonHeight(UInt16 *height );
|
||||
OSStatus GetPartBounds (DataBrowserItemID item, DataBrowserPropertyID property, DataBrowserPropertyPart part, Rect* bounds);
|
||||
OSStatus GetRowHeight (DataBrowserItemID item , UInt16 *height) const;
|
||||
OSStatus GetScrollPosition (UInt32* top, UInt32 *left) const;
|
||||
|
||||
@@ -129,8 +130,9 @@ public:
|
||||
OSStatus GetColumnIndex (DataBrowserPropertyID propertyID, DataBrowserTableViewColumnIndex* index) const; // returns for the passed property the corresponding column index
|
||||
OSStatus GetFreePropertyID(DataBrowserPropertyID* propertyID) const; // this method returns a property id that is valid and currently not used; if it cannot be found 'errDataBrowerPropertyNotSupported' is returned
|
||||
OSStatus GetPropertyFlags (DataBrowserPropertyID propertyID, DataBrowserPropertyFlags *flags ) const;
|
||||
OSStatus GetPropertyID (DataBrowserTableViewColumnIndex index, DataBrowserTableViewColumnID* propertyId); // returns for the passed column index the corresponding property ID
|
||||
|
||||
OSStatus GetPropertyID (DataBrowserItemDataRef itemData, DataBrowserPropertyID* propertyID); // returns for the passed item data reference the corresponding property ID
|
||||
OSStatus GetPropertyID (DataBrowserTableViewColumnIndex index, DataBrowserPropertyID* propertyID); // returns for the passed column index the corresponding property ID
|
||||
|
||||
OSStatus IsUsedPropertyID(DataBrowserPropertyID propertyID) const; // checks if passed property id is used by the control; no error is returned if the id exists
|
||||
|
||||
OSStatus RemoveColumn(DataBrowserTableViewColumnIndex index);
|
||||
@@ -154,7 +156,7 @@ public:
|
||||
return this->GetItemCount(kDataBrowserNoItem,true,kDataBrowserItemAnyState,numItems);
|
||||
}
|
||||
OSStatus GetItemCount (DataBrowserItemID container, Boolean recurse, DataBrowserItemState state, ItemCount* numItems) const;
|
||||
OSStatus GetItemID (DataBrowserTableViewRowIndex row, DataBrowserItemID * item) const;
|
||||
OSStatus GetItemID (DataBrowserTableViewRowIndex row, DataBrowserItemID* item) const;
|
||||
OSStatus GetItems (DataBrowserItemID container, Boolean recurse, DataBrowserItemState state, Handle items) const;
|
||||
OSStatus GetItemRow (DataBrowserItemID item, DataBrowserTableViewRowIndex* row) const;
|
||||
|
||||
@@ -200,6 +202,8 @@ public:
|
||||
OSStatus GetSortOrder (DataBrowserSortOrder* order) const;
|
||||
OSStatus GetSortProperty(DataBrowserPropertyID* propertyID) const;
|
||||
|
||||
OSStatus Resort(DataBrowserItemID container=kDataBrowserNoItem, Boolean sortChildren=true);
|
||||
|
||||
OSStatus SetSortOrder (DataBrowserSortOrder order);
|
||||
OSStatus SetSortProperty(DataBrowserPropertyID propertyID);
|
||||
|
||||
|
@@ -500,15 +500,37 @@ public:
|
||||
return this;
|
||||
}
|
||||
|
||||
virtual wxDataViewItem GetSelection(void);
|
||||
virtual void EnsureVisible(wxDataViewItem const& item, wxDataViewColumn const* columnPtr=NULL);
|
||||
|
||||
virtual wxRect GetItemRect(wxDataViewItem const& item, wxDataViewColumn const* columnPtr) const;
|
||||
virtual wxDataViewItem GetSelection(void) const;
|
||||
virtual int GetSelections(wxDataViewItemArray& sel) const;
|
||||
|
||||
virtual void HitTest(wxPoint const& point, wxDataViewItem& item, wxDataViewColumn*& columnPtr) const;
|
||||
|
||||
virtual bool IsSelected(wxDataViewItem const& item) const;
|
||||
|
||||
virtual void SelectAll(void);
|
||||
virtual void Select(wxDataViewItem const& item);
|
||||
virtual void SetSelections(wxDataViewItemArray const& sel);
|
||||
|
||||
virtual void Unselect(wxDataViewItem const& item);
|
||||
virtual void UnselectAll(void);
|
||||
|
||||
|
||||
//
|
||||
// implementation
|
||||
//
|
||||
|
||||
// adds all children of the passed parent to the control; if 'parentItem' is invalid the root(s) is/are added:
|
||||
// adds all children of the passed parent to the control; if 'parentItem' is invalid the root(s) is/are added:
|
||||
void AddChildrenLevel(wxDataViewItem const& parentItem);
|
||||
|
||||
// checks if currently a delete process is running:
|
||||
bool IsDeleting(void) const
|
||||
{
|
||||
return this->m_Deleting;
|
||||
}
|
||||
|
||||
// with CG, we need to get the context from an kEventControlDraw event
|
||||
// unfortunately, the DataBrowser callbacks don't provide the context
|
||||
// and we need it, so we need to set/remove it before and after draw
|
||||
@@ -522,6 +544,12 @@ public:
|
||||
return this->m_cgContext;
|
||||
}
|
||||
|
||||
/// sets the flag indicating a deletion process:
|
||||
void SetDeleting(bool deleting)
|
||||
{
|
||||
this->m_Deleting = deleting;
|
||||
}
|
||||
|
||||
protected:
|
||||
// inherited methods from wxDataViewCtrlBase:
|
||||
virtual void DoSetExpanderColumn(void);
|
||||
@@ -538,9 +566,13 @@ private:
|
||||
// variables
|
||||
//
|
||||
|
||||
wxDataViewModelNotifier* m_NotifierPtr; // the notifier is NOT owned by this class but by the associated model
|
||||
bool m_Deleting; // flag indicating if a delete process is running; this flag is necessary because the notifier indicating an item deletion in the model may be called
|
||||
// after the actual deletion of the item; then, the callback function "wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc" may
|
||||
// try to update data into variables that are already deleted; this flag will ignore all variable update requests during item deletion
|
||||
|
||||
void* m_cgContext; // pointer to core graphics context
|
||||
|
||||
wxDataViewModelNotifier* m_NotifierPtr; // the notifier is NOT owned by this class but by the associated model
|
||||
|
||||
// wxWidget internal stuff:
|
||||
DECLARE_DYNAMIC_CLASS(wxDataViewCtrl)
|
||||
|
Reference in New Issue
Block a user