summaryrefslogtreecommitdiff
path: root/FL/Fl_Grid.H
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-11-05 20:04:43 +0100
committerMatthias Melcher <github@matthiasm.com>2023-11-05 20:04:49 +0100
commit1f5472a7d37af7909c1daa37bb5aee7296df170a (patch)
tree9ff3fde1ce50587c5ce3b27e55593cb8f27dc788 /FL/Fl_Grid.H
parent0ae927a00e9ecd45a45edf004e939ab2e5ce4813 (diff)
FLUID: Adds transient cells to Fl_Grid
This allows multiple widgets to occupy a single cell which is needed when moving cells across the grid interactively.
Diffstat (limited to 'FL/Fl_Grid.H')
-rw-r--r--FL/Fl_Grid.H21
1 files changed, 17 insertions, 4 deletions
diff --git a/FL/Fl_Grid.H b/FL/Fl_Grid.H
index b240ca95b..403c6c0f3 100644
--- a/FL/Fl_Grid.H
+++ b/FL/Fl_Grid.H
@@ -159,10 +159,10 @@ public:
public:
- Cell(int row, int col) {
+ void Cell_() {
next_ = NULL;
- row_ = row;
- col_ = col;
+ row_ = 0;
+ col_ = 0;
rowspan_ = 1;
colspan_ = 1;
widget_ = NULL;
@@ -171,6 +171,19 @@ public:
align_ = 0;
}
+ Cell(int row, int col) {
+ Cell_();
+ row_ = row;
+ col_ = col;
+ }
+
+ Cell(Fl_Widget *w, int row, int col) {
+ Cell_();
+ widget_ = w;
+ row_ = row;
+ col_ = col;
+ }
+
~Cell() {}
Fl_Widget *widget() { return widget_; }
@@ -211,7 +224,7 @@ protected:
Fl_Color grid_color; // color for drawing the grid lines (design helper)
bool draw_grid_; // draw the grid for testing / design
-private:
+protected:
void init();
Cell *add_cell(int row, int col);
void remove_cell(int row, int col);