23 #ifndef M4_GUI_GUI_DIALOG_H 24 #define M4_GUI_GUI_DIALOG_H 26 #include "m4/m4_types.h" 27 #include "m4/graphics/gr_buff.h" 28 #include "m4/gui/gui.h" 29 #include "m4/gui/gui_item.h" 30 #include "m4/gui/gui_univ.h" 35 TS_GIVEN = 0, TS_JUST_LEFT, TS_JUST_RIGHT, TS_CENTRE
43 Item *cancel_item, *return_item, *default_item;
49 void resize(int32 newW, int32 newH);
50 void configure(int32 defaultTag, int32 returnTag, int32 cancelTag);
51 void setDefault(int32 tag);
52 bool setPressed(int32 tag);
56 bool addMessage(int32 x, int32 y,
const char *prompt, int32 tag);
57 bool addPicture(int32 x, int32 y,
Buffer *myBuff, int32 tag);
58 bool addButton(int32 x, int32 y,
const char *prompt, M4CALLBACK cb, int32 tag);
59 bool addRepeatButton(int32 x, int32 y,
const char *prompt, M4CALLBACK cb, int32 tag);
60 bool addList(int32 x1, int32 y1, int32 x2, int32 y2, M4CALLBACK cb, int32 tag);
63 Item *getItem(int32 tag);
64 void changeItemPrompt(
const char *newPrompt,
Item *myItem, int32 tag);
65 bool removeItem(
Item *myItem, int32 tag);
66 void refreshItem(
Item *myItem, int32 tag);
69 bool addTextField(int32 x1, int32 y1, int32 x2,
const char *defaultPrompt, M4CALLBACK cb, int32 tag, int32 fieldLength);
70 void registerTextField();
80 int32 hiliteColor_alt1;
81 int32 hiliteColor_alt2;
90 bool okButton =
false;
92 bool movingScreen =
false;
93 Item *clickItem =
nullptr;
94 Item *doubleClickItem =
nullptr;
95 char listboxSearchStr[80] = { 0 };
98 bool gui_dialog_init();
99 void gui_dialog_shutdown();
102 Dialog *DialogCreateAbsolute(int32 x1, int32 y1, int32 x2, int32 y2, uint32 scrnFlags);
104 void vmng_Dialog_Destroy(
Dialog *d);
106 void Dialog_Refresh(
Dialog *d);
107 void Dialog_Refresh_All();
108 void Dialog_Resize(
Dialog *d, int32 newW, int32 newH);
110 void Dialog_Configure(
Dialog *d, int32 defaultTag, int32 returnTag, int32 cancelTag);
111 void Dialog_SetDefault(
Dialog *d, int32 tag);
112 bool Dialog_SetPressed(
Dialog *d, int32 tag);
115 bool Dialog_Add_Message(
Dialog *d, int32 x, int32 y,
const char *prompt, int32 tag);
118 bool Dialog_Add_Picture(
Dialog *d, int32 x, int32 y,
Buffer *myBuff, int32 tag);
121 bool Dialog_Add_Button(
Dialog *d, int32 x, int32 y,
const char *prompt, M4CALLBACK cb, int32 tag);
122 bool Dialog_Add_RepeatButton(
Dialog *d, int32 x, int32 y,
const char *prompt, M4CALLBACK cb, int32 tag);
125 bool Dialog_Add_List(
Dialog *d, int32 x1, int32 y1, int32 x2, int32 y2, M4CALLBACK cb, int32 tag);
126 bool Dialog_Add_DirList(
Dialog *d, int32 x1, int32 y1, int32 x2, int32 y2, M4CALLBACK cb, int32 tag,
char *myDir,
char *myTypes);
127 bool Dialog_Change_DirList(
Dialog *d,
Item *myItem,
const char *myDir,
const char *myTypes);
128 bool Dialog_Add_List_Item(
Dialog *d,
Item *myItem,
const char *prompt, int32 tag, int32 listTag, int32 addMode,
bool refresh);
129 bool Dialog_Delete_List_Item(
Dialog *d,
Item *myItem, int32 tag,
ListItem *myListItem, int32 listTag);
130 bool Dialog_Change_List_Item(
Dialog *d,
Item *myItem, int32 tag,
ListItem *myListItem, int32 listTag,
char *newPrompt, int32 newListTag, int32 changeMode,
bool refresh);
131 void Dialog_EmptyListBox(
Dialog *d,
Item *i, int32 tag);
132 char *Dialog_GetListItemPrompt(
Dialog *d,
Item *i, int32 tag, int32 listTag);
134 char *Dialog_GetCurrListItemPrompt(
Dialog *d,
Item *i, int32 tag);
135 bool Dialog_GetCurrListItemTag(
Dialog *d,
Item *i, int32 tag, int32 *listTag);
136 bool Dialog_ListItemExists(
Dialog *d,
Item *myItem, int32 tag,
char *prompt, int32 listTag);
137 bool Dialog_ListboxSearch(
Dialog *d,
Item *myItem, int32 tag, int32 searchMode,
char *searchStr, int32 parm1);
138 void Dialog_GetPrevListItem(
Dialog *d);
139 void Dialog_GetNextListItem(
Dialog *d);
142 bool Dialog_Add_TextField(
Dialog *d, int32 x1, int32 y1, int32 x2,
const char *defaultPrompt, M4CALLBACK cb, int32 tag, int32 fieldLength);
143 void Dialog_RegisterTextField(
Dialog *d);
146 bool Dialog_Add_Key(
Dialog *d,
long myKey, HotkeyCB cb);
147 bool Dialog_Remove_Key(
Dialog *d,
long myKey);
151 void Dialog_Change_Item_Prompt(
Dialog *d,
const char *newPrompt,
Item *myItem, int32 tag);
152 bool Dialog_Remove_Item(
Dialog *d,
Item *myItem, int32 tag);
153 void Dialog_Refresh_Item(
Dialog *d,
Item *myItem, int32 tag);
154 void Dialog_KeyMouseCollision();
156 void Dialog_SystemError(
char *s);
158 bool sizeofGUIelement_border(int16 el_type, int32 *w, int32 *h);
163 bool custom_sizeofGUIelement_border(int16 el_type, int32 *w, int32 *h);
168 TextScrn *TextScrn_Create(int32 x1, int32 y1, int32 x2, int32 y2, int32 luminance, uint32 scrnFlags,
169 int32 textColor, int32 hiliteColor,
170 int32 textColor_alt1 = 0, int32 hiliteColor_alt1 = 0,
171 int32 textColor_alt2 = 0, int32 hiliteColor_alt2 = 0);
172 void vmng_TextScrn_Destroy(
TextScrn *myTextScrn);
173 void TextScrn_Destroy(
TextScrn *myTextScrn);
174 void TextScrn_Activate(
TextScrn *myTextScrn);
175 bool TextScrn_Add_Key(
TextScrn *myTextScrn,
long myKey, HotkeyCB cb);
176 bool TextScrn_Add_TextItem(
TextScrn *myTextScrn, int32 x, int32 y, int32 tag,
177 int32 justification,
const char *prompt, M4CALLBACK callback);
178 bool TextScrn_Add_Message(
TextScrn *myTextScrn, int32 x, int32 y, int32 tag,
179 int32 justification,
const char *prompt);
180 void TextScrn_Change_TextItem(
TextScrn *myTextScrn, int32 tag,
char *prompt, uint8 color);
181 void TextScrn_Delete_TextItem(
TextScrn *myTextScrn, int32 tag);
Definition: gui_dialog.h:74
Definition: gui_item.h:62
Definition: gui_dialog.h:89
Definition: gui_item.h:69
Definition: gui_item.h:82
Definition: m4_types.h:67
Definition: database.h:28
Definition: gui_dialog.h:38