X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/20b35a6916b9b54af4bbfe4227393c08cd9a2724..553c5bcc3ab65e8b8a002dc6d5f51cba4f39292c:/include/wx/gbsizer.h diff --git a/include/wx/gbsizer.h b/include/wx/gbsizer.h index a6f90d9c9f..a0fe51142b 100644 --- a/include/wx/gbsizer.h +++ b/include/wx/gbsizer.h @@ -25,8 +25,8 @@ // Classes to represent a position in the grid and a size of an item in the // grid, IOW, the number of rows and columns it occupies. I chose to use these // instead of wxPoint and wxSize because they are (x,y) and usually pixel -// oriented whild grids and tables are usually thought of as (row,col) so some -// confusion would definitly result in using wxPoint... +// oriented while grids and tables are usually thought of as (row,col) so some +// confusion would definitely result in using wxPoint... // // NOTE: This should probably be refactored to a common RowCol data type which // is used for this and also for wxGridCellCoords. @@ -114,6 +114,10 @@ public: int border, wxObject* userData ); + // default ctor + wxGBSizerItem(); + + // Get the grid position of the item wxGBPosition GetPos() const { return m_pos; } void GetPos(int& row, int& col) const; @@ -144,18 +148,18 @@ public: void GetEndPos(int& row, int& col); - wxGridBagSizer* GetSizer() const { return m_sizer; } - void SetSizer(wxGridBagSizer* sizer) { m_sizer = sizer; } + wxGridBagSizer* GetGBSizer() const { return m_gbsizer; } + void SetGBSizer(wxGridBagSizer* sizer) { m_gbsizer = sizer; } protected: wxGBPosition m_pos; wxGBSpan m_span; - wxGridBagSizer* m_sizer; + wxGridBagSizer* m_gbsizer; // so SetPos/SetSpan can check for intersects private: - DECLARE_CLASS(wxGBSizerItem) + DECLARE_DYNAMIC_CLASS(wxGBSizerItem) DECLARE_NO_COPY_CLASS(wxGBSizerItem) }; @@ -198,6 +202,10 @@ public: wxSize GetEmptyCellSize() const { return m_emptyCellSize; } void SetEmptyCellSize(const wxSize& sz) { m_emptyCellSize = sz; } + // Get the size of the specified cell, including hgap and vgap. Only + // valid after a Layout. + wxSize GetCellSize(int row, int col) const; + // Get the grid position of the specified item (non-recursive) wxGBPosition GetItemPosition(wxWindow *window); wxGBPosition GetItemPosition(wxSizer *sizer); @@ -234,6 +242,13 @@ public: wxGBSizerItem* FindItemAtPosition(const wxGBPosition& pos); + // Return the sizer item located at the point given in pt, or NULL if + // there is no item at that point. The (x,y) coordinates in pt correspond + // to the client coordinates of the window using the sizer for + // layout. (non-recursive) + wxGBSizerItem* FindItemAtPoint(const wxPoint& pt); + + // Return the sizer item that has a matching user data (it only compares // pointer values) or NULL if not found. (non-recursive) wxGBSizerItem* FindItemWithData(const wxObject* userData);