diff options
| author | Matthias Melcher <github@matthiasm.com> | 2025-11-29 12:57:08 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-29 12:57:08 +0100 |
| commit | 349b818d3fd4f568160537616857b9ff7d68d3aa (patch) | |
| tree | aa4deb3b74345abf0dd6584bd9e3139c5812e43d /fluid/panels/function_panel.fl | |
| parent | 725be0116f1d4dbcd64a99b555572341f2d29eda (diff) | |
Fluid: convert modal panels into tabs in the widget panel (#1339)
Diffstat (limited to 'fluid/panels/function_panel.fl')
| -rw-r--r-- | fluid/panels/function_panel.fl | 544 |
1 files changed, 3 insertions, 541 deletions
diff --git a/fluid/panels/function_panel.fl b/fluid/panels/function_panel.fl index d07af5c8c..23240f469 100644 --- a/fluid/panels/function_panel.fl +++ b/fluid/panels/function_panel.fl @@ -2,6 +2,7 @@ version 1.0500 header_name {.h} code_name {.cxx} +include_guard {} snap { ver 1 current_suite FLTK @@ -46,545 +47,6 @@ decl {\#include "widgets/Bin_Button.h"} {private global decl {\#include "widgets/Node_Browser.h"} {private local } -Function {use_tab_navigation(int, Fl_Text_Editor*)} { - comment {Allow widget navigation on text fields with Tab.} private return_type int -} { - code {return 0;} {} -} - -Function {make_function_panel()} {open -} { - Fl_Window function_panel { - label {Function/Method Properties} - xywh {540 418 343 232} type Double align 80 resizable modal visible - } { - Fl_Group {} {open - xywh {10 10 270 20} - } { - Fl_Choice f_public_member_choice {open - tooltip {Change member access attribute.} xywh {10 10 75 20} down_box BORDER_BOX labelsize 11 when 1 textsize 11 - } { - MenuItem {} { - label private - user_data 0 user_data_type long - xywh {5 5 100 20} labelsize 11 - } - MenuItem {} { - label public - user_data 1 user_data_type long - xywh {5 5 100 20} labelsize 11 - } - MenuItem {} { - label protected - user_data 2 user_data_type long - xywh {5 5 100 20} labelsize 11 - } - } - Fl_Choice f_public_choice {open - tooltip {Change widget accessibility.} xywh {10 10 75 20} down_box BORDER_BOX labelsize 11 when 1 textsize 11 - } { - MenuItem {} { - label static - user_data 0 user_data_type long - xywh {15 15 100 20} labelsize 11 - } - MenuItem {} { - label global - user_data 1 user_data_type long - xywh {15 15 100 20} labelsize 11 - } - MenuItem {} { - label local - user_data 2 user_data_type long - xywh {15 15 100 20} labelsize 11 - } - } - Fl_Light_Button f_c_button { - label {C declaration} - tooltip {Declare with a C interface instead of C++.} xywh {95 10 120 20} labelsize 11 - } - Fl_Box {} { - xywh {235 10 45 20} resizable - } - } - Fl_Input f_name_input { - label {Name(args): (blank for main())} - tooltip {The name of the function or method.} xywh {10 50 320 20} labelfont 1 labelsize 11 align 5 when 0 textfont 4 textsize 11 - } - Fl_Input f_return_type_input { - label {Return Type: (blank to return outermost widget)} - tooltip {The return type of the function or method.} xywh {10 90 320 20} labelfont 1 labelsize 11 align 5 when 0 textfont 4 textsize 11 - } - Fl_Text_Editor f_comment_input { - label {Comment:} - tooltip {Function comment in Doxygen format} xywh {10 125 320 65} box DOWN_BOX labelfont 1 labelsize 11 align 5 textfont 4 textsize 11 resizable - code0 {f_comment_input->buffer(new Fl_Text_Buffer());} - code1 {f_comment_input->add_key_binding(FL_Tab, 0, use_tab_navigation);} - } - Fl_Group {} {open - xywh {10 200 320 20} - } { - Fl_Return_Button f_panel_ok { - label OK - tooltip {Apply the changes.} xywh {220 200 50 20} labelsize 11 hotspot - } - Fl_Button f_panel_cancel { - label Cancel - tooltip {Cancel the changes.} xywh {280 200 50 20} labelsize 11 - } - Fl_Box {} { - xywh {10 200 205 20} resizable - } - } - } -} - -Function {make_code_panel()} {open -} { - Fl_Window code_panel { - label {Code Properties} - callback {if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape) - return; // ignore Escape -code_panel->hide(); // otherwise hide..} - xywh {539 567 540 180} type Double labelsize 11 hide resizable - code0 {o->size_range(200, 150);} modal - } { - Fl_Text_Editor code_input { - xywh {10 10 520 130} box DOWN_BOX labelsize 11 textfont 4 textsize 11 resizable - code0 {o->when(FL_WHEN_ENTER_KEY_CHANGED|FL_WHEN_RELEASE);} - code1 {\#include "widgets/Code_Editor.h"} - class {fld::widget::Code_Editor} - } - Fl_Group {} {open - xywh {10 150 520 20} labelsize 11 - } { - Fl_Return_Button code_panel_ok { - label OK - xywh {400 150 60 20} labelsize 11 hotspot - } - Fl_Button code_panel_cancel { - label Cancel - xywh {470 150 60 20} labelsize 11 - } - Fl_Box {} { - xywh {10 150 380 20} labelsize 11 resizable - } - } - } - code {// Enable line numbers -code_input->linenumber_width(60); -code_input->linenumber_size(code_input->Fl_Text_Display::textsize());} {} -} - -Function {make_codeblock_panel()} {open -} { - Fl_Window codeblock_panel { - label {Code Block Properties} - xywh {806 735 300 115} type Double labelsize 11 hide resizable - code0 {o->size_range(o->w(), o->h(), Fl::w(), o->h());} modal - } { - Fl_Input code_before_input { - label {Conditional code block} - tooltip {\#ifdef or similar conditional code block.} xywh {10 15 280 20} labelsize 11 align 5 when 0 textfont 4 textsize 11 - } - Fl_Input code_after_input { - label {"{...child code...}" is inserted here} - tooltip {\#endif or similar conditional code block.} xywh {10 55 280 20} labelsize 11 align 5 when 0 textfont 4 textsize 11 resizable - } - Fl_Group {} {open - xywh {10 85 280 20} - } { - Fl_Return_Button codeblock_panel_ok { - label OK - xywh {160 85 60 20} labelsize 11 hotspot - } - Fl_Button codeblock_panel_cancel { - label Cancel - xywh {230 85 60 20} shortcut 0xff1b labelsize 11 - } - Fl_Box {} { - xywh {10 85 140 20} resizable - } - } - } -} - -Function {make_declblock_panel()} {open -} { - Fl_Window declblock_panel { - label {Declaration Block Properties} open - xywh {645 452 300 355} type Double labelsize 11 align 80 resizable - code0 {o->size_range(o->w(), o->h(), Fl::w(), o->h());} modal size_range {300 355 0 0} visible - } { - Fl_Input declblock_before_input { - label {Start Code:} - tooltip {\#ifdef or similar conditional declaration block.} xywh {10 23 280 20} labelfont 1 labelsize 11 align 5 when 0 textfont 4 textsize 11 - } - Fl_Box {} { - label {"\\n...child code...\\n" is inserted here} - xywh {10 48 280 20} labelsize 11 - } - Fl_Input declblock_after_input { - label {End Code:} - tooltip {\#endif or similar declaration code block.} xywh {10 80 280 20} labelfont 1 labelsize 11 align 5 when 0 textfont 4 textsize 11 - } - Fl_Group {} {open - xywh {10 105 280 120} - } { - Fl_Box {} { - label {Enclose code generated by children in source file:} - xywh {10 105 270 20} labelsize 11 align 20 - } - Fl_Check_Button declblock_code_source { - label implementations - xywh {20 125 260 20} down_box DOWN_BOX labelsize 11 - } - Fl_Check_Button declblock_static_source { - label {static initializations and callbacks} - xywh {20 145 260 20} down_box DOWN_BOX labelsize 11 - } - Fl_Box {} { - label {Enclose code in header file:} - xywh {10 165 270 20} labelsize 11 align 20 - } - Fl_Check_Button declblock_code_header { - label {forward declarations} - xywh {20 185 260 20} down_box DOWN_BOX labelsize 11 - } - Fl_Check_Button declblock_static_header { - label {preprecessor and callback declarations} - xywh {20 205 260 20} down_box DOWN_BOX labelsize 11 - } - Fl_Box {} { - xywh {280 105 10 120} labelsize 11 hide resizable - } - } - Fl_Text_Editor declblock_comment_input { - label {Comment:} - tooltip {Declaration comment in Doxygen format} xywh {10 242 280 65} box DOWN_BOX labelfont 1 labelsize 11 align 5 textfont 4 textsize 11 resizable - code0 {declblock_comment_input->buffer(new Fl_Text_Buffer());} - code1 {declblock_comment_input->add_key_binding(FL_Tab, 0, use_tab_navigation);} - } - Fl_Group {} { - xywh {10 321 280 20} - } { - Fl_Return_Button declblock_panel_ok { - label OK - xywh {160 321 60 20} labelsize 11 hotspot - } - Fl_Button declblock_panel_cancel { - label Cancel - xywh {230 321 60 20} shortcut 0xff1b labelsize 11 - } - Fl_Box {} { - xywh {10 321 140 20} resizable - } - } - } -} - -Function {make_decl_panel()} {open -} { - Fl_Window decl_panel { - label {Declaration Properties} - xywh {497 618 343 262} type Double align 80 resizable size_range {343 262 0 0} visible - } { - Fl_Group {} { - xywh {10 10 270 20} - } { - Fl_Box {} { - xywh {200 10 80 20} resizable - } - Fl_Choice decl_choice { - xywh {10 10 185 20} down_box BORDER_BOX labelsize 11 textsize 11 - } { - MenuItem {} { - label {in source file only} - xywh {0 0 100 20} labelsize 11 - } - MenuItem {} { - label {in header file only} - xywh {0 0 100 20} labelsize 11 - } - MenuItem {} { - label {"static" in source file} - xywh {0 0 100 20} labelsize 11 - } - MenuItem {} { - label {in source and "extern" in header} - xywh {0 0 100 20} labelsize 11 - } - } - Fl_Choice decl_class_choice { - xywh {10 10 75 20} down_box BORDER_BOX labelsize 11 textsize 11 - } { - MenuItem {} { - label private - xywh {10 10 100 20} labelsize 11 - } - MenuItem {} { - label public - xywh {10 10 100 20} labelsize 11 - } - MenuItem {} { - label protected - xywh {10 10 100 20} labelsize 11 - } - } - } - Fl_Tile {} {open - xywh {10 40 320 180} resizable - code2 {o->size_range(0, 320, 100);} - code3 {o->size_range(1, 320, 60);} - } { - Fl_Group {} {open - xywh {10 40 320 100} box FLAT_BOX resizable - } { - Fl_Text_Editor decl_input { - label {This can be any declaration, like "int x;", an external symbol like "extern int foo();", a \#directive like "\#include <foo.h>", a comment like "//foo" or "/*foo*/", or typedef like "typedef char byte;" or "using std::list;".} - xywh {10 40 320 45} labelsize 11 align 134 resizable - code0 {\#include "widgets/Code_Editor.h"} - class {fld::widget::Code_Editor} - } - Fl_Box {} { - xywh {20 139 300 1} box BORDER_FRAME color 43 - } - } - Fl_Group {} {open - xywh {10 140 320 80} box FLAT_BOX - } { - Fl_Text_Editor decl_comment_input { - label {Comment:} - tooltip {Declaration comment in Doxygen format} xywh {10 155 320 64} box DOWN_BOX labelfont 1 labelsize 11 align 5 textfont 4 textsize 11 resizable - code0 {decl_comment_input->buffer(new Fl_Text_Buffer());} - code1 {decl_comment_input->add_key_binding(FL_Tab, 0, use_tab_navigation);} - } - } - } - Fl_Group {} {open - xywh {10 230 320 20} - } { - Fl_Return_Button decl_panel_ok { - label OK - xywh {200 230 60 20} labelsize 11 hotspot - } - Fl_Button decl_panel_cancel { - label Cancel - xywh {270 230 60 20} shortcut 0xff1b labelsize 11 - } - Fl_Box {} { - xywh {10 230 185 20} resizable - } - } - } -} - -Function {make_data_panel()} {open -} { - Fl_Window data_panel { - label {Inline Data Properties} - xywh {567 382 343 264} type Double align 80 resizable size_range {343 237 0 0} visible - } { - Fl_Group {} {open - xywh {10 10 320 48} - } { - Fl_Box {} { - xywh {288 10 42 20} resizable - } - Fl_Choice data_choice {open - xywh {10 10 185 20} down_box BORDER_BOX labelsize 11 textsize 11 - } { - MenuItem {} { - label {in source file only} - xywh {0 0 100 20} labelsize 11 - } - MenuItem {} { - label {in header file only} - xywh {0 0 100 20} labelsize 11 hide - } - MenuItem {} { - label {"static" in source file} - xywh {0 0 100 20} labelsize 11 - } - MenuItem {} { - label {in source and "extern" in header} - xywh {0 0 100 20} labelsize 11 - } - } - Fl_Choice data_class_choice {open - xywh {10 10 75 20} down_box BORDER_BOX labelsize 11 textsize 11 - } { - MenuItem {} { - label private - xywh {10 10 100 20} labelsize 11 - } - MenuItem {} { - label public - xywh {10 10 100 20} labelsize 11 - } - MenuItem {} { - label protected - xywh {10 10 100 20} labelsize 11 - } - } - Fl_Choice data_mode {open - tooltip {text mode generates a "const char*" and a trailing NUL, compressed mode uses zlib to generate a binary block} xywh {10 38 185 20} down_box BORDER_BOX labelsize 11 textsize 11 - } { - MenuItem {} { - label {binary mode} - user_data 0 user_data_type long - xywh {0 0 100 20} labelsize 11 - } - MenuItem {} { - label {text mode} - user_data 1 user_data_type long - xywh {0 0 100 20} labelsize 11 - } - MenuItem {} { - label {compressed binary} - user_data 2 user_data_type long - xywh {0 0 100 20} labelsize 11 - } - } - } - Fl_Input data_input { - label {Variable Name:} - tooltip {Inline Data variables are declared "const unsigned char []" in binary mode and "const char*" in text mode.} xywh {10 78 320 20} labelfont 1 labelsize 11 align 133 when 0 textfont 4 textsize 11 - } - Fl_Input data_filename { - label {Filename:} - tooltip {Name and path of file that will be inlined.} xywh {10 116 280 20} labelfont 1 labelsize 11 align 133 when 0 textfont 4 textsize 11 - } - Fl_Button data_filebrowser { - label {@fileopen} - xywh {290 116 40 20} labelcolor 134 - } - Fl_Text_Editor data_comment_input { - label {Comment:} - tooltip {Declaration comment in Doxygen format} xywh {10 156 320 65} box DOWN_BOX labelfont 1 labelsize 11 align 5 textfont 4 textsize 11 resizable - code0 {data_comment_input->buffer(new Fl_Text_Buffer());} - code1 {data_comment_input->add_key_binding(FL_Tab, 0, use_tab_navigation);} - } - Fl_Group {} {open - xywh {10 231 320 20} - } { - Fl_Return_Button data_panel_ok { - label OK - xywh {200 231 60 20} labelsize 11 hotspot - } - Fl_Button data_panel_cancel { - label Cancel - xywh {270 231 60 20} shortcut 0xff1b labelsize 11 - } - Fl_Box {} { - xywh {10 231 185 20} resizable - } - } - } -} - -Function {make_class_panel()} {open -} { - Fl_Window class_panel { - label {Class Properties} - xywh {795 337 342 196} type Double labelsize 11 hide resizable modal size_range {343 188 0 0} - } { - Fl_Group {} {open - xywh {10 10 280 20} hide - } { - Fl_Light_Button c_public_button { - label public - tooltip {Make the class publicly accessible.} xywh {10 10 60 20} labelsize 11 when 0 hide - } - Fl_Box {} { - xywh {80 10 210 20} resizable - } - } - Fl_Input c_name_input { - label {Name:} - tooltip {Name of class.} xywh {10 20 320 20} labelfont 1 labelsize 11 align 5 when 0 textfont 4 textsize 11 - } - Fl_Input c_subclass_input { - label {Subclass of (text between : and \{)} - tooltip {Name of subclass.} xywh {10 55 320 20} labelfont 1 labelsize 11 align 5 when 0 textfont 4 textsize 11 - } - Fl_Text_Editor c_comment_input { - label {Comment:} - tooltip {Class comment in Doxygen format} xywh {10 90 320 65} box DOWN_BOX labelfont 1 labelsize 11 align 5 textfont 4 textsize 11 resizable - code0 {c_comment_input->buffer(new Fl_Text_Buffer());} - code1 {c_comment_input->add_key_binding(FL_Tab, 0, use_tab_navigation);} - } - Fl_Group {} {open - xywh {10 165 320 20} - } { - Fl_Return_Button c_panel_ok { - label OK - xywh {200 165 60 20} labelsize 11 hotspot - } - Fl_Button c_panel_cancel { - label Cancel - xywh {270 165 60 20} shortcut 0xff1b labelsize 11 - } - Fl_Box {} { - xywh {10 165 185 20} resizable - } - } - } -} - -Function {make_comment_panel()} {open -} { - Fl_Window comment_panel { - label {Comment Properties} - xywh {519 374 550 280} type Double labelsize 11 hide resizable - code0 {o->size_range(320, 180);} modal - } { - Fl_Text_Editor comment_input { - xywh {110 10 430 230} box DOWN_BOX labelsize 11 textfont 4 textsize 11 textcolor 58 resizable - code0 {o->when(FL_WHEN_ENTER_KEY_CHANGED|FL_WHEN_RELEASE);} - code1 {o->buffer(new Fl_Text_Buffer());} - } - Fl_Group {} {open - xywh {110 250 430 20} labelsize 11 - } { - Fl_Return_Button comment_panel_ok { - label OK - xywh {370 250 80 20} labelsize 11 hotspot - } - Fl_Button comment_panel_cancel { - label Cancel - xywh {460 250 80 20} shortcut 0xff1b labelsize 11 - } - Fl_Box {} { - xywh {110 250 250 20} labelsize 11 resizable - } - } - Fl_Group {} {open - xywh {10 10 90 243} labelsize 11 - } { - Fl_Light_Button comment_in_source { - label {In Source} - tooltip {Put the comment into the source (.cxx) file.} xywh {10 10 90 20} labelsize 11 when 0 - } - Fl_Light_Button comment_in_header { - label {In Header} - tooltip {Put the comment into the header (.h) file.} xywh {10 40 90 20} labelsize 11 when 0 - } - Fl_Menu_Button comment_predefined { - label Predefined open - xywh {10 70 90 20} labelsize 11 textsize 11 - } {} - Fl_Button comment_load { - label {Import...} - xywh {10 100 90 20} labelsize 11 - } - Fl_Box {} { - xywh {10 132 90 121} labelsize 11 resizable - } - } - } -} - Function {type_make_cb(Fl_Widget*,void*d)} {open return_type void } { code {const char *type_name = (const char*)d; @@ -601,7 +63,7 @@ Function {make_widgetbin()} {open callback {if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape) Fluid.quit(); else - Fluid.toggle_widget_bin();} open + Fluid.toggle_widget_bin();} xywh {395 227 600 102} type Single align 80 non_modal visible } { Fl_Group {} { @@ -677,7 +139,7 @@ else } Fl_Button {} { user_data {"Fl_Group"} - callback type_make_cb selected + callback type_make_cb tooltip Group xywh {114 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[(int)Type::Group]);} class {fld::widget::Bin_Button} |
