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 ShBtnErrWarn : public BC_CheckBox
113 ShBtnErrWarn(ShBtnTextWindow *st_window, int x, int y);
116 ShBtnTextWindow *st_window;
119 class ShBtnRunScript : public BC_CheckBox
122 ShBtnRunScript(ShBtnTextWindow *st_window, int x, int y);
125 ShBtnTextWindow *st_window;
128 class ShBtnTextWindow : public BC_Window
131 BC_TextBox *cmd_name;
132 BC_ScrollTextBox *cmd_text;
133 ShBtnEditWindow *sb_window;
134 ShBtnErrWarn *st_err_warn;
135 ShBtnRunScript *st_run_script;
139 void create_objects();
141 ShBtnTextWindow(ShBtnEditWindow *sb_window, int x, int y);
145 class ShBtnPrefItem : public BC_ListBoxItem {
149 ShBtnPrefItem(ShBtnPref *item);
153 class ShBtnPrefList : public BC_ListBox
156 ShBtnEditWindow *sb_window;
159 ShBtnPrefList(ShBtnEditWindow *sb_window, int x, int y);
163 class ShBtnEditWindow : public BC_Window
166 ShBtnAddButton *add_button;
167 ShBtnDelButton *del_button;
168 ShBtnEditButton *edit_button;
169 ShBtnTextDialog *sb_dialog;
170 ArrayList<BC_ListBoxItem *> shbtn_items;
171 ShBtnPrefList *op_list;
173 void create_objects();
175 int start_edit(ShBtnPref *pref);
177 ShBtnEditWindow(ShBtnEditDialog *shbtn_edit, int x, int y);
180 ShBtnEditDialog *shbtn_edit;
183 class MainShBtnItem : public BC_MenuItem
186 MainShBtnItem(MainShBtns *shbtns, ShBtnPref *pref);
193 class MainShBtns : public BC_PopupMenu
196 MainShBtns(MWindow *mwindow, int x, int y);
197 int load(Preferences *preferences);