SWILIB API (NSG)    
Loading...
Searching...
No Matches
UI

Detailed Description

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   0x59D
 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.
 

Enumerations

enum  DialogFlags {
  DIALOG_FULLSCREEN = 0x00 ,
  DIALOG_NORMAL = 0x01 ,
  DIALOG_DUMMY_CSM = 0x10
}
 Dialog windows style flags. More...
 
enum  SetSoftKeyID {
  SET_LEFT_SOFTKEY = 0 ,
  SET_RIGHT_SOFTKEY = 1 ,
  SET_MIDDLE_SOFTKEY = 2
}
 Softkey IDs for SetSoftKey. More...
 
enum  EditControlTypeID {
  ECT_READ_ONLY = 0 ,
  ECT_HEADER = 1 ,
  ECT_NUMBER_TYPING = 2 ,
  ECT_NORMAL_TEXT = 3 ,
  ECT_CURSOR_STAY = 4 ,
  ECT_FIXED_STR_NUM = 5 ,
  ECT_NORMAL_NUM = 6 ,
  ECT_COMBO_BOX = 7 ,
  ECT_READ_ONLY_SELECTED = 8 ,
  ECT_LINK = 9 ,
  ECT_CALENDAR = 10 ,
  ECT_TIME = 11
}
 Types of the EditControl. More...
 
enum  EditControlFlags {
  ECF_NORMAL_STR = 0 ,
  ECF_SKIP = 4 ,
  ECF_INVISIBLE_CURSOR = 8 ,
  ECF_PASSW = 0x10 ,
  ECF_DELSTR = 0x20 ,
  ECF_APPEND_EOL = 0x40 ,
  ECF_SET_CURSOR_END = 0x80 ,
  ECF_DISABLE_NUM = 0x100 ,
  ECF_DISABLE_SMALL_LETTERS = 0x200 ,
  ECF_DISABLE_BIG_LETTERS = 0x400 ,
  ECF_DEFAULT_BIG_LETTER = 0x1000 ,
  ECF_DISABLE_T9 = 0x2000 ,
  ECF_DEFAULT_ITAP = 0x4000 ,
  ECF_DEFAULT_DIGIT = 0x8000 ,
  ECF_DISABLE_EOLCHAR = 0x10000 ,
  ECF_DISABLE_MINUS = 0x20000 ,
  ECF_DISABLE_POINT = 0x40000 ,
  ECF_LONGDIEZ_EQ_QUESTION = 0x80000 ,
  ECF_ENABLE_TEXT_FORMAT = 0x800000 ,
  ECF_MARKED = 0x2000000 ,
  ECF_GRAY = 0x4000000
}
 Flags for the EditControl. More...
 
enum  UIDialogCmdID {
  UI_CMD_CREATE = 0x2 ,
  UI_CMD_DESTROY = 0x3 ,
  UI_CMD_REDRAW = 0x7 ,
  UI_CMD_UNFOCUS = 0x9 ,
  UI_CMD_FOCUS = 0xA
}
 Ghook commands. More...
 
enum  TextInputDialogCmdID {
  TI_CMD_CREATE = 2 ,
  TI_CMD_DESTROY = 3 ,
  TI_CMD_REDRAW = 7 ,
  TI_CMD_UNFOCUS = 9 ,
  TI_CMD_FOCUS = 10 ,
  TI_CMD_SUBFOCUS_CHANGE = 12 ,
  TI_CMD_COMBOBOX_FOCUS = 13
}
 TextInputDialog ghook commands. More...
 
enum  InputDialogFlags {
  INPUTDIA_FLAGS_READONLY = 0x00000002 ,
  INPUTDIA_FLAGS_LOCK_CURSOR = 0x00000004 ,
  INPUTDIA_FLAGS_SWAP_SOFTKEYS = 0x40000000
}
 InputDialog options. More...
 
enum  MenuDialogFlags {
  MENU_FLAGS_ENABLE_ICONS = 0x00000001 ,
  MENU_FLAGS_ENABLE_TEXT_SCROLLING = 0x00000010 ,
  MENU_FLAGS_DISABLE_SCROLLBAR = 0x00000040 ,
  MENU_FLAGS_ENABLE_BIG_LETTERS = 0x00000080 ,
  MENU_FLAGS_ALIGN_RIGHT = 0x00000100 ,
  MENU_FLAGS_DISABLE_BREAKLINE = 0x00000400 ,
  MENU_FLAGS_ENABLE_SEARCH = 0x00010000
}
 Menu options. More...
 

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]).
 

Data Structure Documentation

◆ HEADER_DESC

struct HEADER_DESC

◆ SOFTKEY_DESC

struct SOFTKEY_DESC

◆ SOFTKEYSTAB

struct SOFTKEYSTAB

◆ EDITQ

struct EDITQ

◆ EDITC_OPTIONS

struct EDITC_OPTIONS

◆ EDITCONTROL

struct EDITCONTROL

◆ INPUTDIA_DESC

struct INPUTDIA_DESC

◆ USR_MENU_ITEM

struct USR_MENU_ITEM

◆ MENUITEM_DESC

struct MENUITEM_DESC

◆ MENU_DESC

struct MENU_DESC

◆ ML_MENU_DESC

struct ML_MENU_DESC

◆ POPUP_DESC

struct POPUP_DESC

◆ TVIEW_DESC

struct TVIEW_DESC

◆ TABGUI_DESC

struct TABGUI_DESC

◆ PBAR_DESC

struct PBAR_DESC

◆ SCROLLBAR_DESC

struct SCROLLBAR_DESC

Macro Definition Documentation

◆ SET_SOFT_KEY_N

#define SET_SOFT_KEY_N   SET_LEFT_SOFTKEY

Definition at line 113 of file ui.h.

◆ SET_SOFT_KEY_M

#define SET_SOFT_KEY_M   SET_MIDDLE_SOFTKEY

Definition at line 114 of file ui.h.

◆ MENU_FLAG3

#define MENU_FLAG3   3

Magic value.

Definition at line 121 of file ui.h.

◆ MENU_FLAG2

#define MENU_FLAG2   0x59D

Magic value.

Definition at line 122 of file ui.h.

◆ YDISP

#define YDISP   (0)

Iconbar height.

Definition at line 123 of file ui.h.

Typedef Documentation

◆ EDITCONTROL

typedef struct EDITCONTROL EDITCONTROL

Definition at line 20 of file ui.h.

◆ EDITC_OPTIONS

typedef struct EDITC_OPTIONS EDITC_OPTIONS

Definition at line 21 of file ui.h.

◆ EDITQ

typedef struct EDITQ EDITQ

Definition at line 22 of file ui.h.

◆ INPUTDIA_DESC

typedef struct INPUTDIA_DESC INPUTDIA_DESC

Definition at line 23 of file ui.h.

◆ USR_MENU_ITEM

typedef struct USR_MENU_ITEM USR_MENU_ITEM

Definition at line 24 of file ui.h.

◆ HEADER_DESC

typedef struct HEADER_DESC HEADER_DESC

Definition at line 25 of file ui.h.

◆ SOFTKEY_DESC

typedef struct SOFTKEY_DESC SOFTKEY_DESC

Definition at line 26 of file ui.h.

◆ SOFTKEYSTAB

typedef struct SOFTKEYSTAB SOFTKEYSTAB

Definition at line 27 of file ui.h.

◆ MENUITEM_DESC

typedef struct MENUITEM_DESC MENUITEM_DESC

Definition at line 28 of file ui.h.

◆ MENU_DESC

typedef struct MENU_DESC MENU_DESC

Definition at line 29 of file ui.h.

◆ ML_MENU_DESC

typedef struct ML_MENU_DESC ML_MENU_DESC

Definition at line 30 of file ui.h.

◆ POPUP_DESC

typedef struct POPUP_DESC POPUP_DESC

Definition at line 31 of file ui.h.

◆ TABGUI_DESC

typedef struct TABGUI_DESC TABGUI_DESC

Definition at line 32 of file ui.h.

◆ TVIEW_DESC

typedef struct TVIEW_DESC TVIEW_DESC

Definition at line 33 of file ui.h.

◆ PBAR_DESC

typedef struct PBAR_DESC PBAR_DESC

Definition at line 34 of file ui.h.

◆ SCROLLBAR_DESC

typedef struct SCROLLBAR_DESC SCROLLBAR_DESC

Definition at line 35 of file ui.h.

◆ MENUITEM_DRAW_PROC

typedef void(* MENUITEM_DRAW_PROC) (void *gui, int item_n, void *user_pointer)

Menu item draw callback.

Parameters
guipointer to the Menu GUI
item_nindex of the item
user_pointerpointer to the item

Definition at line 43 of file ui.h.

◆ MENUPROCS_DESC

typedef void(* MENUPROCS_DESC) (GUI *gui)

Menu item select callback.

Parameters
guipointer to the Menu GUI

Definition at line 49 of file ui.h.

◆ GUI_ONKEY_CALLBACK

typedef int(* GUI_ONKEY_CALLBACK) (GUI *gui, GUI_MSG *msg)

GUI keys handler.

Parameters
guipointer to the GUI
msgkeyboard message
Returns
value which passed to the GeneralFunc

Definition at line 57 of file ui.h.

◆ GUI_GHOOK_CALLBACK

typedef void(* GUI_GHOOK_CALLBACK) (GUI *gui, int cmd)

GUI global hook.

Parameters
guipointer to the GUI
cmdcommand from the GeneralFunc

Definition at line 64 of file ui.h.

◆ GUI_LOCRET_CALLBACK

typedef void(* GUI_LOCRET_CALLBACK) (void)

GUI locret callback (empty stub).

Definition at line 69 of file ui.h.

◆ MenuSearchCallBack

typedef int(* MenuSearchCallBack) (void *gui, WSHDR *search)

Menu search callback.

Parameters
guipointer to the GUI
searchsearch query
Returns
-1

Definition at line 77 of file ui.h.

◆ DialogFlags

typedef enum DialogFlags DialogFlags

Dialog windows style flags.

◆ PopupDialogFlags

Popup dialog flags.

Definition at line 91 of file ui.h.

◆ MsgBoxFlags

Flags for ShowMSG.

Definition at line 96 of file ui.h.

Enumeration Type Documentation

◆ DialogFlags

Dialog windows style flags.

Enumerator
DIALOG_FULLSCREEN 

Full-screen window.

DIALOG_NORMAL 

Normal (small) window.

DIALOG_DUMMY_CSM 

Create a dummy CSM.

Definition at line 82 of file ui.h.

◆ SetSoftKeyID

Softkey IDs for SetSoftKey.

Enumerator
SET_LEFT_SOFTKEY 

Left softkey.

SET_RIGHT_SOFTKEY 

Right softkey.

SET_MIDDLE_SOFTKEY 

Middle softkey.

Definition at line 101 of file ui.h.

◆ EditControlTypeID

Types of the EditControl.

Enumerator
ECT_READ_ONLY 
ECT_HEADER 
ECT_NUMBER_TYPING 
ECT_NORMAL_TEXT 
ECT_CURSOR_STAY 
ECT_FIXED_STR_NUM 
ECT_NORMAL_NUM 
ECT_COMBO_BOX 
ECT_READ_ONLY_SELECTED 
ECT_LINK 
ECT_CALENDAR 
ECT_TIME 

Definition at line 133 of file ui.h.

◆ EditControlFlags

Flags for the EditControl.

Enumerator
ECF_NORMAL_STR 
ECF_SKIP 
ECF_INVISIBLE_CURSOR 
ECF_PASSW 
ECF_DELSTR 
ECF_APPEND_EOL 
ECF_SET_CURSOR_END 
ECF_DISABLE_NUM 
ECF_DISABLE_SMALL_LETTERS 
ECF_DISABLE_BIG_LETTERS 
ECF_DEFAULT_BIG_LETTER 

Enable big letter after ". ".

ECF_DISABLE_T9 
ECF_DEFAULT_ITAP 
ECF_DEFAULT_DIGIT 
ECF_DISABLE_EOLCHAR 

In chartable.

ECF_DISABLE_MINUS 

Also disable #.

ECF_DISABLE_POINT 

Also disable *.

ECF_LONGDIEZ_EQ_QUESTION 
ECF_ENABLE_TEXT_FORMAT 
ECF_MARKED 
ECF_GRAY 

Definition at line 151 of file ui.h.

◆ UIDialogCmdID

Ghook commands.

Enumerator
UI_CMD_CREATE 
UI_CMD_DESTROY 
UI_CMD_REDRAW 
UI_CMD_UNFOCUS 
UI_CMD_FOCUS 

Definition at line 178 of file ui.h.

◆ TextInputDialogCmdID

TextInputDialog ghook commands.

Enumerator
TI_CMD_CREATE 
TI_CMD_DESTROY 
TI_CMD_REDRAW 
TI_CMD_UNFOCUS 
TI_CMD_FOCUS 
TI_CMD_SUBFOCUS_CHANGE 
TI_CMD_COMBOBOX_FOCUS 

Definition at line 189 of file ui.h.

◆ InputDialogFlags

InputDialog options.

Enumerator
INPUTDIA_FLAGS_READONLY 
INPUTDIA_FLAGS_LOCK_CURSOR 
INPUTDIA_FLAGS_SWAP_SOFTKEYS 

Definition at line 202 of file ui.h.

◆ MenuDialogFlags

Menu options.

Enumerator
MENU_FLAGS_ENABLE_ICONS 
MENU_FLAGS_ENABLE_TEXT_SCROLLING 
MENU_FLAGS_DISABLE_SCROLLBAR 
MENU_FLAGS_ENABLE_BIG_LETTERS 
MENU_FLAGS_ALIGN_RIGHT 
MENU_FLAGS_DISABLE_BREAKLINE 
MENU_FLAGS_ENABLE_SEARCH 

Definition at line 211 of file ui.h.

Function Documentation

◆ SetHeader()

void SetHeader ( void * gui,
const HEADER_DESC * header,
const void * malloc_fn )

Set header to the GUI.

Parameters
guipointer to the GUI
headerpointer to the header definition
malloc_fnpointer to the malloc() function, use result of malloc_adr

◆ GetHeaderPointer()

void * GetHeaderPointer ( void * gui)

Get pointer to the UI header.

Parameters
guipointer to the any GUI
Returns
pointer

◆ SetHeaderText()

void SetHeaderText ( void * header,
const WSHDR * title,
const void * malloc_fn,
const void * mfree_fn )

Set main text to the UI header.

Parameters
headerpointer to the header (GetHeaderPointer)
titlenew title value
malloc_fnresult of malloc_adr()
mfree_fnresult of mfree_adr()

◆ SetHeaderScrollText()

void SetHeaderScrollText ( void * header,
const WSHDR * title,
const void * malloc_fn,
const void * mfree_fn )

Set scolled text to the UI header.

Parameters
headerpointer to the header (GetHeaderPointer)
titlenew title value
malloc_fnresult of malloc_adr()
mfree_fnresult of mfree_adr()

◆ SetHeaderExtraText()

void SetHeaderExtraText ( void * header,
const WSHDR * ws,
const void * malloc_fn,
const void * mfree_fn )

Set extra text to the UI header.

Parameters
headerpointer to the header (GetHeaderPointer)
wsnew extra title value
malloc_fnresult of malloc_adr()
mfree_fnresult of mfree_adr()

◆ SetHeaderIcon()

void SetHeaderIcon ( void * header,
const int * icons,
const void * malloc_fn,
const void * mfree_fn )

Set icons of the UI header.

Parameters
headerpointer to the header (GetHeaderPointer)
iconsC-array of the icons (ID from PIT or pointer to IMGHDR), last item is always 0
Note
The icons array is not copied and must stay valid while the GUI exists.
Parameters
malloc_fnresult of malloc_adr()
mfree_fnresult of mfree_adr()

◆ SetSoftKey()

void SetSoftKey ( void * gui,
const SOFTKEY_DESC * softkey,
int softkey_id )

Add softkey to the GUI.

Parameters
guipointer to the any GUI
softkeypointer to the softkey definition
softkey_idsee SetSoftKeyID

◆ RefreshGUI()

void RefreshGUI ( void )

Force refresh current GUI.

◆ SetGUIDefinition()

void SetGUIDefinition ( void * gui,
const void * definition )

Set UI definition to the GUI.

Parameters
guipointer to the any GUI
definitionpointer to the MENU_DESC, ML_MENU_DESC, TABGUI_DESC, INPUTDIA_DESC, POPUP_DESC, TVIEW_DESC

◆ FindItemByID()

void * FindItemByID ( GUI * gui,
int id )

Find private item in the GUI.

Parameters
guipointer to the any GUI
idID of the private item
Returns
pointer to the item structure

◆ GetDataOfItemByID()

void * GetDataOfItemByID ( GUI * gui,
int id )

Get data of the private item in the GUI.

Parameters
guipointer to the any GUI
idID of the private item
Returns
pointer to the item data

◆ GetHeaderRECT()

RECT * GetHeaderRECT ( void )

Size of UI header.

Returns
pointer to the rect

◆ GetOptionsHeaderRECT()

RECT * GetOptionsHeaderRECT ( void )

Size of UI options header.

Returns
pointer to the rect

◆ GetMainAreaRECT()

RECT * GetMainAreaRECT ( void )

Size of UI main area.

Returns
pointer to the rect

◆ SetWidgetRect()

void SetWidgetRect ( void * widget,
int x,
int y,
int x2,
int y2 )

Dynamically set the bounding rectangle for the widget.

Parameters
widgetpointer to the widget
xtop-left X coordinate of the widget rectangle
ytop-left Y coordinate of the widget rectangle
x2bottom-right X coordinate of the widget rectangle
y2bottom-right Y coordinate of the widget rectangle

◆ AddIconToIconBar()

void AddIconToIconBar ( int pic,
short * num )

Push icon to the iconbar (E/EL71).

Parameters
picnumber of the icon in PIT table
numpoinetr to the icon index (from iconbar hook)

Call this function the iconbar hook.

Warning
Depend of the patch: https://patches.kibab.com/patches/search.php5?action=search&kw=Elfs+can+add+icons+to+iconbar

◆ GUI_GetUserPointer()

void * GUI_GetUserPointer ( void * gui)

Get custom user pointer from standard GUI, like Menu.

Parameters
guipointer to the standard GUI
Returns
pointer

◆ GUI_SetUserPointer()

void GUI_SetUserPointer ( void * gui,
void * user_pointer )

Set custom user pointer to the GUI, like Menu.

Parameters
guipointer to the standard GUI
user_pointercustom user pointer

◆ RamIconBar()

char * RamIconBar ( )

Pointer to the status of iconbar (EL/E71).

Returns
1: enabled, 0: disabled
Available on platforms:
ELKA
int iconbar_is_enabled = *RamIconBar();
char * RamIconBar()
Pointer to the status of iconbar (EL/E71).

◆ IsIconBarDisabled()

int IsIconBarDisabled ( )

Check state of iconbar (EL71/E71).

It can be disabled by DisableIconBar function.

Returns
1 or 0
Available on platforms:
ELKA

◆ DisableIconBar()

void DisableIconBar ( int disable)

Enable or disable global iconbar on EL/E71.

Parameters
disable1 for disable, 0 for enable

◆ AttachWidget()

void AttachWidget ( void * gui,
const void * widget,
int id,
const void * malloc_fn )

Attach a widget to the GUI.

Parameters
guipointer to the GUI
widgetpointer to the WIDGET
idan identifier for the widget
malloc_fnresult of malloc_adr

◆ ShowMSG()

int ShowMSG ( int flags,
int message )

Show info popup.

Parameters
flagssee MsgBoxFlags
messageid from the langpack or pointer to the C-string
Returns
GUI ID
ShowMSG(0, (int) "Hello World!")
int ShowMSG(int flags, int message)
Show info popup.

◆ MsgBoxError()

int MsgBoxError ( int flags,
int message )

Show error popup.

Parameters
flagssee MsgBoxFlags
messageid from the langpack or pointer to the C-string
Returns
GUI ID
MsgBoxError(0, (int) "Error!")
int MsgBoxError(int flags, int message)
Show error popup.

◆ MsgBoxYesNo()

int MsgBoxYesNo ( int flags,
int message,
void(* callback )(int canceled) )

Confirmation popup with Yes/No.

Parameters
flagssee PopupDialogFlags
messageid from the langpack or pointer to the C-string
callbackcallback for handling popup answer
Returns
GUI ID
void erase_eeprom_handler(int canceled) {
if (!canceled) { // YES
do_erase();
} else { // NO
// ...
}
}
// ...
MsgBoxYesNo(0, (int) "Erase EEPROM?", erase_eeprom_handler)
int MsgBoxYesNo(int flags, int message, void(*callback)(int canceled))
Confirmation popup with Yes/No.

◆ MsgBoxOkCancel()

int MsgBoxOkCancel ( int flags,
int message,
void(* callback )(int canceled) )

Confirmation popup with Ok/Cancel.

Parameters
flagssee PopupDialogFlags
messageid from the langpack or pointer to the C-string
callbackcallback for handling popup answer
Returns
GUI ID
void erase_eeprom_handler(int canceled) {
if (!canceled) { // YES
do_erase();
} else { // NO
// ...
}
}
// ...
MsgBoxOkCancel(0, (int) "Erase EEPROM?", erase_eeprom_handler)
int MsgBoxOkCancel(int flags, int message, void(*callback)(int canceled))
Confirmation popup with Ok/Cancel.

◆ ShowWaitBox()

int ShowWaitBox ( int flags,
int message )

Wait popup.

Parameters
flagssee PopupDialogFlags
messageid from the langpack or pointer to the C-string
Returns
GUI_ID

◆ ShowPleaseWaitBox()

int ShowPleaseWaitBox ( int flags)

'Please wait' popup.

Parameters
flagsPopupDialogFlags
Returns
GUI_ID

◆ GetPBarProc3()

void * GetPBarProc3 ( )

Get pointer for proc3 method of PBAR_DESC struct.

Returns
pointer
Pointer to the memory:
FLASH

◆ ShowPBarBox()

int ShowPBarBox ( int flags,
int message,
PBAR_DESC * pbar_desc,
int initial_value,
WSHDR * initial_ws )

Progressbar popup.

Parameters
flagsPopupDialogFlags
messageid from the langpack or pointer to the C-string
pbar_descpointer to the PBAR_DESC or NULL
initial_valueinitial value 0-100
initial_wspointer to initial WSHDR string or NULL. The passed WSHDR will be destroyed by the function; caller must not free it.
Returns
GUI_ID

◆ SetPBarValue()

int SetPBarValue ( int gui_id,
int value )

Set value to progressbar popup.

Parameters
gui_idprogressbar GUI ID
valuevalue
Returns
1: success, 0: error

◆ SetPBarText()

int SetPBarText ( int gui_id,
WSHDR * ws )

Set WSHDR string to progressbar popup.

Parameters
gui_idprogressbar GUI ID
wspointer to WSHDR string, don't need to free memory
Returns
1: success, 0: error

◆ CreatePopupGUI()

int CreatePopupGUI ( int flags,
void * user_pointer,
const POPUP_DESC * popup,
int lgp_id )

Create custom Popup.

Parameters
flagssee PopupDialogFlags
user_pointercustom user pointer
popuppointer to the Popup definition
lgp_idPopup message, LGP ID or pointer to the C-string
Returns
GUI ID

◆ CreatePopupGUI_ws()

int CreatePopupGUI_ws ( int flags,
void * user_pointer,
const POPUP_DESC * popup,
const WSHDR * message )

Create custom Popup.

Parameters
flagssee PopupDialogFlags
user_pointercustom user pointer
popuppointer to the Popup definition
messageUTF-16 pascal-style string
Returns
GUI ID

◆ GetPopupUserPointer()

void * GetPopupUserPointer ( void * gui)

Get user pointer from the popup.

Parameters
guipointer to the Popup GUI
Returns
pointer

◆ CreateInputTextDialog()

int CreateInputTextDialog ( const INPUTDIA_DESC * input_desc,
const HEADER_DESC * header_desc,
EDITQ * eq,
int do_mfree,
void * user_pointer )

Create InputDialog GUI.

Parameters
input_descdefinition of the InputDialog
header_descdefinition of the dialog header
eqlist of the edit controls
do_mfreeset to 1 if you want free eq data
user_pointercustom user pointer
Returns
GUI ID

◆ EDIT_GetGUI()

void * EDIT_GetGUI ( const void * malloc_fn,
const void * mfree_fn )

Allocate GUI for the Input.

Parameters
malloc_fnresult of malloc_adr
mfree_fnresult of mfree_adr
Returns
new allocated GUI

◆ EDIT_SetDefinition()

void EDIT_SetDefinition ( void * gui,
const INPUTDIA_DESC * input_desc )

Attach the Input definition to the allocated GUI.

Parameters
guipointer to the Input GUI
input_descpointer to the INPUTDIA_DESC

◆ EDIT_SetUserPointer()

void EDIT_SetUserPointer ( void * gui,
void * user_pointer )

Set custom user pointer to the Input.

Parameters
guipointer to the Input GUI
user_pointercustom user pointer

◆ EDIT_GetUserPointer()

void * EDIT_GetUserPointer ( void * gui)

Get user pointer from the InputDialog.

Parameters
guipointer to the InputDialog GUI
Returns
pointer

◆ EDIT_IsBusy()

int EDIT_IsBusy ( void * gui)

Check if InputDialog is busy.

Parameters
guipointer to the InputDialog GUI
Returns
1: busy, 0: not busy

◆ EDIT_OpenOptionMenuWithUserItems()

int EDIT_OpenOptionMenuWithUserItems ( void * gui,
void(* itemhandler )(USR_MENU_ITEM *item),
void * user_pointer,
int to_add )

◆ AllocEQueue()

EDITQ * AllocEQueue ( const void * malloc_func,
const void * mfree_func )

List of the edit controls.

Parameters
malloc_funcresult of malloc_adr
mfree_funcresult of mfree_adr
Returns
allocated EDITQ

◆ EDIT_SetEQueue()

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.

Parameters
guipointer to the Input GUI
eqlist of the edit controls
do_mfreeset to 1 if you want free eq data
malloc_fnresult of malloc_adr

◆ PrepareEditControl()

EDITCONTROL * PrepareEditControl ( EDITCONTROL * ec)

Pre-initialize EDITCONTROL structure.

Parameters
ecpointer to the EDITCONTROL
Returns
bypass ec

Typical usage:

PrepareEditControl(&ec); // <--- initialize
// One control
AddEditControlToEditQend(eq, ec, mallloc_adr()); // <-- copy to the list
// Second control
AddEditControlToEditQend(eq, ec, mallloc_adr()); // <-- copy to the list
EDITQ * AllocEQueue(const void *malloc_func, const void *mfree_func)
List of the edit controls.
int AddEditControlToEditQend(EDITQ *eq, const EDITCONTROL *ec, const void *malloc_func)
Add edit control to the end of the list.
void ConstructEditControl(EDITCONTROL *ec, int type, int flags, const WSHDR *title, int maxlen)
Create new edit control.
EDITCONTROL * PrepareEditControl(EDITCONTROL *ec)
Pre-initialize EDITCONTROL structure.
@ ECF_NORMAL_STR
Definition ui.h:152
@ ECF_APPEND_EOL
Definition ui.h:157
@ ECT_NORMAL_TEXT
Definition ui.h:137
EditControl definition.
Definition ui.h:277
Linked-list of the EditControl's.
Definition ui.h:255
void * malloc_adr(void)
Pointer to the function malloc().
void * mfree_adr(void)
Pointer to the function free().

◆ ConstructEditControl()

void ConstructEditControl ( EDITCONTROL * ec,
int type,
int flags,
const WSHDR * title,
int maxlen )

Create new edit control.

Parameters
ecpointer to the EDITCONTROL
typeedit control type, see EditControlTypeID
flagsedit control flags, see EditControlFlags
titleedit control title, can be NULL
maxlenmaximum length of the value

◆ ConstructComboBox()

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.

Parameters
ecpointer to the EDITCONTROL
typeedit control type, see EditControlTypeID
flagsedit control flags, see EditControlFlags
titleedit control title, can be NULL
maxlenmaximum length of the value
unk_zeroset to 0
items_countitems count in the combo-box
selected_itemselected item index (from 1)

◆ ConstructEditTime()

int ConstructEditTime ( EDITCONTROL * ec,
const TTime * time )

Create new edit control (Time).

Use in pair with ConstructEditControl

Parameters
ecpointer to the constructed edit control with type ECT_TIME
timedefault value

◆ ConstructEditDate()

int ConstructEditDate ( EDITCONTROL * ec,
const TDate * date )

Create new edit control (Date).

Use in pair with ConstructEditControl

Parameters
ecpointer to the constructed edit control with type ECT_CALENDAR
datedefault value

◆ CopyOptionsToEditControl()

void CopyOptionsToEditControl ( EDITCONTROL * ec,
const EDITC_OPTIONS * options )

Set options to the edit control.

Parameters
ecpointer to the initilaized EDITCONTROL
optionspointer to the options

◆ AddEditControlToEditQend()

int AddEditControlToEditQend ( EDITQ * eq,
const EDITCONTROL * ec,
const void * malloc_func )

Add edit control to the end of the list.

  • Note
    This function copies EDITCONTROL structure. You can safely for free or change it after a call.
    Parameters
    eqpointer to the list of the edit controls
    ecpointer to the initilaized EDITCONTROL
    malloc_funcresult of malloc_adr
    Returns
    1: success, 0: error

◆ EDIT_GetFocus()

int EDIT_GetFocus ( void * gui)

Get index of the focused edit control.

Returns
index

◆ EDIT_GetUnFocus()

int EDIT_GetUnFocus ( void * gui)

Get index of the previous focused edit control.

Returns
index

◆ EDIT_SetFocus()

void EDIT_SetFocus ( void * gui,
int n )

Focus given edit control.

Parameters
guipointer to the InputDialog GUI
nindex of the edit control to be focused

◆ EDIT_RemoveEditControl()

void EDIT_RemoveEditControl ( void * gui,
int n )

Remove edit control for the InputDialog.

Parameters
guipointer to the InputDialog GUI
nindex of the edit control

◆ EDIT_InsertEditControl()

void EDIT_InsertEditControl ( void * gui,
int n,
const EDITCONTROL * ec )

Insert edit control to the InputDialog.

Note
This function copies EDITCONTROL structure. You can safely for free or change it after a call.
Parameters
guipointer to the InputDialog GUI
nindex where will be inserted
ecpointer to new EDITCONTROL

◆ ExtractEditControl()

int ExtractEditControl ( void * gui,
int n,
EDITCONTROL * ec )

Get a copy of the edit control in the InputDialog.

Parameters
guipointer to the InputDialog GUI
nindex of control in the list
ecpointer to EDITCONTROL where there will be a stored copy of the extracted control
Returns
1: success, 0: error

◆ EDIT_ExtractFocusedControl()

void EDIT_ExtractFocusedControl ( void * gui,
EDITCONTROL * ec )

Get a copy of the focused edit control in the InputDialog.

Parameters
guipointer to the InputDialog GUI
ecpointer to EDITCONTROL where there will be a stored copy of the extracted control

◆ StoreEditControl()

int StoreEditControl ( void * gui,
int n,
const EDITCONTROL * ec )

Replace the edit control in the InputDialog.

Note
This function copies EDITCONTROL structure. You can safely for free or change it after a call.
Parameters
guipointer to the InputDialog GUI
nindex of control in the list
ecpointer to new EDITCONTROL
Returns
1: success, 0: error

◆ EDIT_StoreControlToFocused()

int EDIT_StoreControlToFocused ( void * gui,
const EDITCONTROL * ec )

Replace focused edit control in the InputDialog.

Note
This function copies EDITCONTROL structure. You can safely for free or change it after a call.
Parameters
guipointer to the InputDialog GUI
ecpointer to new EDITCONTROL
Returns
1: success, 0: error

◆ EDIT_SetTextToFocused()

void EDIT_SetTextToFocused ( void * gui,
const WSHDR * value )

Set value to the focused edit control.

Parameters
guipointer to the InputDialog GUI
valuenew value

◆ EDIT_SetTextToEditControl()

int EDIT_SetTextToEditControl ( void * gui,
int n,
const WSHDR * value )

Set value to the given edit control.

Parameters
guipointer to the InputDialog GUI
nindex of the edit control
valuenew value

◆ EDIT_GetItemNumInFocusedComboBox()

int EDIT_GetItemNumInFocusedComboBox ( void * gui)

Get item index in the focused ComboBox.

Parameters
guipointer to the InputDialog GUI
Returns
item index, from 1

◆ EDIT_SetDate()

void EDIT_SetDate ( void * gui,
int n,
const TDate * date )

Set date value to the edit control.

Parameters
guipointer to the InputDialog GUI
nindex of the edit control
datenew value

◆ EDIT_SetTime()

void EDIT_SetTime ( void * gui,
int n,
const TTime * time )

Set time value to the edit control.

Parameters
guipointer to the InputDialog GUI
nindex of the edit control
timenew value

◆ EDIT_GetDate()

void EDIT_GetDate ( void * gui,
int n,
TDate * date )

Get date value from the edit control.

Parameters
guipointer to the InputDialog GUI
nindex of the edit control
[out]datedate value

◆ EDIT_GetTime()

void EDIT_GetTime ( void * gui,
int n,
TTime * time )

Get time value from the edit control.

Parameters
guipointer to the InputDialog GUI
nindex of the edit control
[out]timetime value

◆ EDIT_GetCursorPos()

int EDIT_GetCursorPos ( void * gui)

Get cursor position in text.

Function working with current focused edit control.

Parameters
guipointer to the InputDialog GUI
Returns
position

◆ EDIT_SetCursorPos()

void EDIT_SetCursorPos ( void * gui,
int position )

Set cursor position in text.

Function working with current focused edit control.

Parameters
guipointer to the InputDialog GUI
positionnew cursor position

◆ EDIT_IsMarkModeActive()

int EDIT_IsMarkModeActive ( void * gui)

Check if text selection enabled.

Function working with current focused edit control.

Parameters
guipointer to the InputDialog GUI
Returns
1 or 0

◆ EDIT_GetMarkedText()

int EDIT_GetMarkedText ( void * gui,
WSHDR * selected_text )

Get value of the selected text.

Function working with current focused edit control.

Parameters
guipointer to the InputDialog GUI
[out]selected_textvalue of the selected text
Returns
1 or 0

◆ EDIT_SetTextInvert()

int EDIT_SetTextInvert ( void * gui,
int position,
int len )

Invert background of the part of text.

Function working with current focused edit control.

Parameters
guipointer to the InputDialog GUI
positionposition in the text te be inverted
lenlength of the text te be inverted
Returns
1 or 0

◆ EDIT_RemoveTextInvert()

void EDIT_RemoveTextInvert ( void * gui)

Remove text background ivertion.

Function working with current focused edit control.

Parameters
guipointer to the InputDialog GUI

◆ PrepareEditCOptions()

EDITC_OPTIONS * PrepareEditCOptions ( EDITC_OPTIONS * options)

Initialize EDITC_OPTIONS structure.

Parameters
optionspointer to the EDITC_OPTIONS
Returns
bypass options

◆ SetInvertToEditCOptions()

void SetInvertToEditCOptions ( EDITC_OPTIONS * options,
int invert )

Enable background inversion.

Parameters
optionspointer to the EDITC_OPTIONS
invert1 or 0

◆ SetFontToEditCOptions()

void SetFontToEditCOptions ( EDITC_OPTIONS * options,
int font )

Change text font.

Parameters
optionspointer to the EDITC_OPTIONS
fontsee SystemFontID

◆ SetTextAttrToEditCOptions()

void SetTextAttrToEditCOptions ( EDITC_OPTIONS * options,
int flags )

Set text attributes.

Parameters
optionspointer to the EDITC_OPTIONS
flagssee TextAttributesFlags

◆ SetAlignToEditCOptions()

void SetAlignToEditCOptions ( EDITC_OPTIONS * options,
int flags )

Set text attributes.

Parameters
optionspointer to the EDITC_OPTIONS
flagssee TextAttributesFlags
Deprecated
Function with wrong name, use instead SetTextAttrToEditCOptions

◆ SetPenColorToEditCOptions()

void SetPenColorToEditCOptions ( EDITC_OPTIONS * options,
int pen )

Set text color.

Parameters
optionspointer to the EDITC_OPTIONS
pencolor index, see ThemePeletteColorID

◆ SetBrushColorToEditCOptions()

void SetBrushColorToEditCOptions ( EDITC_OPTIONS * options,
int brush )

Set background color.

Parameters
optionspointer to the EDITC_OPTIONS
brushcolor index, see ThemePeletteColorID

◆ CreateMenu()

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).

Parameters
stylesize of the menu (1: small, 0: big)
zeroset to 0
menupointer to the menu definition
headerpointer to the header definition
selected_itemindex of the selected item in menu (from 0)
items_counttotal count of the items
user_pointercustom user pointer
to_removeC-array with indexes to be removed from the menu (first array item is items count)
Returns
GUI ID

◆ CreateMultiLinesMenu()

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).

Parameters
stylesize of the menu (1: small, 0: big)
zeroset to 0
menupointer to the menu definition
headerpointer to the header definition
selected_itemindex of the selected item in menu (from 0)
items_counttotal count of the items
Returns
GUI ID

◆ GetCurMenuItem()

int GetCurMenuItem ( void * gui)

Get index of the selected item in menu.

Parameters
guipointer to the Menu GUI
Returns
index

◆ SetMenuItemIcon()

void SetMenuItemIcon ( void * gui,
int item_n,
int icon )

Set icon for a menu item.

Note
SetMenuItemIconArray() must be called before this function.
Parameters
guipointer to the Menu GUI
item_nindex of the menu item (0-based)
iconindex into the icon array (not a PIT ID)

◆ SetMenuItemIconIMGHDR()

void SetMenuItemIconIMGHDR ( void * gui,
void * item,
IMGHDR * icon )

Add icon to the list item (IMGHDR).

Parameters
guipointer to the Menu GUI
itempointer to the menu item
iconpointer to IMGHDR

◆ AllocMenuItem()

void * AllocMenuItem ( void * gui)

Dynamic allocation of the menu item.

Used for menus with dynamic items.

Note
Only for single-line menu (CreateMenu).
Parameters
guipointer to the Menu GUI
Returns
new allocated menu item

◆ AllocMLMenuItem()

void * AllocMLMenuItem ( void * gui)

Dynamic allocation of the menu item.

Used for menus with dynamic items.

Note
Only for multi-line menu (CreateMultiLinesMenu).
Parameters
guipointer to the Menu GUI
Returns
new allocated menu item

◆ AllocMenuWS()

WSHDR * AllocMenuWS ( void * gui,
int len )

Allocate WSHDR for using it in SetMenuItemText.

Parameters
guipointer to the Menu GUI
lenmaximum length of the WSHDR
Returns
new allocated WSHDR

◆ SetMenuItemIconArray()

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().

Parameters
guipointer to the Menu GUI
itempointer to the menu item
iconsarray of icon IDs (PIT), terminated by 0

◆ SetMenuItemText()

void SetMenuItemText ( void * gui,
void * item,
WSHDR * text,
int item_n )

Set text to menu item.

Parameters
guipointer to the Menu GUI
itempointer to the menu item
textWSHDR string allocated with AllocMenuWS
item_nindex of the item
Note
Only for single-line menu (CreateMenu).

◆ SetMLMenuItemText()

void SetMLMenuItemText ( void * gui,
void * item,
WSHDR * text1,
WSHDR * text2,
int item_n )

Set text to menu item.

Parameters
guipointer to the Menu GUI
itempointer to the menu item
text1WSHDR string allocated with AllocMenuWS
text2WSHDR string allocated with AllocMenuWS
item_nindex of the item
Note
Only for multi-line menu (CreateMultiLinesMenu).

◆ GetMenuItemCount()

int GetMenuItemCount ( void * gui)

Get count of items on the menu.

Parameters
guipointer to the Menu GUI
Returns
count

◆ SetMenuItemCount()

void SetMenuItemCount ( void * gui,
int items_count )

Statically set items count in the menu.

Note
Use this function only when you create a menu from scratch instead of CreateMenu
Parameters
guipointer to the Menu GUI
items_counttotal count of the items

◆ Menu_SetItemCountDyn()

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.

Parameters
guipointer to the Menu GUI
items_counttotal count of the items

◆ SetCursorToMenuItem()

void SetCursorToMenuItem ( void * gui,
int item_n )

Scroll to the given menu item.

Parameters
guipointer to the Menu GUI
item_nindex of the item (from 0)

◆ UpdateMenuCursorItem()

void UpdateMenuCursorItem ( void * gui,
int item_n )

Scroll to the given menu item and refresh the menu.

Parameters
guipointer to the Menu GUI
item_nindex of the item (from 0)
Note
Unlike SetCursorToMenuItem, it also re-applies the item count (relayout and redraw).
Updates the scrollbar when the menu is focused.

◆ SetMenuSearchCallBack()

void SetMenuSearchCallBack ( void * gui,
const MenuSearchCallBack callback )

Set callback for the searching in the menu.

Parameters
guipointer to the Menu GUI
callbacksearch callback

◆ SetMenuSoftKey()

void SetMenuSoftKey ( void * gui,
const SOFTKEY_DESC * softkey,
int softkey_id )

Add softkey to the menu.

Parameters
guipointer to the Menu GUI
softkeypointer to the softkey definition
softkey_idsee SetSoftKeyID
Deprecated
Use SetSoftKey instead.

◆ SetHeaderToMenu()

void SetHeaderToMenu ( void * gui,
const HEADER_DESC * header,
const void * malloc_fn )

Set header to the GUI.

Parameters
guipointer to the GUI
headerpointer to the header definition
malloc_fnpointer to the malloc() function, use result of malloc_adr
Deprecated
Use SetHeader instead.

◆ MenuGetUserPointer()

void * MenuGetUserPointer ( void * gui)

Get custom user pointer from menu.

Parameters
guipointer to the Menu GUI
Returns
pointer

◆ MenuSetUserPointer()

void MenuSetUserPointer ( void * gui,
void * user_pointer )

Set custom user pointer to the menu.

Parameters
guipointer to the Menu GUI
user_pointercustom user pointer

◆ GetMenuGUI()

void * GetMenuGUI ( const void * malloc_fn,
const void * mfree_fn )

Allocate GUI for single-line menu.

Note
Low-level function, use CreateMenu instead.
Parameters
malloc_fnresult of malloc_adr
mfree_fnresult of mfree_adr
Returns
new allocated GUI

◆ GetMultiLinesMenuGUI()

void * GetMultiLinesMenuGUI ( const void * malloc_fn,
const void * mfree_fn )

Allocate GUI for multi-line menu.

Note
Low-level function, use CreateMenu instead.
Parameters
malloc_fnresult of malloc_adr
mfree_fnresult of mfree_adr
Returns
new allocated GUI

◆ SetMenuToGUI()

void SetMenuToGUI ( void * gui,
const void * menu )

Attach the menu definition to the allocated GUI (by GetMenuGUI or GetMultiLinesMenuGUI).

Parameters
guipointer to the Menu GUI
menupointer to the MENU_DESC or ML_MENU_DESC
Note
Low-level function, use CreateMenu instead.

◆ GetTabGUI()

void * GetTabGUI ( void * malloc_fn,
void * mfree_fn )

Allocate GUI for tabs.

Parameters
malloc_fnresult of malloc_adr
mfree_fnresult of mfree_adr
Returns
new allocated GUI

◆ SetGUIToTabGUI()

int SetGUIToTabGUI ( void * gui,
int tab_n,
const int * icons,
void * content_gui )

Link content gui with tab.

Parameters
guipointer to the Tabs GUI
tab_nindex of the tab
iconsC-array of the tab icons (ID from PIT or pointer to IMGHDR), last item is always 0
content_guipointer to the GUI for the tab content
Returns
1: success, 0: error

◆ GetGuiByTab()

void * GetGuiByTab ( void * gui,
int tab_n )

Get GUI of the tab content.

Parameters
guipointer to the Tabs GUI
tab_nindex of the tab
Returns
pointer to the GUI for the tab content

◆ SetCursorTab()

int SetCursorTab ( void * gui,
int tab_n )

Switch to the given tab.

Parameters
guipointer to the Tabs GUI
tab_nindex of the tab
Returns
1: success, 0: error

◆ GetCursorTab()

int GetCursorTab ( void * gui)

Get index of the active tab.

Parameters
guipointer to the Tabs GUI
Returns
index

◆ UpdateTab1stItem()

int UpdateTab1stItem ( void * gui,
int unk_0 )

Update content of the active tab.

Parameters
guipointer to the Tabs GUI
unk_0set to 0
Returns
1: success, 0: error

◆ TViewGetGUI()

void * TViewGetGUI ( const void * malloc_fn,
const void * mfree_fn )

Allocate GUI for TextView.

Parameters
malloc_fnresult of malloc_adr
mfree_fnresult of mfree_adr
Returns
new allocated GUI

◆ TViewSetDefinition()

void TViewSetDefinition ( void * gui,
const TVIEW_DESC * tv )

Attach the TextView definition to the allocated GUI.

Parameters
guipointer to the TextVIew GUI
tvpointer to the TVIEW_DESC

◆ TViewSetText()

void TViewSetText ( void * gui,
const WSHDR * text,
const void * malloc_fn,
const void * mfree_fn )

Set text to the TextView.

Parameters
guipointer to the TextVIew GUI
texttext content
malloc_fnresult of malloc_adr
mfree_fnresult of mfree_adr

◆ TViewSetUserPointer()

void TViewSetUserPointer ( void * gui,
void * user_pointer )

Set custom user pointer to the TextView.

Parameters
guipointer to the TextView GUI
user_pointercustom user pointer

◆ TViewGetUserPointer()

void * TViewGetUserPointer ( void * gui)

Get custom user pointer from TextView.

Parameters
guipointer to the TextView GUI
Returns
pointer

◆ CreateRadioButtonList()

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.

Parameters
itemsarray of 20-byte items, the first word of each item is its ID
numnumber of the items
exclude_idsIDs of the items to hide, can be NULL
exclude_countnumber of the IDs in exclude_ids
selected_idID of the checked item (used when bit 1 of flags is set)
handleritem handler, return 1 to close the list
flagsbit 0: alternative header and GUI style, bit 1: check selected_id
header_lgpheader text (LGP ID)
header_iconheader icon
user1passed to the handler
user2passed to the handler
Returns
GUI ID or 0

◆ CreateScrollbarWidget()

WIDGET * CreateScrollbarWidget ( const void * malloc_fn)

Allocate Scrollbar WIDGET.

Parameters
malloc_fnresult of malloc_adr
Returns
new allocated WIDGET

◆ Scrollbar_Configure()

void Scrollbar_Configure ( WIDGET * scrollbar,
int limit,
int unk1,
int unk2 )

Configure the scrollbar's behavior constraints.

Parameters
scrollbarpointer to the Scrollbar WIDGET
limitMaximum allowed switch operations (must be > 0)
unk1unknown, set to 0
unk2unknown, set to 0

◆ Scrollbar_SetValue()

void Scrollbar_SetValue ( WIDGET * scrollbar,
int value )

Set the scrollbar's current position.

Parameters
scrollbarpointer to the Scrollbar WIDGET
valuescroll position in scrollbar units

◆ RamMenuAnywhere()

void * RamMenuAnywhere ( )

Key sequence buffer of the "menu anywhere" shortcut (char[4]).

Returns
pointer to the buffer
Note
Not available on NSG.