From 793fa5a91f24358aa7ce21abf6ee4e93a17b04ee Mon Sep 17 00:00:00 2001 From: maxim nikonov Date: Fri, 6 Feb 2026 19:04:24 +0500 Subject: wip --- fluid/panels/widget_panel.cxx | 101 ++++++++++++++++++++---------------------- 1 file changed, 49 insertions(+), 52 deletions(-) (limited to 'fluid/panels/widget_panel.cxx') diff --git a/fluid/panels/widget_panel.cxx b/fluid/panels/widget_panel.cxx index 33720b5ac..d7e4ced55 100644 --- a/fluid/panels/widget_panel.cxx +++ b/fluid/panels/widget_panel.cxx @@ -43,7 +43,7 @@ extern void color_common(Fl_Color c); extern void color2_common(Fl_Color c); extern void textcolor_common(Fl_Color c); extern int widget_i; -extern fld::widget::Formula_Input_Vars widget_vars[]; +extern Formula_Input_Vars widget_vars[]; extern int numselected; extern Fl_Menu_Item boxmenu[]; extern int haderror; @@ -91,9 +91,9 @@ static void cb_image_panel_data(Fl_Box* o, void* v) { //fl ▲ ----------=~-=-~-~---~-----------~=--~~~-~~=--~-=--=-= ▲ fl// } -fld::widget::Formula_Input *image_panel_imagew=(fld::widget::Formula_Input *)0; +Formula_Input *image_panel_imagew=(Formula_Input *)0; -static void cb_image_panel_imagew(fld::widget::Formula_Input* o, void* v) { +static void cb_image_panel_imagew(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ~~--~=---~-~=-=~~~-~~- ▼ fl// if (v == LOAD) { if (current_widget->is_widget() && !current_widget->is_a(FLD_NODE_TYPE_Window)) { @@ -124,9 +124,9 @@ static void cb_image_panel_imagew(fld::widget::Formula_Input* o, void* v) { //fl ▲ ----------~==~=~-~~=~~----------~-~-=-=~~-~=~~-~=~~-~- ▲ fl// } -fld::widget::Formula_Input *image_panel_imageh=(fld::widget::Formula_Input *)0; +Formula_Input *image_panel_imageh=(Formula_Input *)0; -static void cb_image_panel_imageh(fld::widget::Formula_Input* o, void* v) { +static void cb_image_panel_imageh(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ~-~=-~~-=-=~~~--~----= ▼ fl// if (v == LOAD) { if (current_widget->is_widget() && !current_widget->is_a(FLD_NODE_TYPE_Window)) { @@ -233,9 +233,9 @@ static void cb_image_panel_dedata(Fl_Box* o, void* v) { //fl ▲ ----------~=~=-~~---=~------------~~=-~~=-=-=~=~--=--~ ▲ fl// } -fld::widget::Formula_Input *image_panel_deimagew=(fld::widget::Formula_Input *)0; +Formula_Input *image_panel_deimagew=(Formula_Input *)0; -static void cb_image_panel_deimagew(fld::widget::Formula_Input* o, void* v) { +static void cb_image_panel_deimagew(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ~~--=~=~=~=~-=~--=~~=- ▼ fl// if (v == LOAD) { if (current_widget->is_widget() && !current_widget->is_a(FLD_NODE_TYPE_Window)) { @@ -266,9 +266,9 @@ static void cb_image_panel_deimagew(fld::widget::Formula_Input* o, void* v) { //fl ▲ ----------~=-~--=-=~=~----------~-~-~~--~~-=-==~~==-~= ▲ fl// } -fld::widget::Formula_Input *image_panel_deimageh=(fld::widget::Formula_Input *)0; +Formula_Input *image_panel_deimageh=(Formula_Input *)0; -static void cb_image_panel_deimageh(fld::widget::Formula_Input* o, void* v) { +static void cb_image_panel_deimageh(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ~~=-=---~-~~-=-=~-~--- ▼ fl// if (v == LOAD) { if (current_widget->is_widget() && !current_widget->is_a(FLD_NODE_TYPE_Window)) { @@ -379,7 +379,7 @@ Fl_Double_Window* make_image_panel() { } // Fl_Box* image_panel_data { Fl_Group* o = new Fl_Group(75, 75, 170, 20); o->callback((Fl_Callback*)propagate_load); - { image_panel_imagew = new fld::widget::Formula_Input(75, 75, 55, 20, "Width:"); + { image_panel_imagew = new Formula_Input(75, 75, 55, 20, "Width:"); image_panel_imagew->tooltip("Scale image to this width in pixel units"); image_panel_imagew->box(FL_DOWN_BOX); image_panel_imagew->color(FL_BACKGROUND2_COLOR); @@ -392,8 +392,8 @@ Fl_Double_Window* make_image_panel() { image_panel_imagew->callback((Fl_Callback*)cb_image_panel_imagew); image_panel_imagew->align(Fl_Align(FL_ALIGN_TOP_LEFT)); image_panel_imagew->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* image_panel_imagew - { image_panel_imageh = new fld::widget::Formula_Input(135, 75, 55, 20, "Height:"); + } // Formula_Input* image_panel_imagew + { image_panel_imageh = new Formula_Input(135, 75, 55, 20, "Height:"); image_panel_imageh->tooltip("Scale image to this height in pixel units"); image_panel_imageh->box(FL_DOWN_BOX); image_panel_imageh->color(FL_BACKGROUND2_COLOR); @@ -406,7 +406,7 @@ Fl_Double_Window* make_image_panel() { image_panel_imageh->callback((Fl_Callback*)cb_image_panel_imageh); image_panel_imageh->align(Fl_Align(FL_ALIGN_TOP_LEFT)); image_panel_imageh->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* image_panel_imageh + } // Formula_Input* image_panel_imageh { Fl_Button* o = new Fl_Button(195, 75, 50, 20, "Reset"); o->tooltip("Reset scale to original size"); o->labelsize(11); @@ -455,7 +455,7 @@ Fl_Double_Window* make_image_panel() { } // Fl_Box* image_panel_dedata { Fl_Group* o = new Fl_Group(75, 215, 170, 20); o->callback((Fl_Callback*)propagate_load); - { image_panel_deimagew = new fld::widget::Formula_Input(75, 215, 55, 20, "Width:"); + { image_panel_deimagew = new Formula_Input(75, 215, 55, 20, "Width:"); image_panel_deimagew->tooltip("Scale image to this width in pixel units"); image_panel_deimagew->box(FL_DOWN_BOX); image_panel_deimagew->color(FL_BACKGROUND2_COLOR); @@ -468,8 +468,8 @@ Fl_Double_Window* make_image_panel() { image_panel_deimagew->callback((Fl_Callback*)cb_image_panel_deimagew); image_panel_deimagew->align(Fl_Align(FL_ALIGN_TOP_LEFT)); image_panel_deimagew->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* image_panel_deimagew - { image_panel_deimageh = new fld::widget::Formula_Input(135, 215, 55, 20, "Height:"); + } // Formula_Input* image_panel_deimagew + { image_panel_deimageh = new Formula_Input(135, 215, 55, 20, "Height:"); image_panel_deimageh->tooltip("Scale image to this height in pixel units"); image_panel_deimageh->box(FL_DOWN_BOX); image_panel_deimageh->color(FL_BACKGROUND2_COLOR); @@ -482,7 +482,7 @@ Fl_Double_Window* make_image_panel() { image_panel_deimageh->callback((Fl_Callback*)cb_image_panel_deimageh); image_panel_deimageh->align(Fl_Align(FL_ALIGN_TOP_LEFT)); image_panel_deimageh->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* image_panel_deimageh + } // Formula_Input* image_panel_deimageh { Fl_Button* o = new Fl_Button(195, 215, 50, 20, "Reset"); o->tooltip("Reset scale to original size"); o->labelsize(11); @@ -719,9 +719,9 @@ Fl_Menu_Item menu_1[] = { {0,0,0,0,0,0,0,0,0} }; -fld::widget::Formula_Input *widget_x_input=(fld::widget::Formula_Input *)0; +Formula_Input *widget_x_input=(Formula_Input *)0; -static void cb_widget_x_input(fld::widget::Formula_Input* o, void* v) { +static void cb_widget_x_input(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ~~=-~~~~~~=-~-~~----~- ▼ fl// if (v == LOAD) { if (current_widget->is_true_widget()) { @@ -753,9 +753,9 @@ static void cb_widget_x_input(fld::widget::Formula_Input* o, void* v) { //fl ▲ ----------=~=~--~~-=-~----------~~=~=--~~~-=~=~-=~~==- ▲ fl// } -fld::widget::Formula_Input *widget_y_input=(fld::widget::Formula_Input *)0; +Formula_Input *widget_y_input=(Formula_Input *)0; -static void cb_widget_y_input(fld::widget::Formula_Input* o, void* v) { +static void cb_widget_y_input(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ~~--~=--~-~=-~=~~~=~~= ▼ fl// if (v == LOAD) { if (current_widget->is_true_widget()) { @@ -786,9 +786,9 @@ static void cb_widget_y_input(fld::widget::Formula_Input* o, void* v) { //fl ▲ ----------~==--=~=--=-----------~~=~--~~=~-~---=~-=-~= ▲ fl// } -fld::widget::Formula_Input *widget_w_input=(fld::widget::Formula_Input *)0; +Formula_Input *widget_w_input=(Formula_Input *)0; -static void cb_widget_w_input(fld::widget::Formula_Input* o, void* v) { +static void cb_widget_w_input(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback ---=~~--~==-=-~-=-~-=~ ▼ fl// if (v == LOAD) { if (current_widget->is_true_widget()) { @@ -819,9 +819,9 @@ static void cb_widget_w_input(fld::widget::Formula_Input* o, void* v) { //fl ▲ ----------~=~-=~~--~------------~--~-==-~~~~~==-=--=-= ▲ fl// } -fld::widget::Formula_Input *widget_h_input=(fld::widget::Formula_Input *)0; +Formula_Input *widget_h_input=(Formula_Input *)0; -static void cb_widget_h_input(fld::widget::Formula_Input* o, void* v) { +static void cb_widget_h_input(Formula_Input* o, void* v) { //fl ▼ ---------------------- callback -~-=-==~--~=-~--=----- ▼ fl// if (v == LOAD) { if (current_widget->is_true_widget()) { @@ -2342,9 +2342,9 @@ static void cb_wComment(Fl_Text_Editor* o, void* v) { //fl ▲ ----------=~---~~-=--~----------~~-~--=~~~-~~==~~=~~~- ▲ fl// } -fld::widget::Code_Editor *wCallback=(fld::widget::Code_Editor *)0; +Code_Editor *wCallback=(Code_Editor *)0; -static void cb_wCallback(fld::widget::Code_Editor* o, void* v) { +static void cb_wCallback(Code_Editor* o, void* v) { //fl ▼ ---------------------- callback ~--~-~-~~-=~~-~=~=-~~= ▼ fl// if (v == LOAD) { const char *cbtext = current_widget->callback(); @@ -2563,9 +2563,6 @@ Fl_Menu_Item menu_7[] = { {"binary: unsigned char[]", 0, 0, (void*)(0), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0}, {"text: const char*", 0, 0, (void*)(1), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0}, {"compressed: unsigned char[]", 0, 0, (void*)(2), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0}, - {"binary: std::vector", 0, 0, (void*)(3), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0}, - {"text: std::string", 0, 0, (void*)(4), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0}, - {"compressed: std::vector", 0, 0, (void*)(5), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0}, {0,0,0,0,0,0,0,0,0} }; @@ -3202,7 +3199,7 @@ static void cb_1b(Fl_Tile* o, void* v) { //fl ▲ ----------=~-=~--~~=~=-----------~~----=--~=~~-~-----= ▲ fl// } -static void cb_Declaration(fld::widget::Code_Editor* o, void* v) { +static void cb_Declaration(Code_Editor* o, void* v) { //fl ▼ ---------------------- callback ---==--~~-=-=-~=----=- ▼ fl// if (!current_node || !current_node->is_a(FLD_NODE_TYPE_Decl)) return; Decl_Node* nd = (Decl_Node*)current_node; @@ -3331,7 +3328,7 @@ static void cb_code_tabs(Fl_Tabs* o, void* v) { Fl_Group *code_tabs_main=(Fl_Group *)0; -static void cb_1c(fld::widget::Code_Editor* o, void* v) { +static void cb_1c(Code_Editor* o, void* v) { //fl ▼ ---------------------- callback ~-=--~=~~==~=~=~-~--=~ ▼ fl// if (!current_node || !current_node->is_a(FLD_NODE_TYPE_Code)) return; Code_Node* nd = (Code_Node*)current_node; @@ -3454,7 +3451,7 @@ static void cb_1f(Fl_Tile* o, void* v) { //fl ▲ ----------=~~=~~-~---~-----------~~----=--~=~~-~-----= ▲ fl// } -static void cb_Function(fld::widget::Code_Editor* o, void* v) { +static void cb_Function(Code_Editor* o, void* v) { //fl ▼ ---------------------- callback --=~=----~=~~-=~-==--~ ▼ fl// if (!current_node || !current_node->is_a(FLD_NODE_TYPE_Function)) return; Function_Node* nd = (Function_Node*)current_node; @@ -3478,7 +3475,7 @@ static void cb_Function(fld::widget::Code_Editor* o, void* v) { //fl ▲ ----------=~=~=-=--~=~-----------~=-=~~~~~-=~~~=-=-~-- ▲ fl// } -static void cb_Return(fld::widget::Code_Editor* o, void* v) { +static void cb_Return(Code_Editor* o, void* v) { //fl ▼ ---------------------- callback -~=--~-~=~=~~~---=~~=~ ▼ fl// if (!current_node || !current_node->is_a(FLD_NODE_TYPE_Function)) return; Function_Node* nd = (Function_Node*)current_node; @@ -3708,7 +3705,7 @@ Fl_Double_Window* make_widget_panel() { o->labelsize(11); o->callback((Fl_Callback*)position_group_cb); o->align(Fl_Align(FL_ALIGN_LEFT)); - { widget_x_input = new fld::widget::Formula_Input(95, 150, 55, 20, "X:"); + { widget_x_input = new Formula_Input(95, 150, 55, 20, "X:"); widget_x_input->tooltip("The X position of the widget as a number or formula.\nFormulas can be simple " "math, including the variables\nx, px, sx, cx, and i"); widget_x_input->box(FL_DOWN_BOX); @@ -3722,8 +3719,8 @@ Fl_Double_Window* make_widget_panel() { widget_x_input->callback((Fl_Callback*)cb_widget_x_input); widget_x_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_x_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_x_input - { widget_y_input = new fld::widget::Formula_Input(155, 150, 55, 20, "Y:"); + } // Formula_Input* widget_x_input + { widget_y_input = new Formula_Input(155, 150, 55, 20, "Y:"); widget_y_input->tooltip("The Y position of the widget as a number or formula.\nFormulas can be simple " "math, including the variables\ny, py, sy, cy, and i"); widget_y_input->box(FL_DOWN_BOX); @@ -3737,8 +3734,8 @@ Fl_Double_Window* make_widget_panel() { widget_y_input->callback((Fl_Callback*)cb_widget_y_input); widget_y_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_y_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_y_input - { widget_w_input = new fld::widget::Formula_Input(215, 150, 55, 20, "Width:"); + } // Formula_Input* widget_y_input + { widget_w_input = new Formula_Input(215, 150, 55, 20, "Width:"); widget_w_input->tooltip("The width of the widget as a number or formula.\nFormulas can be simple math," " including the variables\nw, pw, sw, cw, and i"); widget_w_input->box(FL_DOWN_BOX); @@ -3752,8 +3749,8 @@ Fl_Double_Window* make_widget_panel() { widget_w_input->callback((Fl_Callback*)cb_widget_w_input); widget_w_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_w_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_w_input - { widget_h_input = new fld::widget::Formula_Input(275, 150, 55, 20, "Height:"); + } // Formula_Input* widget_w_input + { widget_h_input = new Formula_Input(275, 150, 55, 20, "Height:"); widget_h_input->tooltip("The height of the widget as a number or formula.\nFormulas can be simple math" ", including the variables\nh, ph, sh, ch, and i"); widget_h_input->box(FL_DOWN_BOX); @@ -3767,7 +3764,7 @@ Fl_Double_Window* make_widget_panel() { widget_h_input->callback((Fl_Callback*)cb_widget_h_input); widget_h_input->align(Fl_Align(FL_ALIGN_TOP_LEFT)); widget_h_input->when(FL_WHEN_RELEASE); - } // fld::widget::Formula_Input* widget_h_input + } // Formula_Input* widget_h_input { Fl_Choice* o = new Fl_Choice(335, 150, 64, 20, "Children:"); o->tooltip("When instantiating a widget class, the children can either be fixed in their " "original position, automatically be repositioned, or both repsositioned and re" @@ -4371,7 +4368,7 @@ Fl_Double_Window* make_widget_panel() { } // Fl_Group* o { Fl_Group* o = new Fl_Group(95, 223, 310, 82); o->box(FL_FLAT_BOX); - { wCallback = new fld::widget::Code_Editor(95, 225, 310, 80, "Callback:"); + { wCallback = new Code_Editor(95, 225, 310, 80, "Callback:"); wCallback->tooltip("The callback function or code for the widget. Use the variable name \'o\' to " "access the Widget pointer and \'v\' to access the user value."); wCallback->box(FL_DOWN_BOX); @@ -4387,7 +4384,7 @@ Fl_Double_Window* make_widget_panel() { wCallback->align(Fl_Align(FL_ALIGN_LEFT)); wCallback->when(FL_WHEN_RELEASE); Fl_Group::current()->resizable(wCallback); - } // fld::widget::Code_Editor* wCallback + } // Code_Editor* wCallback o->end(); } // Fl_Group* o o->end(); @@ -4825,7 +4822,7 @@ Fl_Double_Window* make_widget_panel() { o->labelsize(11); o->callback((Fl_Callback*)propagate_load); o->align(Fl_Align(FL_ALIGN_LEFT)); - { fld::widget::Code_Editor* o = new fld::widget::Code_Editor(95, 75, 310, 100, "Declaration:"); + { Code_Editor* o = new Code_Editor(95, 75, 310, 100, "Declaration:"); o->tooltip("a declaration: `int x;`, an external symbol: `extern int foo();`,\na `#` dire" "ctive: `#include `, a typedef `typedef char byte;`,\n or a `using` stat" "ement, etc."); @@ -4842,7 +4839,7 @@ Fl_Double_Window* make_widget_panel() { o->when(FL_WHEN_RELEASE); Fl_Group::current()->resizable(o); o->add_key_binding(FL_Tab, 0, use_tab_navigation); - } // fld::widget::Code_Editor* o + } // Code_Editor* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(15, 180, 390, 105); @@ -4924,7 +4921,7 @@ Fl_Double_Window* make_widget_panel() { { code_tabs_main = new Fl_Group(10, 30, 400, 330, "Code"); code_tabs_main->labelsize(11); code_tabs_main->callback((Fl_Callback*)propagate_load); - { fld::widget::Code_Editor* o = new fld::widget::Code_Editor(15, 40, 390, 315); + { Code_Editor* o = new Code_Editor(15, 40, 390, 315); o->box(FL_DOWN_BOX); o->color(FL_BACKGROUND2_COLOR); o->selection_color(FL_SELECTION_COLOR); @@ -4940,7 +4937,7 @@ Fl_Double_Window* make_widget_panel() { Fl_Group::current()->resizable(o); o->linenumber_width(60); o->linenumber_size(o->Fl_Text_Display::textsize()); - } // fld::widget::Code_Editor* o + } // Code_Editor* o code_tabs_main->end(); Fl_Group::current()->resizable(code_tabs_main); } // Fl_Group* code_tabs_main @@ -4998,7 +4995,7 @@ o->linenumber_size(o->Fl_Text_Display::textsize()); o->labelsize(11); o->callback((Fl_Callback*)propagate_load); o->align(Fl_Align(FL_ALIGN_LEFT)); - { fld::widget::Code_Editor* o = new fld::widget::Code_Editor(95, 100, 310, 50, "Function\nName and\nArgs:"); + { Code_Editor* o = new Code_Editor(95, 100, 310, 50, "Function\nName and\nArgs:"); o->tooltip("function name and args, or blank for `main(..)`"); o->box(FL_DOWN_FRAME); o->color(FL_BACKGROUND2_COLOR); @@ -5013,7 +5010,7 @@ o->linenumber_size(o->Fl_Text_Display::textsize()); o->when(FL_WHEN_RELEASE); Fl_Group::current()->resizable(o); o->add_key_binding(FL_Tab, 0, use_tab_navigation); - } // fld::widget::Code_Editor* o + } // Code_Editor* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(15, 155, 390, 60); @@ -5022,7 +5019,7 @@ o->linenumber_size(o->Fl_Text_Display::textsize()); o->labelsize(11); o->callback((Fl_Callback*)propagate_load); o->align(Fl_Align(FL_ALIGN_LEFT)); - { fld::widget::Code_Editor* o = new fld::widget::Code_Editor(95, 160, 310, 50, "Return Type:"); + { Code_Editor* o = new Code_Editor(95, 160, 310, 50, "Return Type:"); o->tooltip("return type, or blank to return outermost widget"); o->box(FL_DOWN_FRAME); o->color(FL_BACKGROUND2_COLOR); @@ -5037,7 +5034,7 @@ o->linenumber_size(o->Fl_Text_Display::textsize()); o->when(FL_WHEN_RELEASE); Fl_Group::current()->resizable(o); o->add_key_binding(FL_Tab, 0, use_tab_navigation); - } // fld::widget::Code_Editor* o + } // Code_Editor* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(15, 215, 390, 105); -- cgit v1.2.3