diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2024-03-18 23:23:49 +0100 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2024-03-18 23:23:49 +0100 |
| commit | 5af2d77b8468bc585ac350b53d704f030b74fe1d (patch) | |
| tree | 5ac8c979b0295695a66d1dcc1c9cd4bb62e40634 /FL | |
| parent | dddfec57a1310defead31eee22590c3948984b27 (diff) | |
Add more public accessor methods to Fl_Grid (#937)
Some of these accessor methods should be private so they can't be used
by user code but - due to compiler issues - they must be public for
HP-UX 11.11 (for details see GitHub Issue #937).
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl_Grid.H | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/FL/Fl_Grid.H b/FL/Fl_Grid.H index 7473ae050..3661977c5 100644 --- a/FL/Fl_Grid.H +++ b/FL/Fl_Grid.H @@ -151,7 +151,7 @@ public: class Cell { friend class Fl_Grid; private: - Cell *next_; // next cell in row + Cell *next_; // next cell in the same row short row_; // row number short col_; // column number short rowspan_; // row span (1 - n) @@ -163,7 +163,7 @@ public: public: - void Cell_() { + void Cell_() { // common initialization next_ = NULL; row_ = 0; col_ = 0; @@ -175,21 +175,49 @@ public: align_ = 0; } - Cell(int row, int col) { + Cell(int row, int col) { // constructor Cell_(); row_ = row; col_ = col; } - Cell(Fl_Widget *w, int row, int col) { + Cell(Fl_Widget *w, int row, int col) { // widget assignment Cell_(); widget_ = w; row_ = row; col_ = col; } + /** + The destructor deletes the cell. + + \todo Fl_Grid's cell destructor should remove the cell from the grid. + Currently it does nothing! + */ ~Cell() {} + /** + Returns the next widget cell of the same row of this cell. + */ + Cell *next() { + return next_; + } + + /** + Sets the \c next pointer of a grid's cell. + + \b Internal use only! + + Do not use this method, it may corrupt the allocated memory. + + \internal + This method is public due to issue #937 but should be private or + at least protected. For more info see GitHub issue #937. + */ + void next(Cell *c) { + next_ = c; + } + Fl_Widget *widget() const { return widget_; } short row() const { return row_; } |
