X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/23efa4bfb9104d6ef947a217efa80b2bc5bf9e76..d8efd2198ff050ca5a5726bcad0f42692fe872df:/interface/wx/dataview.h diff --git a/interface/wx/dataview.h b/interface/wx/dataview.h index 6e2272ddf6..c4ac26a10b 100644 --- a/interface/wx/dataview.h +++ b/interface/wx/dataview.h @@ -554,6 +554,12 @@ public: Process a wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED event. @event{EVT_DATAVIEW_COLUMN_REORDERED(id, func)} Process a wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED event. + @event{EVT_DATAVIEW_ITEM_BEGIN_DRAG(id, func)} + Process a wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG event. + @event{EVT_DATAVIEW_ITEM_DROP_POSSIBLE(id, func)} + Process a wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE event. + @event{EVT_DATAVIEW_ITEM_DROP(id, func)} + Process a wxEVT_COMMAND_DATAVIEW_ITEM_DROP event. @endEventTable @library{wxadv} @@ -763,6 +769,16 @@ public: */ virtual bool DeleteColumn(wxDataViewColumn* column); + /** + Enable drag operations using the given @a format. + */ + virtual bool EnableDragSource( const wxDataFormat &format ); + + /** + Enable drop operations using the given @a format. + */ + virtual bool EnableDropTarget( const wxDataFormat &format ); + /** Call this to ensure that the given item is visible. */ @@ -1493,8 +1509,8 @@ public: @code wxDataViewListCtrl *listctrl = new wxDataViewListCtrl( parent, -1 ); - listctrl->AppendToggleCol( "Toggle" ); - listctrl->AppendTextCol( "Text" ); + listctrl->AppendToggleColumn( "Toggle" ); + listctrl->AppendTextColumn( "Text" ); wxVector data; data.push_back( true ); @@ -1511,9 +1527,9 @@ public: @library{wxadv} @category{ctrl,dvc} */ - class wxDataViewListCtrl: public wxDataViewCtrl { +public: /** Default ctor. */ @@ -1552,45 +1568,69 @@ class wxDataViewListCtrl: public wxDataViewCtrl Appends a column to the control and additonally appends a column to the store with the type @a varianttype. */ - void AppendCol( wxDataViewColumn *column, const wxString &varianttype ); + void AppendColumn( wxDataViewColumn *column, const wxString &varianttype ); /** Prepends a column to the control and additonally prepends a column to the store with the type @a varianttype. */ - void PrependCol( wxDataViewColumn *column, const wxString &varianttype ); + void PrependColumn( wxDataViewColumn *column, const wxString &varianttype ); /** Inserts a column to the control and additonally inserts a column to the store with the type @a varianttype. */ - void InsertCol( unsigned int pos, wxDataViewColumn *column, const wxString &varianttype ); + void InsertColumn( unsigned int pos, wxDataViewColumn *column, const wxString &varianttype ); + + /** + Overridden from wxDataViewCtrl + + Appends a column to the control and additonally appends a + column to the store with the type string. + */ + virtual void AppendColumn( wxDataViewColumn *column ); + + /** + Overridden from wxDataViewCtrl + + Prepends a column to the control and additonally prepends a + column to the store with the type string. + */ + virtual void PrependColumn( wxDataViewColumn *column ); + + /** + Overridden from wxDataViewCtrl + + Inserts a column to the control and additonally inserts a + column to the store with the type string. + */ + virtual void InsertColumn( unsigned int pos, wxDataViewColumn *column ); /** Inserts a text column to the control and the store. */ - wxDataViewColumn *AppendTextCol( const wxString &label, + wxDataViewColumn *AppendTextColumn( const wxString &label, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, wxAlignment align = wxALIGN_LEFT, int flags = wxDATAVIEW_COL_RESIZABLE ); /** Inserts a toggle column to the control and the store. */ - wxDataViewColumn *AppendToggleCol( const wxString &label, + wxDataViewColumn *AppendToggleColumn( const wxString &label, wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1, wxAlignment align = wxALIGN_LEFT, int flags = wxDATAVIEW_COL_RESIZABLE ); /** Inserts a progress column to the control and the store. */ - wxDataViewColumn *AppendProgressCol( const wxString &label, + wxDataViewColumn *AppendProgressColumn( const wxString &label, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, wxAlignment align = wxALIGN_LEFT, int flags = wxDATAVIEW_COL_RESIZABLE ); /** Inserts a icon and text column to the control and the store. */ - wxDataViewColumn *AppendIconTextCol( const wxString &label, + wxDataViewColumn *AppendIconTextColumn( const wxString &label, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, wxAlignment align = wxALIGN_LEFT, int flags = wxDATAVIEW_COL_RESIZABLE ); @@ -1700,7 +1740,7 @@ public: virtual ~wxDataViewTreeCtrl(); /** - @todo docme + Appends a container to the given @a parent. */ wxDataViewItem AppendContainer(const wxDataViewItem& parent, const wxString& text, @@ -1709,7 +1749,7 @@ public: wxClientData* data = NULL); /** - @todo docme + Appends an item to the given @a parent. */ wxDataViewItem AppendItem(const wxDataViewItem& parent, const wxString& text, @@ -2173,14 +2213,11 @@ public: class wxDataViewEvent : public wxNotifyEvent { public: - //@{ /** Constructor. Typically used by wxWidgets internals only. */ wxDataViewEvent(wxEventType commandType = wxEVT_NULL, int winid = 0); - wxDataViewEvent(const wxDataViewEvent& event); - //@} /** Returns the position of the column in the control or -1 @@ -2228,5 +2265,46 @@ public: Sets the value associated with this event. */ void SetValue(const wxVariant& value); + + /** + Set wxDataObject for data transfer within a drag operation. + */ + void SetDataObject( wxDataObject *obj ); + + /** + Used internally. Gets associated wxDataObject for data transfer + within a drag operation. + */ + wxDataObject *GetDataObject() const; + + /** + Used internally. Sets the wxDataFormat during a drop operation. + */ + void SetDataFormat( const wxDataFormat &format ); + + /** + Gets the wxDataFormat during a drop operation. + */ + wxDataFormat GetDataFormat() const; + + /** + Used internally. Sets the data size for a drop data transfer. + */ + void SetDataSize( size_t size ); + + /** + Gets the data size for a drop data transfer. + */ + size_t GetDataSize() const; + + /** + Used internally. Sets the data buffer for a drop data transfer. + */ + void SetDataBuffer( void* buf ); + + /** + Gets the data buffer for a drop data transfer. + */ + void *GetDataBuffer() const; };