|
SWILIB API (SG)
|
Standart user interface.
Usage: #include <swilib.h> or #include <swilib/ui.h>
Data Structures | |
| struct | HEADER_DESC |
| UI header definition. More... | |
| struct | SOFTKEY_DESC |
| UI softkey definition. More... | |
| struct | SOFTKEYSTAB |
| List of the softkeys. More... | |
| struct | EDITQ |
| Linked-list of the EditControl's. More... | |
| struct | EDITC_OPTIONS |
| Custom options for EditControl. More... | |
| struct | EDITCONTROL |
| EditControl definition. More... | |
| struct | INPUTDIA_DESC |
| InputDialog definition. More... | |
| struct | USR_MENU_ITEM |
| Custom options menu item for InputDialog. More... | |
| struct | MENUITEM_DESC |
| Menu item. More... | |
| struct | MENU_DESC |
| Menu definition (single-line). More... | |
| struct | ML_MENU_DESC |
| Menu definition (multi-line). More... | |
| struct | POPUP_DESC |
| Popup definition. More... | |
| struct | TVIEW_DESC |
| Popup definition. More... | |
| struct | TABGUI_DESC |
| Tabs definition. More... | |
| struct | PBAR_DESC |
| Progressbar definition. More... | |
| struct | SCROLLBAR_DESC |
| Scrollbar widget definition. More... | |
Macros | |
| #define | SET_SOFT_KEY_N SET_LEFT_SOFTKEY |
| #define | SET_SOFT_KEY_M SET_MIDDLE_SOFTKEY |
| #define | MENU_FLAG3 3 |
| Magic value. | |
| #define | MENU_FLAG2 0x578 |
| Magic value. | |
| #define | YDISP (0) |
| Iconbar height. | |
Typedefs | |
| typedef struct EDITCONTROL | EDITCONTROL |
| typedef struct EDITC_OPTIONS | EDITC_OPTIONS |
| typedef struct EDITQ | EDITQ |
| typedef struct INPUTDIA_DESC | INPUTDIA_DESC |
| typedef struct USR_MENU_ITEM | USR_MENU_ITEM |
| typedef struct HEADER_DESC | HEADER_DESC |
| typedef struct SOFTKEY_DESC | SOFTKEY_DESC |
| typedef struct SOFTKEYSTAB | SOFTKEYSTAB |
| typedef struct MENUITEM_DESC | MENUITEM_DESC |
| typedef struct MENU_DESC | MENU_DESC |
| typedef struct ML_MENU_DESC | ML_MENU_DESC |
| typedef struct POPUP_DESC | POPUP_DESC |
| typedef struct TABGUI_DESC | TABGUI_DESC |
| typedef struct TVIEW_DESC | TVIEW_DESC |
| typedef struct PBAR_DESC | PBAR_DESC |
| typedef struct SCROLLBAR_DESC | SCROLLBAR_DESC |
| typedef void(* | MENUITEM_DRAW_PROC) (void *gui, int item_n, void *user_pointer) |
| Menu item draw callback. | |
| typedef void(* | MENUPROCS_DESC) (GUI *gui) |
| Menu item select callback. | |
| typedef int(* | GUI_ONKEY_CALLBACK) (GUI *gui, GUI_MSG *msg) |
| GUI keys handler. | |
| typedef void(* | GUI_GHOOK_CALLBACK) (GUI *gui, int cmd) |
| GUI global hook. | |
| typedef void(* | GUI_LOCRET_CALLBACK) (void) |
| GUI locret callback (empty stub). | |
| typedef int(* | MenuSearchCallBack) (void *gui, WSHDR *search) |
| Menu search callback. | |
| typedef enum DialogFlags | DialogFlags |
| Dialog windows style flags. | |
| typedef DialogFlags | PopupDialogFlags |
| Popup dialog flags. | |
| typedef DialogFlags | MsgBoxFlags |
| Flags for ShowMSG. | |
Common UI functions. | |
| void | SetHeader (void *gui, const HEADER_DESC *header, const void *malloc_fn) |
| Set header to the GUI. | |
| void * | GetHeaderPointer (void *gui) |
| Get pointer to the UI header. | |
| void | SetHeaderText (void *header, const WSHDR *title, const void *malloc_fn, const void *mfree_fn) |
| Set main text to the UI header. | |
| void | SetHeaderScrollText (void *header, const WSHDR *title, const void *malloc_fn, const void *mfree_fn) |
| Set scolled text to the UI header. | |
| void | SetHeaderExtraText (void *header, const WSHDR *ws, const void *malloc_fn, const void *mfree_fn) |
| Set extra text to the UI header. | |
| void | SetHeaderIcon (void *header, const int *icons, const void *malloc_fn, const void *mfree_fn) |
| Set icons of the UI header. | |
| void | SetSoftKey (void *gui, const SOFTKEY_DESC *softkey, int softkey_id) |
| Add softkey to the GUI. | |
| void | RefreshGUI (void) |
| Force refresh current GUI. | |
| void | SetGUIDefinition (void *gui, const void *definition) |
| Set UI definition to the GUI. | |
| void * | FindItemByID (GUI *gui, int id) |
| Find private item in the GUI. | |
| void * | GetDataOfItemByID (GUI *gui, int id) |
| Get data of the private item in the GUI. | |
| RECT * | GetHeaderRECT (void) |
| Size of UI header. | |
| RECT * | GetOptionsHeaderRECT (void) |
| Size of UI options header. | |
| RECT * | GetMainAreaRECT (void) |
| Size of UI main area. | |
| void | SetWidgetRect (void *widget, int x, int y, int x2, int y2) |
| Dynamically set the bounding rectangle for the widget. | |
Iconbar | |
| void | AddIconToIconBar (int pic, short *num) |
| Push icon to the iconbar (E/EL71). | |
| void * | GUI_GetUserPointer (void *gui) |
| Get custom user pointer from standard GUI, like Menu. | |
| void | GUI_SetUserPointer (void *gui, void *user_pointer) |
| Set custom user pointer to the GUI, like Menu. | |
| char * | RamIconBar () |
| Pointer to the status of iconbar (EL/E71). | |
| int | IsIconBarDisabled () |
| Check state of iconbar (EL71/E71). | |
| void | DisableIconBar (int disable) |
| Enable or disable global iconbar on EL/E71. | |
| void | AttachWidget (void *gui, const void *widget, int id, const void *malloc_fn) |
| Attach a widget to the GUI. | |
Popups | |
| int | ShowMSG (int flags, int message) |
| Show info popup. | |
| int | MsgBoxError (int flags, int message) |
| Show error popup. | |
| int | MsgBoxYesNo (int flags, int message, void(*callback)(int canceled)) |
| Confirmation popup with Yes/No. | |
| int | MsgBoxOkCancel (int flags, int message, void(*callback)(int canceled)) |
| Confirmation popup with Ok/Cancel. | |
| int | ShowWaitBox (int flags, int message) |
| Wait popup. | |
| int | ShowPleaseWaitBox (int flags) |
| 'Please wait' popup. | |
| void * | GetPBarProc3 () |
| Get pointer for proc3 method of PBAR_DESC struct. | |
| int | ShowPBarBox (int flags, int message, PBAR_DESC *pbar_desc, int initial_value, WSHDR *initial_ws) |
| Progressbar popup. | |
| int | SetPBarValue (int gui_id, int value) |
| Set value to progressbar popup. | |
| int | SetPBarText (int gui_id, WSHDR *ws) |
| Set WSHDR string to progressbar popup. | |
| int | CreatePopupGUI (int flags, void *user_pointer, const POPUP_DESC *popup, int lgp_id) |
| Create custom Popup. | |
| int | CreatePopupGUI_ws (int flags, void *user_pointer, const POPUP_DESC *popup, const WSHDR *message) |
| Create custom Popup. | |
| void * | GetPopupUserPointer (void *gui) |
| Get user pointer from the popup. | |
InputDialog & EditControl | |
| int | CreateInputTextDialog (const INPUTDIA_DESC *input_desc, const HEADER_DESC *header_desc, EDITQ *eq, int do_mfree, void *user_pointer) |
| Create InputDialog GUI. | |
| void * | EDIT_GetGUI (const void *malloc_fn, const void *mfree_fn) |
| Allocate GUI for the Input. | |
| void | EDIT_SetDefinition (void *gui, const INPUTDIA_DESC *input_desc) |
| Attach the Input definition to the allocated GUI. | |
| void | EDIT_SetUserPointer (void *gui, void *user_pointer) |
| Set custom user pointer to the Input. | |
| void * | EDIT_GetUserPointer (void *gui) |
| Get user pointer from the InputDialog. | |
| int | EDIT_IsBusy (void *gui) |
| Check if InputDialog is busy. | |
| int | EDIT_OpenOptionMenuWithUserItems (void *gui, void(*itemhandler)(USR_MENU_ITEM *item), void *user_pointer, int to_add) |
| EDITQ * | AllocEQueue (const void *malloc_func, const void *mfree_func) |
| List of the edit controls. | |
| void | EDIT_SetEQueue (void *gui, const EDITQ *eq, int do_mfree, const void *malloc_fn) |
| Set list of the edit controls to the allocated GUI. | |
| EDITCONTROL * | PrepareEditControl (EDITCONTROL *ec) |
| Pre-initialize EDITCONTROL structure. | |
| void | ConstructEditControl (EDITCONTROL *ec, int type, int flags, const WSHDR *title, int maxlen) |
| Create new edit control. | |
| void | ConstructComboBox (EDITCONTROL *ec, int type, int flags, WSHDR *title, int maxlen, int unk_zero, int items_count, int selected_item) |
| Create new edit control (ComboBox). | |
| int | ConstructEditTime (EDITCONTROL *ec, const TTime *time) |
| Create new edit control (Time). | |
| int | ConstructEditDate (EDITCONTROL *ec, const TDate *date) |
| Create new edit control (Date). | |
| void | CopyOptionsToEditControl (EDITCONTROL *ec, const EDITC_OPTIONS *options) |
| Set options to the edit control. | |
| int | AddEditControlToEditQend (EDITQ *eq, const EDITCONTROL *ec, const void *malloc_func) |
| Add edit control to the end of the list. | |
| int | EDIT_GetFocus (void *gui) |
| Get index of the focused edit control. | |
| int | EDIT_GetUnFocus (void *gui) |
| Get index of the previous focused edit control. | |
| void | EDIT_SetFocus (void *gui, int n) |
| Focus given edit control. | |
| void | EDIT_RemoveEditControl (void *gui, int n) |
| Remove edit control for the InputDialog. | |
| void | EDIT_InsertEditControl (void *gui, int n, const EDITCONTROL *ec) |
| Insert edit control to the InputDialog. | |
| int | ExtractEditControl (void *gui, int n, EDITCONTROL *ec) |
| Get a copy of the edit control in the InputDialog. | |
| void | EDIT_ExtractFocusedControl (void *gui, EDITCONTROL *ec) |
| Get a copy of the focused edit control in the InputDialog. | |
| int | StoreEditControl (void *gui, int n, const EDITCONTROL *ec) |
| Replace the edit control in the InputDialog. | |
| int | EDIT_StoreControlToFocused (void *gui, const EDITCONTROL *ec) |
| Replace focused edit control in the InputDialog. | |
| void | EDIT_SetTextToFocused (void *gui, const WSHDR *value) |
| Set value to the focused edit control. | |
| int | EDIT_SetTextToEditControl (void *gui, int n, const WSHDR *value) |
| Set value to the given edit control. | |
| int | EDIT_GetItemNumInFocusedComboBox (void *gui) |
| Get item index in the focused ComboBox. | |
| void | EDIT_SetDate (void *gui, int n, const TDate *date) |
| Set date value to the edit control. | |
| void | EDIT_SetTime (void *gui, int n, const TTime *time) |
| Set time value to the edit control. | |
| void | EDIT_GetDate (void *gui, int n, TDate *date) |
| Get date value from the edit control. | |
| void | EDIT_GetTime (void *gui, int n, TTime *time) |
| Get time value from the edit control. | |
| int | EDIT_GetCursorPos (void *gui) |
| Get cursor position in text. | |
| void | EDIT_SetCursorPos (void *gui, int position) |
| Set cursor position in text. | |
| int | EDIT_IsMarkModeActive (void *gui) |
| Check if text selection enabled. | |
| int | EDIT_GetMarkedText (void *gui, WSHDR *selected_text) |
| Get value of the selected text. | |
| int | EDIT_SetTextInvert (void *gui, int position, int len) |
| Invert background of the part of text. | |
| void | EDIT_RemoveTextInvert (void *gui) |
| Remove text background ivertion. | |
EditControl options | |
| EDITC_OPTIONS * | PrepareEditCOptions (EDITC_OPTIONS *options) |
| Initialize EDITC_OPTIONS structure. | |
| void | SetInvertToEditCOptions (EDITC_OPTIONS *options, int invert) |
| Enable background inversion. | |
| void | SetFontToEditCOptions (EDITC_OPTIONS *options, int font) |
| Change text font. | |
| void | SetTextAttrToEditCOptions (EDITC_OPTIONS *options, int flags) |
| Set text attributes. | |
| void | SetAlignToEditCOptions (EDITC_OPTIONS *options, int flags) |
| Set text attributes. | |
| void | SetPenColorToEditCOptions (EDITC_OPTIONS *options, int pen) |
| Set text color. | |
| void | SetBrushColorToEditCOptions (EDITC_OPTIONS *options, int brush) |
| Set background color. | |
Menu | |
| int | CreateMenu (int style, int zero, const MENU_DESC *menu, const HEADER_DESC *header, int selected_item, int items_count, void *user_pointer, int *to_remove) |
| Create menu (list with items). | |
| int | CreateMultiLinesMenu (int style, int zero, const ML_MENU_DESC *menu, const HEADER_DESC *header, int selected_item, int items_count) |
| Create menu with multiline items (list with items). | |
| int | GetCurMenuItem (void *gui) |
| Get index of the selected item in menu. | |
| void | SetMenuItemIcon (void *gui, int item_n, int icon) |
| Set icon for a menu item. | |
| void | SetMenuItemIconIMGHDR (void *gui, void *item, IMGHDR *icon) |
| Add icon to the list item (IMGHDR). | |
| void * | AllocMenuItem (void *gui) |
| Dynamic allocation of the menu item. | |
| void * | AllocMLMenuItem (void *gui) |
| Dynamic allocation of the menu item. | |
| WSHDR * | AllocMenuWS (void *gui, int len) |
| Allocate WSHDR for using it in SetMenuItemText. | |
| void | SetMenuItemIconArray (void *gui, void *item, const int *icons) |
| Set the icon array used by the menu. | |
| void | SetMenuItemText (void *gui, void *item, WSHDR *text, int item_n) |
| Set text to menu item. | |
| void | SetMLMenuItemText (void *gui, void *item, WSHDR *text1, WSHDR *text2, int item_n) |
| Set text to menu item. | |
| int | GetMenuItemCount (void *gui) |
| Get count of items on the menu. | |
| void | SetMenuItemCount (void *gui, int items_count) |
| Statically set items count in the menu. | |
| void | Menu_SetItemCountDyn (void *gui, int items_count) |
| Dynamically set items count on the menu. | |
| void | SetCursorToMenuItem (void *gui, int item_n) |
| Scroll to the given menu item. | |
| void | UpdateMenuCursorItem (void *gui, int item_n) |
| Scroll to the given menu item and refresh the menu. | |
| void | SetMenuSearchCallBack (void *gui, const MenuSearchCallBack callback) |
| Set callback for the searching in the menu. | |
| void | SetMenuSoftKey (void *gui, const SOFTKEY_DESC *softkey, int softkey_id) |
| Add softkey to the menu. | |
| void | SetHeaderToMenu (void *gui, const HEADER_DESC *header, const void *malloc_fn) |
| Set header to the GUI. | |
| void * | MenuGetUserPointer (void *gui) |
| Get custom user pointer from menu. | |
| void | MenuSetUserPointer (void *gui, void *user_pointer) |
| Set custom user pointer to the menu. | |
| void * | GetMenuGUI (const void *malloc_fn, const void *mfree_fn) |
| Allocate GUI for single-line menu. | |
| void * | GetMultiLinesMenuGUI (const void *malloc_fn, const void *mfree_fn) |
| Allocate GUI for multi-line menu. | |
| void | SetMenuToGUI (void *gui, const void *menu) |
| Attach the menu definition to the allocated GUI (by GetMenuGUI or GetMultiLinesMenuGUI). | |
Tabs | |
| void * | GetTabGUI (void *malloc_fn, void *mfree_fn) |
| Allocate GUI for tabs. | |
| int | SetGUIToTabGUI (void *gui, int tab_n, const int *icons, void *content_gui) |
| Link content gui with tab. | |
| void * | GetGuiByTab (void *gui, int tab_n) |
| Get GUI of the tab content. | |
| int | SetCursorTab (void *gui, int tab_n) |
| Switch to the given tab. | |
| int | GetCursorTab (void *gui) |
| Get index of the active tab. | |
| int | UpdateTab1stItem (void *gui, int unk_0) |
| Update content of the active tab. | |
TextView | |
| void * | TViewGetGUI (const void *malloc_fn, const void *mfree_fn) |
| Allocate GUI for TextView. | |
| void | TViewSetDefinition (void *gui, const TVIEW_DESC *tv) |
| Attach the TextView definition to the allocated GUI. | |
| void | TViewSetText (void *gui, const WSHDR *text, const void *malloc_fn, const void *mfree_fn) |
| Set text to the TextView. | |
| void | TViewSetUserPointer (void *gui, void *user_pointer) |
| Set custom user pointer to the TextView. | |
| void * | TViewGetUserPointer (void *gui) |
| Get custom user pointer from TextView. | |
RadioButtonList | |
| int | CreateRadioButtonList (const void *items, int num, const int *exclude_ids, int exclude_count, int selected_id, int(*handler)(int item_id, int key, int user1, int user2), int flags, int header_lgp, const int *header_icon, int user1, int user2) |
| Create radio button list. | |
Scrollbar | |
| WIDGET * | CreateScrollbarWidget (const void *malloc_fn) |
| Allocate Scrollbar WIDGET. | |
| void | Scrollbar_Configure (WIDGET *scrollbar, int limit, int unk1, int unk2) |
| Configure the scrollbar's behavior constraints. | |
| void | Scrollbar_SetValue (WIDGET *scrollbar, int value) |
| Set the scrollbar's current position. | |
Hacks | |
| void * | RamMenuAnywhere () |
Key sequence buffer of the "menu anywhere" shortcut (char[4]). | |
| struct HEADER_DESC |
| struct SOFTKEY_DESC |
| struct SOFTKEYSTAB |
| struct EDITQ |
| struct EDITC_OPTIONS |
| struct EDITCONTROL |
| struct INPUTDIA_DESC |
| struct USR_MENU_ITEM |
| struct MENUITEM_DESC |
| struct MENU_DESC |
| struct ML_MENU_DESC |
| struct POPUP_DESC |
| struct TVIEW_DESC |
| struct TABGUI_DESC |
| struct PBAR_DESC |
| struct SCROLLBAR_DESC |
| #define SET_SOFT_KEY_N SET_LEFT_SOFTKEY |
| #define SET_SOFT_KEY_M SET_MIDDLE_SOFTKEY |
| typedef void(* MENUITEM_DRAW_PROC) (void *gui, int item_n, void *user_pointer) |
| typedef void(* MENUPROCS_DESC) (GUI *gui) |
| typedef void(* GUI_GHOOK_CALLBACK) (GUI *gui, int cmd) |
| typedef void(* GUI_LOCRET_CALLBACK) (void) |
| typedef int(* MenuSearchCallBack) (void *gui, WSHDR *search) |
| typedef enum DialogFlags DialogFlags |
Dialog windows style flags.
| typedef DialogFlags PopupDialogFlags |
| typedef DialogFlags MsgBoxFlags |
| enum DialogFlags |
| enum SetSoftKeyID |
Softkey IDs for SetSoftKey.
| Enumerator | |
|---|---|
| SET_LEFT_SOFTKEY | Left softkey. |
| SET_RIGHT_SOFTKEY | Right softkey. |
| SET_MIDDLE_SOFTKEY | Middle softkey. |
| enum EditControlTypeID |
| enum EditControlFlags |
Flags for the EditControl.
| enum UIDialogCmdID |
| enum TextInputDialogCmdID |
| enum InputDialogFlags |
| enum MenuDialogFlags |
| void SetHeader | ( | void * | gui, |
| const HEADER_DESC * | header, | ||
| const void * | malloc_fn ) |
Set header to the GUI.
| gui | pointer to the GUI |
| header | pointer to the header definition |
| malloc_fn | pointer to the malloc() function, use result of malloc_adr |
| void * GetHeaderPointer | ( | void * | gui | ) |
| void SetHeaderText | ( | void * | header, |
| const WSHDR * | title, | ||
| const void * | malloc_fn, | ||
| const void * | mfree_fn ) |
Set main text to the UI header.
| header | pointer to the header (GetHeaderPointer) |
| title | new title value |
| malloc_fn | result of malloc_adr() |
| mfree_fn | result of mfree_adr() |
| void SetHeaderScrollText | ( | void * | header, |
| const WSHDR * | title, | ||
| const void * | malloc_fn, | ||
| const void * | mfree_fn ) |
Set scolled text to the UI header.
| header | pointer to the header (GetHeaderPointer) |
| title | new title value |
| malloc_fn | result of malloc_adr() |
| mfree_fn | result of mfree_adr() |
| void SetHeaderExtraText | ( | void * | header, |
| const WSHDR * | ws, | ||
| const void * | malloc_fn, | ||
| const void * | mfree_fn ) |
Set extra text to the UI header.
| header | pointer to the header (GetHeaderPointer) |
| ws | new extra title value |
| malloc_fn | result of malloc_adr() |
| mfree_fn | result of mfree_adr() |
| void SetHeaderIcon | ( | void * | header, |
| const int * | icons, | ||
| const void * | malloc_fn, | ||
| const void * | mfree_fn ) |
Set icons of the UI header.
| header | pointer to the header (GetHeaderPointer) |
| icons | C-array of the icons (ID from PIT or pointer to IMGHDR), last item is always 0 |
| malloc_fn | result of malloc_adr() |
| mfree_fn | result of mfree_adr() |
| void SetSoftKey | ( | void * | gui, |
| const SOFTKEY_DESC * | softkey, | ||
| int | softkey_id ) |
Add softkey to the GUI.
| gui | pointer to the any GUI |
| softkey | pointer to the softkey definition |
| softkey_id | see SetSoftKeyID |
| void RefreshGUI | ( | void | ) |
Force refresh current GUI.
| void SetGUIDefinition | ( | void * | gui, |
| const void * | definition ) |
Set UI definition to the GUI.
| gui | pointer to the any GUI |
| definition | pointer to the MENU_DESC, ML_MENU_DESC, TABGUI_DESC, INPUTDIA_DESC, POPUP_DESC, TVIEW_DESC |
| void * FindItemByID | ( | GUI * | gui, |
| int | id ) |
| void * GetDataOfItemByID | ( | GUI * | gui, |
| int | id ) |
| RECT * GetHeaderRECT | ( | void | ) |
Size of UI header.
| RECT * GetOptionsHeaderRECT | ( | void | ) |
Size of UI options header.
| RECT * GetMainAreaRECT | ( | void | ) |
Size of UI main area.
| void SetWidgetRect | ( | void * | widget, |
| int | x, | ||
| int | y, | ||
| int | x2, | ||
| int | y2 ) |
Dynamically set the bounding rectangle for the widget.
| widget | pointer to the widget |
| x | top-left X coordinate of the widget rectangle |
| y | top-left Y coordinate of the widget rectangle |
| x2 | bottom-right X coordinate of the widget rectangle |
| y2 | bottom-right Y coordinate of the widget rectangle |
| void AddIconToIconBar | ( | int | pic, |
| short * | num ) |
Push icon to the iconbar (E/EL71).
| pic | number of the icon in PIT table |
| num | poinetr to the icon index (from iconbar hook) |
Call this function the iconbar hook.
| void * GUI_GetUserPointer | ( | void * | gui | ) |
| void GUI_SetUserPointer | ( | void * | gui, |
| void * | user_pointer ) |
| char * RamIconBar | ( | ) |
Pointer to the status of iconbar (EL/E71).
| int IsIconBarDisabled | ( | ) |
Check state of iconbar (EL71/E71).
It can be disabled by DisableIconBar function.
| void DisableIconBar | ( | int | disable | ) |
Enable or disable global iconbar on EL/E71.
| disable | 1 for disable, 0 for enable |
Attach a widget to the GUI.
| gui | pointer to the GUI |
| widget | pointer to the WIDGET |
| id | an identifier for the widget |
| malloc_fn | result of malloc_adr |
| int ShowMSG | ( | int | flags, |
| int | message ) |
Show info popup.
| flags | see MsgBoxFlags |
| message | id from the langpack or pointer to the C-string |
| int MsgBoxError | ( | int | flags, |
| int | message ) |
Show error popup.
| flags | see MsgBoxFlags |
| message | id from the langpack or pointer to the C-string |
| int MsgBoxYesNo | ( | int | flags, |
| int | message, | ||
| void(* | callback )(int canceled) ) |
Confirmation popup with Yes/No.
| flags | see PopupDialogFlags |
| message | id from the langpack or pointer to the C-string |
| callback | callback for handling popup answer |
| int MsgBoxOkCancel | ( | int | flags, |
| int | message, | ||
| void(* | callback )(int canceled) ) |
Confirmation popup with Ok/Cancel.
| flags | see PopupDialogFlags |
| message | id from the langpack or pointer to the C-string |
| callback | callback for handling popup answer |
| int ShowWaitBox | ( | int | flags, |
| int | message ) |
Wait popup.
| flags | see PopupDialogFlags |
| message | id from the langpack or pointer to the C-string |
| int ShowPleaseWaitBox | ( | int | flags | ) |
| void * GetPBarProc3 | ( | ) |
| int ShowPBarBox | ( | int | flags, |
| int | message, | ||
| PBAR_DESC * | pbar_desc, | ||
| int | initial_value, | ||
| WSHDR * | initial_ws ) |
Progressbar popup.
| flags | PopupDialogFlags |
| message | id from the langpack or pointer to the C-string |
| pbar_desc | pointer to the PBAR_DESC or NULL |
| initial_value | initial value 0-100 |
| initial_ws | pointer to initial WSHDR string or NULL. The passed WSHDR will be destroyed by the function; caller must not free it. |
| int SetPBarValue | ( | int | gui_id, |
| int | value ) |
Set value to progressbar popup.
| gui_id | progressbar GUI ID |
| value | value |
| int SetPBarText | ( | int | gui_id, |
| WSHDR * | ws ) |
| int CreatePopupGUI | ( | int | flags, |
| void * | user_pointer, | ||
| const POPUP_DESC * | popup, | ||
| int | lgp_id ) |
Create custom Popup.
| flags | see PopupDialogFlags |
| user_pointer | custom user pointer |
| popup | pointer to the Popup definition |
| lgp_id | Popup message, LGP ID or pointer to the C-string |
| int CreatePopupGUI_ws | ( | int | flags, |
| void * | user_pointer, | ||
| const POPUP_DESC * | popup, | ||
| const WSHDR * | message ) |
Create custom Popup.
| flags | see PopupDialogFlags |
| user_pointer | custom user pointer |
| popup | pointer to the Popup definition |
| message | UTF-16 pascal-style string |
| void * GetPopupUserPointer | ( | void * | gui | ) |
| int CreateInputTextDialog | ( | const INPUTDIA_DESC * | input_desc, |
| const HEADER_DESC * | header_desc, | ||
| EDITQ * | eq, | ||
| int | do_mfree, | ||
| void * | user_pointer ) |
Allocate GUI for the Input.
| malloc_fn | result of malloc_adr |
| mfree_fn | result of mfree_adr |
| void EDIT_SetDefinition | ( | void * | gui, |
| const INPUTDIA_DESC * | input_desc ) |
Attach the Input definition to the allocated GUI.
| gui | pointer to the Input GUI |
| input_desc | pointer to the INPUTDIA_DESC |
| void EDIT_SetUserPointer | ( | void * | gui, |
| void * | user_pointer ) |
Set custom user pointer to the Input.
| gui | pointer to the Input GUI |
| user_pointer | custom user pointer |
| void * EDIT_GetUserPointer | ( | void * | gui | ) |
| int EDIT_IsBusy | ( | void * | gui | ) |
Check if InputDialog is busy.
| gui | pointer to the InputDialog GUI |
| int EDIT_OpenOptionMenuWithUserItems | ( | void * | gui, |
| void(* | itemhandler )(USR_MENU_ITEM *item), | ||
| void * | user_pointer, | ||
| int | to_add ) |
List of the edit controls.
| malloc_func | result of malloc_adr |
| mfree_func | result of mfree_adr |
Set list of the edit controls to the allocated GUI.
| gui | pointer to the Input GUI |
| eq | list of the edit controls |
| do_mfree | set to 1 if you want free eq data |
| malloc_fn | result of malloc_adr |
| EDITCONTROL * PrepareEditControl | ( | EDITCONTROL * | ec | ) |
Pre-initialize EDITCONTROL structure.
| ec | pointer to the EDITCONTROL |
ecTypical usage:
| void ConstructEditControl | ( | EDITCONTROL * | ec, |
| int | type, | ||
| int | flags, | ||
| const WSHDR * | title, | ||
| int | maxlen ) |
Create new edit control.
| ec | pointer to the EDITCONTROL |
| type | edit control type, see EditControlTypeID |
| flags | edit control flags, see EditControlFlags |
| title | edit control title, can be NULL |
| maxlen | maximum length of the value |
| void ConstructComboBox | ( | EDITCONTROL * | ec, |
| int | type, | ||
| int | flags, | ||
| WSHDR * | title, | ||
| int | maxlen, | ||
| int | unk_zero, | ||
| int | items_count, | ||
| int | selected_item ) |
Create new edit control (ComboBox).
Items will be created dynamically in ghook. You need to specify only the number of items.
| ec | pointer to the EDITCONTROL |
| type | edit control type, see EditControlTypeID |
| flags | edit control flags, see EditControlFlags |
| title | edit control title, can be NULL |
| maxlen | maximum length of the value |
| unk_zero | set to 0 |
| items_count | items count in the combo-box |
| selected_item | selected item index (from 1) |
| int ConstructEditTime | ( | EDITCONTROL * | ec, |
| const TTime * | time ) |
Create new edit control (Time).
Use in pair with ConstructEditControl
| ec | pointer to the constructed edit control with type ECT_TIME |
| time | default value |
| int ConstructEditDate | ( | EDITCONTROL * | ec, |
| const TDate * | date ) |
Create new edit control (Date).
Use in pair with ConstructEditControl
| ec | pointer to the constructed edit control with type ECT_CALENDAR |
| date | default value |
| void CopyOptionsToEditControl | ( | EDITCONTROL * | ec, |
| const EDITC_OPTIONS * | options ) |
Set options to the edit control.
| ec | pointer to the initilaized EDITCONTROL |
| options | pointer to the options |
| int AddEditControlToEditQend | ( | EDITQ * | eq, |
| const EDITCONTROL * | ec, | ||
| const void * | malloc_func ) |
Add edit control to the end of the list.
| eq | pointer to the list of the edit controls |
| ec | pointer to the initilaized EDITCONTROL |
| malloc_func | result of malloc_adr |
| int EDIT_GetFocus | ( | void * | gui | ) |
Get index of the focused edit control.
| int EDIT_GetUnFocus | ( | void * | gui | ) |
Get index of the previous focused edit control.
| void EDIT_SetFocus | ( | void * | gui, |
| int | n ) |
Focus given edit control.
| gui | pointer to the InputDialog GUI |
| n | index of the edit control to be focused |
| void EDIT_RemoveEditControl | ( | void * | gui, |
| int | n ) |
Remove edit control for the InputDialog.
| gui | pointer to the InputDialog GUI |
| n | index of the edit control |
| void EDIT_InsertEditControl | ( | void * | gui, |
| int | n, | ||
| const EDITCONTROL * | ec ) |
Insert edit control to the InputDialog.
| gui | pointer to the InputDialog GUI |
| n | index where will be inserted |
| ec | pointer to new EDITCONTROL |
| int ExtractEditControl | ( | void * | gui, |
| int | n, | ||
| EDITCONTROL * | ec ) |
Get a copy of the edit control in the InputDialog.
| gui | pointer to the InputDialog GUI |
| n | index of control in the list |
| ec | pointer to EDITCONTROL where there will be a stored copy of the extracted control |
| void EDIT_ExtractFocusedControl | ( | void * | gui, |
| EDITCONTROL * | ec ) |
Get a copy of the focused edit control in the InputDialog.
| gui | pointer to the InputDialog GUI |
| ec | pointer to EDITCONTROL where there will be a stored copy of the extracted control |
| int StoreEditControl | ( | void * | gui, |
| int | n, | ||
| const EDITCONTROL * | ec ) |
Replace the edit control in the InputDialog.
| gui | pointer to the InputDialog GUI |
| n | index of control in the list |
| ec | pointer to new EDITCONTROL |
| int EDIT_StoreControlToFocused | ( | void * | gui, |
| const EDITCONTROL * | ec ) |
Replace focused edit control in the InputDialog.
| gui | pointer to the InputDialog GUI |
| ec | pointer to new EDITCONTROL |
Set value to the focused edit control.
| gui | pointer to the InputDialog GUI |
| value | new value |
Set value to the given edit control.
| gui | pointer to the InputDialog GUI |
| n | index of the edit control |
| value | new value |
| int EDIT_GetItemNumInFocusedComboBox | ( | void * | gui | ) |
Get item index in the focused ComboBox.
| gui | pointer to the InputDialog GUI |
Set date value to the edit control.
| gui | pointer to the InputDialog GUI |
| n | index of the edit control |
| date | new value |
Set time value to the edit control.
| gui | pointer to the InputDialog GUI |
| n | index of the edit control |
| time | new value |
| void EDIT_GetDate | ( | void * | gui, |
| int | n, | ||
| TDate * | date ) |
Get date value from the edit control.
| gui | pointer to the InputDialog GUI | |
| n | index of the edit control | |
| [out] | date | date value |
| void EDIT_GetTime | ( | void * | gui, |
| int | n, | ||
| TTime * | time ) |
Get time value from the edit control.
| gui | pointer to the InputDialog GUI | |
| n | index of the edit control | |
| [out] | time | time value |
| int EDIT_GetCursorPos | ( | void * | gui | ) |
Get cursor position in text.
Function working with current focused edit control.
| gui | pointer to the InputDialog GUI |
| void EDIT_SetCursorPos | ( | void * | gui, |
| int | position ) |
Set cursor position in text.
Function working with current focused edit control.
| gui | pointer to the InputDialog GUI |
| position | new cursor position |
| int EDIT_IsMarkModeActive | ( | void * | gui | ) |
Check if text selection enabled.
Function working with current focused edit control.
| gui | pointer to the InputDialog GUI |
| int EDIT_GetMarkedText | ( | void * | gui, |
| WSHDR * | selected_text ) |
Get value of the selected text.
Function working with current focused edit control.
| gui | pointer to the InputDialog GUI | |
| [out] | selected_text | value of the selected text |
| int EDIT_SetTextInvert | ( | void * | gui, |
| int | position, | ||
| int | len ) |
Invert background of the part of text.
Function working with current focused edit control.
| gui | pointer to the InputDialog GUI |
| position | position in the text te be inverted |
| len | length of the text te be inverted |
| void EDIT_RemoveTextInvert | ( | void * | gui | ) |
Remove text background ivertion.
Function working with current focused edit control.
| gui | pointer to the InputDialog GUI |
| EDITC_OPTIONS * PrepareEditCOptions | ( | EDITC_OPTIONS * | options | ) |
Initialize EDITC_OPTIONS structure.
| options | pointer to the EDITC_OPTIONS |
options | void SetInvertToEditCOptions | ( | EDITC_OPTIONS * | options, |
| int | invert ) |
Enable background inversion.
| options | pointer to the EDITC_OPTIONS |
| invert | 1 or 0 |
| void SetFontToEditCOptions | ( | EDITC_OPTIONS * | options, |
| int | font ) |
Change text font.
| options | pointer to the EDITC_OPTIONS |
| font | see SystemFontID |
| void SetTextAttrToEditCOptions | ( | EDITC_OPTIONS * | options, |
| int | flags ) |
Set text attributes.
| options | pointer to the EDITC_OPTIONS |
| flags | see TextAttributesFlags |
| void SetAlignToEditCOptions | ( | EDITC_OPTIONS * | options, |
| int | flags ) |
Set text attributes.
| options | pointer to the EDITC_OPTIONS |
| flags | see TextAttributesFlags |
| void SetPenColorToEditCOptions | ( | EDITC_OPTIONS * | options, |
| int | pen ) |
Set text color.
| options | pointer to the EDITC_OPTIONS |
| pen | color index, see ThemePeletteColorID |
| void SetBrushColorToEditCOptions | ( | EDITC_OPTIONS * | options, |
| int | brush ) |
Set background color.
| options | pointer to the EDITC_OPTIONS |
| brush | color index, see ThemePeletteColorID |
| int CreateMenu | ( | int | style, |
| int | zero, | ||
| const MENU_DESC * | menu, | ||
| const HEADER_DESC * | header, | ||
| int | selected_item, | ||
| int | items_count, | ||
| void * | user_pointer, | ||
| int * | to_remove ) |
Create menu (list with items).
| style | size of the menu (1: small, 0: big) |
| zero | set to 0 |
| menu | pointer to the menu definition |
| header | pointer to the header definition |
| selected_item | index of the selected item in menu (from 0) |
| items_count | total count of the items |
| user_pointer | custom user pointer |
| to_remove | C-array with indexes to be removed from the menu (first array item is items count) |
| int CreateMultiLinesMenu | ( | int | style, |
| int | zero, | ||
| const ML_MENU_DESC * | menu, | ||
| const HEADER_DESC * | header, | ||
| int | selected_item, | ||
| int | items_count ) |
Create menu with multiline items (list with items).
| style | size of the menu (1: small, 0: big) |
| zero | set to 0 |
| menu | pointer to the menu definition |
| header | pointer to the header definition |
| selected_item | index of the selected item in menu (from 0) |
| items_count | total count of the items |
| int GetCurMenuItem | ( | void * | gui | ) |
| void SetMenuItemIcon | ( | void * | gui, |
| int | item_n, | ||
| int | icon ) |
Set icon for a menu item.
| gui | pointer to the Menu GUI |
| item_n | index of the menu item (0-based) |
| icon | index into the icon array (not a PIT ID) |
| void SetMenuItemIconIMGHDR | ( | void * | gui, |
| void * | item, | ||
| IMGHDR * | icon ) |
| void * AllocMenuItem | ( | void * | gui | ) |
Dynamic allocation of the menu item.
Used for menus with dynamic items.
| gui | pointer to the Menu GUI |
| void * AllocMLMenuItem | ( | void * | gui | ) |
Dynamic allocation of the menu item.
Used for menus with dynamic items.
| gui | pointer to the Menu GUI |
| WSHDR * AllocMenuWS | ( | void * | gui, |
| int | len ) |
Allocate WSHDR for using it in SetMenuItemText.
| void SetMenuItemIconArray | ( | void * | gui, |
| void * | item, | ||
| const int * | icons ) |
Set the icon array used by the menu.
Each menu item's icon is selected by index via SetMenuItemIcon().
| gui | pointer to the Menu GUI |
| item | pointer to the menu item |
| icons | array of icon IDs (PIT), terminated by 0 |
| void SetMenuItemText | ( | void * | gui, |
| void * | item, | ||
| WSHDR * | text, | ||
| int | item_n ) |
Set text to menu item.
| gui | pointer to the Menu GUI |
| item | pointer to the menu item |
| text | WSHDR string allocated with AllocMenuWS |
| item_n | index of the item |
Set text to menu item.
| gui | pointer to the Menu GUI |
| item | pointer to the menu item |
| text1 | WSHDR string allocated with AllocMenuWS |
| text2 | WSHDR string allocated with AllocMenuWS |
| item_n | index of the item |
| int GetMenuItemCount | ( | void * | gui | ) |
| void SetMenuItemCount | ( | void * | gui, |
| int | items_count ) |
Statically set items count in the menu.
| gui | pointer to the Menu GUI |
| items_count | total count of the items |
| void Menu_SetItemCountDyn | ( | void * | gui, |
| int | items_count ) |
Dynamically set items count on the menu.
You can use this function even for already created menus.
| gui | pointer to the Menu GUI |
| items_count | total count of the items |
| void SetCursorToMenuItem | ( | void * | gui, |
| int | item_n ) |
Scroll to the given menu item.
| gui | pointer to the Menu GUI |
| item_n | index of the item (from 0) |
| void UpdateMenuCursorItem | ( | void * | gui, |
| int | item_n ) |
Scroll to the given menu item and refresh the menu.
| gui | pointer to the Menu GUI |
| item_n | index of the item (from 0) |
| void SetMenuSearchCallBack | ( | void * | gui, |
| const MenuSearchCallBack | callback ) |
Set callback for the searching in the menu.
| gui | pointer to the Menu GUI |
| callback | search callback |
| void SetMenuSoftKey | ( | void * | gui, |
| const SOFTKEY_DESC * | softkey, | ||
| int | softkey_id ) |
Add softkey to the menu.
| gui | pointer to the Menu GUI |
| softkey | pointer to the softkey definition |
| softkey_id | see SetSoftKeyID |
| void SetHeaderToMenu | ( | void * | gui, |
| const HEADER_DESC * | header, | ||
| const void * | malloc_fn ) |
Set header to the GUI.
| gui | pointer to the GUI |
| header | pointer to the header definition |
| malloc_fn | pointer to the malloc() function, use result of malloc_adr |
| void * MenuGetUserPointer | ( | void * | gui | ) |
| void MenuSetUserPointer | ( | void * | gui, |
| void * | user_pointer ) |
Set custom user pointer to the menu.
| gui | pointer to the Menu GUI |
| user_pointer | custom user pointer |
Allocate GUI for single-line menu.
| malloc_fn | result of malloc_adr |
| mfree_fn | result of mfree_adr |
Allocate GUI for multi-line menu.
| malloc_fn | result of malloc_adr |
| mfree_fn | result of mfree_adr |
| void SetMenuToGUI | ( | void * | gui, |
| const void * | menu ) |
Attach the menu definition to the allocated GUI (by GetMenuGUI or GetMultiLinesMenuGUI).
| gui | pointer to the Menu GUI |
| menu | pointer to the MENU_DESC or ML_MENU_DESC |
| void * GetTabGUI | ( | void * | malloc_fn, |
| void * | mfree_fn ) |
Allocate GUI for tabs.
| malloc_fn | result of malloc_adr |
| mfree_fn | result of mfree_adr |
| int SetGUIToTabGUI | ( | void * | gui, |
| int | tab_n, | ||
| const int * | icons, | ||
| void * | content_gui ) |
| void * GetGuiByTab | ( | void * | gui, |
| int | tab_n ) |
| int SetCursorTab | ( | void * | gui, |
| int | tab_n ) |
Switch to the given tab.
| gui | pointer to the Tabs GUI |
| tab_n | index of the tab |
| int GetCursorTab | ( | void * | gui | ) |
| int UpdateTab1stItem | ( | void * | gui, |
| int | unk_0 ) |
Update content of the active tab.
| gui | pointer to the Tabs GUI |
| unk_0 | set to 0 |
Allocate GUI for TextView.
| malloc_fn | result of malloc_adr |
| mfree_fn | result of mfree_adr |
| void TViewSetDefinition | ( | void * | gui, |
| const TVIEW_DESC * | tv ) |
Attach the TextView definition to the allocated GUI.
| gui | pointer to the TextVIew GUI |
| tv | pointer to the TVIEW_DESC |
Set text to the TextView.
| gui | pointer to the TextVIew GUI |
| text | text content |
| malloc_fn | result of malloc_adr |
| mfree_fn | result of mfree_adr |
| void TViewSetUserPointer | ( | void * | gui, |
| void * | user_pointer ) |
Set custom user pointer to the TextView.
| gui | pointer to the TextView GUI |
| user_pointer | custom user pointer |
| void * TViewGetUserPointer | ( | void * | gui | ) |
| int CreateRadioButtonList | ( | const void * | items, |
| int | num, | ||
| const int * | exclude_ids, | ||
| int | exclude_count, | ||
| int | selected_id, | ||
| int(* | handler )(int item_id, int key, int user1, int user2), | ||
| int | flags, | ||
| int | header_lgp, | ||
| const int * | header_icon, | ||
| int | user1, | ||
| int | user2 ) |
Create radio button list.
| items | array of 20-byte items, the first word of each item is its ID |
| num | number of the items |
| exclude_ids | IDs of the items to hide, can be NULL |
| exclude_count | number of the IDs in exclude_ids |
| selected_id | ID of the checked item (used when bit 1 of flags is set) |
| handler | item handler, return 1 to close the list |
| flags | bit 0: alternative header and GUI style, bit 1: check selected_id |
| header_lgp | header text (LGP ID) |
| header_icon | header icon |
| user1 | passed to the handler |
| user2 | passed to the handler |
| void Scrollbar_Configure | ( | WIDGET * | scrollbar, |
| int | limit, | ||
| int | unk1, | ||
| int | unk2 ) |
Configure the scrollbar's behavior constraints.
| scrollbar | pointer to the Scrollbar WIDGET |
| limit | Maximum allowed switch operations (must be > 0) |
| unk1 | unknown, set to 0 |
| unk2 | unknown, set to 0 |
| void Scrollbar_SetValue | ( | WIDGET * | scrollbar, |
| int | value ) |
Set the scrollbar's current position.
| scrollbar | pointer to the Scrollbar WIDGET |
| value | scroll position in scrollbar units |
| void * RamMenuAnywhere | ( | ) |
Key sequence buffer of the "menu anywhere" shortcut (char[4]).