summaryrefslogtreecommitdiff
path: root/fluid/app/Menu.cxx
diff options
context:
space:
mode:
authormaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 02:33:41 +0500
committermaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 02:33:41 +0500
commit43e0a37906afabb0b3b091b8d3eac9a910cae50c (patch)
treed2a037c2bf0dc395fddb08e32ebfcf2795503b7c /fluid/app/Menu.cxx
parent4ce4967c33d56e4b56d85d11fe0e0be91e159f5d (diff)
wip
Diffstat (limited to 'fluid/app/Menu.cxx')
-rw-r--r--fluid/app/Menu.cxx79
1 files changed, 38 insertions, 41 deletions
diff --git a/fluid/app/Menu.cxx b/fluid/app/Menu.cxx
index ab03a822d..54db5801f 100644
--- a/fluid/app/Menu.cxx
+++ b/fluid/app/Menu.cxx
@@ -35,11 +35,8 @@ extern void layout_suite_marker(Fl_Widget *, void *user_data);
extern void select_layout_preset_cb(Fl_Widget *, void *user_data);
extern Fl_Menu_Item main_layout_submenu_[];
-using namespace fld;
-
-
void write_cb(Fl_Widget *, void *) {
- Fluid.write_code_files();
+ Fluid.write_code_files(0);
}
void openwidget_cb(Fl_Widget *, void *) { Fluid.edit_selected(); }
void copy_cb(Fl_Widget*, void*) { Fluid.copy_selected(); }
@@ -59,13 +56,13 @@ void manual_cb(Fl_Widget *, void *) {
Fluid.show_help("index.html");
}
-static void menu_file_new_cb(Fl_Widget *, void *) { Fluid.new_project(); }
+static void menu_file_new_cb(Fl_Widget *, void *) { Fluid.new_project(1); }
static void menu_file_new_from_template_cb(Fl_Widget *, void *) { Fluid.new_project_from_template(); }
static void menu_file_open_cb(Fl_Widget *, void *) { Fluid.open_project_file(""); }
static void menu_file_insert_cb(Fl_Widget *, void *) { Fluid.merge_project_file(""); }
void menu_file_save_cb(Fl_Widget *, void *arg) { Fluid.save_project_file(arg); }
static void menu_file_print_cb(Fl_Widget *, void *arg) { Fluid.print_snapshots(); }
-void menu_file_open_history_cb(Fl_Widget *, void *v) { Fluid.open_project_file(std::string((const char*)v)); }
+void menu_file_open_history_cb(Fl_Widget *, void *v) { Fluid.open_project_file((const char*)v); }
static void menu_layout_sync_resize_cb(Fl_Menu_ *m, void*) {
if (m->mvalue()->value()) Fluid.proj.tree.allow_layout = 1; else Fluid.proj.tree.allow_layout = 0;
}
@@ -88,21 +85,21 @@ void toggle_widgetbin_cb(Fl_Widget *, void *) { Fluid.toggle_widget_bin(); }
\todo Shortcuts are all over the place (Alt, Ctrl, Command, Shift-Ctrl,
function keys), and there should be a help page listing all shortcuts.
*/
-Fl_Menu_Item Application::main_menu[] = {
- {"&File",0,nullptr,nullptr,FL_SUBMENU},
+Fl_Menu_Item fld::Application::main_menu[] = {
+ {"&File",0,0,0,FL_SUBMENU},
{"&New", FL_COMMAND+'n', menu_file_new_cb},
{"&Open...", FL_COMMAND+'o', menu_file_open_cb},
- {"&Insert...", FL_COMMAND+'i', menu_file_insert_cb, nullptr, FL_MENU_DIVIDER},
- {"&Save", FL_COMMAND+'s', menu_file_save_cb, nullptr},
+ {"&Insert...", FL_COMMAND+'i', menu_file_insert_cb, 0, FL_MENU_DIVIDER},
+ {"&Save", FL_COMMAND+'s', menu_file_save_cb, 0},
{"Save &As...", FL_COMMAND+FL_SHIFT+'s', menu_file_save_cb, (void*)1},
{"Sa&ve A Copy...", 0, menu_file_save_cb, (void*)2},
- {"&Revert...", 0, menu_file_revert_cb, nullptr, FL_MENU_DIVIDER},
- {"New &From Template...", FL_COMMAND+'N', menu_file_new_from_template_cb, nullptr},
- {"Save As &Template...", 0, save_template_cb, nullptr, FL_MENU_DIVIDER},
+ {"&Revert...", 0, menu_file_revert_cb, 0, FL_MENU_DIVIDER},
+ {"New &From Template...", FL_COMMAND+'N', menu_file_new_from_template_cb, 0},
+ {"Save As &Template...", 0, save_template_cb, 0, FL_MENU_DIVIDER},
{"&Print...", FL_COMMAND+'p', menu_file_print_cb},
- {"Write &Code", FL_COMMAND+FL_SHIFT+'c', write_cb, nullptr},
+ {"Write &Code", FL_COMMAND+FL_SHIFT+'c', write_cb, 0},
{"MergeBack Code", FL_COMMAND+FL_SHIFT+'m', mergeback_cb, 0},
- {"&Write Strings", FL_COMMAND+FL_SHIFT+'w', write_strings_cb, nullptr, FL_MENU_DIVIDER},
+ {"&Write Strings", FL_COMMAND+FL_SHIFT+'w', write_strings_cb, 0, FL_MENU_DIVIDER},
{Fluid.history.relpath[0], FL_COMMAND+'1', menu_file_open_history_cb, Fluid.history.abspath[0]},
{Fluid.history.relpath[1], FL_COMMAND+'2', menu_file_open_history_cb, Fluid.history.abspath[1]},
{Fluid.history.relpath[2], FL_COMMAND+'3', menu_file_open_history_cb, Fluid.history.abspath[2]},
@@ -114,67 +111,67 @@ Fl_Menu_Item Application::main_menu[] = {
{Fluid.history.relpath[8], FL_COMMAND+'9', menu_file_open_history_cb, Fluid.history.abspath[8]},
{Fluid.history.relpath[9], 0, menu_file_open_history_cb, Fluid.history.abspath[9], FL_MENU_DIVIDER},
{"&Quit", FL_COMMAND+'q', exit_cb},
- {nullptr},
- {"&Edit",0,nullptr,nullptr,FL_SUBMENU},
+ {0},
+ {"&Edit",0,0,0,FL_SUBMENU},
{"&Undo", FL_COMMAND+'z', fld::proj::Undo::undo_cb},
- {"&Redo", FL_COMMAND+FL_SHIFT+'z', fld::proj::Undo::redo_cb, nullptr, FL_MENU_DIVIDER},
+ {"&Redo", FL_COMMAND+FL_SHIFT+'z', fld::proj::Undo::redo_cb, 0, FL_MENU_DIVIDER},
{"C&ut", FL_COMMAND+'x', cut_cb},
{"&Copy", FL_COMMAND+'c', copy_cb},
{"&Paste", FL_COMMAND+'v', paste_cb},
{"Dup&licate", FL_COMMAND+'u', duplicate_cb},
- {"&Delete", FL_Delete, delete_cb, nullptr, FL_MENU_DIVIDER},
+ {"&Delete", FL_Delete, delete_cb, 0, FL_MENU_DIVIDER},
{"Select &All", FL_COMMAND+'a', select_all_cb},
- {"Select &None", FL_COMMAND+FL_SHIFT+'a', select_none_cb, nullptr, FL_MENU_DIVIDER},
+ {"Select &None", FL_COMMAND+FL_SHIFT+'a', select_none_cb, 0, FL_MENU_DIVIDER},
{"Pr&operties...", FL_F+1, openwidget_cb},
{"&Sort",0,sort_cb},
{"&Earlier", FL_F+2, earlier_cb},
{"&Later", FL_F+3, later_cb},
{"&Group", FL_F+7, group_cb},
- {"Ung&roup", FL_F+8, ungroup_cb,nullptr, FL_MENU_DIVIDER},
+ {"Ung&roup", FL_F+8, ungroup_cb,0, FL_MENU_DIVIDER},
{"Hide O&verlays",FL_COMMAND+FL_SHIFT+'o',toggle_overlays},
{"Hide Guides",FL_COMMAND+FL_SHIFT+'g',toggle_guides},
{"Hide Restricted",FL_COMMAND+FL_SHIFT+'r',toggle_restricted},
{"Show Widget &Bin...",FL_ALT+'b',toggle_widgetbin_cb},
- {"Show Code View",FL_ALT+'c', (Fl_Callback*)toggle_codeview_cb, nullptr, FL_MENU_DIVIDER},
+ {"Show Code View",FL_ALT+'c', (Fl_Callback*)toggle_codeview_cb, 0, FL_MENU_DIVIDER},
{"Settings...",FL_ALT+'p',show_settings_cb},
- {nullptr},
- {"&New", 0, nullptr, (void *)New_Menu, FL_SUBMENU_POINTER},
- {"&Layout",0,nullptr,nullptr,FL_SUBMENU},
- {"&Align",0,nullptr,nullptr,FL_SUBMENU},
+ {0},
+ {"&New", 0, 0, (void *)New_Menu, FL_SUBMENU_POINTER},
+ {"&Layout",0,0,0,FL_SUBMENU},
+ {"&Align",0,0,0,FL_SUBMENU},
{"&Left",0,(Fl_Callback *)align_widget_cb,(void*)10},
{"&Center",0,(Fl_Callback *)align_widget_cb,(void*)11},
{"&Right",0,(Fl_Callback *)align_widget_cb,(void*)12},
{"&Top",0,(Fl_Callback *)align_widget_cb,(void*)13},
{"&Middle",0,(Fl_Callback *)align_widget_cb,(void*)14},
{"&Bottom",0,(Fl_Callback *)align_widget_cb,(void*)15},
- {nullptr},
- {"&Space Evenly",0,nullptr,nullptr,FL_SUBMENU},
+ {0},
+ {"&Space Evenly",0,0,0,FL_SUBMENU},
{"&Across",0,(Fl_Callback *)align_widget_cb,(void*)20},
{"&Down",0,(Fl_Callback *)align_widget_cb,(void*)21},
- {nullptr},
- {"&Make Same Size",0,nullptr,nullptr,FL_SUBMENU},
+ {0},
+ {"&Make Same Size",0,0,0,FL_SUBMENU},
{"&Width",0,(Fl_Callback *)align_widget_cb,(void*)30},
{"&Height",0,(Fl_Callback *)align_widget_cb,(void*)31},
{"&Both",0,(Fl_Callback *)align_widget_cb,(void*)32},
- {nullptr},
- {"&Center In Group",0,nullptr,nullptr,FL_SUBMENU},
+ {0},
+ {"&Center In Group",0,0,0,FL_SUBMENU},
{"&Horizontal",0,(Fl_Callback *)align_widget_cb,(void*)40},
{"&Vertical",0,(Fl_Callback *)align_widget_cb,(void*)41},
- {nullptr},
- {"Synchronized Resize", 0, (Fl_Callback*)menu_layout_sync_resize_cb, nullptr, FL_MENU_TOGGLE|FL_MENU_DIVIDER },
- {"&Grid and Size Settings...",FL_COMMAND+'g',show_grid_cb, nullptr, FL_MENU_DIVIDER},
+ {0},
+ {"Synchronized Resize", 0, (Fl_Callback*)menu_layout_sync_resize_cb, 0, FL_MENU_TOGGLE|FL_MENU_DIVIDER },
+ {"&Grid and Size Settings...",FL_COMMAND+'g',show_grid_cb, 0, FL_MENU_DIVIDER},
{"Presets", 0, layout_suite_marker, (void*)main_layout_submenu_, FL_SUBMENU_POINTER },
- {"Application", 0, select_layout_preset_cb, (void*)nullptr, FL_MENU_RADIO|FL_MENU_VALUE },
+ {"Application", 0, select_layout_preset_cb, (void*)0, FL_MENU_RADIO|FL_MENU_VALUE },
{"Dialog", 0, select_layout_preset_cb, (void*)1, FL_MENU_RADIO },
{"Toolbox", 0, select_layout_preset_cb, (void*)2, FL_MENU_RADIO },
- {nullptr},
+ {0},
{"&Shell", 0, Fd_Shell_Command_List::menu_marker, (void*)Fd_Shell_Command_List::default_menu, FL_SUBMENU_POINTER},
- {"&Help",0,nullptr,nullptr,FL_SUBMENU},
+ {"&Help",0,0,0,FL_SUBMENU},
{"&Rapid development with FLUID...",0,help_cb},
- {"&FLTK Programmers Manual...",0,manual_cb, nullptr, FL_MENU_DIVIDER},
+ {"&FLTK Programmers Manual...",0,manual_cb, 0, FL_MENU_DIVIDER},
{"&About FLUID...",0,about_cb},
- {nullptr},
-{nullptr}};
+ {0},
+{0}};
/**
Show or hide the code preview window.