diff options
| author | Matthias Melcher <git@matthiasm.com> | 2021-12-11 19:43:00 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2021-12-13 18:17:07 +0100 |
| commit | 160832ce04f932fbb3df199aa01d1c93148bb292 (patch) | |
| tree | d1ce303700666997a8608b7a488a25e633f07804 /fluid/function_panel.fl | |
| parent | a802aaeb170e3c233c5d92ae29d8703a0b9c2768 (diff) | |
STR 3442: copy/paste now inserts widget as expected.
Fluid would add pasted widgets as the last child of the
current group, even if they were cut at the beginning
of the group. This patch adds a 'startegy' to adding
widgets to allow merging closer to the 'current' widget.
Also added d'n'd for the widget bin and some other
UI improvements.
STR 3442: some preparation, variable renaming
STR 3442: unifying functions to add widgets.
Adding widgets interactively is merged into one function,
making undo/redo work as expected and removing
unexpected differences between adding by menu or bin.
STR 3442: adding drag'n'drop for windows from bin.
Just drag the window symbol out of the tree and drop it anywhere
on the desktop.
Visual representation of dragged Window.
STR 3442: insert individual nodes after 'current'
STR 3442: adding new widget at expected positions.
The widget bin can finally do drag'n'drop.
Widgets appear in the tree close to the last selection.
Duplicating now ads right below.
Cut and paste inserts after last selection.
Fluid: replaced #define with strict enum type.
Diffstat (limited to 'fluid/function_panel.fl')
| -rw-r--r-- | fluid/function_panel.fl | 69 |
1 files changed, 55 insertions, 14 deletions
diff --git a/fluid/function_panel.fl b/fluid/function_panel.fl index df0e307b2..e3f4d76de 100644 --- a/fluid/function_panel.fl +++ b/fluid/function_panel.fl @@ -25,6 +25,9 @@ comment {// decl {\#include "fluid.h"} {private local } +decl {\#include "Shortcut_Button.h"} {private global +} + decl {\#include "pixmaps.h"} {private local } @@ -84,7 +87,7 @@ Function {make_function_panel()} {open } MenuItem {} { label global - user_data 1 user_data_type long selected + user_data 1 user_data_type long xywh {15 15 100 20} labelsize 11 } } @@ -522,18 +525,10 @@ Function {make_comment_panel()} {} { } } -Function {type_make_cb(Fl_Widget*,void*d)} {return_type void +Function {type_make_cb(Fl_Widget*,void*d)} {open return_type void } { - code {undo_checkpoint(); - Fl_Type *t = Fl_Type_make((char*)d); - if (t) { - select_only(t); - set_modflag(1); - t->open(); - } else { - undo_current --; - undo_last --; - }} {} + code {const char *type_name = (const char*)d; +add_new_widget_from_user(type_name);} {} } Function {make_widgetbin()} {open @@ -543,7 +538,7 @@ Function {make_widgetbin()} {open callback {if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape) exit_cb((Fl_Widget*)o, v); else - toggle_widgetbin_cb((Fl_Widget*)o, v);} + toggle_widgetbin_cb((Fl_Widget*)o, v);} open xywh {449 206 600 102} type Single align 80 non_modal visible } { Fl_Group {} { @@ -611,45 +606,52 @@ else } { Fl_Button {} { user_data {"Fl_Window"} - callback type_make_cb + callback type_make_cb selected tooltip Window xywh {89 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[1]);} + class Widget_Bin_Window_Button } Fl_Button {} { user_data {"Fl_Group"} callback type_make_cb tooltip Group xywh {114 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[6]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Pack"} callback type_make_cb tooltip Pack xywh {139 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[22]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Tabs"} callback type_make_cb tooltip Tabs xywh {89 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[13]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Scroll"} callback type_make_cb tooltip Scroll xywh {114 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[19]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Tile"} callback type_make_cb tooltip Tile xywh {89 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[20]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Wizard"} callback type_make_cb tooltip Wizard xywh {114 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[21]);} + class Widget_Bin_Button } } Fl_Group {} { @@ -661,36 +663,42 @@ else callback type_make_cb tooltip Button xywh {173 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[2]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Return_Button"} callback type_make_cb tooltip {Return Button} xywh {198 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[23]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Light_Button"} callback type_make_cb tooltip {Light Button} xywh {173 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[24]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Repeat_Button"} callback type_make_cb tooltip {Repeat Button} xywh {198 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[25]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Check_Button"} callback type_make_cb tooltip {Check Button} xywh {173 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[3]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Round_Button"} callback type_make_cb tooltip {Round Button} xywh {198 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[4]);} + class Widget_Bin_Button } } Fl_Group {} { @@ -702,60 +710,70 @@ else callback type_make_cb tooltip Slider xywh {232 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[37]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Scrollbar"} callback type_make_cb tooltip {Scroll Bar} xywh {257 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[38]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Value_Slider"} callback type_make_cb tooltip {Value Slider} xywh {282 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[39]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Value_Output"} callback type_make_cb tooltip {Value Output} xywh {307 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[45]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Adjuster"} callback type_make_cb tooltip Adjuster xywh {232 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[40]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Counter"} callback type_make_cb tooltip Counter xywh {257 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[41]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Dial"} callback type_make_cb tooltip Dial xywh {282 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[42]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Roller"} callback type_make_cb tooltip Roller xywh {232 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[43]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Spinner"} callback type_make_cb tooltip Spinner xywh {257 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[47]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Value_Input"} callback type_make_cb tooltip {Value Input} xywh {282 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[44]);} + class Widget_Bin_Button } } Fl_Group {} { @@ -767,36 +785,42 @@ else callback type_make_cb tooltip Input xywh {341 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[14]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Output"} callback type_make_cb tooltip Output xywh {366 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[27]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Text_Editor"} callback type_make_cb tooltip {Text Edit} xywh {341 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[29]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Text_Display"} callback type_make_cb tooltip {Text Display} xywh {366 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[28]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_File_Input"} callback type_make_cb tooltip {File Input} xywh {341 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[30]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Simple_Terminal"} callback type_make_cb tooltip {Simple Terminal} xywh {366 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[52]);} + class Widget_Bin_Button } } Fl_Group {} { @@ -808,48 +832,56 @@ else callback type_make_cb tooltip {Input Choice} xywh {400 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[53]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"menuitem"} callback type_make_cb tooltip {Menu Item} xywh {425 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[16]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Menu_Bar"} callback type_make_cb tooltip {Menu Bar} xywh {450 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[17]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Menu_Button"} callback type_make_cb tooltip {Menu Button} xywh {400 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[26]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"checkmenuitem"} callback type_make_cb tooltip {Checkbox Menu Item} xywh {425 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[54]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"submenu"} callback type_make_cb tooltip {Sub Menu} xywh {450 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[18]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Choice"} callback type_make_cb tooltip Choice xywh {400 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[15]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"radiomenuitem"} callback type_make_cb tooltip {Radio Menu Item} xywh {425 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[55]);} + class Widget_Bin_Button } } Fl_Group {} { @@ -861,36 +893,42 @@ else callback type_make_cb tooltip Browser xywh {484 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[31]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Tree"} callback type_make_cb tooltip Tree xywh {509 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[50]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Check_Browser"} callback type_make_cb tooltip {Check Browser} xywh {484 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[32]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Help_View"} callback type_make_cb tooltip {Help Browser} xywh {509 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[35]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_File_Browser"} callback type_make_cb tooltip {File Browser} xywh {484 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[33]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Table"} callback type_make_cb tooltip Table xywh {509 71 24 24} box THIN_UP_BOX code0 {o->image(pixmap[51]);} + class Widget_Bin_Button } } Fl_Group {} { @@ -902,18 +940,21 @@ else callback type_make_cb tooltip Box xywh {542 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[5]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Clock"} callback type_make_cb tooltip Clock xywh {567 21 24 24} box THIN_UP_BOX code0 {o->image(pixmap[34]);} + class Widget_Bin_Button } Fl_Button {} { user_data {"Fl_Progress"} callback type_make_cb tooltip Progress xywh {542 46 24 24} box THIN_UP_BOX code0 {o->image(pixmap[36]);} + class Widget_Bin_Button } } } |
