46 #ifndef __D4D_EDIT_BOX_H
47 #define __D4D_EDIT_BOX_H
59 #ifndef D4D_EDIT_BOX_F_DEFAULT
60 #define D4D_EDIT_BOX_F_DEFAULT (D4D_OBJECT_F_VISIBLE | D4D_OBJECT_F_ENABLED | D4D_OBJECT_F_TABSTOP | D4D_OBJECT_F_TOUCHENABLE | D4D_OBJECT_F_FOCUSRECT | D4D_OBJECT_F_MOUSE_NORMAL | D4D_OBJECT_F_BEVEL_DENTED)
65 #ifndef D4D_EDIT_BOX_FNT_PRTY_DEFAULT
66 #define D4D_EDIT_BOX_FNT_PRTY_DEFAULT ( 0 )
71 #ifndef D4D_EDIT_BOX_TXT_PRTY_DEFAULT
72 #define D4D_EDIT_BOX_TXT_PRTY_DEFAULT ( D4D_ALIGN_V_CENTER_MASK | D4D_ALIGN_H_LEFT_MASK )
77 #ifndef D4D_EDIT_BOX_CURSOR_BLINK_TICK_COUNTER
78 #define D4D_EDIT_BOX_CURSOR_BLINK_TICK_COUNTER ( 10 )
110 #define D4D_EDIT_BOX_FLAGS_REDRAWTEXT (0x04)
111 #define D4D_EDIT_BOX_FLAGS_MOVECURSOR (0x08)
112 #define D4D_EDIT_BOX_FLAGS_REDRAWCURSOR (0x10)
113 #define D4D_EDIT_BOX_FLAGS_CURSORSTATE (0x20)
114 #define D4D_EDIT_BOX_FLAGS_FULL (0x40)
115 #define D4D_EDIT_BOX_FLAGS_CHANGETEXT (0x80)
141 #define D4D_GET_EDIT_BOX(pObj) ((D4D_EDIT_BOX*)((pObj)->pParam))
142 #define D4D_GET_EDIT_BOX_DATA(pEditBox) ((pEditBox)->pData)
175 #define _D4D_DECLARE_EDIT_BOX(type, name, x, y, cx, cy, radius, pMargin, pRelations, flags, pScheme, pInitText, fontId, maxStr, pUser, pOnEvent, pOnUsrMsg) \
176 static D4D_STR_PROPERTIES name##_strPrties = {D4D_EDIT_BOX_FNT_PRTY_DEFAULT, D4D_EDIT_BOX_TXT_PRTY_DEFAULT};\
177 static D4D_TCHAR name##_txtArray[maxStr + 1];\
178 static D4D_EDIT_BOX_DATA name##_data = { {name##_txtArray, maxStr, fontId, &name##_strPrties, 0, 0}, 0, 0, 0};\
179 static type D4D_EDIT_BOX name##_params = \
186 D4D_DECLARE_OBJECT(type, name, x, y, cx, cy, radius, pMargin, pRelations, pOnUsrMsg, &d4d_editBoxSysFunc, &(name##_params), flags, pUser, pScheme)
211 #define D4D_DECLARE_EDIT_BOX(name, x, y, cx, cy, pRelations, flags, pScheme, pInitText, fontId, maxStr, pUser, pOnEvent, pOnUsrMsg) \
212 _D4D_DECLARE_EDIT_BOX(D4D_CONST, name, x, y, cx, cy, 0, (D4D_MARGIN*)&d4d_marginDefault, pRelations, flags, pScheme, pInitText,\
213 fontId, maxStr, pUser, pOnEvent, pOnUsrMsg)
233 #define D4D_DECLARE_STD_EDIT_BOX(name, x, y, cx, cy, pRelations, pInitText, fontId, maxStr, pOnEvent) \
234 D4D_DECLARE_EDIT_BOX(name, x, y, cx, cy, pRelations, (D4D_EDIT_BOX_F_DEFAULT), NULL, pInitText, fontId, maxStr, NULL, pOnEvent, NULL)
260 #define D4D_DECLARE_REDIT_BOX(name, x, y, cx, cy, radius, pRelations, flags, pScheme, pInitText, fontId, maxStr, pUser, pOnEvent, pOnUsrMsg) \
261 _D4D_DECLARE_EDIT_BOX(D4D_CONST, name, x, y, cx, cy, radius, (D4D_MARGIN*)&d4d_marginDefault, pRelations, flags, pScheme, pInitText,\
262 fontId, maxStr, pUser, pOnEvent, pOnUsrMsg)
283 #define D4D_DECLARE_STD_REDIT_BOX(name, x, y, cx, cy, radius, pRelations, pInitText, fontId, maxStr, pOnEvent) \
284 D4D_DECLARE_REDIT_BOX(name, x, y, cx, cy, radius, pRelations, (D4D_EDIT_BOX_F_DEFAULT), NULL, pInitText, fontId, maxStr, NULL, pOnEvent, NULL)
291 #define D4D_DECLARE_EDIT_BOX_INRAM(name, x, y, cx, cy, pRelations, flags, pScheme, pInitText, fontId, maxStr, pUser, pOnEvent, pOnUsrMsg) \
292 _D4D_DECLARE_EDIT_BOX(D4D_NO_CONST, name, x, y, cx, cy, 0, (D4D_MARGIN*)&d4d_marginDefault, pRelations, flags, pScheme, pInitText,\
293 fontId, maxStr, pUser, pOnEvent, pOnUsrMsg)
298 #define D4D_DECLARE_STD_EDIT_BOX_INRAM(name, x, y, cx, cy, pRelations, pInitText, fontId, maxStr, pOnEvent) \
299 D4D_DECLARE_EDIT_BOX_INRAM(name, x, y, cx, cy, pRelations, (D4D_EDIT_BOX_F_DEFAULT), NULL, pInitText, fontId, maxStr, NULL, pOnEvent, NULL)
305 #define D4D_DECLARE_REDIT_BOX_INRAM(name, x, y, cx, cy, radius, pRelations, flags, pScheme, pInitText, fontId, maxStr, pUser, pOnEvent, pOnUsrMsg) \
306 _D4D_DECLARE_EDIT_BOX(D4D_NO_CONST, name, x, y, cx, cy, radius, (D4D_MARGIN*)&d4d_marginDefault, pRelations, flags, pScheme, pInitText,\
307 fontId, maxStr, pUser, pOnEvent, pOnUsrMsg)
312 #define D4D_DECLARE_STD_REDIT_BOX_INRAM(name, x, y, cx, cy, radius, pRelations, pInitText, fontId, maxStr, pOnEvent) \
313 D4D_DECLARE_REDIT_BOX_INRAM(name, x, y, cx, cy, radius, pRelations, (D4D_EDIT_BOX_F_DEFAULT), NULL, pInitText, fontId, maxStr, NULL, pOnEvent, NULL)
D4D_WCHAR D4D_TCHAR
Type definition of eGUI character (it depends on UNICODE setting if this is D4D_CHAR or D4D_WCHAR)...
The string type. This structure contains all properties about string in eGUI.
const D4D_OBJECT_SYS_FUNCTION d4d_editBoxSysFunc
unsigned char Byte
Type definition of Byte (unsigned 8-bit).
D4D_EVENTID
D4D events that is handled by object callback functions.
void D4D_EditBoxClearAll(D4D_OBJECT_PTR pObj)
The function clear whole edit box data.
D4D_INDEX D4D_EditBoxSetCursor(D4D_OBJECT_PTR pObj, D4D_INDEX newPos)
The function chenge the cursor position to new one.
void(* D4D_EDIT_BOX_ON_EVENT)(D4D_OBJECT *pThis, D4D_EVENTID eventId)
Type definition of edit box on event callback function.
D4D_TCHAR * D4D_EditBoxGetText(D4D_OBJECT_PTR pObj)
The function returns the pointer to the edit box text buffer.
LWord D4D_INDEX
Type definition of eGUI general index variables.
The object main structure type definition.
signed char sByte
Type definition of sByte (signed 8-bit).
D4D_EDIT_BOX_DATA * pData
The object system function needed for each object - this is part of D4D_OBJECT main structure...
D4D_EDIT_BOX_ON_EVENT pOnEvent
LWord D4D_BOOL
Type definition of eGUI boolean.
D4D_BOOL D4D_EditBoxPutString(D4D_OBJECT_PTR pObj, D4D_TCHAR *pText)
The function puts string on cursor position and updates cursor.
D4D_BOOL D4D_EditBoxPutChar(D4D_OBJECT_PTR pObj, D4D_TCHAR ch)
The function puts one char on cursor position and updates cursor.
D4D_INDEX D4D_EditBoxGetCursor(D4D_OBJECT_PTR pObj)
The function returns the cursor position.