summaryrefslogtreecommitdiff
path: root/fluid
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-10-22 20:25:41 +0200
committerMatthias Melcher <github@matthiasm.com>2023-10-22 20:25:50 +0200
commitbf62959f1f76a5bafd3566a802b49fc2138a4763 (patch)
tree4cfe161bcaae3be36904c3f7413d07813db21205 /fluid
parent1209e9dcd7e1e97bedc747d06ba4eea837562158 (diff)
FLUID: New layout of Grid tab.
Diffstat (limited to 'fluid')
-rw-r--r--fluid/Fl_Grid_Type.cxx173
-rw-r--r--fluid/Fl_Grid_Type.h2
-rw-r--r--fluid/custom_widgets.cxx1
-rw-r--r--fluid/widget_panel.cxx964
-rw-r--r--fluid/widget_panel.fl703
-rw-r--r--fluid/widget_panel.h32
6 files changed, 1348 insertions, 527 deletions
diff --git a/fluid/Fl_Grid_Type.cxx b/fluid/Fl_Grid_Type.cxx
index 390153ed4..2ae88d127 100644
--- a/fluid/Fl_Grid_Type.cxx
+++ b/fluid/Fl_Grid_Type.cxx
@@ -393,102 +393,11 @@ void Fl_Grid_Type::child_resized(Fl_Widget_Type *child_type) {
// TODO: if the user resizes an FL_GRID_FILL widget, should we change the alignment?
}
-void grid_cb(Fl_Value_Input* i, void* v, int what) {
- if (v == LOAD) {
- if (current_widget->is_a(ID_Grid)) {
- int v;
- Fl_Grid *g = ((Fl_Grid*)current_widget->o);
- switch (what) {
- case 0: g->margin(&v, NULL, NULL, NULL); break;
- case 1: g->margin(NULL, &v, NULL, NULL); break;
- case 2: g->margin(NULL, NULL, &v, NULL); break;
- case 3: g->margin(NULL, NULL, NULL, &v); break;
- case 4: g->gap(&v, NULL); break;
- case 5: g->gap(NULL, &v); break;
- }
- i->value(v);
- }
- } else {
- int mod = 0;
- int v = (int)i->value();
- for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
- if (o->selected && o->is_a(ID_Grid)) {
- Fl_Grid *g = ((Fl_Grid*)(((Fl_Widget_Type*)o)->o));
- switch (what) {
- case 0: g->margin(v, -1, -1, -1); break;
- case 1: g->margin(-1, v, -1, -1); break;
- case 2: g->margin(-1, -1, v, -1); break;
- case 3: g->margin(-1, -1, -1, v); break;
- case 4: g->gap(v, -1); break;
- case 5: g->gap(-1, v); break;
- }
- g->need_layout(true);
- g->redraw();
- mod = 1;
- }
- }
- if (mod) set_modflag(1);
- }
-}
-void grid_margin_left_cb(Fl_Value_Input* i, void* v) {
- grid_cb(i, v, 0);
-}
-void grid_margin_top_cb(Fl_Value_Input* i, void* v) {
- grid_cb(i, v, 1);
-}
-void grid_margin_right_cb(Fl_Value_Input* i, void* v) {
- grid_cb(i, v, 2);
-}
-void grid_margin_bottom_cb(Fl_Value_Input* i, void* v) {
- grid_cb(i, v, 3);
-}
-void grid_row_gap_cb(Fl_Value_Input* i, void* v) {
- grid_cb(i, v, 4);
-}
-void grid_col_gap_cb(Fl_Value_Input* i, void* v) {
- grid_cb(i, v, 5);
-}
-
-void grid_cb(Fluid_Coord_Input* i, void* v, int what) {
- if (v == LOAD) {
- if (current_widget->is_a(ID_Grid)) {
- int v = 0;
- Fl_Grid *g = ((Fl_Grid*)current_widget->o);
- switch (what) {
- case 6: v = g->rows(); break;
- case 7: v = g->cols(); break;
- }
- i->value(v);
- }
- } else {
- int mod = 0;
- int old_v = 0, v = (int)i->value();
- for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
- if (o->selected && o->is_a(ID_Grid)) {
- Fl_Grid *g = ((Fl_Grid*)(((Fl_Widget_Type*)o)->o));
- switch (what) {
- case 6: old_v = g->rows(); break;
- case 7: old_v = g->cols(); break;
- }
- if (old_v != v) {
- switch (what) {
- case 6: g->layout(v, g->cols()); break;
- case 7: g->layout(g->rows(), v); break;
- }
- g->need_layout(true);
- g->redraw();
- mod = 1;
- }
- }
- }
- if (mod) set_modflag(1);
- }
-}
-void grid_rows_cb(Fluid_Coord_Input* i, void* v) {
- grid_cb(i, v, 6);
-}
-void grid_cols_cb(Fluid_Coord_Input* i, void* v) {
- grid_cb(i, v, 7);
+/** Return the currently selected Grid widget if is a Grid Type. */
+Fl_Grid *Fl_Grid_Type::selected() {
+ if (current_widget && current_widget->is_a(ID_Grid))
+ return ((Fl_Grid*)((Fl_Grid_Type*)current_widget)->o);
+ return NULL;
}
extern Fluid_Coord_Input *widget_grid_row_input, *widget_grid_col_input;
@@ -616,75 +525,3 @@ void grid_align_cb(Fl_Choice* i, void* v) {
}
}
}
-
-void grid_row_col_cb(Fluid_Coord_Input* i, void* v, int what) {
- if ( !current_widget
- || !current_widget->parent
- || !current_widget->parent->is_a(ID_Grid))
- {
- return;
- }
- Fl_Grid *g = ((Fl_Grid*)((Fl_Widget_Type*)current_widget->parent)->o);
- Fl_Grid::Cell *cell = g->cell(current_widget->o);
- if (v == LOAD) {
- if (cell) {
- int v = 0;
- switch (what) {
- case 0: v = g->row_height(cell->row()); break;
- case 1: v = g->row_weight(cell->row()); break;
- case 2: v = g->row_gap(cell->row()); break;
- case 3: v = g->col_width(cell->col()); break;
- case 4: v = g->col_weight(cell->col()); break;
- case 5: v = g->col_gap(cell->col()); break;
- }
- i->value(v);
- i->activate();
- } else {
- i->deactivate();
- }
- } else {
- if (cell) {
- int v = i->value(), old_v = 0;
- switch (what) {
- case 0: old_v = g->row_height(cell->row()); break;
- case 1: old_v = g->row_weight(cell->row()); break;
- case 2: old_v = g->row_gap(cell->row()); break;
- case 3: old_v = g->col_width(cell->col()); break;
- case 4: old_v = g->col_weight(cell->col()); break;
- case 5: old_v = g->col_gap(cell->col()); break;
- }
- if (old_v != v) {
- switch (what) {
- case 0: g->row_height(cell->row(), v); break;
- case 1: g->row_weight(cell->row(), v); break;
- case 2: g->row_gap(cell->row(), v); break;
- case 3: g->col_width(cell->col(), v); break;
- case 4: g->col_weight(cell->col(), v); break;
- case 5: g->col_gap(cell->col(), v); break;
- }
- g->need_layout(true);
- g->redraw();
- set_modflag(1);
- }
- }
- }
-}
-void grid_row_height(Fluid_Coord_Input* i, void* v) {
- grid_row_col_cb(i, v, 0);
-}
-void grid_row_weight(Fluid_Coord_Input* i, void* v) {
- grid_row_col_cb(i, v, 1);
-}
-void grid_row_gap(Fluid_Coord_Input* i, void* v) {
- grid_row_col_cb(i, v, 2);
-}
-
-void grid_col_width(Fluid_Coord_Input* i, void* v) {
- grid_row_col_cb(i, v, 3);
-}
-void grid_col_weight(Fluid_Coord_Input* i, void* v) {
- grid_row_col_cb(i, v, 4);
-}
-void grid_col_gap(Fluid_Coord_Input* i, void* v) {
- grid_row_col_cb(i, v, 5);
-}
diff --git a/fluid/Fl_Grid_Type.h b/fluid/Fl_Grid_Type.h
index 6ee1831ab..3ad25095c 100644
--- a/fluid/Fl_Grid_Type.h
+++ b/fluid/Fl_Grid_Type.h
@@ -45,6 +45,8 @@ public:
void move_child(Fl_Type*, Fl_Type*) FL_OVERRIDE;
void remove_child(Fl_Type*) FL_OVERRIDE;
void child_resized(Fl_Widget_Type *child);
+
+ static class Fl_Grid *selected();
};
#endif // _FLUID_FL_GRID_TYPE_H
diff --git a/fluid/custom_widgets.cxx b/fluid/custom_widgets.cxx
index 88b4a6b8a..e254f19d4 100644
--- a/fluid/custom_widgets.cxx
+++ b/fluid/custom_widgets.cxx
@@ -142,6 +142,7 @@ vars_(0L),
vars_user_data_(0L)
{
Fl_Input::callback((Fl_Callback*)callback_handler_cb);
+ text("0");
}
void Fluid_Coord_Input::callback_handler_cb(Fluid_Coord_Input *This, void *v) {
diff --git a/fluid/widget_panel.cxx b/fluid/widget_panel.cxx
index 8b5a7c680..4d0cf5d5f 100644
--- a/fluid/widget_panel.cxx
+++ b/fluid/widget_panel.cxx
@@ -17,8 +17,40 @@
// generated by Fast Light User Interface Designer (fluid) version 1.0400
#include "widget_panel.h"
+#include "undo.h"
#include "Fl_Widget_Type.h"
+#include "Fl_Grid_Type.h"
#include <FL/Fl_Grid.H>
+extern void set_modflag(int mf, int mfc=-1);
+
+Fl_Double_Window* make_window() {
+ Fl_Double_Window* w;
+ { Fl_Double_Window* o = new Fl_Double_Window(480, 320);
+ w = o; (void)w;
+ { Fl_Grid* o = new Fl_Grid(25, 25, 240, 160);
+ o->labelsize(11);
+ o->layout(3, 3);
+ o->margin(10, 8, 11, 12);
+ static const int rowgaps[] = { 3, -1, -1 };
+ o->row_gap(rowgaps, 3);
+ static const int colwidths[] = { 0, 100, 0 };
+ o->col_width(colwidths, 3);
+ static const int colweights[] = { 50, 40, 50 };
+ o->col_weight(colweights, 3);
+ static const int colgaps[] = { 1, 3, -1 };
+ o->col_gap(colgaps, 3);
+ { Fl_Button* o = new Fl_Button(77, 75, 133, 59, "Button");
+ o->labelsize(11);
+ } // Fl_Button* o
+ Fl_Grid::Cell *cell = NULL;
+ cell = o->widget(o->child(0), 1, 1, 1, 1, 48);
+ if (cell) cell->minimum_size(20, 20);
+ o->end();
+ } // Fl_Grid* o
+ o->end();
+ } // Fl_Double_Window* o
+ return w;
+}
Fl_Tabs *widget_tabs=(Fl_Tabs *)0;
@@ -114,15 +146,13 @@ Fl_Menu_Item menu_4[] = {
Fl_Box *w_when_box=(Fl_Box *)0;
-Fl_Tabs *widget_tabs_repo=(Fl_Tabs *)0;
-
Fl_Group *widget_tab_grid_child=(Fl_Group *)0;
Fluid_Coord_Input *widget_grid_row_input=(Fluid_Coord_Input *)0;
Fluid_Coord_Input *widget_grid_col_input=(Fluid_Coord_Input *)0;
-Fl_Menu_Item menu_Align[] = {
+Fl_Menu_Item menu_5[] = {
{"GRID_CENTER", 0, 0, (void*)(FL_GRID_CENTER), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
{"GRID_FILL", 0, 0, (void*)(FL_GRID_FILL), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
{"GRID_HORIZONTAL", 0, 0, (void*)(FL_GRID_HORIZONTAL), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
@@ -140,6 +170,371 @@ Fl_Menu_Item menu_Align[] = {
Fl_Group *widget_tab_grid=(Fl_Group *)0;
+Fluid_Coord_Input *widget_grid_rows=(Fluid_Coord_Input *)0;
+
+static void cb_widget_grid_rows(Fluid_Coord_Input* o, void* v) {
+ // grid_rows_cb
+ Fl_Grid *grid = Fl_Grid_Type::selected();
+ if (!grid) return;
+ if (v == LOAD) {
+ o->value(grid->rows());
+ } else {
+ int m = o->value(), old_m = grid->rows();
+ if (m < 1) {
+ m = 1;
+ o->value(m);
+ }
+ if (m < old_m) {
+ // TODO: verify that this will not unlink existings cells
+ // Offer a dialog with "delete children", "unlink cells", "cancel"
+ }
+ if (m != old_m) {
+ undo_checkpoint();
+ grid->layout(m, grid->cols());
+ grid->need_layout(true);
+ set_modflag(1);
+ widget_tab_grid->do_callback(widget_tab_grid, LOAD);
+ }
+ }
+}
+
+static void cb_1(Fl_Button*, void* v) {
+ if (v != LOAD) {
+ widget_grid_rows->value( widget_grid_rows->value()-1 );
+ widget_grid_rows->do_callback();
+ }
+}
+
+static void cb_2(Fl_Button*, void* v) {
+ if (v != LOAD) {
+ widget_grid_rows->value( widget_grid_rows->value()+1 );
+ widget_grid_rows->do_callback();
+ }
+}
+
+Fluid_Coord_Input *widget_grid_cols=(Fluid_Coord_Input *)0;
+
+static void cb_widget_grid_cols(Fluid_Coord_Input* o, void* v) {
+ // grid_rows_cb
+ Fl_Grid *grid = Fl_Grid_Type::selected();
+ if (!grid) return;
+ if (v == LOAD) {
+ o->value(grid->cols());
+ } else {
+ int m = o->value(), old_m = grid->cols();
+ if (m < 1) {
+ m = 1;
+ o->value(m);
+ }
+ if (m < old_m) {
+ // TODO: verify that this will not unlink existings cells
+ // Offer a dialog with "delete children", "unlink cells", "cancel"
+ }
+ if (m != old_m) {
+ undo_checkpoint();
+ grid->layout(grid->rows(), m);
+ grid->need_layout(true);
+ set_modflag(1);
+ widget_tab_grid->do_callback(widget_tab_grid, LOAD);
+ }
+ }
+}
+
+static void cb_3(Fl_Button*, void* v) {
+ if (v != LOAD) {
+ widget_grid_cols->value( widget_grid_cols->value()-1 );
+ widget_grid_cols->do_callback();
+ }
+}
+
+static void cb_4(Fl_Button*, void* v) {
+ if (v != LOAD) {
+ widget_grid_cols->value( widget_grid_cols->value()+1 );
+ widget_grid_cols->do_callback();
+ }
+}
+
+static void cb_Left(Fl_Value_Input* o, void* v) {
+ Fl_Grid *grid = Fl_Grid_Type::selected();
+ if (!grid) return;
+ int m = 0;
+ if (v == LOAD) {
+ grid->margin(&m, NULL, NULL, NULL);
+ o->value(m);
+ } else {
+ int m = o->value(), old_m;
+ grid->margin(&old_m, NULL, NULL, NULL);
+ if (m != old_m) {
+ grid->margin(m, -1, -1, -1);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+ }
+}
+
+static void cb_Top(Fl_Value_Input* o, void* v) {
+ Fl_Grid *grid = Fl_Grid_Type::selected();
+ if (!grid) return;
+ int m = 0;
+ if (v == LOAD) {
+ grid->margin(NULL, &m, NULL, NULL);
+ o->value(m);
+ } else {
+ int m = o->value(), old_m;
+ grid->margin(NULL, &old_m, NULL, NULL);
+ if (m != old_m) {
+ grid->margin(-1, m, -1, -1);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+ }
+}
+
+static void cb_Right(Fl_Value_Input* o, void* v) {
+ Fl_Grid *grid = Fl_Grid_Type::selected();
+ if (!grid) return;
+ int m = 0;
+ if (v == LOAD) {
+ grid->margin(NULL, NULL, &m, NULL);
+ o->value(m);
+ } else {
+ int m = o->value(), old_m;
+ grid->margin(NULL, NULL, &old_m, NULL);
+ if (m != old_m) {
+ grid->margin(-1, -1, m, -1);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+ }
+}
+
+static void cb_Bottom(Fl_Value_Input* o, void* v) {
+ Fl_Grid *grid = Fl_Grid_Type::selected();
+ if (!grid) return;
+ int m = 0;
+ if (v == LOAD) {
+ grid->margin(NULL, NULL, NULL, &m);
+ o->value(m);
+ } else {
+ int m = o->value(), old_m;
+ grid->margin(NULL, NULL, NULL, &old_m);
+ if (m != old_m) {
+ grid->margin(-1, -1, -1, m);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+ }
+}
+
+static void cb_Row(Fl_Value_Input* o, void* v) {
+ Fl_Grid *grid = Fl_Grid_Type::selected();
+ if (!grid) return;
+ int m = 0;
+ if (v == LOAD) {
+ grid->gap(&m, NULL);
+ o->value(m);
+ } else {
+ int m = o->value(), old_m;
+ grid->gap(&old_m, NULL);
+ if (m != old_m) {
+ grid->gap(m, -1);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+ }
+}
+
+static void cb_Col(Fl_Value_Input* o, void* v) {
+ Fl_Grid *grid = Fl_Grid_Type::selected();
+ if (!grid) return;
+ int m = 0;
+ if (v == LOAD) {
+ grid->gap(NULL, &m);
+ o->value(m);
+ } else {
+ int m = o->value(), old_m;
+ grid->gap(NULL, &old_m);
+ if (m != old_m) {
+ grid->gap(-1, m);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+ }
+}
+
+static void cb_Row1(Fl_Group* o, void* v) {
+ if (v == LOAD) {
+ Fl_Grid *grid = Fl_Grid_Type::selected();
+ if (grid)
+ o->activate();
+ else
+ o->deactivate();
+ propagate_load(o, v);
+ }
+}
+
+Fluid_Coord_Input *widget_grid_curr_row=(Fluid_Coord_Input *)0;
+
+static void cb_widget_grid_curr_row(Fluid_Coord_Input* o, void* v) {
+ Fl_Grid *grid = Fl_Grid_Type::selected();
+ if (!grid) return;
+ int r = o->value(), old_r = r;
+ if (r < 0) r = 0;
+ if (r >= grid->rows()) r = grid->rows()-1;
+ if (r != old_r) o->value(r);
+ if (v == LOAD) {
+ // will automatically propagate
+ } else {
+ widget_grid_curr_row_attributes->do_callback(widget_grid_curr_row_attributes, LOAD);
+ }
+}
+
+static void cb_5(Fl_Button*, void* v) {
+ if (v != LOAD) {
+ widget_grid_curr_row->value( widget_grid_curr_row->value()-1 );
+ widget_grid_curr_row->do_callback();
+ }
+}
+
+static void cb_6(Fl_Button*, void* v) {
+ if (v != LOAD) {
+ widget_grid_curr_row->value( widget_grid_curr_row->value()+1 );
+ widget_grid_curr_row->do_callback();
+ }
+}
+
+Fl_Group *widget_grid_curr_row_attributes=(Fl_Group *)0;
+
+static void cb_Height(Fluid_Coord_Input* o, void* v) {
+ Fl_Grid *grid = Fl_Grid_Type::selected();
+ if (!grid) return;
+ int r = widget_grid_curr_row->value();
+ if (v == LOAD) {
+ o->value(grid->row_height(r));
+ } else {
+ int h = o->value(), old_h = grid->row_height(r);
+ if (h != old_h) {
+ grid->row_height(r, h);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+ }
+}
+
+static void cb_Weight(Fluid_Coord_Input* o, void* v) {
+ Fl_Grid *grid = Fl_Grid_Type::selected();
+ if (!grid) return;
+ int r = widget_grid_curr_row->value();
+ if (v == LOAD) {
+ o->value(grid->row_weight(r));
+ } else {
+ int h = o->value(), old_h = grid->row_weight(r);
+ if (h != old_h) {
+ grid->row_weight(r, h);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+ }
+}
+
+static void cb_Gap(Fluid_Coord_Input* o, void* v) {
+ Fl_Grid *grid = Fl_Grid_Type::selected();
+ if (!grid) return;
+ int r = widget_grid_curr_row->value();
+ if (v == LOAD) {
+ o->value(grid->row_gap(r));
+ } else {
+ int h = o->value(), old_h = grid->row_gap(r);
+ if (h != old_h) {
+ grid->row_gap(r, h);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+ }
+}
+
+Fluid_Coord_Input *widget_grid_curr_col=(Fluid_Coord_Input *)0;
+
+static void cb_widget_grid_curr_col(Fluid_Coord_Input* o, void* v) {
+ Fl_Grid *grid = Fl_Grid_Type::selected();
+ if (!grid) return;
+ int c = o->value(), old_c = c;
+ if (c < 0) c = 0;
+ if (c >= grid->cols()) c = grid->cols()-1;
+ if (c != old_c) o->value(c);
+ if (v == LOAD) {
+ // will automatically propagate
+ } else {
+ widget_grid_curr_col_attributes->do_callback(widget_grid_curr_col_attributes, LOAD);
+ }
+}
+
+static void cb_7(Fl_Button*, void* v) {
+ if (v != LOAD) {
+ widget_grid_curr_col->value( widget_grid_curr_col->value()-1 );
+ widget_grid_curr_col->do_callback();
+ }
+}
+
+static void cb_8(Fl_Button*, void* v) {
+ if (v != LOAD) {
+ widget_grid_curr_col->value( widget_grid_curr_col->value()+1 );
+ widget_grid_curr_col->do_callback();
+ }
+}
+
+Fl_Group *widget_grid_curr_col_attributes=(Fl_Group *)0;
+
+static void cb_Width(Fluid_Coord_Input* o, void* v) {
+ Fl_Grid *grid = Fl_Grid_Type::selected();
+ if (!grid) return;
+ int c = widget_grid_curr_col->value();
+ if (v == LOAD) {
+ o->value(grid->col_width(c));
+ } else {
+ int h = o->value(), old_h = grid->col_width(c);
+ if (h != old_h) {
+ grid->col_width(c, h);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+ }
+}
+
+static void cb_Weight1(Fluid_Coord_Input* o, void* v) {
+ Fl_Grid *grid = Fl_Grid_Type::selected();
+ if (!grid) return;
+ int c = widget_grid_curr_col->value();
+ if (v == LOAD) {
+ o->value(grid->col_weight(c));
+ } else {
+ int h = o->value(), old_h = grid->col_weight(c);
+ if (h != old_h) {
+ grid->col_weight(c, h);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+ }
+}
+
+static void cb_Gap1(Fluid_Coord_Input* o, void* v) {
+ Fl_Grid *grid = Fl_Grid_Type::selected();
+ if (!grid) return;
+ int c = widget_grid_curr_col->value();
+ if (v == LOAD) {
+ o->value(grid->col_gap(c));
+ } else {
+ int h = o->value(), old_h = grid->col_gap(c);
+ if (h != old_h) {
+ grid->col_gap(c, h);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+ }
+}
+
+Fl_Tabs *widget_tabs_repo=(Fl_Tabs *)0;
+
Fl_Button *wLiveMode=(Fl_Button *)0;
Fl_Button *overlay_button=(Fl_Button *)0;
@@ -1035,37 +1430,16 @@ access the Widget pointer and \'v\' to access the user value.");
} // Fl_Group* o
o->end();
} // Fl_Group* o
- o->show();
- widget_tabs->end();
- Fl_Group::current()->resizable(widget_tabs);
- } // Fl_Tabs* widget_tabs
- { Fl_Tabs* o = widget_tabs_repo = new Fl_Tabs(10, 10, 400, 350);
- widget_tabs_repo->hide();
- { Fl_Group* o = new Fl_Group(10, 30, 400, 330);
- o->hide();
- o->end();
- Fl_Group::current()->resizable(o);
- } // Fl_Group* o
{ widget_tab_grid_child = new Fl_Group(10, 30, 400, 330, "Grid Child");
widget_tab_grid_child->labelsize(11);
widget_tab_grid_child->callback((Fl_Callback*)propagate_load);
widget_tab_grid_child->hide();
- { Fl_Box* o = new Fl_Box(25, 43, 370, 28, "The Fl_Grid implementation in FLUID is still experimental!");
- o->labelfont(1);
- o->labelsize(11);
- o->labelcolor((Fl_Color)1);
- } // Fl_Box* o
- { Fl_Box* o = new Fl_Box(96, 74, 155, 20, "-- Widget --");
- o->labelfont(1);
- o->labelsize(12);
- o->align(Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE));
- } // Fl_Box* o
- { Fl_Group* o = new Fl_Group(96, 110, 314, 20, "Location:");
+ { Fl_Group* o = new Fl_Group(95, 60, 315, 20, "Location:");
o->labelfont(1);
o->labelsize(11);
o->callback((Fl_Callback*)propagate_load);
o->align(Fl_Align(FL_ALIGN_LEFT));
- { widget_grid_row_input = new Fluid_Coord_Input(96, 110, 55, 20, "Row:");
+ { widget_grid_row_input = new Fluid_Coord_Input(95, 60, 40, 20, "Row:");
widget_grid_row_input->box(FL_DOWN_BOX);
widget_grid_row_input->color(FL_BACKGROUND2_COLOR);
widget_grid_row_input->selection_color(FL_SELECTION_COLOR);
@@ -1078,7 +1452,20 @@ access the Widget pointer and \'v\' to access the user value.");
widget_grid_row_input->align(Fl_Align(FL_ALIGN_TOP_LEFT));
widget_grid_row_input->when(FL_WHEN_RELEASE);
} // Fluid_Coord_Input* widget_grid_row_input
- { widget_grid_col_input = new Fluid_Coord_Input(156, 110, 55, 20, "Column:");
+ { Fl_Group* o = new Fl_Group(135, 60, 30, 20);
+ { Fl_Button* o = new Fl_Button(135, 60, 15, 20, "-");
+ o->compact(1);
+ o->labelsize(11);
+ o->hide();
+ } // Fl_Button* o
+ { Fl_Button* o = new Fl_Button(150, 60, 15, 20, "+");
+ o->compact(1);
+ o->labelsize(11);
+ o->hide();
+ } // Fl_Button* o
+ o->end();
+ } // Fl_Group* o
+ { widget_grid_col_input = new Fluid_Coord_Input(175, 60, 40, 20, "Column:");
widget_grid_col_input->box(FL_DOWN_BOX);
widget_grid_col_input->color(FL_BACKGROUND2_COLOR);
widget_grid_col_input->selection_color(FL_SELECTION_COLOR);
@@ -1091,67 +1478,50 @@ access the Widget pointer and \'v\' to access the user value.");
widget_grid_col_input->align(Fl_Align(FL_ALIGN_TOP_LEFT));
widget_grid_col_input->when(FL_WHEN_RELEASE);
} // Fluid_Coord_Input* widget_grid_col_input
- { Fl_Choice* o = new Fl_Choice(215, 110, 185, 20, "Align:");
- o->down_box(FL_BORDER_BOX);
- o->labelsize(11);
- o->textsize(11);
- o->callback((Fl_Callback*)grid_align_cb);
- o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
- o->menu(menu_Align);
- } // Fl_Choice* o
- { Fl_Box* o = new Fl_Box(400, 110, 1, 20);
+ { Fl_Group* o = new Fl_Group(215, 60, 30, 20);
+ { Fl_Button* o = new Fl_Button(215, 60, 15, 20, "-");
+ o->compact(1);
+ o->labelsize(11);
+ o->hide();
+ } // Fl_Button* o
+ { Fl_Button* o = new Fl_Button(230, 60, 15, 20, "+");
+ o->compact(1);
+ o->labelsize(11);
+ o->hide();
+ } // Fl_Button* o
+ o->end();
+ } // Fl_Group* o
+ { Fl_Box* o = new Fl_Box(395, 60, 1, 20);
o->hide();
Fl_Group::current()->resizable(o);
} // Fl_Box* o
o->end();
} // Fl_Group* o
- { Fl_Group* o = new Fl_Group(96, 145, 314, 20, "Cell Span:");
+ { Fl_Group* o = new Fl_Group(95, 90, 315, 20, "Align:");
o->labelfont(1);
o->labelsize(11);
o->callback((Fl_Callback*)propagate_load);
o->align(Fl_Align(FL_ALIGN_LEFT));
- { Fl_Box* o = new Fl_Box(400, 145, 1, 20);
- o->hide();
- Fl_Group::current()->resizable(o);
- } // Fl_Box* o
- { Fluid_Coord_Input* o = new Fluid_Coord_Input(96, 145, 55, 20, "Row Span:");
- o->box(FL_DOWN_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->selection_color(FL_SELECTION_COLOR);
- o->labeltype(FL_NORMAL_LABEL);
- o->labelfont(0);
- o->labelsize(11);
- o->labelcolor(FL_FOREGROUND_COLOR);
- o->textsize(11);
- o->callback((Fl_Callback*)grid_set_rowspan_cb);
- o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
- o->when(FL_WHEN_RELEASE);
- } // Fluid_Coord_Input* o
- { Fluid_Coord_Input* o = new Fluid_Coord_Input(156, 145, 55, 20, "Col Span:");
- o->box(FL_DOWN_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->selection_color(FL_SELECTION_COLOR);
- o->labeltype(FL_NORMAL_LABEL);
- o->labelfont(0);
+ { Fl_Choice* o = new Fl_Choice(95, 90, 160, 20);
+ o->down_box(FL_BORDER_BOX);
o->labelsize(11);
- o->labelcolor(FL_FOREGROUND_COLOR);
o->textsize(11);
- o->callback((Fl_Callback*)grid_set_colspan_cb);
+ o->callback((Fl_Callback*)grid_align_cb);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
- o->when(FL_WHEN_RELEASE);
- } // Fluid_Coord_Input* o
+ o->menu(menu_5);
+ } // Fl_Choice* o
+ { Fl_Box* o = new Fl_Box(395, 90, 1, 20);
+ o->hide();
+ Fl_Group::current()->resizable(o);
+ } // Fl_Box* o
o->end();
} // Fl_Group* o
- { Fl_Group* o = new Fl_Group(96, 180, 314, 20, "Size:");
+ { Fl_Group* o = new Fl_Group(95, 125, 315, 20, "Min. Size:");
o->labelfont(1);
o->labelsize(11);
o->callback((Fl_Callback*)propagate_load);
o->align(Fl_Align(FL_ALIGN_LEFT));
- { Fl_Box* o = new Fl_Box(400, 180, 1, 20);
- o->hide();
- Fl_Group::current()->resizable(o);
- } // Fl_Box* o
- { Fluid_Coord_Input* o = new Fluid_Coord_Input(96, 180, 55, 20, "Min.Width:");
+ { Fluid_Coord_Input* o = new Fluid_Coord_Input(95, 125, 55, 20, "Width:");
o->box(FL_DOWN_BOX);
o->color(FL_BACKGROUND2_COLOR);
o->selection_color(FL_SELECTION_COLOR);
@@ -1164,7 +1534,7 @@ access the Widget pointer and \'v\' to access the user value.");
o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
o->when(FL_WHEN_RELEASE);
} // Fluid_Coord_Input* o
- { Fluid_Coord_Input* o = new Fluid_Coord_Input(156, 180, 55, 20, "Min.Height:");
+ { Fluid_Coord_Input* o = new Fluid_Coord_Input(155, 125, 55, 20, "Height:");
o->box(FL_DOWN_BOX);
o->color(FL_BACKGROUND2_COLOR);
o->selection_color(FL_SELECTION_COLOR);
@@ -1177,24 +1547,18 @@ access the Widget pointer and \'v\' to access the user value.");
o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
o->when(FL_WHEN_RELEASE);
} // Fluid_Coord_Input* o
+ { Fl_Box* o = new Fl_Box(395, 125, 1, 20);
+ o->hide();
+ Fl_Group::current()->resizable(o);
+ } // Fl_Box* o
o->end();
} // Fl_Group* o
- widget_tab_grid_child->end();
- } // Fl_Group* widget_tab_grid_child
- { widget_tab_grid = new Fl_Group(10, 30, 400, 330, "Grid");
- widget_tab_grid->labelsize(11);
- widget_tab_grid->callback((Fl_Callback*)propagate_load);
- { Fl_Box* o = new Fl_Box(25, 43, 370, 28, "The Fl_Grid implementation in FLUID is still experimental!");
- o->labelfont(1);
- o->labelsize(11);
- o->labelcolor((Fl_Color)1);
- } // Fl_Box* o
- { Fl_Group* o = new Fl_Group(96, 170, 314, 20, "Row:");
+ { Fl_Group* o = new Fl_Group(95, 160, 315, 20, "Cell Span:");
o->labelfont(1);
o->labelsize(11);
o->callback((Fl_Callback*)propagate_load);
o->align(Fl_Align(FL_ALIGN_LEFT));
- { Fluid_Coord_Input* o = new Fluid_Coord_Input(96, 170, 55, 20, "Index");
+ { Fluid_Coord_Input* o = new Fluid_Coord_Input(95, 160, 40, 20, "Rows:");
o->box(FL_DOWN_BOX);
o->color(FL_BACKGROUND2_COLOR);
o->selection_color(FL_SELECTION_COLOR);
@@ -1203,37 +1567,24 @@ access the Widget pointer and \'v\' to access the user value.");
o->labelsize(11);
o->labelcolor(FL_FOREGROUND_COLOR);
o->textsize(11);
- o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
- o->when(FL_WHEN_RELEASE);
- o->deactivate();
- } // Fluid_Coord_Input* o
- { Fluid_Coord_Input* o = new Fluid_Coord_Input(156, 170, 55, 20, "Height:");
- o->box(FL_DOWN_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->selection_color(FL_SELECTION_COLOR);
- o->labeltype(FL_NORMAL_LABEL);
- o->labelfont(0);
- o->labelsize(11);
- o->labelcolor(FL_FOREGROUND_COLOR);
- o->textsize(11);
- o->callback((Fl_Callback*)grid_row_height);
- o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
- o->when(FL_WHEN_RELEASE);
- } // Fluid_Coord_Input* o
- { Fluid_Coord_Input* o = new Fluid_Coord_Input(216, 170, 55, 20, "Weight:");
- o->box(FL_DOWN_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->selection_color(FL_SELECTION_COLOR);
- o->labeltype(FL_NORMAL_LABEL);
- o->labelfont(0);
- o->labelsize(11);
- o->labelcolor(FL_FOREGROUND_COLOR);
- o->textsize(11);
- o->callback((Fl_Callback*)grid_row_weight);
+ o->callback((Fl_Callback*)grid_set_rowspan_cb);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
o->when(FL_WHEN_RELEASE);
} // Fluid_Coord_Input* o
- { Fluid_Coord_Input* o = new Fluid_Coord_Input(276, 170, 55, 20, "Gap:");
+ { Fl_Group* o = new Fl_Group(135, 160, 30, 20);
+ { Fl_Button* o = new Fl_Button(135, 160, 15, 20, "-");
+ o->compact(1);
+ o->labelsize(11);
+ o->hide();
+ } // Fl_Button* o
+ { Fl_Button* o = new Fl_Button(150, 160, 15, 20, "+");
+ o->compact(1);
+ o->labelsize(11);
+ o->hide();
+ } // Fl_Button* o
+ o->end();
+ } // Fl_Group* o
+ { Fluid_Coord_Input* o = new Fluid_Coord_Input(175, 160, 40, 20, "Columns:");
o->box(FL_DOWN_BOX);
o->color(FL_BACKGROUND2_COLOR);
o->selection_color(FL_SELECTION_COLOR);
@@ -1242,173 +1593,370 @@ access the Widget pointer and \'v\' to access the user value.");
o->labelsize(11);
o->labelcolor(FL_FOREGROUND_COLOR);
o->textsize(11);
- o->callback((Fl_Callback*)grid_row_gap);
+ o->callback((Fl_Callback*)grid_set_colspan_cb);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
o->when(FL_WHEN_RELEASE);
} // Fluid_Coord_Input* o
- { Fl_Box* o = new Fl_Box(400, 170, 1, 20);
+ { Fl_Group* o = new Fl_Group(215, 160, 30, 20);
+ { Fl_Button* o = new Fl_Button(215, 160, 15, 20, "-");
+ o->compact(1);
+ o->labelsize(11);
+ o->hide();
+ } // Fl_Button* o
+ { Fl_Button* o = new Fl_Button(230, 160, 15, 20, "+");
+ o->compact(1);
+ o->labelsize(11);
+ o->hide();
+ } // Fl_Button* o
+ o->end();
+ } // Fl_Group* o
+ { Fl_Box* o = new Fl_Box(395, 160, 1, 20);
o->hide();
Fl_Group::current()->resizable(o);
} // Fl_Box* o
o->end();
} // Fl_Group* o
- { Fl_Group* o = new Fl_Group(96, 205, 314, 20, "Column:");
+ { Fl_Box* o = new Fl_Box(95, 350, 300, 5);
+ o->labelsize(11);
+ o->hide();
+ Fl_Group::current()->resizable(o);
+ } // Fl_Box* o
+ widget_tab_grid_child->end();
+ } // Fl_Group* widget_tab_grid_child
+ { widget_tab_grid = new Fl_Group(10, 30, 400, 330, "Grid");
+ widget_tab_grid->labelsize(11);
+ widget_tab_grid->callback((Fl_Callback*)propagate_load);
+ widget_tab_grid->hide();
+ { Fl_Group* o = new Fl_Group(95, 60, 315, 20, "Grid Layout:");
o->labelfont(1);
o->labelsize(11);
o->callback((Fl_Callback*)propagate_load);
o->align(Fl_Align(FL_ALIGN_LEFT));
- { Fluid_Coord_Input* o = new Fluid_Coord_Input(96, 205, 55, 20, "Index");
- o->box(FL_DOWN_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->selection_color(FL_SELECTION_COLOR);
- o->labeltype(FL_NORMAL_LABEL);
- o->labelfont(0);
- o->labelsize(11);
- o->labelcolor(FL_FOREGROUND_COLOR);
- o->textsize(11);
- o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
- o->when(FL_WHEN_RELEASE);
- o->deactivate();
- } // Fluid_Coord_Input* o
- { Fluid_Coord_Input* o = new Fluid_Coord_Input(156, 205, 55, 20, "Width:");
- o->box(FL_DOWN_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->selection_color(FL_SELECTION_COLOR);
- o->labeltype(FL_NORMAL_LABEL);
- o->labelfont(0);
- o->labelsize(11);
- o->labelcolor(FL_FOREGROUND_COLOR);
- o->textsize(11);
- o->callback((Fl_Callback*)grid_col_width);
- o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
- o->when(FL_WHEN_RELEASE);
- } // Fluid_Coord_Input* o
- { Fluid_Coord_Input* o = new Fluid_Coord_Input(216, 205, 55, 20, "Weight:");
- o->box(FL_DOWN_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->selection_color(FL_SELECTION_COLOR);
- o->labeltype(FL_NORMAL_LABEL);
- o->labelfont(0);
- o->labelsize(11);
- o->labelcolor(FL_FOREGROUND_COLOR);
- o->textsize(11);
- o->callback((Fl_Callback*)grid_col_weight);
- o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
- o->when(FL_WHEN_RELEASE);
- } // Fluid_Coord_Input* o
- { Fluid_Coord_Input* o = new Fluid_Coord_Input(276, 205, 55, 20, "Gap:");
- o->box(FL_DOWN_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->selection_color(FL_SELECTION_COLOR);
- o->labeltype(FL_NORMAL_LABEL);
- o->labelfont(0);
- o->labelsize(11);
- o->labelcolor(FL_FOREGROUND_COLOR);
- o->textsize(11);
- o->callback((Fl_Callback*)grid_col_gap);
- o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
- o->when(FL_WHEN_RELEASE);
- } // Fluid_Coord_Input* o
- { Fl_Box* o = new Fl_Box(400, 205, 1, 20);
- o->hide();
+ { widget_grid_rows = new Fluid_Coord_Input(95, 60, 40, 20, "Rows:");
+ widget_grid_rows->tooltip("Number of horizontal rows in the Grid group");
+ widget_grid_rows->box(FL_DOWN_BOX);
+ widget_grid_rows->color(FL_BACKGROUND2_COLOR);
+ widget_grid_rows->selection_color(FL_SELECTION_COLOR);
+ widget_grid_rows->labeltype(FL_NORMAL_LABEL);
+ widget_grid_rows->labelfont(0);
+ widget_grid_rows->labelsize(11);
+ widget_grid_rows->labelcolor(FL_FOREGROUND_COLOR);
+ widget_grid_rows->textsize(11);
+ widget_grid_rows->callback((Fl_Callback*)cb_widget_grid_rows);
+ widget_grid_rows->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ widget_grid_rows->when(FL_WHEN_RELEASE);
+ } // Fluid_Coord_Input* widget_grid_rows
+ { Fl_Group* o = new Fl_Group(135, 60, 30, 20);
+ { Fl_Button* o = new Fl_Button(135, 60, 15, 20, "-");
+ o->compact(1);
+ o->labelsize(11);
+ o->callback((Fl_Callback*)cb_1);
+ o->clear_visible_focus();
+ } // Fl_Button* o
+ { Fl_Button* o = new Fl_Button(150, 60, 15, 20, "+");
+ o->compact(1);
+ o->labelsize(11);
+ o->callback((Fl_Callback*)cb_2);
+ o->clear_visible_focus();
+ } // Fl_Button* o
+ o->end();
+ } // Fl_Group* o
+ { widget_grid_cols = new Fluid_Coord_Input(175, 60, 40, 20, "Columns:");
+ widget_grid_cols->tooltip("Number of vertical columns in the Grid group");
+ widget_grid_cols->box(FL_DOWN_BOX);
+ widget_grid_cols->color(FL_BACKGROUND2_COLOR);
+ widget_grid_cols->selection_color(FL_SELECTION_COLOR);
+ widget_grid_cols->labeltype(FL_NORMAL_LABEL);
+ widget_grid_cols->labelfont(0);
+ widget_grid_cols->labelsize(11);
+ widget_grid_cols->labelcolor(FL_FOREGROUND_COLOR);
+ widget_grid_cols->textsize(11);
+ widget_grid_cols->callback((Fl_Callback*)cb_widget_grid_cols);
+ widget_grid_cols->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ widget_grid_cols->when(FL_WHEN_RELEASE);
+ } // Fluid_Coord_Input* widget_grid_cols
+ { Fl_Group* o = new Fl_Group(215, 60, 30, 20);
+ { Fl_Button* o = new Fl_Button(215, 60, 15, 20, "-");
+ o->compact(1);
+ o->labelsize(11);
+ o->callback((Fl_Callback*)cb_3);
+ o->clear_visible_focus();
+ } // Fl_Button* o
+ { Fl_Button* o = new Fl_Button(230, 60, 15, 20, "+");
+ o->compact(1);
+ o->labelsize(11);
+ o->callback((Fl_Callback*)cb_4);
+ o->clear_visible_focus();
+ } // Fl_Button* o
+ o->end();
+ } // Fl_Group* o
+ { Fl_Box* o = new Fl_Box(396, 60, 0, 20);
Fl_Group::current()->resizable(o);
} // Fl_Box* o
o->end();
} // Fl_Group* o
- { Fl_Group* o = new Fl_Group(96, 97, 300, 55, "Grid Margins:\n\n\nLayout:");
+ { Fl_Group* o = new Fl_Group(95, 100, 315, 20, "Margin:");
o->labelfont(1);
o->labelsize(11);
o->callback((Fl_Callback*)propagate_load);
o->align(Fl_Align(FL_ALIGN_LEFT));
- { Fl_Value_Input* o = new Fl_Value_Input(96, 97, 45, 20, "Left:");
+ { Fl_Value_Input* o = new Fl_Value_Input(95, 100, 55, 20, "Left:");
o->tooltip("Left margin in group.");
o->labelsize(11);
o->maximum(1000);
o->step(1);
o->textsize(11);
- o->callback((Fl_Callback*)grid_margin_left_cb);
+ o->callback((Fl_Callback*)cb_Left);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
} // Fl_Value_Input* o
- { Fl_Value_Input* o = new Fl_Value_Input(145, 97, 45, 20, "Top:");
+ { Fl_Value_Input* o = new Fl_Value_Input(155, 100, 55, 20, "Top:");
o->tooltip("Top margin in group.");
o->labelsize(11);
o->maximum(1000);
o->step(1);
o->textsize(11);
- o->callback((Fl_Callback*)grid_margin_top_cb);
+ o->callback((Fl_Callback*)cb_Top);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
} // Fl_Value_Input* o
- { Fl_Value_Input* o = new Fl_Value_Input(194, 97, 45, 20, "Right:");
+ { Fl_Value_Input* o = new Fl_Value_Input(215, 100, 55, 20, "Right:");
o->tooltip("Right margin in group.");
o->labelsize(11);
o->maximum(1000);
o->step(1);
o->textsize(11);
- o->callback((Fl_Callback*)grid_margin_right_cb);
+ o->callback((Fl_Callback*)cb_Right);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
} // Fl_Value_Input* o
- { Fl_Value_Input* o = new Fl_Value_Input(243, 97, 45, 20, "Bottom:");
+ { Fl_Value_Input* o = new Fl_Value_Input(275, 100, 55, 20, "Bottom:");
o->tooltip("Bottom margin in group.");
o->labelsize(11);
o->maximum(1000);
o->step(1);
o->textsize(11);
- o->callback((Fl_Callback*)grid_margin_bottom_cb);
+ o->callback((Fl_Callback*)cb_Bottom);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
} // Fl_Value_Input* o
- { Fl_Value_Input* o = new Fl_Value_Input(292, 97, 45, 20, "RowGap:");
+ { Fl_Box* o = new Fl_Box(396, 100, 0, 20);
+ Fl_Group::current()->resizable(o);
+ } // Fl_Box* o
+ o->end();
+ } // Fl_Group* o
+ { Fl_Group* o = new Fl_Group(95, 135, 315, 20, "Gaps:");
+ o->labelfont(1);
+ o->labelsize(11);
+ o->callback((Fl_Callback*)propagate_load);
+ o->align(Fl_Align(FL_ALIGN_LEFT));
+ { Fl_Value_Input* o = new Fl_Value_Input(95, 135, 55, 20, "Row:");
o->tooltip("Gap between children.");
o->labelsize(11);
o->maximum(1000);
o->step(1);
o->textsize(11);
- o->callback((Fl_Callback*)grid_row_gap_cb);
+ o->callback((Fl_Callback*)cb_Row);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
} // Fl_Value_Input* o
- { Fl_Value_Input* o = new Fl_Value_Input(341, 97, 45, 20, "ColGap:");
+ { Fl_Value_Input* o = new Fl_Value_Input(155, 135, 55, 20, "Col:");
o->tooltip("Gap between children.");
o->labelsize(11);
o->maximum(1000);
o->step(1);
o->textsize(11);
- o->callback((Fl_Callback*)grid_col_gap_cb);
+ o->callback((Fl_Callback*)cb_Col);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
} // Fl_Value_Input* o
- { Fl_Box* o = new Fl_Box(396, 97, 0, 20);
+ { Fl_Box* o = new Fl_Box(396, 135, 0, 20);
Fl_Group::current()->resizable(o);
} // Fl_Box* o
- { Fluid_Coord_Input* o = new Fluid_Coord_Input(96, 132, 55, 20, "Rows:");
- o->tooltip("Number of horizontal rows in the Grid group");
- o->box(FL_DOWN_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->selection_color(FL_SELECTION_COLOR);
- o->labeltype(FL_NORMAL_LABEL);
- o->labelfont(0);
+ o->end();
+ } // Fl_Group* o
+ { Fl_Group* o = new Fl_Group(95, 175, 315, 20, "Row:");
+ o->labelfont(1);
+ o->labelsize(11);
+ o->callback((Fl_Callback*)cb_Row1);
+ o->align(Fl_Align(FL_ALIGN_LEFT));
+ { widget_grid_curr_row = new Fluid_Coord_Input(95, 175, 40, 20, "Index");
+ widget_grid_curr_row->box(FL_DOWN_BOX);
+ widget_grid_curr_row->color(FL_BACKGROUND2_COLOR);
+ widget_grid_curr_row->selection_color(FL_SELECTION_COLOR);
+ widget_grid_curr_row->labeltype(FL_NORMAL_LABEL);
+ widget_grid_curr_row->labelfont(0);
+ widget_grid_curr_row->labelsize(11);
+ widget_grid_curr_row->labelcolor(FL_FOREGROUND_COLOR);
+ widget_grid_curr_row->textsize(11);
+ widget_grid_curr_row->callback((Fl_Callback*)cb_widget_grid_curr_row);
+ widget_grid_curr_row->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ widget_grid_curr_row->when(FL_WHEN_RELEASE);
+ } // Fluid_Coord_Input* widget_grid_curr_row
+ { Fl_Group* o = new Fl_Group(135, 175, 30, 20);
+ o->callback((Fl_Callback*)propagate_load);
+ { Fl_Button* o = new Fl_Button(135, 175, 15, 20, "-");
+ o->compact(1);
+ o->labelsize(11);
+ o->callback((Fl_Callback*)cb_5);
+ o->clear_visible_focus();
+ } // Fl_Button* o
+ { Fl_Button* o = new Fl_Button(150, 175, 15, 20, "+");
+ o->compact(1);
+ o->labelsize(11);
+ o->callback((Fl_Callback*)cb_6);
+ o->clear_visible_focus();
+ } // Fl_Button* o
+ o->end();
+ } // Fl_Group* o
+ { Fl_Box* o = new Fl_Box(165, 175, 15, 20, ":");
o->labelsize(11);
- o->labelcolor(FL_FOREGROUND_COLOR);
- o->textsize(11);
- o->callback((Fl_Callback*)grid_rows_cb);
- o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
- o->when(FL_WHEN_RELEASE);
- } // Fluid_Coord_Input* o
- { Fluid_Coord_Input* o = new Fluid_Coord_Input(155, 132, 55, 20, "Columns:");
- o->tooltip("Number of vertical columns in the Grid group");
- o->box(FL_DOWN_BOX);
- o->color(FL_BACKGROUND2_COLOR);
- o->selection_color(FL_SELECTION_COLOR);
- o->labeltype(FL_NORMAL_LABEL);
- o->labelfont(0);
+ } // Fl_Box* o
+ { widget_grid_curr_row_attributes = new Fl_Group(180, 175, 175, 20);
+ widget_grid_curr_row_attributes->callback((Fl_Callback*)propagate_load);
+ { Fluid_Coord_Input* o = new Fluid_Coord_Input(180, 175, 55, 20, "Height:");
+ o->box(FL_DOWN_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->selection_color(FL_SELECTION_COLOR);
+ o->labeltype(FL_NORMAL_LABEL);
+ o->labelfont(0);
+ o->labelsize(11);
+ o->labelcolor(FL_FOREGROUND_COLOR);
+ o->textsize(11);
+ o->callback((Fl_Callback*)cb_Height);
+ o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ o->when(FL_WHEN_RELEASE);
+ } // Fluid_Coord_Input* o
+ { Fluid_Coord_Input* o = new Fluid_Coord_Input(240, 175, 55, 20, "Weight:");
+ o->box(FL_DOWN_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->selection_color(FL_SELECTION_COLOR);
+ o->labeltype(FL_NORMAL_LABEL);
+ o->labelfont(0);
+ o->labelsize(11);
+ o->labelcolor(FL_FOREGROUND_COLOR);
+ o->textsize(11);
+ o->callback((Fl_Callback*)cb_Weight);
+ o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ o->when(FL_WHEN_RELEASE);
+ } // Fluid_Coord_Input* o
+ { Fluid_Coord_Input* o = new Fluid_Coord_Input(300, 175, 55, 20, "Gap:");
+ o->box(FL_DOWN_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->selection_color(FL_SELECTION_COLOR);
+ o->labeltype(FL_NORMAL_LABEL);
+ o->labelfont(0);
+ o->labelsize(11);
+ o->labelcolor(FL_FOREGROUND_COLOR);
+ o->textsize(11);
+ o->callback((Fl_Callback*)cb_Gap);
+ o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ o->when(FL_WHEN_RELEASE);
+ } // Fluid_Coord_Input* o
+ widget_grid_curr_row_attributes->end();
+ } // Fl_Group* widget_grid_curr_row_attributes
+ { Fl_Box* o = new Fl_Box(400, 175, 1, 20);
+ o->hide();
+ Fl_Group::current()->resizable(o);
+ } // Fl_Box* o
+ o->end();
+ } // Fl_Group* o
+ { Fl_Group* o = new Fl_Group(95, 210, 315, 20, "Column:");
+ o->labelfont(1);
+ o->labelsize(11);
+ o->callback((Fl_Callback*)propagate_load);
+ o->align(Fl_Align(FL_ALIGN_LEFT));
+ { widget_grid_curr_col = new Fluid_Coord_Input(95, 210, 40, 20, "Index");
+ widget_grid_curr_col->box(FL_DOWN_BOX);
+ widget_grid_curr_col->color(FL_BACKGROUND2_COLOR);
+ widget_grid_curr_col->selection_color(FL_SELECTION_COLOR);
+ widget_grid_curr_col->labeltype(FL_NORMAL_LABEL);
+ widget_grid_curr_col->labelfont(0);
+ widget_grid_curr_col->labelsize(11);
+ widget_grid_curr_col->labelcolor(FL_FOREGROUND_COLOR);
+ widget_grid_curr_col->textsize(11);
+ widget_grid_curr_col->callback((Fl_Callback*)cb_widget_grid_curr_col);
+ widget_grid_curr_col->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ widget_grid_curr_col->when(FL_WHEN_RELEASE);
+ } // Fluid_Coord_Input* widget_grid_curr_col
+ { Fl_Group* o = new Fl_Group(135, 210, 30, 20);
+ { Fl_Button* o = new Fl_Button(135, 210, 15, 20, "-");
+ o->compact(1);
+ o->labelsize(11);
+ o->callback((Fl_Callback*)cb_7);
+ o->clear_visible_focus();
+ } // Fl_Button* o
+ { Fl_Button* o = new Fl_Button(150, 210, 15, 20, "+");
+ o->compact(1);
+ o->labelsize(11);
+ o->callback((Fl_Callback*)cb_8);
+ o->clear_visible_focus();
+ } // Fl_Button* o
+ o->end();
+ } // Fl_Group* o
+ { Fl_Box* o = new Fl_Box(165, 210, 15, 20, ":");
o->labelsize(11);
- o->labelcolor(FL_FOREGROUND_COLOR);
- o->textsize(11);
- o->callback((Fl_Callback*)grid_cols_cb);
- o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
- o->when(FL_WHEN_RELEASE);
- } // Fluid_Coord_Input* o
+ } // Fl_Box* o
+ { widget_grid_curr_col_attributes = new Fl_Group(180, 210, 175, 20);
+ widget_grid_curr_col_attributes->callback((Fl_Callback*)propagate_load);
+ { Fluid_Coord_Input* o = new Fluid_Coord_Input(180, 210, 55, 20, "Width:");
+ o->box(FL_DOWN_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->selection_color(FL_SELECTION_COLOR);
+ o->labeltype(FL_NORMAL_LABEL);
+ o->labelfont(0);
+ o->labelsize(11);
+ o->labelcolor(FL_FOREGROUND_COLOR);
+ o->textsize(11);
+ o->callback((Fl_Callback*)cb_Width);
+ o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ o->when(FL_WHEN_RELEASE);
+ } // Fluid_Coord_Input* o
+ { Fluid_Coord_Input* o = new Fluid_Coord_Input(240, 210, 55, 20, "Weight:");
+ o->box(FL_DOWN_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->selection_color(FL_SELECTION_COLOR);
+ o->labeltype(FL_NORMAL_LABEL);
+ o->labelfont(0);
+ o->labelsize(11);
+ o->labelcolor(FL_FOREGROUND_COLOR);
+ o->textsize(11);
+ o->callback((Fl_Callback*)cb_Weight1);
+ o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ o->when(FL_WHEN_RELEASE);
+ } // Fluid_Coord_Input* o
+ { Fluid_Coord_Input* o = new Fluid_Coord_Input(300, 210, 55, 20, "Gap:");
+ o->box(FL_DOWN_BOX);
+ o->color(FL_BACKGROUND2_COLOR);
+ o->selection_color(FL_SELECTION_COLOR);
+ o->labeltype(FL_NORMAL_LABEL);
+ o->labelfont(0);
+ o->labelsize(11);
+ o->labelcolor(FL_FOREGROUND_COLOR);
+ o->textsize(11);
+ o->callback((Fl_Callback*)cb_Gap1);
+ o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
+ o->when(FL_WHEN_RELEASE);
+ } // Fluid_Coord_Input* o
+ widget_grid_curr_col_attributes->end();
+ } // Fl_Group* widget_grid_curr_col_attributes
+ { Fl_Box* o = new Fl_Box(400, 210, 1, 20);
+ o->hide();
+ Fl_Group::current()->resizable(o);
+ } // Fl_Box* o
o->end();
} // Fl_Group* o
+ { Fl_Box* o = new Fl_Box(95, 350, 300, 5);
+ o->labelsize(11);
+ o->hide();
+ Fl_Group::current()->resizable(o);
+ } // Fl_Box* o
widget_tab_grid->end();
} // Fl_Group* widget_tab_grid
+ o->show();
+ widget_tabs->end();
+ Fl_Group::current()->resizable(widget_tabs);
+ } // Fl_Tabs* widget_tabs
+ { Fl_Tabs* o = widget_tabs_repo = new Fl_Tabs(10, 10, 400, 350);
+ widget_tabs_repo->hide();
+ { Fl_Group* o = new Fl_Group(10, 30, 400, 330);
+ o->end();
+ Fl_Group::current()->resizable(o);
+ } // Fl_Group* o
o->hide();
widget_tabs_repo->end();
} // Fl_Tabs* widget_tabs_repo
diff --git a/fluid/widget_panel.fl b/fluid/widget_panel.fl
index f8876a995..c58139949 100644
--- a/fluid/widget_panel.fl
+++ b/fluid/widget_panel.fl
@@ -2,6 +2,11 @@
version 1.0400
header_name {.h}
code_name {.cxx}
+snap {
+ ver 1
+ current_suite FLTK
+ current_preset 1
+}
comment {//
// Widget panel for the Fast Light Tool Kit (FLTK).
//
@@ -20,21 +25,54 @@ comment {//
} {in_source in_header
}
+decl {\#include "undo.h"} {private global
+}
+
decl {\#include "Fl_Widget_Type.h"} {private global
}
+decl {\#include "Fl_Grid_Type.h"} {private global
+}
+
decl {\#include <FL/Fl_Grid.H>} {private global
}
decl {\#include "custom_widgets.h"} {public global
}
+decl {extern void set_modflag(int mf, int mfc=-1);} {private local
+}
+
+Function {make_window()} {open
+} {
+ Fl_Window {} {open
+ xywh {867 441 480 320} type Double visible
+ } {
+ Fl_Grid {} {open
+ xywh {25 25 240 160} labelsize 11
+ dimensions {3 3} margin {10 8 11 12}
+ rowgaps { 3 -1 -1 }
+ colwidths { 0 100 0 }
+ colweights { 50 40 50 }
+ colgaps { 1 3 -1 }
+ } {
+ Fl_Button {} {
+ label Button
+ xywh {77 75 133 59} labelsize 11
+ parent_properties {
+ location {1 1}
+ }
+ }
+ }
+ }
+}
+
Function {make_widget_panel()} {
comment {Create a panel that can be used with all known widgets} open
} {
Fl_Window {} {
comment {Use a Double Window to avoid flickering.} open
- xywh {566 244 420 400} type Double labelsize 11 align 80 resizable hotspot
+ xywh {413 247 420 400} type Double labelsize 11 align 80 resizable hotspot
code0 {o->size_range(o->w(), o->h());} size_range {420 400 0 0} visible
} {
Fl_Tabs widget_tabs {
@@ -44,7 +82,7 @@ Function {make_widget_panel()} {
} {
Fl_Group {} {
label GUI
- callback propagate_load open
+ callback propagate_load selected
xywh {10 30 400 330} labelsize 11 when 0 resizable
} {
Fl_Group {} {
@@ -666,7 +704,7 @@ Use Ctrl-J for newlines.} xywh {95 285 310 20} labelfont 1 labelsize 11 textsize
}
Fl_Group {} {
label {C++}
- callback propagate_load open
+ callback propagate_load
xywh {10 30 400 330} labelsize 11 when 0 hide
} {
Fl_Group {} {
@@ -818,48 +856,64 @@ wCallback->do_callback(wCallback, v);} open
}
}
}
- }
- Fl_Tabs widget_tabs_repo {open selected
- xywh {10 10 400 350} hide
- code0 {o->hide();}
- } {
- Fl_Group {} {open
- xywh {10 30 400 330} hide resizable
- } {}
Fl_Group widget_tab_grid_child {
label {Grid Child}
callback propagate_load open
xywh {10 30 400 330} labelsize 11 hide
} {
- Fl_Box {} {
- label {The Fl_Grid implementation in FLUID is still experimental!}
- xywh {25 43 370 28} labelfont 1 labelsize 11 labelcolor 1
- }
- Fl_Box {} {
- label {-- Widget --}
- xywh {96 74 155 20} labelfont 1 labelsize 12 align 20
- }
Fl_Group {} {
label {Location:}
callback propagate_load open
- xywh {96 110 314 20} labelfont 1 labelsize 11 align 4
+ xywh {95 60 315 20} labelfont 1 labelsize 11 align 4
} {
Fl_Input widget_grid_row_input {
label {Row:}
callback grid_set_row_cb
- xywh {96 110 55 20} labelsize 11 align 5 textsize 11
+ xywh {95 60 40 20} labelsize 11 align 5 textsize 11
class Fluid_Coord_Input
}
+ Fl_Group {} {open
+ xywh {135 60 30 20}
+ } {
+ Fl_Button {} {
+ label {-}
+ xywh {135 60 15 20} labelsize 11 hide compact 1
+ }
+ Fl_Button {} {
+ label {+}
+ xywh {150 60 15 20} labelsize 11 hide compact 1
+ }
+ }
Fl_Input widget_grid_col_input {
label {Column:}
callback grid_set_col_cb
- xywh {156 110 55 20} labelsize 11 align 5 textsize 11
+ xywh {175 60 40 20} labelsize 11 align 5 textsize 11
class Fluid_Coord_Input
}
+ Fl_Group {} {open
+ xywh {215 60 30 20}
+ } {
+ Fl_Button {} {
+ label {-}
+ xywh {215 60 15 20} labelsize 11 hide compact 1
+ }
+ Fl_Button {} {
+ label {+}
+ xywh {230 60 15 20} labelsize 11 hide compact 1
+ }
+ }
+ Fl_Box {} {
+ xywh {395 60 1 20} hide resizable
+ }
+ }
+ Fl_Group {} {
+ label {Align:}
+ callback propagate_load open
+ xywh {95 90 315 20} labelfont 1 labelsize 11 align 4
+ } {
Fl_Choice {} {
- label {Align:}
callback grid_align_cb
- xywh {215 110 185 20} down_box BORDER_BOX labelsize 11 align 5 textsize 11
+ xywh {95 90 160 20} down_box BORDER_BOX labelsize 11 align 5 textsize 11
} {
MenuItem {} {
label GRID_CENTER
@@ -923,181 +977,566 @@ wCallback->do_callback(wCallback, v);} open
}
}
Fl_Box {} {
- xywh {400 110 1 20} hide resizable
+ xywh {395 90 1 20} hide resizable
}
}
Fl_Group {} {
- label {Cell Span:}
- callback propagate_load
- xywh {96 145 314 20} labelfont 1 labelsize 11 align 4
- } {
- Fl_Box {} {
- xywh {400 145 1 20} hide resizable
- }
- Fl_Input {} {
- label {Row Span:}
- callback grid_set_rowspan_cb
- xywh {96 145 55 20} labelsize 11 align 5 textsize 11
- class Fluid_Coord_Input
- }
- Fl_Input {} {
- label {Col Span:}
- callback grid_set_colspan_cb
- xywh {156 145 55 20} labelsize 11 align 5 textsize 11
- class Fluid_Coord_Input
- }
- }
- Fl_Group {} {
- label {Size:}
- callback propagate_load
- xywh {96 180 314 20} labelfont 1 labelsize 11 align 4
+ label {Min. Size:}
+ callback propagate_load open
+ xywh {95 125 315 20} labelfont 1 labelsize 11 align 4
} {
- Fl_Box {} {
- xywh {400 180 1 20} hide resizable
- }
Fl_Input {} {
- label {Min.Width:}
+ label {Width:}
callback grid_set_min_wdt_cb
- xywh {96 180 55 20} labelsize 11 align 5 textsize 11
+ xywh {95 125 55 20} labelsize 11 align 5 textsize 11
class Fluid_Coord_Input
}
Fl_Input {} {
- label {Min.Height:}
+ label {Height:}
callback grid_set_min_hgt_cb
- xywh {156 180 55 20} labelsize 11 align 5 textsize 11
+ xywh {155 125 55 20} labelsize 11 align 5 textsize 11
class Fluid_Coord_Input
}
- }
- }
- Fl_Group widget_tab_grid {
- label Grid
- callback propagate_load open
- xywh {10 30 400 330} labelsize 11
- } {
- Fl_Box {} {
- label {The Fl_Grid implementation in FLUID is still experimental!}
- xywh {25 43 370 28} labelfont 1 labelsize 11 labelcolor 1
+ Fl_Box {} {
+ xywh {395 125 1 20} hide resizable
+ }
}
Fl_Group {} {
- label {Row:}
+ label {Cell Span:}
callback propagate_load open
- xywh {96 170 314 20} labelfont 1 labelsize 11 align 4
+ xywh {95 160 315 20} labelfont 1 labelsize 11 align 4
} {
Fl_Input {} {
- label Index
- xywh {96 170 55 20} labelsize 11 align 5 textsize 11 deactivate
+ label {Rows:}
+ callback grid_set_rowspan_cb
+ xywh {95 160 40 20} labelsize 11 align 5 textsize 11
class Fluid_Coord_Input
}
- Fl_Input {} {
- label {Height:}
- callback grid_row_height
- xywh {156 170 55 20} labelsize 11 align 5 textsize 11
- class Fluid_Coord_Input
+ Fl_Group {} {open
+ xywh {135 160 30 20}
+ } {
+ Fl_Button {} {
+ label {-}
+ xywh {135 160 15 20} labelsize 11 hide compact 1
+ }
+ Fl_Button {} {
+ label {+}
+ xywh {150 160 15 20} labelsize 11 hide compact 1
+ }
}
Fl_Input {} {
- label {Weight:}
- callback grid_row_weight
- xywh {216 170 55 20} labelsize 11 align 5 textsize 11
+ label {Columns:}
+ callback grid_set_colspan_cb
+ xywh {175 160 40 20} labelsize 11 align 5 textsize 11
class Fluid_Coord_Input
}
- Fl_Input {} {
- label {Gap:}
- callback grid_row_gap
- xywh {276 170 55 20} labelsize 11 align 5 textsize 11
- class Fluid_Coord_Input
+ Fl_Group {} {open
+ xywh {215 160 30 20}
+ } {
+ Fl_Button {} {
+ label {-}
+ xywh {215 160 15 20} labelsize 11 hide compact 1
+ }
+ Fl_Button {} {
+ label {+}
+ xywh {230 160 15 20} labelsize 11 hide compact 1
+ }
}
Fl_Box {} {
- xywh {400 170 1 20} hide resizable
+ xywh {395 160 1 20} hide resizable
}
}
+ Fl_Box {} {
+ xywh {95 350 300 5} labelsize 11 hide resizable
+ }
+ }
+ Fl_Group widget_tab_grid {
+ label Grid
+ callback propagate_load open
+ xywh {10 30 400 330} labelsize 11 hide
+ } {
Fl_Group {} {
- label {Column:}
+ label {Grid Layout:}
callback propagate_load open
- xywh {96 205 314 20} labelfont 1 labelsize 11 align 4
+ xywh {95 60 315 20} labelfont 1 labelsize 11 align 4
} {
- Fl_Input {} {
- label Index
- xywh {96 205 55 20} labelsize 11 align 5 textsize 11 deactivate
+ Fl_Input widget_grid_rows {
+ label {Rows:}
+ callback {// grid_rows_cb
+Fl_Grid *grid = Fl_Grid_Type::selected();
+if (!grid) return;
+if (v == LOAD) {
+ o->value(grid->rows());
+} else {
+ int m = o->value(), old_m = grid->rows();
+ if (m < 1) {
+ m = 1;
+ o->value(m);
+ }
+ if (m < old_m) {
+ // TODO: verify that this will not unlink existings cells
+ // Offer a dialog with "delete children", "unlink cells", "cancel"
+ }
+ if (m != old_m) {
+ undo_checkpoint();
+ grid->layout(m, grid->cols());
+ grid->need_layout(true);
+ set_modflag(1);
+ widget_tab_grid->do_callback(widget_tab_grid, LOAD);
+ }
+}}
+ tooltip {Number of horizontal rows in the Grid group} xywh {95 60 40 20} labelsize 11 align 5 textsize 11
class Fluid_Coord_Input
}
- Fl_Input {} {
- label {Width:}
- callback grid_col_width
- xywh {156 205 55 20} labelsize 11 align 5 textsize 11
- class Fluid_Coord_Input
+ Fl_Group {} {open
+ xywh {135 60 30 20}
+ } {
+ Fl_Button {} {
+ label {-}
+ callback {if (v != LOAD) {
+ widget_grid_rows->value( widget_grid_rows->value()-1 );
+ widget_grid_rows->do_callback();
+}}
+ xywh {135 60 15 20} labelsize 11
+ code0 {o->clear_visible_focus();} compact 1
+ }
+ Fl_Button {} {
+ label {+}
+ callback {if (v != LOAD) {
+ widget_grid_rows->value( widget_grid_rows->value()+1 );
+ widget_grid_rows->do_callback();
+}}
+ xywh {150 60 15 20} labelsize 11
+ code0 {o->clear_visible_focus();} compact 1
+ }
}
- Fl_Input {} {
- label {Weight:}
- callback grid_col_weight
- xywh {216 205 55 20} labelsize 11 align 5 textsize 11
+ Fl_Input widget_grid_cols {
+ label {Columns:}
+ callback {// grid_rows_cb
+Fl_Grid *grid = Fl_Grid_Type::selected();
+if (!grid) return;
+if (v == LOAD) {
+ o->value(grid->cols());
+} else {
+ int m = o->value(), old_m = grid->cols();
+ if (m < 1) {
+ m = 1;
+ o->value(m);
+ }
+ if (m < old_m) {
+ // TODO: verify that this will not unlink existings cells
+ // Offer a dialog with "delete children", "unlink cells", "cancel"
+ }
+ if (m != old_m) {
+ undo_checkpoint();
+ grid->layout(grid->rows(), m);
+ grid->need_layout(true);
+ set_modflag(1);
+ widget_tab_grid->do_callback(widget_tab_grid, LOAD);
+ }
+}}
+ tooltip {Number of vertical columns in the Grid group} xywh {175 60 40 20} labelsize 11 align 5 textsize 11
class Fluid_Coord_Input
}
- Fl_Input {} {
- label {Gap:}
- callback grid_col_gap
- xywh {276 205 55 20} labelsize 11 align 5 textsize 11
- class Fluid_Coord_Input
+ Fl_Group {} {open
+ xywh {215 60 30 20}
+ } {
+ Fl_Button {} {
+ label {-}
+ callback {if (v != LOAD) {
+ widget_grid_cols->value( widget_grid_cols->value()-1 );
+ widget_grid_cols->do_callback();
+}}
+ xywh {215 60 15 20} labelsize 11
+ code0 {o->clear_visible_focus();} compact 1
+ }
+ Fl_Button {} {
+ label {+}
+ callback {if (v != LOAD) {
+ widget_grid_cols->value( widget_grid_cols->value()+1 );
+ widget_grid_cols->do_callback();
+}}
+ xywh {230 60 15 20} labelsize 11
+ code0 {o->clear_visible_focus();} compact 1
+ }
}
Fl_Box {} {
- xywh {400 205 1 20} hide resizable
+ xywh {396 60 0 20} resizable
}
}
Fl_Group {} {
- label {Grid Margins:
-
-
-Layout:}
+ label {Margin:}
callback propagate_load open
- xywh {96 97 300 55} labelfont 1 labelsize 11 align 4
+ xywh {95 100 315 20} labelfont 1 labelsize 11 align 4
} {
Fl_Value_Input {} {
label {Left:}
- callback grid_margin_left_cb
- tooltip {Left margin in group.} xywh {96 97 45 20} labelsize 11 align 5 maximum 1000 step 1 textsize 11
+ callback {Fl_Grid *grid = Fl_Grid_Type::selected();
+if (!grid) return;
+int m = 0;
+if (v == LOAD) {
+ grid->margin(&m, NULL, NULL, NULL);
+ o->value(m);
+} else {
+ int m = o->value(), old_m;
+ grid->margin(&old_m, NULL, NULL, NULL);
+ if (m != old_m) {
+ grid->margin(m, -1, -1, -1);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+}}
+ tooltip {Left margin in group.} xywh {95 100 55 20} labelsize 11 align 5 maximum 1000 step 1 textsize 11
}
Fl_Value_Input {} {
label {Top:}
- callback grid_margin_top_cb
- tooltip {Top margin in group.} xywh {145 97 45 20} labelsize 11 align 5 maximum 1000 step 1 textsize 11
+ callback {Fl_Grid *grid = Fl_Grid_Type::selected();
+if (!grid) return;
+int m = 0;
+if (v == LOAD) {
+ grid->margin(NULL, &m, NULL, NULL);
+ o->value(m);
+} else {
+ int m = o->value(), old_m;
+ grid->margin(NULL, &old_m, NULL, NULL);
+ if (m != old_m) {
+ grid->margin(-1, m, -1, -1);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+}}
+ tooltip {Top margin in group.} xywh {155 100 55 20} labelsize 11 align 5 maximum 1000 step 1 textsize 11
}
Fl_Value_Input {} {
label {Right:}
- callback grid_margin_right_cb
- tooltip {Right margin in group.} xywh {194 97 45 20} labelsize 11 align 5 maximum 1000 step 1 textsize 11
+ callback {Fl_Grid *grid = Fl_Grid_Type::selected();
+if (!grid) return;
+int m = 0;
+if (v == LOAD) {
+ grid->margin(NULL, NULL, &m, NULL);
+ o->value(m);
+} else {
+ int m = o->value(), old_m;
+ grid->margin(NULL, NULL, &old_m, NULL);
+ if (m != old_m) {
+ grid->margin(-1, -1, m, -1);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+}}
+ tooltip {Right margin in group.} xywh {215 100 55 20} labelsize 11 align 5 maximum 1000 step 1 textsize 11
}
Fl_Value_Input {} {
label {Bottom:}
- callback grid_margin_bottom_cb
- tooltip {Bottom margin in group.} xywh {243 97 45 20} labelsize 11 align 5 maximum 1000 step 1 textsize 11
+ callback {Fl_Grid *grid = Fl_Grid_Type::selected();
+if (!grid) return;
+int m = 0;
+if (v == LOAD) {
+ grid->margin(NULL, NULL, NULL, &m);
+ o->value(m);
+} else {
+ int m = o->value(), old_m;
+ grid->margin(NULL, NULL, NULL, &old_m);
+ if (m != old_m) {
+ grid->margin(-1, -1, -1, m);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+}}
+ tooltip {Bottom margin in group.} xywh {275 100 55 20} labelsize 11 align 5 maximum 1000 step 1 textsize 11
+ }
+ Fl_Box {} {
+ xywh {396 100 0 20} resizable
}
+ }
+ Fl_Group {} {
+ label {Gaps:}
+ callback propagate_load open
+ xywh {95 135 315 20} labelfont 1 labelsize 11 align 4
+ } {
Fl_Value_Input {} {
- label {RowGap:}
- callback grid_row_gap_cb
- tooltip {Gap between children.} xywh {292 97 45 20} labelsize 11 align 5 maximum 1000 step 1 textsize 11
+ label {Row:}
+ callback {Fl_Grid *grid = Fl_Grid_Type::selected();
+if (!grid) return;
+int m = 0;
+if (v == LOAD) {
+ grid->gap(&m, NULL);
+ o->value(m);
+} else {
+ int m = o->value(), old_m;
+ grid->gap(&old_m, NULL);
+ if (m != old_m) {
+ grid->gap(m, -1);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+}}
+ tooltip {Gap between children.} xywh {95 135 55 20} labelsize 11 align 5 maximum 1000 step 1 textsize 11
}
Fl_Value_Input {} {
- label {ColGap:}
- callback grid_col_gap_cb
- tooltip {Gap between children.} xywh {341 97 45 20} labelsize 11 align 5 maximum 1000 step 1 textsize 11
+ label {Col:}
+ callback {Fl_Grid *grid = Fl_Grid_Type::selected();
+if (!grid) return;
+int m = 0;
+if (v == LOAD) {
+ grid->gap(NULL, &m);
+ o->value(m);
+} else {
+ int m = o->value(), old_m;
+ grid->gap(NULL, &old_m);
+ if (m != old_m) {
+ grid->gap(-1, m);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+}}
+ tooltip {Gap between children.} xywh {155 135 55 20} labelsize 11 align 5 maximum 1000 step 1 textsize 11
}
Fl_Box {} {
- xywh {396 97 0 20} resizable
+ xywh {396 135 0 20} resizable
}
- Fl_Input {} {
- label {Rows:}
- callback grid_rows_cb
- tooltip {Number of horizontal rows in the Grid group} xywh {96 132 55 20} labelsize 11 align 5 textsize 11
+ }
+ Fl_Group {} {
+ label {Row:}
+ callback {if (v == LOAD) {
+ Fl_Grid *grid = Fl_Grid_Type::selected();
+ if (grid)
+ o->activate();
+ else
+ o->deactivate();
+ propagate_load(o, v);
+}} open
+ xywh {95 175 315 20} labelfont 1 labelsize 11 align 4
+ } {
+ Fl_Input widget_grid_curr_row {
+ label Index
+ callback {Fl_Grid *grid = Fl_Grid_Type::selected();
+if (!grid) return;
+int r = o->value(), old_r = r;
+if (r < 0) r = 0;
+if (r >= grid->rows()) r = grid->rows()-1;
+if (r != old_r) o->value(r);
+if (v == LOAD) {
+ // will automatically propagate
+} else {
+ widget_grid_curr_row_attributes->do_callback(widget_grid_curr_row_attributes, LOAD);
+}}
+ xywh {95 175 40 20} labelsize 11 align 5 textsize 11
class Fluid_Coord_Input
}
- Fl_Input {} {
- label {Columns:}
- callback grid_cols_cb
- tooltip {Number of vertical columns in the Grid group} xywh {155 132 55 20} labelsize 11 align 5 textsize 11
+ Fl_Group {} {
+ callback propagate_load open
+ xywh {135 175 30 20}
+ } {
+ Fl_Button {} {
+ label {-}
+ callback {if (v != LOAD) {
+ widget_grid_curr_row->value( widget_grid_curr_row->value()-1 );
+ widget_grid_curr_row->do_callback();
+}}
+ xywh {135 175 15 20} labelsize 11
+ code0 {o->clear_visible_focus();} compact 1
+ }
+ Fl_Button {} {
+ label {+}
+ callback {if (v != LOAD) {
+ widget_grid_curr_row->value( widget_grid_curr_row->value()+1 );
+ widget_grid_curr_row->do_callback();
+}}
+ xywh {150 175 15 20} labelsize 11
+ code0 {o->clear_visible_focus();} compact 1
+ }
+ }
+ Fl_Box {} {
+ label {:}
+ xywh {165 175 15 20} labelsize 11
+ }
+ Fl_Group widget_grid_curr_row_attributes {
+ callback propagate_load open
+ xywh {180 175 175 20}
+ } {
+ Fl_Input {} {
+ label {Height:}
+ callback {Fl_Grid *grid = Fl_Grid_Type::selected();
+if (!grid) return;
+int r = widget_grid_curr_row->value();
+if (v == LOAD) {
+ o->value(grid->row_height(r));
+} else {
+ int h = o->value(), old_h = grid->row_height(r);
+ if (h != old_h) {
+ grid->row_height(r, h);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+}}
+ xywh {180 175 55 20} labelsize 11 align 5 textsize 11
+ class Fluid_Coord_Input
+ }
+ Fl_Input {} {
+ label {Weight:}
+ callback {Fl_Grid *grid = Fl_Grid_Type::selected();
+if (!grid) return;
+int r = widget_grid_curr_row->value();
+if (v == LOAD) {
+ o->value(grid->row_weight(r));
+} else {
+ int h = o->value(), old_h = grid->row_weight(r);
+ if (h != old_h) {
+ grid->row_weight(r, h);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+}}
+ xywh {240 175 55 20} labelsize 11 align 5 textsize 11
+ class Fluid_Coord_Input
+ }
+ Fl_Input {} {
+ label {Gap:}
+ callback {Fl_Grid *grid = Fl_Grid_Type::selected();
+if (!grid) return;
+int r = widget_grid_curr_row->value();
+if (v == LOAD) {
+ o->value(grid->row_gap(r));
+} else {
+ int h = o->value(), old_h = grid->row_gap(r);
+ if (h != old_h) {
+ grid->row_gap(r, h);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+}}
+ xywh {300 175 55 20} labelsize 11 align 5 textsize 11
+ class Fluid_Coord_Input
+ }
+ }
+ Fl_Box {} {
+ xywh {400 175 1 20} hide resizable
+ }
+ }
+ Fl_Group {} {
+ label {Column:}
+ callback propagate_load open
+ xywh {95 210 315 20} labelfont 1 labelsize 11 align 4
+ } {
+ Fl_Input widget_grid_curr_col {
+ label Index
+ callback {Fl_Grid *grid = Fl_Grid_Type::selected();
+if (!grid) return;
+int c = o->value(), old_c = c;
+if (c < 0) c = 0;
+if (c >= grid->cols()) c = grid->cols()-1;
+if (c != old_c) o->value(c);
+if (v == LOAD) {
+ // will automatically propagate
+} else {
+ widget_grid_curr_col_attributes->do_callback(widget_grid_curr_col_attributes, LOAD);
+}}
+ xywh {95 210 40 20} labelsize 11 align 5 textsize 11
class Fluid_Coord_Input
}
+ Fl_Group {} {open
+ xywh {135 210 30 20}
+ } {
+ Fl_Button {} {
+ label {-}
+ callback {if (v != LOAD) {
+ widget_grid_curr_col->value( widget_grid_curr_col->value()-1 );
+ widget_grid_curr_col->do_callback();
+}}
+ xywh {135 210 15 20} labelsize 11
+ code0 {o->clear_visible_focus();} compact 1
+ }
+ Fl_Button {} {
+ label {+}
+ callback {if (v != LOAD) {
+ widget_grid_curr_col->value( widget_grid_curr_col->value()+1 );
+ widget_grid_curr_col->do_callback();
+}}
+ xywh {150 210 15 20} labelsize 11
+ code0 {o->clear_visible_focus();} compact 1
+ }
+ }
+ Fl_Box {} {
+ label {:}
+ xywh {165 210 15 20} labelsize 11
+ }
+ Fl_Group widget_grid_curr_col_attributes {
+ callback propagate_load open
+ xywh {180 210 175 20}
+ } {
+ Fl_Input {} {
+ label {Width:}
+ callback {Fl_Grid *grid = Fl_Grid_Type::selected();
+if (!grid) return;
+int c = widget_grid_curr_col->value();
+if (v == LOAD) {
+ o->value(grid->col_width(c));
+} else {
+ int h = o->value(), old_h = grid->col_width(c);
+ if (h != old_h) {
+ grid->col_width(c, h);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+}}
+ xywh {180 210 55 20} labelsize 11 align 5 textsize 11
+ class Fluid_Coord_Input
+ }
+ Fl_Input {} {
+ label {Weight:}
+ callback {Fl_Grid *grid = Fl_Grid_Type::selected();
+if (!grid) return;
+int c = widget_grid_curr_col->value();
+if (v == LOAD) {
+ o->value(grid->col_weight(c));
+} else {
+ int h = o->value(), old_h = grid->col_weight(c);
+ if (h != old_h) {
+ grid->col_weight(c, h);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+}}
+ xywh {240 210 55 20} labelsize 11 align 5 textsize 11
+ class Fluid_Coord_Input
+ }
+ Fl_Input {} {
+ label {Gap:}
+ callback {Fl_Grid *grid = Fl_Grid_Type::selected();
+if (!grid) return;
+int c = widget_grid_curr_col->value();
+if (v == LOAD) {
+ o->value(grid->col_gap(c));
+} else {
+ int h = o->value(), old_h = grid->col_gap(c);
+ if (h != old_h) {
+ grid->col_gap(c, h);
+ grid->need_layout(true);
+ set_modflag(1);
+ }
+}}
+ xywh {300 210 55 20} labelsize 11 align 5 textsize 11
+ class Fluid_Coord_Input
+ }
+ }
+ Fl_Box {} {
+ xywh {400 210 1 20} hide resizable
+ }
+ }
+ Fl_Box {} {
+ xywh {95 350 300 5} labelsize 11 hide resizable
}
}
}
+ Fl_Tabs widget_tabs_repo {
+ xywh {10 10 400 350} hide
+ code0 {o->hide();}
+ } {
+ Fl_Group {} {open
+ xywh {10 30 400 330} resizable
+ } {}
+ }
Fl_Group {} {
xywh {10 370 400 20} labelsize 11
} {
diff --git a/fluid/widget_panel.h b/fluid/widget_panel.h
index 723a73b37..a412f5b98 100644
--- a/fluid/widget_panel.h
+++ b/fluid/widget_panel.h
@@ -21,6 +21,9 @@
#include <FL/Fl.H>
#include "custom_widgets.h"
#include <FL/Fl_Double_Window.H>
+#include <FL/Fl_Grid.H>
+#include <FL/Fl_Button.H>
+Fl_Double_Window* make_window();
#include <FL/Fl_Tabs.H>
extern Fl_Tabs *widget_tabs;
#include <FL/Fl_Group.H>
@@ -31,7 +34,6 @@ extern void label_cb(Fl_Input*, void*);
extern Fl_Menu_Item labeltypemenu[];
extern void labeltype_cb(Fl_Choice*, void*);
extern void image_cb(Fl_Input*, void*);
-#include <FL/Fl_Button.H>
extern void image_browse_cb(Fl_Button*, void*);
#include "pixmaps.h"
extern void compress_image_cb(Fl_Button*, void*);
@@ -134,32 +136,24 @@ extern void when_cb(Fl_Menu_Button*, void*);
#include <FL/Fl_Input_Choice.H>
extern void user_data_type_cb(Fl_Input_Choice*, void*);
extern Fl_Box *w_when_box;
-extern Fl_Tabs *widget_tabs_repo;
extern Fl_Group *widget_tab_grid_child;
extern void grid_set_row_cb(Fluid_Coord_Input*, void*);
extern Fluid_Coord_Input *widget_grid_row_input;
extern void grid_set_col_cb(Fluid_Coord_Input*, void*);
extern Fluid_Coord_Input *widget_grid_col_input;
extern void grid_align_cb(Fl_Choice*, void*);
-extern void grid_set_rowspan_cb(Fluid_Coord_Input*, void*);
-extern void grid_set_colspan_cb(Fluid_Coord_Input*, void*);
extern void grid_set_min_wdt_cb(Fluid_Coord_Input*, void*);
extern void grid_set_min_hgt_cb(Fluid_Coord_Input*, void*);
+extern void grid_set_rowspan_cb(Fluid_Coord_Input*, void*);
+extern void grid_set_colspan_cb(Fluid_Coord_Input*, void*);
extern Fl_Group *widget_tab_grid;
-extern void grid_row_height(Fluid_Coord_Input*, void*);
-extern void grid_row_weight(Fluid_Coord_Input*, void*);
-extern void grid_row_gap(Fluid_Coord_Input*, void*);
-extern void grid_col_width(Fluid_Coord_Input*, void*);
-extern void grid_col_weight(Fluid_Coord_Input*, void*);
-extern void grid_col_gap(Fluid_Coord_Input*, void*);
-extern void grid_margin_left_cb(Fl_Value_Input*, void*);
-extern void grid_margin_top_cb(Fl_Value_Input*, void*);
-extern void grid_margin_right_cb(Fl_Value_Input*, void*);
-extern void grid_margin_bottom_cb(Fl_Value_Input*, void*);
-extern void grid_row_gap_cb(Fl_Value_Input*, void*);
-extern void grid_col_gap_cb(Fl_Value_Input*, void*);
-extern void grid_rows_cb(Fluid_Coord_Input*, void*);
-extern void grid_cols_cb(Fluid_Coord_Input*, void*);
+extern Fluid_Coord_Input *widget_grid_rows;
+extern Fluid_Coord_Input *widget_grid_cols;
+extern Fluid_Coord_Input *widget_grid_curr_row;
+extern Fl_Group *widget_grid_curr_row_attributes;
+extern Fluid_Coord_Input *widget_grid_curr_col;
+extern Fl_Group *widget_grid_curr_col_attributes;
+extern Fl_Tabs *widget_tabs_repo;
extern void live_mode_cb(Fl_Button*, void*);
extern Fl_Button *wLiveMode;
extern void overlay_cb(Fl_Button*, void*);
@@ -173,5 +167,5 @@ extern Fl_Menu_Item menu_Children[];
extern Fl_Menu_Item menu_2[];
extern Fl_Menu_Item menu_3[];
extern Fl_Menu_Item menu_4[];
-extern Fl_Menu_Item menu_Align[];
+extern Fl_Menu_Item menu_5[];
#endif