summaryrefslogtreecommitdiff
path: root/fluid/panels/settings_panel.fl
diff options
context:
space:
mode:
authormaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 19:04:24 +0500
committermaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 19:04:24 +0500
commit793fa5a91f24358aa7ce21abf6ee4e93a17b04ee (patch)
treee81d1e60ffdf068ac1e93e8d36d9c2046b2d7c50 /fluid/panels/settings_panel.fl
parentb4995f979d127cea667b4e2b71c91e9db4ab52ef (diff)
wip
Diffstat (limited to 'fluid/panels/settings_panel.fl')
-rw-r--r--fluid/panels/settings_panel.fl39
1 files changed, 17 insertions, 22 deletions
diff --git a/fluid/panels/settings_panel.fl b/fluid/panels/settings_panel.fl
index 86513bafd..00d28e7fd 100644
--- a/fluid/panels/settings_panel.fl
+++ b/fluid/panels/settings_panel.fl
@@ -98,8 +98,6 @@ decl {\#include "../src/flstring.h"} {private global
decl {\#include <string.h>} {private global
}
-decl {using namespace fld::widget;} {private global
-}
decl {extern struct Fl_Menu_Item *dbmanager_item;} {public local
}
@@ -500,10 +498,11 @@ an include guard in header file:
if (v == LOAD) return;
-std::string old_name = "Copy of ";
-old_name.append(Fluid.layout_list[Fluid.layout_list.current_suite()].name_);
-const char *new_name = fl_input("Enter a name for the new layout:", old_name.c_str());
-if (new_name == nullptr)
+char old_name[256];
+snprintf(old_name, sizeof(old_name), "Copy of %s",
+ Fluid.layout_list[Fluid.layout_list.current_suite()].name_);
+const char *new_name = fl_input("Enter a name for the new layout:", old_name);
+if (new_name == 0)
return;
Fluid.layout_list.add(new_name);
@@ -512,7 +511,7 @@ Fluid.layout_list.update_dialogs();}
}
Fl_Menu_Button w_layout_menu {
callback {if (v == LOAD) {
- fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()];
+ Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()];
if (suite.storage_ == FLD_TOOL_STORE_INTERNAL) {
w_layout_menu_rename->deactivate();
for (int i=1; i<4; i++) w_layout_menu_storage[i]->deactivate();
@@ -530,9 +529,9 @@ Fluid.layout_list.update_dialogs();}
label {Rename...}
callback {// Rename the current layout suite
-std::string old_name = Fluid.layout_list[Fluid.layout_list.current_suite()].name_;
-const char *new_name = fl_input("Enter a new name for the layout:", old_name.c_str());
-if (new_name == nullptr)
+const char *old_name = Fluid.layout_list[Fluid.layout_list.current_suite()].name_;
+const char *new_name = fl_input("Enter a new name for the layout:", old_name);
+if (new_name == 0)
return;
Fluid.layout_list.rename(new_name);
@@ -541,28 +540,28 @@ Fluid.layout_list.update_dialogs();}
}
MenuItem {w_layout_menu_storage[0]} {
label {@fd_beaker FLUID Built-In}
- callback {fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()];
+ callback {Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()];
suite.storage(FLD_TOOL_STORE_INTERNAL);
Fluid.layout_list.update_dialogs();}
xywh {0 0 31 20} type Radio deactivate
}
MenuItem {w_layout_menu_storage[1]} {
label {@fd_user User Preference}
- callback {fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()];
+ callback {Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()];
suite.storage(FLD_TOOL_STORE_USER);
Fluid.layout_list.update_dialogs();}
xywh {0 0 31 20} type Radio
}
MenuItem {w_layout_menu_storage[2]} {
label {@fd_project Store in .fl Project File}
- callback {fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()];
+ callback {Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()];
suite.storage(FLD_TOOL_STORE_PROJECT);
Fluid.layout_list.update_dialogs();}
xywh {0 0 31 20} type Radio
}
MenuItem {w_layout_menu_storage[3]} {
label {@fd_file Store in External File}
- callback {fld::app::Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()];
+ callback {Layout_Suite &suite = Fluid.layout_list[Fluid.layout_list.current_suite()];
suite.storage(FLD_TOOL_STORE_FILE);
Fluid.layout_list.update_dialogs();}
xywh {0 0 31 20} type Radio divider
@@ -591,13 +590,9 @@ Fluid.layout_list.update_dialogs();}
fnfc.type(Fl_Native_File_Chooser::BROWSE_SAVE_FILE);
fnfc.options(Fl_Native_File_Chooser::SAVEAS_CONFIRM | Fl_Native_File_Chooser::USE_FILTER_EXT);
fnfc.filter("FLUID Layouts\\t*.fll\\n");
- std::string filename = Fluid.layout_list.filename_;
- fnfc.directory(fl_filename_path_str(filename).c_str());
- fnfc.preset_file(fl_filename_name_str(filename).c_str());
if (fnfc.show() != 0) return;
const char *new_filename = fnfc.filename();
if (!new_filename) return;
- Fluid.layout_list.filename_ = new_filename;
Fluid.layout_list.save(new_filename);}
xywh {0 0 31 20} divider
code0 {\#include <FL/Fl_Native_File_Chooser.H>}
@@ -1020,7 +1015,7 @@ if (v==LOAD) {
} else {
if (!selected) return;
int ret = fl_choice("Delete the shell command\\n\\"%s\\"?\\n\\nThis can not be undone.",
- "Delete", "Cancel", nullptr, g_shell_config->list[selected-1]->name.c_str());
+ "Delete", "Cancel", 0, g_shell_config->list[selected-1]->name.c_str());
if (ret==1) return;
if (g_shell_config->at(selected-1)->storage == FLD_TOOL_STORE_PROJECT) Fluid.proj.set_modflag(1);
g_shell_config->remove(selected-1);
@@ -1179,7 +1174,7 @@ if (v == LOAD) {
callback {int selected = w_settings_shell_list_selected;
if (v == LOAD) {
if (selected) {
- fld::Tool_Store ts = g_shell_config->list[selected-1]->storage;
+ Tool_Store ts = g_shell_config->list[selected-1]->storage;
o->value(o->find_item_with_argument((long)ts));
} else {
o->value(o->find_item_with_argument((long)FLD_TOOL_STORE_USER));
@@ -1187,7 +1182,7 @@ if (v == LOAD) {
} else {
if (selected) {
Fd_Shell_Command *cmd = g_shell_config->list[selected-1];
- fld::Tool_Store ts = (fld::Tool_Store)(o->mvalue()->argument());
+ Tool_Store ts = (Tool_Store)(o->mvalue()->argument());
if (cmd->storage == FLD_TOOL_STORE_PROJECT) Fluid.proj.set_modflag(1);
cmd->storage = ts;
//w_settings_shell_list->text(selected, cmd->name.c_str());
@@ -1319,7 +1314,7 @@ if (mi) {
int pos = w_settings_shell_command->insert_position();
w_settings_shell_command->buffer()->insert(pos, word);
}
- w_settings_shell_command->do_callback(w_settings_shell_command, (void*)nullptr);
+ w_settings_shell_command->do_callback(w_settings_shell_command, (void*)0);
}} open
tooltip {a list of text replacements available for the shell script} xywh {318 373 22 22} labelsize 12 textsize 12
} {