diff -up flCalc/SciCalc.fld.bigsize flCalc/SciCalc.fld --- flCalc/SciCalc.fld.bigsize 2017-05-17 10:08:00.000000000 +0300 +++ flCalc/SciCalc.fld 2017-05-17 13:11:38.012034704 +0300 @@ -89,7 +89,7 @@ class SciCalc {open Function {SciCalc()} {open } { Fl_Window win { - label flCalc open + label flCalc private xywh {361 248 180 260} type Double box UP_BOX visible } { Fl_Box leddisplay { @@ -500,10 +500,13 @@ else }} private xywh {6 44 32 21} type Toggle labelsize 11 labelcolor 4 } - Fl_Button but_quit { - label Exit - callback {win->hide();} selected - private xywh {145 44 29 21} color 15 labeltype ENGRAVED_LABEL labelsize 12 labelcolor 33 + Fl_Button but_x2 { + label x2 + callback {bool increase = (but_x2->labeltype() & FL_EMBOSSED_LABEL) != 0; +const float scale = (increase)?2.0f:0.5f; +resize(win, scale, scale, 0); +but_x2->labeltype(increase?FL_ENGRAVED_LABEL:FL_EMBOSSED_LABEL);} + private xywh {145 44 29 21} color 223 labeltype EMBOSSED_LABEL labelsize 12 labelcolor 33 } } code {init_value(0); @@ -516,7 +519,7 @@ else set_brktdisp(); radio_10->value(1); set_drgdisp(); - set_display(0.0,NONE);} {} + set_display(0.0,NONE); } Function {~SciCalc()} {open } { @@ -1022,4 +1025,29 @@ char digstr[2]; ready = 1; set_memdisp();} {} } + Function {resize(Fl_Widget *widget, const float gscale, const float fscale, int deep = 0) const} {open private return_type void + } { + code {const bool move = (deep != 0); +const bool geom = (deep < 2); + +if (geom) +{ + const float pscale = (move)?gscale:1; + const int x = ceill(widget->x()*pscale), + y = ceill(widget->y()*pscale), + w = ceill(widget->w()*gscale), + h = ceill(widget->h()*gscale); + widget->resize(x, y, w, h); +} + +widget->labelsize(ceill(widget->labelsize()*fscale)); + +Fl_Group * const group = widget->as_group(); +if (NULL != group) +{ + for (int ind = group->children()-1; ind >= 0; --ind) + resize(group->child(ind), gscale, fscale, deep+1); +}} {selected + } + } }