// generated by Fast Light User Interface Designer (fluid) version 1.0500

#include "Grid_Tab.h"
#include "Fluid.h"
#include "proj/undo.h"
#include "nodes/Grid_Node.h"
extern Grid_Tab *widget_tab_grid;

void Grid_Tab::cb_widget_grid_rows_i(fld::widget::Formula_Input* o, void* v) {
  // grid_rows_cb
  Fl_Grid *grid = Grid_Node::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) {
      Fluid.proj.undo.checkpoint();
      grid->layout(m, grid->cols());
      grid->need_layout(true);
      Fluid.proj.set_modflag(1);
      widget_tab_grid->do_callback(widget_tab_grid, LOAD);
    }
  }
}
void Grid_Tab::cb_widget_grid_rows(fld::widget::Formula_Input* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()))->cb_widget_grid_rows_i(o,v);
}

void Grid_Tab::cb__i(Fl_Button*, void* v) {
  if (v != LOAD) {
    widget_grid_rows->value( widget_grid_rows->value()-1 );
    widget_grid_rows->do_callback();
  }
}
void Grid_Tab::cb_(Fl_Button* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()->parent()))->cb__i(o,v);
}

void Grid_Tab::cb_1_i(Fl_Button*, void* v) {
  if (v != LOAD) {
    widget_grid_rows->value( widget_grid_rows->value()+1 );
    widget_grid_rows->do_callback();
  }
}
void Grid_Tab::cb_1(Fl_Button* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_1_i(o,v);
}

void Grid_Tab::cb_widget_grid_cols_i(fld::widget::Formula_Input* o, void* v) {
  // grid_rows_cb
  Fl_Grid *grid = Grid_Node::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) {
      Fluid.proj.undo.checkpoint();
      grid->layout(grid->rows(), m);
      grid->need_layout(true);
      Fluid.proj.set_modflag(1);
      widget_tab_grid->do_callback(widget_tab_grid, LOAD);
    }
  }
}
void Grid_Tab::cb_widget_grid_cols(fld::widget::Formula_Input* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()))->cb_widget_grid_cols_i(o,v);
}

void Grid_Tab::cb_2_i(Fl_Button*, void* v) {
  if (v != LOAD) {
    widget_grid_cols->value( widget_grid_cols->value()-1 );
    widget_grid_cols->do_callback();
  }
}
void Grid_Tab::cb_2(Fl_Button* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_2_i(o,v);
}

void Grid_Tab::cb_3_i(Fl_Button*, void* v) {
  if (v != LOAD) {
    widget_grid_cols->value( widget_grid_cols->value()+1 );
    widget_grid_cols->do_callback();
  }
}
void Grid_Tab::cb_3(Fl_Button* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_3_i(o,v);
}

void Grid_Tab::cb_Left_i(Fl_Value_Input* o, void* v) {
  Fl_Grid *grid = Grid_Node::selected();
  if (!grid) return;
  int m = 0;
  if (v == LOAD) {
    grid->margin(&m, nullptr, nullptr, nullptr);
    o->value(m);
  } else {
    int m = (int)o->value(), old_m;
    grid->margin(&old_m, nullptr, nullptr, nullptr);
    if (m != old_m) {
      Fluid.proj.undo.checkpoint();
      grid->margin(m, -1, -1, -1);
      grid->need_layout(true);
      Fluid.proj.set_modflag(1);
    }
  }
}
void Grid_Tab::cb_Left(Fl_Value_Input* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()))->cb_Left_i(o,v);
}

void Grid_Tab::cb_Top_i(Fl_Value_Input* o, void* v) {
  Fl_Grid *grid = Grid_Node::selected();
  if (!grid) return;
  int m = 0;
  if (v == LOAD) {
    grid->margin(nullptr, &m, nullptr, nullptr);
    o->value(m);
  } else {
    int m = (int)o->value(), old_m;
    grid->margin(nullptr, &old_m, nullptr, nullptr);
    if (m != old_m) {
      Fluid.proj.undo.checkpoint();
      grid->margin(-1, m, -1, -1);
      grid->need_layout(true);
      Fluid.proj.set_modflag(1);
    }
  }
}
void Grid_Tab::cb_Top(Fl_Value_Input* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()))->cb_Top_i(o,v);
}

void Grid_Tab::cb_Right_i(Fl_Value_Input* o, void* v) {
  Fl_Grid *grid = Grid_Node::selected();
  if (!grid) return;
  int m = 0;
  if (v == LOAD) {
    grid->margin(nullptr, nullptr, &m, nullptr);
    o->value(m);
  } else {
    int m = (int)o->value(), old_m;
    grid->margin(nullptr, nullptr, &old_m, nullptr);
    if (m != old_m) {
      Fluid.proj.undo.checkpoint();
      grid->margin(-1, -1, m, -1);
      grid->need_layout(true);
      Fluid.proj.set_modflag(1);
    }
  }
}
void Grid_Tab::cb_Right(Fl_Value_Input* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()))->cb_Right_i(o,v);
}

void Grid_Tab::cb_Bottom_i(Fl_Value_Input* o, void* v) {
  Fl_Grid *grid = Grid_Node::selected();
  if (!grid) return;
  int m = 0;
  if (v == LOAD) {
    grid->margin(nullptr, nullptr, nullptr, &m);
    o->value(m);
  } else {
    int m = (int)o->value(), old_m;
    grid->margin(nullptr, nullptr, nullptr, &old_m);
    if (m != old_m) {
      Fluid.proj.undo.checkpoint();
      grid->margin(-1, -1, -1, m);
      grid->need_layout(true);
      Fluid.proj.set_modflag(1);
    }
  }
}
void Grid_Tab::cb_Bottom(Fl_Value_Input* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()))->cb_Bottom_i(o,v);
}

void Grid_Tab::cb_Row_i(Fl_Value_Input* o, void* v) {
  Fl_Grid *grid = Grid_Node::selected();
  if (!grid) return;
  if (v == LOAD) {
    int m = 0;
    grid->gap(&m, nullptr);
    o->value(m);
  } else {
    int m = (int)o->value(), old_m, m2;
    grid->gap(&old_m, &m2);
    if (m != old_m) {
      Fluid.proj.undo.checkpoint();
      grid->gap(m, m2);
      grid->need_layout(true);
      Fluid.proj.set_modflag(1);
    }
  }
}
void Grid_Tab::cb_Row(Fl_Value_Input* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()))->cb_Row_i(o,v);
}

void Grid_Tab::cb_Col_i(Fl_Value_Input* o, void* v) {
  Fl_Grid *grid = Grid_Node::selected();
  if (!grid) return;
  if (v == LOAD) {
    int m = 0;
    grid->gap(nullptr, &m);
    o->value(m);
  } else {
    int m = (int)o->value(), old_m, m2;
    grid->gap(&m2, &old_m);
    if (m != old_m) {
      Fluid.proj.undo.checkpoint();
      grid->gap(m2, m);
      grid->need_layout(true);
      Fluid.proj.set_modflag(1);
    }
  }
}
void Grid_Tab::cb_Col(Fl_Value_Input* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()))->cb_Col_i(o,v);
}

void Grid_Tab::cb_Row1_i(Fl_Group* o, void* v) {
  if (v == LOAD) {
    Fl_Grid *grid = Grid_Node::selected();
    if (grid)
      o->activate();
    else
      o->deactivate();
    propagate_load(o, v);
  }
}
void Grid_Tab::cb_Row1(Fl_Group* o, void* v) {
  ((Grid_Tab*)(o->parent()))->cb_Row1_i(o,v);
}

void Grid_Tab::cb_widget_grid_curr_row_i(fld::widget::Formula_Input* o, void* v) {
  Fl_Grid *grid = Grid_Node::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);
  }
}
void Grid_Tab::cb_widget_grid_curr_row(fld::widget::Formula_Input* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()))->cb_widget_grid_curr_row_i(o,v);
}

void Grid_Tab::cb_4_i(Fl_Button*, void* v) {
  if (v != LOAD) {
    widget_grid_curr_row->value( widget_grid_curr_row->value()-1 );
    widget_grid_curr_row->do_callback();
  }
}
void Grid_Tab::cb_4(Fl_Button* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_4_i(o,v);
}

void Grid_Tab::cb_5_i(Fl_Button*, void* v) {
  if (v != LOAD) {
    widget_grid_curr_row->value( widget_grid_curr_row->value()+1 );
    widget_grid_curr_row->do_callback();
  }
}
void Grid_Tab::cb_5(Fl_Button* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_5_i(o,v);
}

void Grid_Tab::cb_Height_i(fld::widget::Formula_Input* o, void* v) {
  Fl_Grid *grid = Grid_Node::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 < 0) h = 0;
    if (h != old_h) {
      Fluid.proj.undo.checkpoint();
      grid->row_height(r, h);
      grid->need_layout(true);
      Fluid.proj.set_modflag(1);
    }
  }
}
void Grid_Tab::cb_Height(fld::widget::Formula_Input* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_Height_i(o,v);
}

void Grid_Tab::cb_Weight_i(fld::widget::Formula_Input* o, void* v) {
  Fl_Grid *grid = Grid_Node::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 < 0) h = 0;
    if (h != old_h) {
      Fluid.proj.undo.checkpoint();
      grid->row_weight(r, h);
      grid->need_layout(true);
      Fluid.proj.set_modflag(1);
    }
  }
}
void Grid_Tab::cb_Weight(fld::widget::Formula_Input* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_Weight_i(o,v);
}

void Grid_Tab::cb_Gap_i(fld::widget::Formula_Input* o, void* v) {
  Fl_Grid *grid = Grid_Node::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 < -1) h = -1;
    if (h != old_h) {
      Fluid.proj.undo.checkpoint();
      grid->row_gap(r, h);
      grid->need_layout(true);
      Fluid.proj.set_modflag(1);
    }
  }
}
void Grid_Tab::cb_Gap(fld::widget::Formula_Input* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_Gap_i(o,v);
}

void Grid_Tab::cb_widget_grid_curr_col_i(fld::widget::Formula_Input* o, void* v) {
  Fl_Grid *grid = Grid_Node::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);
  }
}
void Grid_Tab::cb_widget_grid_curr_col(fld::widget::Formula_Input* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()))->cb_widget_grid_curr_col_i(o,v);
}

void Grid_Tab::cb_6_i(Fl_Button*, void* v) {
  if (v != LOAD) {
    widget_grid_curr_col->value( widget_grid_curr_col->value()-1 );
    widget_grid_curr_col->do_callback();
  }
}
void Grid_Tab::cb_6(Fl_Button* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_6_i(o,v);
}

void Grid_Tab::cb_7_i(Fl_Button*, void* v) {
  if (v != LOAD) {
    widget_grid_curr_col->value( widget_grid_curr_col->value()+1 );
    widget_grid_curr_col->do_callback();
  }
}
void Grid_Tab::cb_7(Fl_Button* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_7_i(o,v);
}

void Grid_Tab::cb_Width_i(fld::widget::Formula_Input* o, void* v) {
  Fl_Grid *grid = Grid_Node::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 < 0) h = 0;
    if (h != old_h) {
      Fluid.proj.undo.checkpoint();
      grid->col_width(c, h);
      grid->need_layout(true);
      Fluid.proj.set_modflag(1);
    }
  }
}
void Grid_Tab::cb_Width(fld::widget::Formula_Input* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_Width_i(o,v);
}

void Grid_Tab::cb_Weight1_i(fld::widget::Formula_Input* o, void* v) {
  Fl_Grid *grid = Grid_Node::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 < 0) h = 0;
    if (h != old_h) {
      Fluid.proj.undo.checkpoint();
      grid->col_weight(c, h);
      grid->need_layout(true);
      Fluid.proj.set_modflag(1);
    }
  }
}
void Grid_Tab::cb_Weight1(fld::widget::Formula_Input* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_Weight1_i(o,v);
}

void Grid_Tab::cb_Gap1_i(fld::widget::Formula_Input* o, void* v) {
  Fl_Grid *grid = Grid_Node::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 < -1) h = -1;
    if (h != old_h) {
      Fluid.proj.undo.checkpoint();
      grid->col_gap(c, h);
      grid->need_layout(true);
      Fluid.proj.set_modflag(1);
    }
  }
}
void Grid_Tab::cb_Gap1(fld::widget::Formula_Input* o, void* v) {
  ((Grid_Tab*)(o->parent()->parent()->parent()))->cb_Gap1_i(o,v);
}

Grid_Tab::Grid_Tab(int X, int Y, int W, int H, const char *L) :
  Fl_Group(0, 0, 400, 330, L)
{
  this->labelsize(11);
  this->callback((Fl_Callback*)propagate_load);
  { Fl_Group* o = new Fl_Group(85, 30, 315, 20, "Grid Layout:");
    o->labelfont(1);
    o->labelsize(11);
    o->callback((Fl_Callback*)propagate_load);
    o->align(Fl_Align(FL_ALIGN_LEFT));
    { widget_grid_rows = new fld::widget::Formula_Input(85, 30, 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);
    } // fld::widget::Formula_Input* widget_grid_rows
    { Fl_Group* o = new Fl_Group(125, 30, 30, 20);
      { Fl_Button* o = new Fl_Button(125, 30, 15, 20, "-");
        o->compact(1);
        o->labelsize(11);
        o->callback((Fl_Callback*)cb_);
        o->clear_visible_focus();
      } // Fl_Button* o
      { Fl_Button* o = new Fl_Button(140, 30, 15, 20, "+");
        o->compact(1);
        o->labelsize(11);
        o->callback((Fl_Callback*)cb_1);
        o->clear_visible_focus();
      } // Fl_Button* o
      o->end();
    } // Fl_Group* o
    { widget_grid_cols = new fld::widget::Formula_Input(165, 30, 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);
    } // fld::widget::Formula_Input* widget_grid_cols
    { Fl_Group* o = new Fl_Group(205, 30, 30, 20);
      { Fl_Button* o = new Fl_Button(205, 30, 15, 20, "-");
        o->compact(1);
        o->labelsize(11);
        o->callback((Fl_Callback*)cb_2);
        o->clear_visible_focus();
      } // Fl_Button* o
      { Fl_Button* o = new Fl_Button(220, 30, 15, 20, "+");
        o->compact(1);
        o->labelsize(11);
        o->callback((Fl_Callback*)cb_3);
        o->clear_visible_focus();
      } // Fl_Button* o
      o->end();
    } // Fl_Group* o
    { Fl_Box* o = new Fl_Box(386, 30, 0, 20);
      Fl_Group::current()->resizable(o);
    } // Fl_Box* o
    o->end();
  } // Fl_Group* o
  { wp_grid_margin = new Fl_Group(85, 70, 315, 20, "Margins:");
    wp_grid_margin->labelfont(1);
    wp_grid_margin->labelsize(11);
    wp_grid_margin->callback((Fl_Callback*)propagate_load);
    wp_grid_margin->align(Fl_Align(FL_ALIGN_LEFT));
    { Fl_Value_Input* o = new Fl_Value_Input(85, 70, 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*)cb_Left);
      o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
    } // Fl_Value_Input* o
    { Fl_Value_Input* o = new Fl_Value_Input(145, 70, 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*)cb_Top);
      o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
    } // Fl_Value_Input* o
    { Fl_Value_Input* o = new Fl_Value_Input(205, 70, 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*)cb_Right);
      o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
    } // Fl_Value_Input* o
    { Fl_Value_Input* o = new Fl_Value_Input(265, 70, 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*)cb_Bottom);
      o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
    } // Fl_Value_Input* o
    { Fl_Box* o = new Fl_Box(386, 70, 0, 20);
      Fl_Group::current()->resizable(o);
    } // Fl_Box* o
    wp_grid_margin->end();
  } // Fl_Group* wp_grid_margin
  { wp_grid_gaps = new Fl_Group(85, 105, 315, 20, "Gaps:");
    wp_grid_gaps->labelfont(1);
    wp_grid_gaps->labelsize(11);
    wp_grid_gaps->callback((Fl_Callback*)propagate_load);
    wp_grid_gaps->align(Fl_Align(FL_ALIGN_LEFT));
    { Fl_Value_Input* o = new Fl_Value_Input(85, 105, 55, 20, "Row:");
      o->tooltip("Gap between children.");
      o->labelsize(11);
      o->maximum(1000);
      o->step(1);
      o->textsize(11);
      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(145, 105, 55, 20, "Col:");
      o->tooltip("Gap between children.");
      o->labelsize(11);
      o->maximum(1000);
      o->step(1);
      o->textsize(11);
      o->callback((Fl_Callback*)cb_Col);
      o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
    } // Fl_Value_Input* o
    { Fl_Box* o = new Fl_Box(386, 105, 0, 20);
      Fl_Group::current()->resizable(o);
    } // Fl_Box* o
    wp_grid_gaps->end();
  } // Fl_Group* wp_grid_gaps
  { Fl_Group* o = new Fl_Group(85, 145, 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 fld::widget::Formula_Input(85, 145, 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);
    } // fld::widget::Formula_Input* widget_grid_curr_row
    { Fl_Group* o = new Fl_Group(125, 145, 30, 20);
      o->callback((Fl_Callback*)propagate_load);
      { Fl_Button* o = new Fl_Button(125, 145, 15, 20, "-");
        o->compact(1);
        o->labelsize(11);
        o->callback((Fl_Callback*)cb_4);
        o->clear_visible_focus();
      } // Fl_Button* o
      { Fl_Button* o = new Fl_Button(140, 145, 15, 20, "+");
        o->compact(1);
        o->labelsize(11);
        o->callback((Fl_Callback*)cb_5);
        o->clear_visible_focus();
      } // Fl_Button* o
      o->end();
    } // Fl_Group* o
    { Fl_Box* o = new Fl_Box(155, 145, 15, 20, ":");
      o->labelsize(11);
    } // Fl_Box* o
    { widget_grid_curr_row_attributes = new Fl_Group(170, 145, 175, 20);
      widget_grid_curr_row_attributes->callback((Fl_Callback*)propagate_load);
      { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(170, 145, 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);
      } // fld::widget::Formula_Input* o
      { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(230, 145, 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);
      } // fld::widget::Formula_Input* o
      { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(290, 145, 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);
      } // fld::widget::Formula_Input* o
      widget_grid_curr_row_attributes->end();
    } // Fl_Group* widget_grid_curr_row_attributes
    { Fl_Box* o = new Fl_Box(390, 145, 1, 20);
      o->hide();
      Fl_Group::current()->resizable(o);
    } // Fl_Box* o
    o->end();
  } // Fl_Group* o
  { Fl_Group* o = new Fl_Group(85, 180, 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 fld::widget::Formula_Input(85, 180, 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);
    } // fld::widget::Formula_Input* widget_grid_curr_col
    { Fl_Group* o = new Fl_Group(125, 180, 30, 20);
      { Fl_Button* o = new Fl_Button(125, 180, 15, 20, "-");
        o->compact(1);
        o->labelsize(11);
        o->callback((Fl_Callback*)cb_6);
        o->clear_visible_focus();
      } // Fl_Button* o
      { Fl_Button* o = new Fl_Button(140, 180, 15, 20, "+");
        o->compact(1);
        o->labelsize(11);
        o->callback((Fl_Callback*)cb_7);
        o->clear_visible_focus();
      } // Fl_Button* o
      o->end();
    } // Fl_Group* o
    { Fl_Box* o = new Fl_Box(155, 180, 15, 20, ":");
      o->labelsize(11);
    } // Fl_Box* o
    { widget_grid_curr_col_attributes = new Fl_Group(170, 180, 175, 20);
      widget_grid_curr_col_attributes->callback((Fl_Callback*)propagate_load);
      { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(170, 180, 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);
      } // fld::widget::Formula_Input* o
      { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(230, 180, 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);
      } // fld::widget::Formula_Input* o
      { fld::widget::Formula_Input* o = new fld::widget::Formula_Input(290, 180, 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);
      } // fld::widget::Formula_Input* o
      widget_grid_curr_col_attributes->end();
    } // Fl_Group* widget_grid_curr_col_attributes
    { Fl_Box* o = new Fl_Box(390, 180, 1, 20);
      o->hide();
      Fl_Group::current()->resizable(o);
    } // Fl_Box* o
    o->end();
  } // Fl_Group* o
  { Fl_Box* o = new Fl_Box(85, 320, 300, 5);
    o->labelsize(11);
    o->hide();
    Fl_Group::current()->resizable(o);
  } // Fl_Box* o
  end();
  resize(X, Y, W, H);
}
