From 1f5472a7d37af7909c1daa37bb5aee7296df170a Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sun, 5 Nov 2023 20:04:43 +0100 Subject: 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. --- FL/Fl_Grid.H | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'FL') 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); -- cgit v1.2.3