X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4cc4bfafe5a31cb96f35b3ec9b19fa2b0b3a4eef..29f86fc1827816c9ab21202bb773caff854c2c10:/interface/dataview.h diff --git a/interface/dataview.h b/interface/dataview.h index cdc7491ef4..e32f513867 100644 --- a/interface/dataview.h +++ b/interface/dataview.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: dataview.h -// Purpose: documentation for wxDataViewIconText class +// Purpose: interface of wxDataViewIconText // Author: wxWidgets team // RCS-ID: $Id$ // Licence: wxWindows license @@ -33,12 +33,12 @@ public: /** Gets the icon. */ - const wxIcon GetIcon(); + const wxIcon GetIcon() const; /** Gets the text. */ - wxString GetText(); + wxString GetText() const; /** Set the icon. @@ -52,6 +52,7 @@ public: }; + /** @class wxDataViewEvent @wxheader{dataview.h} @@ -66,7 +67,7 @@ class wxDataViewEvent : public wxNotifyEvent public: //@{ /** - + */ wxDataViewEvent(wxEventType commandType = wxEVT_NULL, int winid = 0); @@ -76,13 +77,13 @@ public: /** Used to clone the event. */ - wxEvent* Clone(); + wxEvent* Clone() const; /** Returns the position of the column in the control or -1 if no column field was set by the event emitter. */ - int GetColumn(); + int GetColumn() const; /** Returns a pointer to the wxDataViewColumn from which @@ -93,20 +94,20 @@ public: /** Returns the wxDataViewModel associated with the event. */ - wxDataViewModel* GetModel(); + wxDataViewModel* GetModel() const; /** Returns a the position of a context menu event in screen coordinates. */ - wxPoint GetPosition(); + wxPoint GetPosition() const; /** Returns a reference to a value. */ - const wxVariant GetValue(); + const wxVariant GetValue() const; /** - + */ void SetColumn(int col); @@ -116,17 +117,18 @@ public: void SetDataViewColumn(wxDataViewColumn* col); /** - + */ void SetModel(wxDataViewModel* model); /** - + */ void SetValue(const wxVariant& value); }; + /** @class wxDataViewIconTextRenderer @wxheader{dataview.h} @@ -145,13 +147,14 @@ class wxDataViewIconTextRenderer : public wxDataViewRenderer { public: /** - + */ wxDataViewIconTextRenderer(const wxString& varianttype = "wxDataViewIconText", wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT); }; + /** @class wxDataViewIndexListModel @wxheader{dataview.h} @@ -197,7 +200,7 @@ public: /** Oberride this to indicate that the row has special font attributes. This only affects the - wxDataViewTextRendererText renderer. + wxDataViewTextRendererText() renderer. See also wxDataViewItemAttr. */ bool GetAttr(unsigned int row, unsigned int col, @@ -206,18 +209,18 @@ public: /** Returns the wxDataViewItem at the given @e row. */ - wxDataViewItem GetItem(unsigned int row); + wxDataViewItem GetItem(unsigned int row) const; /** Returns the position of given @e item. */ - unsigned int GetRow(const wxDataViewItem& item); + unsigned int GetRow(const wxDataViewItem& item) const; /** Override this to allow getting values from the model. */ void GetValue(wxVariant& variant, unsigned int row, - unsigned int col); + unsigned int col) const; /** Call this after if the data has to be read again from @@ -272,6 +275,7 @@ public: }; + /** @class wxDataViewModel @wxheader{dataview.h} @@ -396,7 +400,7 @@ public: /** Oberride this to indicate that the item has special font attributes. This only affects the - wxDataViewTextRendererText renderer. + wxDataViewTextRendererText() renderer. See also wxDataViewItemAttr. */ bool GetAttr(const wxDataViewItem& item, unsigned int col, @@ -407,26 +411,26 @@ public: an item. Returns the number of items. */ virtual unsigned int GetChildren(const wxDataViewItem& item, - wxDataViewItemArray& children); + wxDataViewItemArray& children) const; /** Override this to indicate the number of columns in the model. */ - virtual unsigned int GetColumnCount(); + virtual unsigned int GetColumnCount() const; /** Override this to indicate what type of data is stored in the column specified by @e col. This should return a string indicating the type of data as reported by wxVariant. */ - virtual wxString GetColumnType(unsigned int col); + virtual wxString GetColumnType(unsigned int col) const; /** Override this to indicate which wxDataViewItem representing the parent of @a item or an invalid wxDataViewItem if the the root item is the parent item. */ - virtual wxDataViewItem GetParent(const wxDataViewItem& item); + virtual wxDataViewItem GetParent(const wxDataViewItem& item) const; /** Override this to indicate the value of @e item @@ -434,7 +438,7 @@ public: */ virtual void GetValue(wxVariant& variant, const wxDataViewItem& item, - unsigned int col); + unsigned int col) const; /** Override this method to indicate if a container item merely @@ -442,7 +446,7 @@ public: acts a normal item with entries for futher columns. By default returns @e @false. */ - virtual bool HasContainerColumns(const wxDataViewItem& item); + virtual bool HasContainerColumns(const wxDataViewItem& item) const; /** Override this to indicate that the model provides a default compare @@ -453,13 +457,13 @@ public: should be used. See also wxDataViewIndexListModel for a model which makes use of this. */ - virtual bool HasDefaultCompare(); + virtual bool HasDefaultCompare() const; /** Override this to indicate of @a item is a container, i.e. if it can have child items. */ - virtual bool IsContainer(const wxDataViewItem& item); + virtual bool IsContainer(const wxDataViewItem& item) const; /** Call this to inform the model that an item has been added @@ -536,6 +540,7 @@ public: }; + /** @class wxDataViewCustomRenderer @wxheader{dataview.h} @@ -577,9 +582,10 @@ public: /** Override this to react to double clicks or ENTER. */ - virtual bool Activate(wxRect cell, wxDataViewModel* model, - unsigned int col, - unsigned int row); + virtual bool Activate( wxRect cell, + wxDataViewModel* model, + const wxDataViewItem & item, + unsigned int col ); /** Override this to create the actual editor control once editing @@ -617,10 +623,11 @@ public: /** Overrride this to react to a left click. */ - virtual bool LeftClick(wxPoint cursor, wxRect cell, - wxDataViewModel* model, - unsigned int col, - unsigned int row); + virtual bool LeftClick( wxPoint cursor, + wxRect cell, + wxDataViewModel * model, + const wxDataViewItem & item, + unsigned int col ); /** Override this to render the cell. Before this is called, @@ -641,21 +648,23 @@ public: /** Overrride this to react to a right click. */ - virtual bool RightClick(wxPoint cursor, wxRect cell, + virtual bool RightClick(wxPoint cursor, + wxRect cell, wxDataViewModel* model, - unsigned int col, - unsigned int row); + const wxDataViewItem & item, + unsigned int col); /** Overrride this to start a drag operation. */ virtual bool StartDrag(wxPoint cursor, wxRect cell, wxDataViewModel* model, - unsigned int col, - unsigned int row); + const wxDataViewItem & item, + unsigned int col); }; + /** @class wxDataViewBitmapRenderer @wxheader{dataview.h} @@ -669,24 +678,25 @@ class wxDataViewBitmapRenderer : public wxDataViewRenderer { public: /** - + */ wxDataViewBitmapRenderer(const wxString& varianttype = "wxBitmap", wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT); }; + /** @class wxDataViewItemAttr @wxheader{dataview.h} This class is used to indicate to a wxDataViewCtrl - that a certain Item has extra font attributes + that a certain Item() has extra font attributes for its renderer. For this, it is required to override wxDataViewModel::GetAttr. Attributes are currently only supported by - wxDataViewTextRendererText. + wxDataViewTextRendererText(). @library{wxadv} @category{FIXME} @@ -717,6 +727,7 @@ public: }; + /** @class wxDataViewItem @wxheader{dataview.h} @@ -745,7 +756,7 @@ class wxDataViewItem public: //@{ /** - + */ wxDataViewItem(void* id = NULL); wxDataViewItem(const wxDataViewItem& item); @@ -754,15 +765,16 @@ public: /** Returns the ID. */ - void* GetID(); + void* GetID() const; /** Returns @true if the ID is not @e @NULL. */ - bool IsOk(); + bool IsOk() const; }; + /** @class wxDataViewCtrl @wxheader{dataview.h} @@ -1011,67 +1023,67 @@ public: position in the control which may change after reordering columns by the user. */ - virtual wxDataViewColumn* GetColumn(unsigned int pos); + virtual wxDataViewColumn* GetColumn(unsigned int pos) const; /** Returns the number of columns. */ - virtual unsigned int GetColumnCount(); + virtual unsigned int GetColumnCount() const; /** Returns the position of the column or -1 if not found in the control. */ - virtual int GetColumnPosition(const wxDataViewColumn* column); + virtual int GetColumnPosition(const wxDataViewColumn* column) const; /** Returns column containing the expanders. */ - wxDataViewColumn* GetExpanderColumn(); + wxDataViewColumn* GetExpanderColumn() const; /** Returns indentation. */ - int GetIndent(); + int GetIndent() const; /** Returns item rect. */ wxRect GetItemRect(const wxDataViewItem& item, - const wxDataViewColumn* col = NULL); + const wxDataViewColumn* col = NULL) const; /** Returns pointer to the data model associated with the control (if any). */ - virtual wxDataViewModel* GetModel(); + virtual wxDataViewModel* GetModel() const; /** Returns first selected item or an invalid item if none is selected. */ - wxDataViewItem GetSelection(); + wxDataViewItem GetSelection() const; /** Fills @a sel with currently selected items and returns their number. */ - int GetSelections(wxDataViewItemArray& sel); + int GetSelections(wxDataViewItemArray& sel) const; /** Returns the wxDataViewColumn currently responsible for sorting or @NULL if none has been selected. */ - virtual wxDataViewColumn* GetSortingColumn(); + virtual wxDataViewColumn* GetSortingColumn() const; /** Hittest. */ void HitTest(const wxPoint& point, wxDataViewItem& item, - wxDataViewColumn*& col); + wxDataViewColumn*& col) const; /** Return @true if the item is selected. */ - bool IsSelected(const wxDataViewItem& item); + bool IsSelected(const wxDataViewItem& item) const; /** Select the given item. @@ -1111,6 +1123,7 @@ public: }; + /** @class wxDataViewModelNotifier @wxheader{dataview.h} @@ -1198,6 +1211,7 @@ public: }; + /** @class wxDataViewRenderer @wxheader{dataview.h} @@ -1315,6 +1329,7 @@ public: }; + /** @class wxDataViewTextRenderer @wxheader{dataview.h} @@ -1329,13 +1344,14 @@ class wxDataViewTextRenderer : public wxDataViewRenderer { public: /** - + */ wxDataViewTextRenderer(const wxString& varianttype = "string", wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT); }; + /** @class wxDataViewProgressRenderer @wxheader{dataview.h} @@ -1349,7 +1365,7 @@ class wxDataViewProgressRenderer : public wxDataViewRenderer { public: /** - + */ wxDataViewProgressRenderer(const wxString& label = wxEmptyString, const wxString& varianttype = "long", @@ -1357,6 +1373,7 @@ public: }; + /** @class wxDataViewSpinRenderer @wxheader{dataview.h} @@ -1381,6 +1398,7 @@ public: }; + /** @class wxDataViewToggleRenderer @wxheader{dataview.h} @@ -1394,13 +1412,14 @@ class wxDataViewToggleRenderer : public wxDataViewRenderer { public: /** - + */ wxDataViewToggleRenderer(const wxString& varianttype = "bool", wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT); }; + /** @class wxDataViewTreeCtrl @wxheader{dataview.h} @@ -1437,7 +1456,7 @@ public: ~wxDataViewTreeCtrl(); /** - + */ wxDataViewItem AppendContainer(const wxDataViewItem& parent, const wxString& text, @@ -1446,7 +1465,7 @@ public: wxClientData* data = NULL); /** - + */ wxDataViewItem AppendItem(const wxDataViewItem& parent, const wxString& text, @@ -1481,7 +1500,7 @@ public: /** Calls the identical method from wxDataViewTreeStore. */ - int GetChildCount(const wxDataViewItem& parent); + int GetChildCount(const wxDataViewItem& parent) const; /** Returns the image list. @@ -1491,35 +1510,35 @@ public: /** Calls the identical method from wxDataViewTreeStore. */ - wxClientData* GetItemData(const wxDataViewItem& item); + wxClientData* GetItemData(const wxDataViewItem& item) const; /** Calls the identical method from wxDataViewTreeStore. */ - const wxIcon GetItemExpandedIcon(const wxDataViewItem& item); + const wxIcon GetItemExpandedIcon(const wxDataViewItem& item) const; /** Calls the identical method from wxDataViewTreeStore. */ - const wxIcon GetItemIcon(const wxDataViewItem& item); + const wxIcon GetItemIcon(const wxDataViewItem& item) const; /** Calls the identical method from wxDataViewTreeStore. */ - wxString GetItemText(const wxDataViewItem& item); + wxString GetItemText(const wxDataViewItem& item) const; /** Calls the identical method from wxDataViewTreeStore. */ wxDataViewItem GetNthChild(const wxDataViewItem& parent, - unsigned int pos); + unsigned int pos) const; //@{ /** Returns the store. */ - wxDataViewTreeStore* GetStore(); - const wxDataViewTreeStore* GetStore(); + wxDataViewTreeStore* GetStore() const; + const wxDataViewTreeStore* GetStore() const; //@} /** @@ -1591,6 +1610,7 @@ public: }; + /** @class wxDataViewTreeStore @wxheader{dataview.h} @@ -1653,33 +1673,33 @@ public: /** Return the number of children of item. */ - int GetChildCount(const wxDataViewItem& parent); + int GetChildCount(const wxDataViewItem& parent) const; /** Returns the client data asoociated with the item. */ - wxClientData* GetItemData(const wxDataViewItem& item); + wxClientData* GetItemData(const wxDataViewItem& item) const; /** Returns the icon to display in expanded containers. */ - const wxIcon GetItemExpandedIcon(const wxDataViewItem& item); + const wxIcon GetItemExpandedIcon(const wxDataViewItem& item) const; /** Returns the icon of the item. */ - const wxIcon GetItemIcon(const wxDataViewItem& item); + const wxIcon GetItemIcon(const wxDataViewItem& item) const; /** Returns the text of the item. */ - wxString GetItemText(const wxDataViewItem& item); + wxString GetItemText(const wxDataViewItem& item) const; /** Returns the nth child item of item. */ wxDataViewItem GetNthChild(const wxDataViewItem& parent, - unsigned int pos); + unsigned int pos) const; /** Inserts a container after @e previous. @@ -1735,6 +1755,7 @@ public: }; + /** @class wxDataViewDateRenderer @wxheader{dataview.h} @@ -1748,13 +1769,14 @@ class wxDataViewDateRenderer : public wxDataViewRenderer { public: /** - + */ wxDataViewDateRenderer(const wxString& varianttype = "datetime", wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE); }; + /** @class wxDataViewTextRendererAttr @wxheader{dataview.h} @@ -1773,7 +1795,7 @@ class wxDataViewTextRendererAttr : public wxDataViewTextRenderer { public: /** - + */ wxDataViewTextRendererAttr(const wxString& varianttype = "string", wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, @@ -1781,6 +1803,7 @@ public: }; + /** @class wxDataViewColumn @wxheader{dataview.h} @@ -1906,3 +1929,4 @@ public: */ void SetTitle(const wxString& title); }; +