From b4995f979d127cea667b4e2b71c91e9db4ab52ef Mon Sep 17 00:00:00 2001 From: maxim nikonov Date: Fri, 6 Feb 2026 18:12:40 +0500 Subject: wip --- fluid/nodes/Grid_Node.cxx | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) (limited to 'fluid/nodes/Grid_Node.cxx') diff --git a/fluid/nodes/Grid_Node.cxx b/fluid/nodes/Grid_Node.cxx index d38bbd1ca..6759c33f2 100644 --- a/fluid/nodes/Grid_Node.cxx +++ b/fluid/nodes/Grid_Node.cxx @@ -225,7 +225,8 @@ void Fl_Grid_Proxy::transient_make_room_(int n) { \param[in] w remove the transient cell for this widget */ void Fl_Grid_Proxy::transient_remove_(Fl_Widget *w) { - for (int i=0; igap(&rg, &cg); d->gap(rg, cg); // copy col widths, heights, and gaps - for (int c=0; ccols(); c++) { + int c; + for (c =0; ccols(); c++) { d->col_width(c, s->col_width(c)); d->col_gap(c, s->col_gap(c)); d->col_weight(c, s->col_weight(c)); } // copy row widths, heights, and gaps - for (int r=0; rrows(); r++) { + int r; + for (r =0; rrows(); r++) { d->row_height(r, s->row_height(r)); d->row_gap(r, s->row_gap(r)); d->row_weight(r, s->row_weight(r)); @@ -331,7 +335,8 @@ void Grid_Node::copy_properties() void Grid_Node::copy_properties_for_children() { Fl_Grid *d = (Fl_Grid*)live_widget, *s =(Fl_Grid*)o; - for (int i=0; ichildren(); i++) { + int i; + for (i =0; ichildren(); i++) { Fl_Grid::Cell *cell = s->cell(s->child(i)); if (cell && ichildren()) { d->widget(d->child(i), @@ -411,6 +416,7 @@ void Grid_Node::write_properties(fld::io::Project_Writer &f) void Grid_Node::read_property(fld::io::Project_Reader &f, const char *c) { Fl_Grid* grid = (Fl_Grid*)o; + int i; if (!strcmp(c,"dimensions")) { int rows = 3, cols = 3; if (sscanf(f.read_word(),"%d %d", &rows, &cols) == 2) @@ -426,32 +432,32 @@ void Grid_Node::read_property(fld::io::Project_Reader &f, const char *c) } else if (!strcmp(c,"rowheights")) { int rows = grid->rows(); f.read_word(1); // "{" - for (int i=0; irow_height(i, f.read_int()); + for (i =0; irow_height(i, f.read_int()); f.read_word(1); // "}" } else if (!strcmp(c,"rowweights")) { int rows = grid->rows(); f.read_word(1); // "{" - for (int i=0; irow_weight(i, f.read_int()); + for (i =0; irow_weight(i, f.read_int()); f.read_word(1); // "}" } else if (!strcmp(c,"rowgaps")) { int rows = grid->rows(); f.read_word(1); // "{" - for (int i=0; irow_gap(i, f.read_int()); + for (i =0; irow_gap(i, f.read_int()); f.read_word(1); // "}" } else if (!strcmp(c,"colwidths")) { int cols = grid->cols(); f.read_word(1); // "{" - for (int i=0; icol_width(i, f.read_int()); + for (i =0; icol_width(i, f.read_int()); f.read_word(1); // "}" } else if (!strcmp(c,"colweights")) { int cols = grid->cols(); f.read_word(1); // "{" - for (int i=0; icol_weight(i, f.read_int()); + for (i =0; icol_weight(i, f.read_int()); f.read_word(1); // "}" } else if (!strcmp(c,"colgaps")) { int cols = grid->cols(); f.read_word(1); // "{" - for (int i=0; icol_gap(i, f.read_int()); + for (i =0; icol_gap(i, f.read_int()); f.read_word(1); // "}" } else { super::read_property(f, c); @@ -612,7 +618,8 @@ void Grid_Node::write_code2(fld::io::Code_Writer& f) { const char *var = name() ? name() : "o"; Fl_Grid* grid = (Fl_Grid*)o; bool first_cell = true; - for (int i=0; ichildren(); i++) { + int i; + for (i =0; ichildren(); i++) { Fl_Widget *c = grid->child(i); Fl_Grid::Cell *cell = grid->cell(c); if (cell) { @@ -694,14 +701,16 @@ void Grid_Node::insert_child_at(Fl_Widget *child, int x, int y) { int x0 = grid->x() + Fl::box_dx(grid->box()) + ml; int y0 = grid->y() + Fl::box_dy(grid->box()) + mt; - for (int r = 0; r < grid->rows(); r++) { + int r; + for (r = 0; r < grid->rows(); r++) { if (y>y0) row = r; int gap = grid->row_gap(r)>=0 ? grid->row_gap(r) : grg; y0 += grid->computed_row_height(r); y0 += gap; } - for (int c = 0; c < grid->cols(); c++) { + int c; + for (c = 0; c < grid->cols(); c++) { if (x>x0) col = c; int gap = grid->col_gap(c)>=0 ? grid->col_gap(c) : gcg; x0 += grid->computed_col_width(c); @@ -732,8 +741,10 @@ void Grid_Node::insert_child_at_next_free_cell(Fl_Widget *child) { // c = current_cell->col(); // } // } - for (int r = 0; r < grid->rows(); r++) { - for (int c = 0; c < grid->cols(); c++) { + int r; + for (r = 0; r < grid->rows(); r++) { + int c; + for (c = 0; c < grid->cols(); c++) { if (!grid->cell(r, c)) { grid->move_cell(child, r, c); return; -- cgit v1.2.3