summaryrefslogtreecommitdiff
path: root/fluid/Fl_Grid_Type.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 /fluid/Fl_Grid_Type.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 'fluid/Fl_Grid_Type.h')
-rw-r--r--fluid/Fl_Grid_Type.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/fluid/Fl_Grid_Type.h b/fluid/Fl_Grid_Type.h
index 5ab87b8a5..9780ace76 100644
--- a/fluid/Fl_Grid_Type.h
+++ b/fluid/Fl_Grid_Type.h
@@ -25,11 +25,24 @@
extern const char grid_type_name[];
class Fl_Grid_Proxy : public Fl_Grid {
+protected:
+ typedef struct { Fl_Widget *widget; Cell *cell; } Cell_Widget_Pair;
+ Cell_Widget_Pair *transient_;
+ int num_transient_;
+ int cap_transient_;
+ void transient_make_room_(int n);
+ void transient_remove_(Fl_Widget *w);
public:
- Fl_Grid_Proxy(int X,int Y,int W,int H) : Fl_Grid(X,Y,W,H) {}
+ Fl_Grid_Proxy(int X,int Y,int W,int H);
+ ~Fl_Grid_Proxy();
void resize(int,int,int,int) FL_OVERRIDE;
void draw() FL_OVERRIDE;
void draw_overlay();
+ void move_cell(Fl_Widget *child, int to_row, int to_col, int how = 0);
+ Cell* any_cell(Fl_Widget *widget) const;
+ Cell* transient_widget(Fl_Widget *wi, int row, int col, int row_span, int col_span, Fl_Grid_Align align = FL_GRID_FILL);
+ Cell* widget(Fl_Widget *wi, int row, int col, Fl_Grid_Align align = FL_GRID_FILL);
+ Cell* widget(Fl_Widget *wi, int row, int col, int rowspan, int colspan, Fl_Grid_Align align = FL_GRID_FILL);
};
class Fl_Grid_Type : public Fl_Group_Type