X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12f5e1e78fe906050ff2fee9529476db332633f0..5267aefd85739afd26bd19bfba998005119db446:/interface/wx/vlbox.h?ds=sidebyside diff --git a/interface/wx/vlbox.h b/interface/wx/vlbox.h index 2f7ae80506..e1f9ee5904 100644 --- a/interface/wx/vlbox.h +++ b/interface/wx/vlbox.h @@ -30,7 +30,7 @@ @library{wxcore} @category{ctrl} - + @appearance{vlistbox.png} @see wxSimpleHtmlListBox, wxHtmlListBox */ @@ -125,6 +125,15 @@ public: */ wxPoint GetMargins() const; + /** + Returns the rectangle occupied by this item in physical coordinates. + + If the item is not currently visible, returns an empty rectangle. + + @since 2.9.0 + */ + wxRect GetItemRect(size_t item) const; + /** Returns the index of the next selected item or @c wxNOT_FOUND if there are no more. @@ -192,23 +201,7 @@ public: @todo Change this function signature to non-const. */ - void OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const; - - /** - The derived class must implement this function to actually draw the - item with the given index on the provided DC. - - @param dc - The device context to use for drawing. - @param rect - The bounding rectangle for the item being drawn (DC clipping - region is set to this rectangle before calling this function). - @param n - The index of the item to be drawn. - - @todo Change this function signature to non-const. - */ - virtual void OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const; + virtual void OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const; /** This method may be used to draw separators between the lines. The @@ -228,12 +221,6 @@ public: */ virtual void OnDrawSeparator(wxDC& dc, wxRect& rect, size_t n) const; - /** - The derived class must implement this method to return the height of - the specified item (in pixels). - */ - virtual wxCoord OnMeasureItem(size_t n) const; - /** Selects or deselects the specified item which must be valid (i.e. not equal to @c wxNOT_FOUND). @@ -277,7 +264,7 @@ public: This is just a synonym for wxVScrolledWindow::SetRowCount(). */ - void SetItemCount(size_t count); + virtual void SetItemCount(size_t count); //@{ /** @@ -323,5 +310,29 @@ public: @see Select() */ void Toggle(size_t item); + +protected: + + /** + The derived class must implement this function to actually draw the + item with the given index on the provided DC. + + @param dc + The device context to use for drawing. + @param rect + The bounding rectangle for the item being drawn (DC clipping + region is set to this rectangle before calling this function). + @param n + The index of the item to be drawn. + + @todo Change this function signature to non-const. + */ + virtual void OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const = 0; + + /** + The derived class must implement this method to return the height of + the specified item (in pixels). + */ + virtual wxCoord OnMeasureItem(size_t n) const = 0; };