gwenhywfar  5.11.1beta
dialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Wed Jan 20 2010
3  copyright : (C) 2019 by Martin Preuss
4  email : martin@libchipcard.de
5 
6  ***************************************************************************
7  * *
8  * This library is free software; you can redistribute it and/or *
9  * modify it under the terms of the GNU Lesser General Public *
10  * License as published by the Free Software Foundation; either *
11  * version 2.1 of the License, or (at your option) any later version. *
12  * *
13  * This library is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16  * Lesser General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU Lesser General Public *
19  * License along with this library; if not, write to the Free Software *
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21  * MA 02111-1307 USA *
22  * *
23  ***************************************************************************/
24 
25 
26 #ifndef GWENHYWFAR_GUI_DIALOG_H
27 #define GWENHYWFAR_GUI_DIALOG_H
28 
29 
30 #include <gwenhywfar/inherit.h>
31 #include <gwenhywfar/list1.h>
32 #include <gwenhywfar/list2.h>
33 #include <gwenhywfar/xml.h>
34 #include <gwenhywfar/db.h>
35 
36 
37 
47 
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 
54 typedef struct GWEN_DIALOG GWEN_DIALOG;
58 
59 
60 #define GWEN_WIDGET_FLAGS_NONE 0x00000000L
61 #define GWEN_WIDGET_FLAGS_FILLX 0x80000000L
62 #define GWEN_WIDGET_FLAGS_FILLY 0x40000000L
63 #define GWEN_WIDGET_FLAGS_READONLY 0x20000000L
64 #define GWEN_WIDGET_FLAGS_PASSWORD 0x10000000L
65 #define GWEN_WIDGET_FLAGS_DEFAULT_WIDGET 0x08000000L
66 
67 #define GWEN_WIDGET_FLAGS_DECOR_SHRINKABLE 0x04000000L
68 #define GWEN_WIDGET_FLAGS_DECOR_STRETCHABLE 0x02000000L
69 #define GWEN_WIDGET_FLAGS_DECOR_MINIMIZE 0x01000000L
70 #define GWEN_WIDGET_FLAGS_DECOR_MAXIMIZE 0x00800000L
71 #define GWEN_WIDGET_FLAGS_DECOR_CLOSE 0x00400000L
72 #define GWEN_WIDGET_FLAGS_DECOR_MENU 0x00200000L
73 
74 #define GWEN_WIDGET_FLAGS_FIXED_WIDTH 0x00100000L
75 #define GWEN_WIDGET_FLAGS_FIXED_HEIGHT 0x00080000L
76 #define GWEN_WIDGET_FLAGS_EQUAL_WIDTH 0x00040000L
77 #define GWEN_WIDGET_FLAGS_EQUAL_HEIGHT 0x00020000L
78 
79 #define GWEN_WIDGET_FLAGS_JUSTIFY_LEFT 0x00010000L
80 #define GWEN_WIDGET_FLAGS_JUSTIFY_RIGHT 0x00008000L
81 #define GWEN_WIDGET_FLAGS_JUSTIFY_TOP 0x00004000L
82 #define GWEN_WIDGET_FLAGS_JUSTIFY_BOTTOM 0x00002000L
83 #define GWEN_WIDGET_FLAGS_JUSTIFY_CENTERX 0x00001000L
84 #define GWEN_WIDGET_FLAGS_JUSTIFY_CENTERY 0x00000800L
85 
86 #define GWEN_WIDGET_FLAGS_NO_WORDWRAP 0x00000400L
87 
88 #define GWEN_WIDGET_FLAGS_HANDLE_KEYS 0x00000200L
89 
90 #define GWEN_WIDGET_FLAGS_FRAME_SUNKEN 0x00000100L
91 #define GWEN_WIDGET_FLAGS_FRAME_RAISED 0x00000080L
92 #define GWEN_WIDGET_FLAGS_FRAME_THICK 0x00000040L
93 #define GWEN_WIDGET_FLAGS_FRAME_GROOVE 0x00000020L
94 
95 
96 
97 
98 typedef enum {
108 
111 
112 
113 
119 enum {
124 };
125 
126 
134  const char *sender);
135 
142  const char *sender,
143  int intArg,
144  const char *stringArg);
145 
146 
147 
149 GWEN_DIALOG *GWEN_Dialog_new(const char *dialogId);
150 
151 
163  const char *pmLibName,
164  const char *pmDataDir,
165  const char *fileName);
166 
167 
170 
176 
177 
182 int GWEN_Dialog_ReadXmlFile(GWEN_DIALOG *dlg, const char *fname);
183 
190 const char *GWEN_Dialog_GetId(const GWEN_DIALOG *dlg);
191 
192 
194 uint32_t GWEN_Dialog_GetGuiId(const GWEN_DIALOG *dlg);
195 
196 
202 void GWEN_Dialog_AddMediaPath(GWEN_DIALOG *dlg, const char *s);
203 
204 
218  const char *destlib,
219  const char *pathName,
220  const char *relPath);
221 
222 
233  const char *parentWidgetName,
234  GWEN_DIALOG *subdlg);
235 
237 int GWEN_Dialog_RemoveWidget(GWEN_DIALOG *dlg, const char *name);
238 
239 
247 
248 
255 
256 
257 
258 
259 
260 typedef enum {
262 
282 
284 
287 
288 
289 typedef enum {
294 
295 
296 typedef enum {
301 
302 
311 
332  const char *name,
334  int index,
335  int value,
336  int doSignal);
337 
349  const char *name,
351  int index,
352  int defaultValue);
353 
362  const char *name,
364  int index,
365  const char *value,
366  int doSignal);
367 
392  const char *name,
394  int index,
395  const char *defaultValue);
408 uint32_t GWEN_Dialog_GetWidgetFlags(const GWEN_DIALOG *dlg, const char *name);
409 
411 void GWEN_Dialog_SetWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl);
412 
414 void GWEN_Dialog_AddWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl);
415 
417 void GWEN_Dialog_SubWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl);
418 
428 int GWEN_Dialog_GetWidgetColumns(const GWEN_DIALOG *dlg, const char *name);
429 
430 
431 
436 void GWEN_Dialog_SetWidgetColumns(GWEN_DIALOG *dlg, const char *name, int i);
437 
438 
439 
447 int GWEN_Dialog_GetWidgetRows(const GWEN_DIALOG *dlg, const char *name);
448 
449 
454 void GWEN_Dialog_SetWidgetRows(GWEN_DIALOG *dlg, const char *name, int i);
455 
456 
458 const char *GWEN_Dialog_GetWidgetText(const GWEN_DIALOG *dlg, const char *name);
459 
461 void GWEN_Dialog_SetWidgetText(GWEN_DIALOG *dlg, const char *name, const char *t);
462 
463 
478 
487 
492 void GWEN_Dialog_SetI18nDomain(GWEN_DIALOG *dlg, const char *s);
493 
504 const char *GWEN_Dialog_GetI18nDomain(const GWEN_DIALOG *dlg);
505 
510 const char *GWEN_Dialog_TranslateString(const GWEN_DIALOG *dlg, const char *s);
519 
536  const char *widgetName,
537  const char *variablePrefix,
538  int maxColumns,
539  int minColumnSize,
540  GWEN_DB_NODE *dbPrefs);
541 
542 
545  const char *widgetName,
546  const char *variablePrefix,
547  int maxColumns,
548  int minColumnSize,
549  GWEN_DB_NODE *dbPrefs);
550 
560 char *GWEN_Dialog_ListGetFirstColumnData(GWEN_DIALOG *dlg, const char *widgetName, int row);
561 
562 
574 int GWEN_Dialog_ListGetItemMatchingFirstColumn(GWEN_DIALOG *dlg, const char *widgetName, const char *dataToMatch);
575 
580 #ifdef __cplusplus
581 }
582 #endif
583 
584 
585 
589 #endif
struct GWEN_DB_NODE GWEN_DB_NODE
Definition: db.h:228
GWENHYWFAR_API void GWEN_Dialog_SetWidgetRows(GWEN_DIALOG *dlg, const char *name, int i)
GWENHYWFAR_API uint32_t GWEN_Dialog_GetGuiId(const GWEN_DIALOG *dlg)
int GWENHYWFAR_CB(* GWEN_DIALOG_SIGNALHANDLER2)(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender, int intArg, const char *stringArg)
Definition: dialog.h:140
GWENHYWFAR_API void GWEN_Dialog_SetWidgetColumns(GWEN_DIALOG *dlg, const char *name, int i)
GWENHYWFAR_API int GWEN_Dialog_GetIntProperty(GWEN_DIALOG *dlg, const char *name, GWEN_DIALOG_PROPERTY prop, int index, int defaultValue)
GWENHYWFAR_API const char * GWEN_Dialog_TranslateString(const GWEN_DIALOG *dlg, const char *s)
GWENHYWFAR_API const char * GWEN_Dialog_GetWidgetText(const GWEN_DIALOG *dlg, const char *name)
GWENHYWFAR_API void GWEN_Dialog_SetI18nDomain(GWEN_DIALOG *dlg, const char *s)
GWENHYWFAR_API const char * GWEN_Dialog_GetCharProperty(GWEN_DIALOG *dlg, const char *name, GWEN_DIALOG_PROPERTY prop, int index, const char *defaultValue)
GWENHYWFAR_API void GWEN_Dialog_AddWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl)
GWENHYWFAR_API uint32_t GWEN_Dialog_GetWidgetFlags(const GWEN_DIALOG *dlg, const char *name)
GWEN_DIALOG_SORT_DIRECTION
Definition: dialog.h:296
@ GWEN_DialogSortDirection_None
Definition: dialog.h:297
@ GWEN_DialogSortDirection_Up
Definition: dialog.h:298
@ GWEN_DialogSortDirection_Down
Definition: dialog.h:299
GWENHYWFAR_API GWEN_DIALOG_SIGNALHANDLER2 GWEN_Dialog_SetSignalHandler2(GWEN_DIALOG *dlg, GWEN_DIALOG_SIGNALHANDLER2 fn)
GWENHYWFAR_API int GWEN_Dialog_ListGetItemMatchingFirstColumn(GWEN_DIALOG *dlg, const char *widgetName, const char *dataToMatch)
GWENHYWFAR_API int GWEN_Dialog_GetWidgetColumns(const GWEN_DIALOG *dlg, const char *name)
GWENHYWFAR_API int GWEN_Dialog_ReadXmlFile(GWEN_DIALOG *dlg, const char *fname)
struct GWEN_DIALOG GWEN_DIALOG
Definition: dialog.h:54
GWENHYWFAR_API void GWEN_Dialog_SubWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl)
GWEN_DIALOG_PROPERTY
Definition: dialog.h:260
@ GWEN_DialogProperty_WindowId
Definition: dialog.h:283
@ GWEN_DialogProperty_SelectionState
Definition: dialog.h:275
@ GWEN_DialogProperty_AddValue
Definition: dialog.h:268
@ GWEN_DialogProperty_MinValue
Definition: dialog.h:265
@ GWEN_DialogProperty_ToolTip
Definition: dialog.h:281
@ GWEN_DialogProperty_Visibility
Definition: dialog.h:280
@ GWEN_DialogProperty_ColumnWidth
Definition: dialog.h:271
@ GWEN_DialogProperty_MaxValue
Definition: dialog.h:266
@ GWEN_DialogProperty_None
Definition: dialog.h:261
@ GWEN_DialogProperty_ValueCount
Definition: dialog.h:270
@ GWEN_DialogProperty_Title
Definition: dialog.h:263
@ GWEN_DialogProperty_Sort
Definition: dialog.h:279
@ GWEN_DialogProperty_ClearValues
Definition: dialog.h:269
@ GWEN_DialogProperty_SelectionMode
Definition: dialog.h:274
@ GWEN_DialogProperty_Height
Definition: dialog.h:273
@ GWEN_DialogProperty_SortDirection
Definition: dialog.h:278
@ GWEN_DialogProperty_Enabled
Definition: dialog.h:267
@ GWEN_DialogProperty_Value
Definition: dialog.h:264
@ GWEN_DialogProperty_Unknown
Definition: dialog.h:285
@ GWEN_DialogProperty_Focus
Definition: dialog.h:276
@ GWEN_DialogProperty_Width
Definition: dialog.h:272
GWENHYWFAR_API GWEN_DIALOG_SIGNALHANDLER GWEN_Dialog_SetSignalHandler(GWEN_DIALOG *dlg, GWEN_DIALOG_SIGNALHANDLER fn)
GWEN_DIALOG_EVENTTYPE
Definition: dialog.h:98
@ GWEN_DialogEvent_TypeKeyPressed
Definition: dialog.h:106
@ GWEN_DialogEvent_TypeValueChanged
Definition: dialog.h:101
@ GWEN_DialogEvent_TypeInit
Definition: dialog.h:99
@ GWEN_DialogEvent_TypeFini
Definition: dialog.h:100
@ GWEN_DialogEvent_TypeClose
Definition: dialog.h:105
@ GWEN_DialogEvent_TypeKeyReleased
Definition: dialog.h:107
@ GWEN_DialogEvent_TypeActivated
Definition: dialog.h:102
@ GWEN_DialogEvent_TypeEnabled
Definition: dialog.h:103
@ GWEN_DialogEvent_TypeDisabled
Definition: dialog.h:104
@ GWEN_DialogEvent_TypeLast
Definition: dialog.h:109
GWENHYWFAR_API void GWEN_Dialog_free(GWEN_DIALOG *dlg)
GWENHYWFAR_API int GWEN_Dialog_SetCharProperty(GWEN_DIALOG *dlg, const char *name, GWEN_DIALOG_PROPERTY prop, int index, const char *value, int doSignal)
GWENHYWFAR_API int GWEN_Dialog_AddSubDialog(GWEN_DIALOG *dlg, const char *parentWidgetName, GWEN_DIALOG *subdlg)
GWENHYWFAR_API void GWEN_Dialog_ListReadColumnSettings(GWEN_DIALOG *dlg, const char *widgetName, const char *variablePrefix, int maxColumns, int minColumnSize, GWEN_DB_NODE *dbPrefs)
GWENHYWFAR_API int GWEN_Dialog_SetIntProperty(GWEN_DIALOG *dlg, const char *name, GWEN_DIALOG_PROPERTY prop, int index, int value, int doSignal)
GWENHYWFAR_API void GWEN_Dialog_SetWidgetFlags(GWEN_DIALOG *dlg, const char *name, uint32_t fl)
GWENHYWFAR_API void GWEN_Dialog_AddMediaPath(GWEN_DIALOG *dlg, const char *s)
GWENHYWFAR_API const char * GWEN_Dialog_GetId(const GWEN_DIALOG *dlg)
GWENHYWFAR_API const char * GWEN_Dialog_GetI18nDomain(const GWEN_DIALOG *dlg)
GWENHYWFAR_API GWEN_DIALOG * GWEN_Dialog_new(const char *dialogId)
@ GWEN_DialogEvent_ResultHandled
Definition: dialog.h:120
@ GWEN_DialogEvent_ResultAccept
Definition: dialog.h:122
@ GWEN_DialogEvent_ResultNotHandled
Definition: dialog.h:121
@ GWEN_DialogEvent_ResultReject
Definition: dialog.h:123
GWENHYWFAR_API void GWEN_Dialog_ListWriteColumnSettings(GWEN_DIALOG *dlg, const char *widgetName, const char *variablePrefix, int maxColumns, int minColumnSize, GWEN_DB_NODE *dbPrefs)
GWENHYWFAR_API int GWEN_Dialog_ReadXml(GWEN_DIALOG *dlg, GWEN_XMLNODE *node)
GWEN_DIALOG_SELECTION_MODE
Definition: dialog.h:289
@ GWEN_Dialog_SelectionMode_None
Definition: dialog.h:290
@ GWEN_Dialog_SelectionMode_Multi
Definition: dialog.h:292
@ GWEN_Dialog_SelectionMode_Single
Definition: dialog.h:291
GWENHYWFAR_API char * GWEN_Dialog_ListGetFirstColumnData(GWEN_DIALOG *dlg, const char *widgetName, int row)
GWENHYWFAR_API GWEN_DIALOG * GWEN_Dialog_CreateAndLoadWithPath(const char *dialogId, const char *pmLibName, const char *pmDataDir, const char *fileName)
GWENHYWFAR_API int GWEN_Dialog_RemoveWidget(GWEN_DIALOG *dlg, const char *name)
GWENHYWFAR_API GWEN_DB_NODE * GWEN_Dialog_GetPreferences(const GWEN_DIALOG *dlg)
GWENHYWFAR_API void GWEN_Dialog_AddMediaPathsFromPathManager(GWEN_DIALOG *dlg, const char *destlib, const char *pathName, const char *relPath)
int GWENHYWFAR_CB(* GWEN_DIALOG_SIGNALHANDLER)(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender)
Definition: dialog.h:132
GWENHYWFAR_API void GWEN_Dialog_SetWidgetText(GWEN_DIALOG *dlg, const char *name, const char *t)
GWENHYWFAR_API int GWEN_Dialog_GetWidgetRows(const GWEN_DIALOG *dlg, const char *name)
#define GWENHYWFAR_API
Definition: gwenhywfarapi.h:67
#define GWENHYWFAR_CB
Definition: gwenhywfarapi.h:89
#define GWEN_INHERIT_FUNCTION_LIB_DEFS(t, decl)
Definition: inherit.h:125
#define GWEN_LIST_FUNCTION_LIB_DEFS(t, pr, decl)
Definition: list1.h:348
This file contains some macros concerning lists.
#define GWEN_LIST2_FUNCTION_LIB_DEFS(t, pr, decl)
Definition: list2.h:56
struct GWEN__XMLNODE GWEN_XMLNODE
Definition: xml.h:156