1 #ifndef __SHBTNPREFS_H__
2 #define __SHBTNPREFS_H__
5 #include "bcwindowbase.h"
9 #include "bclistboxitem.h"
10 #include "preferences.inc"
11 #include "preferencesthread.inc"
13 #include "shbtnprefs.inc"
16 class ShBtnRun : public Thread
21 char commands[BCTEXTLEN];
22 ArrayList<char *> argv;
23 void add_arg(const char *v);
25 ShBtnRun(const char *name, const char *cmds, int warn);
34 char commands[BCTEXTLEN];
37 void execute(ArrayList<Indexable*> &args);
39 ShBtnPref(const char *nm, const char *cmds, int warn=0, int run_script=0);
43 class ShBtnEditDialog : public BC_DialogThread
46 PreferencesWindow *pwindow;
48 ShBtnEditWindow *sb_window;
50 void handle_close_event(int result);
52 ShBtnEditDialog(PreferencesWindow *pwindow);
57 class ShBtnAddButton : public BC_GenericButton {
59 ShBtnEditWindow *sb_window;
62 ShBtnAddButton(ShBtnEditWindow *sb_window, int x, int y);
66 class ShBtnDelButton : public BC_GenericButton {
68 ShBtnEditWindow *sb_window;
71 ShBtnDelButton(ShBtnEditWindow *sb_window, int x, int y);
75 class ShBtnEditButton : public BC_GenericButton {
77 ShBtnEditWindow *sb_window;
81 ShBtnEditButton(ShBtnEditWindow *sb_window, int x, int y);
85 class ShBtnTextDialog : public BC_DialogThread
88 ShBtnEditWindow *sb_window;
89 ShBtnTextWindow *st_window;
93 void handle_close_event(int result);
94 int start_edit(ShBtnPref *pref);
96 ShBtnTextDialog(ShBtnEditWindow *sb_window);
100 class ShBtnTextOK : public BC_OKButton
103 ShBtnTextWindow *st_window;
106 ShBtnTextOK(ShBtnTextWindow *st_window, int x, int y);
110 class ShBtnErrWarnItem : public BC_MenuItem
113 ShBtnErrWarnItem(ShBtnErrWarn *popup, const char *text, int warn);
121 class ShBtnErrWarn : public BC_PopupMenu
124 ShBtnErrWarn(ShBtnTextWindow *st_window, int x, int y);
127 void create_objects();
130 ShBtnTextWindow *st_window;
133 class ShBtnRunScript : public BC_CheckBox
136 ShBtnRunScript(ShBtnTextWindow *st_window, int x, int y);
139 ShBtnTextWindow *st_window;
142 class ShBtnTextWindow : public BC_Window
145 BC_TextBox *cmd_name;
146 BC_ScrollTextBox *cmd_text;
147 ShBtnEditWindow *sb_window;
148 ShBtnErrWarn *st_err_warn;
149 ShBtnRunScript *st_run_script;
153 void create_objects();
155 ShBtnTextWindow(ShBtnEditWindow *sb_window, int x, int y);
159 class ShBtnPrefItem : public BC_ListBoxItem {
163 ShBtnPrefItem(ShBtnPref *item);
167 class ShBtnPrefList : public BC_ListBox
170 ShBtnEditWindow *sb_window;
173 ShBtnPrefList(ShBtnEditWindow *sb_window, int x, int y);
177 class ShBtnEditWindow : public BC_Window
180 ShBtnAddButton *add_button;
181 ShBtnDelButton *del_button;
182 ShBtnEditButton *edit_button;
183 ShBtnTextDialog *sb_dialog;
184 ArrayList<BC_ListBoxItem *> shbtn_items;
185 ShBtnPrefList *op_list;
187 void create_objects();
189 int start_edit(ShBtnPref *pref);
191 ShBtnEditWindow(ShBtnEditDialog *shbtn_edit, int x, int y);
194 ShBtnEditDialog *shbtn_edit;
197 class MainShBtnItem : public BC_MenuItem
200 MainShBtnItem(MainShBtns *shbtns, ShBtnPref *pref);
207 class MainShBtns : public BC_PopupMenu
210 MainShBtns(MWindow *mwindow, int x, int y);
211 int load(Preferences *preferences);