Mon, 25 Aug 2025 20:33:26 +0200
add alternative UiModel creation functions
|
33
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1 | /* |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
3 | * |
|
140
c03c338a7dcf
refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
129
diff
changeset
|
4 | * Copyright 2017 Olaf Wintermann. All rights reserved. |
|
33
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
5 | * |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
6 | * Redistribution and use in source and binary forms, with or without |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
7 | * modification, are permitted provided that the following conditions are met: |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
8 | * |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
9 | * 1. Redistributions of source code must retain the above copyright |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
10 | * notice, this list of conditions and the following disclaimer. |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
11 | * |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
12 | * 2. Redistributions in binary form must reproduce the above copyright |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
13 | * notice, this list of conditions and the following disclaimer in the |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
14 | * documentation and/or other materials provided with the distribution. |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
15 | * |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
26 | * POSSIBILITY OF SUCH DAMAGE. |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
27 | */ |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
28 | |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
29 | #ifndef UI_TREE_H |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
30 | #define UI_TREE_H |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
31 | |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
32 | #include "toolkit.h" |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
33 | |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
34 | #ifdef __cplusplus |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
35 | extern "C" { |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
36 | #endif |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
37 | |
|
411
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
38 | typedef struct UiModel UiModel; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
39 | typedef struct UiListCallbacks UiListCallbacks; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
40 | typedef struct UiListDnd UiListDnd; |
|
39
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
41 | |
|
411
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
42 | typedef struct UiListArgs UiListArgs; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
43 | typedef struct UiSourceListArgs UiSourceListArgs; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
44 | |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
45 | typedef struct UiSubList UiSubList; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
46 | typedef struct UiSubListItem UiSubListItem; |
|
196
320d85f3cd14
add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
150
diff
changeset
|
47 | |
|
58
2b124f8ebd95
added table view (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
48 | typedef enum UiModelType { |
|
39
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
49 | UI_STRING = 0, |
|
241
c51dd0e9ecb7
add support for table string values, that need to be freed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
225
diff
changeset
|
50 | UI_STRING_FREE, |
|
129
5babf09f5f19
fixes stultus commit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
128
diff
changeset
|
51 | UI_INTEGER, |
|
5babf09f5f19
fixes stultus commit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
128
diff
changeset
|
52 | UI_ICON, |
|
5babf09f5f19
fixes stultus commit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
128
diff
changeset
|
53 | UI_ICON_TEXT, |
|
241
c51dd0e9ecb7
add support for table string values, that need to be freed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
225
diff
changeset
|
54 | UI_ICON_TEXT_FREE |
|
58
2b124f8ebd95
added table view (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
55 | } UiModelType; |
|
39
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
56 | |
|
142
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
57 | struct UiModel { |
|
39
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
58 | /* |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
59 | * number of columns |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
60 | */ |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
61 | int columns; |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
62 | |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
63 | /* |
|
728
011d236c4a05
add alternative UiModel creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
722
diff
changeset
|
64 | * current allocation size (internal) |
|
011d236c4a05
add alternative UiModel creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
722
diff
changeset
|
65 | */ |
|
011d236c4a05
add alternative UiModel creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
722
diff
changeset
|
66 | int alloc; |
|
011d236c4a05
add alternative UiModel creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
722
diff
changeset
|
67 | |
|
011d236c4a05
add alternative UiModel creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
722
diff
changeset
|
68 | /* |
|
39
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
69 | * array of column types |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
70 | * array length is the number of columns |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
71 | */ |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
72 | UiModelType *types; |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
73 | |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
74 | /* |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
75 | * array of column titles |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
76 | * array length is the number of columns |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
77 | */ |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
78 | char **titles; |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
79 | |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
80 | /* |
|
380
aad99285865c
make table column sizes adjustable (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
378
diff
changeset
|
81 | * array of column size hints |
|
aad99285865c
make table column sizes adjustable (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
378
diff
changeset
|
82 | */ |
|
aad99285865c
make table column sizes adjustable (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
378
diff
changeset
|
83 | int *columnsize; |
|
142
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
84 | }; |
|
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
85 | |
|
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
86 | struct UiListCallbacks { |
|
39
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
87 | /* |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
88 | * selection callback |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
89 | */ |
|
42
29b2821d1262
added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
90 | ui_callback activate; |
|
29b2821d1262
added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
91 | |
|
29b2821d1262
added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
92 | /* |
|
29b2821d1262
added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
93 | * cursor callback |
|
29b2821d1262
added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
94 | */ |
|
29b2821d1262
added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
95 | ui_callback selection; |
|
39
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
96 | |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
97 | /* |
|
147
2e384acc89a6
adds simple drag and drop support (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
146
diff
changeset
|
98 | * userdata for all callbacks |
|
39
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
99 | */ |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
100 | void *userdata; |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
101 | }; |
|
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
102 | |
|
196
320d85f3cd14
add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
150
diff
changeset
|
103 | struct UiListArgs { |
|
670
d676b2c5e93b
replace UiTri with UiBool in Arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
657
diff
changeset
|
104 | UiBool fill; |
|
196
320d85f3cd14
add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
150
diff
changeset
|
105 | UiBool hexpand; |
|
320d85f3cd14
add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
150
diff
changeset
|
106 | UiBool vexpand; |
|
378
d41b1ffc5f77
implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
356
diff
changeset
|
107 | UiBool hfill; |
|
d41b1ffc5f77
implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
356
diff
changeset
|
108 | UiBool vfill; |
|
464
e06714e6fa12
add override_defaults layout arg
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
453
diff
changeset
|
109 | UiBool override_defaults; |
|
196
320d85f3cd14
add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
150
diff
changeset
|
110 | int colspan; |
|
320d85f3cd14
add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
150
diff
changeset
|
111 | int rowspan; |
|
356
eae98e4f3f1f
add support for groups/states to text, list widgets (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
248
diff
changeset
|
112 | const char *name; |
|
eae98e4f3f1f
add support for groups/states to text, list widgets (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
248
diff
changeset
|
113 | const char *style_class; |
|
196
320d85f3cd14
add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
150
diff
changeset
|
114 | |
|
320d85f3cd14
add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
150
diff
changeset
|
115 | UiList* list; |
|
320d85f3cd14
add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
150
diff
changeset
|
116 | const char* varname; |
|
320d85f3cd14
add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
150
diff
changeset
|
117 | UiModel* model; |
|
489
073a5e893050
add option for static listview/dropdown (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
466
diff
changeset
|
118 | char **static_elements; |
|
073a5e893050
add option for static listview/dropdown (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
466
diff
changeset
|
119 | size_t static_nelm; |
|
196
320d85f3cd14
add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
150
diff
changeset
|
120 | ui_getvaluefunc getvalue; |
|
633
4c6ba81d319e
add ui_getvaluefunc2 (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
632
diff
changeset
|
121 | ui_getvaluefunc2 getvalue2; |
|
4c6ba81d319e
add ui_getvaluefunc2 (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
632
diff
changeset
|
122 | void *getvalue2data; |
|
196
320d85f3cd14
add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
150
diff
changeset
|
123 | ui_callback onactivate; |
|
320d85f3cd14
add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
150
diff
changeset
|
124 | void* onactivatedata; |
|
320d85f3cd14
add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
150
diff
changeset
|
125 | ui_callback onselection; |
|
320d85f3cd14
add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
150
diff
changeset
|
126 | void* onselectiondata; |
|
221
a82d9beaa94a
add semi-functional pathbar (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
215
diff
changeset
|
127 | ui_callback ondragstart; |
|
a82d9beaa94a
add semi-functional pathbar (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
215
diff
changeset
|
128 | void* ondragstartdata; |
|
a82d9beaa94a
add semi-functional pathbar (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
215
diff
changeset
|
129 | ui_callback ondragcomplete; |
|
a82d9beaa94a
add semi-functional pathbar (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
215
diff
changeset
|
130 | void* ondragcompletedata; |
|
a82d9beaa94a
add semi-functional pathbar (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
215
diff
changeset
|
131 | ui_callback ondrop; |
|
632
8cce45a85942
add UiListArgs wrapper functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
594
diff
changeset
|
132 | void* ondropdata; |
|
196
320d85f3cd14
add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
150
diff
changeset
|
133 | UiBool multiselection; |
|
390
b130f80ec7f9
implement list/table contextmenu (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
380
diff
changeset
|
134 | UiMenuBuilder *contextmenu; |
|
356
eae98e4f3f1f
add support for groups/states to text, list widgets (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
248
diff
changeset
|
135 | |
|
eae98e4f3f1f
add support for groups/states to text, list widgets (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
248
diff
changeset
|
136 | const int *groups; |
|
221
a82d9beaa94a
add semi-functional pathbar (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
215
diff
changeset
|
137 | }; |
|
a82d9beaa94a
add semi-functional pathbar (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
215
diff
changeset
|
138 | |
|
657
02bcdbc34f31
add UiList parameter to sublist getvalue func
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
654
diff
changeset
|
139 | typedef void (*ui_sublist_getvalue_func)(UiList *list, void *sublist_userdata, void *rowdata, int index, UiSubListItem *item, void *userdata); |
|
411
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
140 | |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
141 | struct UiSubList { |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
142 | UiList *value; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
143 | const char *varname; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
144 | const char *header; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
145 | UiBool separator; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
146 | void *userdata; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
147 | }; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
148 | |
|
453
abe2c7bf2246
add UiSubListEventData struct that contains all relevant data for sublist action events
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
411
diff
changeset
|
149 | typedef struct UiSubListEventData { |
|
abe2c7bf2246
add UiSubListEventData struct that contains all relevant data for sublist action events
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
411
diff
changeset
|
150 | UiList *list; |
|
abe2c7bf2246
add UiSubListEventData struct that contains all relevant data for sublist action events
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
411
diff
changeset
|
151 | int sublist_index; |
|
abe2c7bf2246
add UiSubListEventData struct that contains all relevant data for sublist action events
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
411
diff
changeset
|
152 | int row_index; |
|
abe2c7bf2246
add UiSubListEventData struct that contains all relevant data for sublist action events
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
411
diff
changeset
|
153 | void *row_data; |
|
abe2c7bf2246
add UiSubListEventData struct that contains all relevant data for sublist action events
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
411
diff
changeset
|
154 | void *sublist_userdata; |
|
abe2c7bf2246
add UiSubListEventData struct that contains all relevant data for sublist action events
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
411
diff
changeset
|
155 | void *event_data; |
|
abe2c7bf2246
add UiSubListEventData struct that contains all relevant data for sublist action events
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
411
diff
changeset
|
156 | } UiSubListEventData; |
|
abe2c7bf2246
add UiSubListEventData struct that contains all relevant data for sublist action events
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
411
diff
changeset
|
157 | |
|
411
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
158 | /* |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
159 | * list item members must be filled by the sublist getvalue func |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
160 | * all members must be allocated (by malloc, strdup, ...) the pointer |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
161 | * will be passed to free |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
162 | */ |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
163 | struct UiSubListItem { |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
164 | char *icon; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
165 | char *label; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
166 | char *button_icon; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
167 | char *button_label; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
168 | char *badge; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
169 | void *eventdata; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
170 | }; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
171 | |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
172 | struct UiSourceListArgs { |
|
670
d676b2c5e93b
replace UiTri with UiBool in Arg structs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
657
diff
changeset
|
173 | UiBool fill; |
|
411
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
174 | UiBool hexpand; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
175 | UiBool vexpand; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
176 | UiBool hfill; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
177 | UiBool vfill; |
|
465
00735562b25b
implement hfill/vfill, def_hfill/def_vfill and override_defaults (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
464
diff
changeset
|
178 | UiBool override_defaults; |
|
411
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
179 | int colspan; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
180 | int rowspan; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
181 | const char *name; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
182 | const char *style_class; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
183 | |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
184 | const int *groups; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
185 | |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
186 | /* |
|
466
7c78b0b8b77d
add support for dynamic sublists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
465
diff
changeset
|
187 | * static list of sublists |
|
411
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
188 | * a sublist must have a varname or a value |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
189 | * |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
190 | * the last entry in the list must contain all NULL values or numsublists |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
191 | * must contain the number of sublists |
|
466
7c78b0b8b77d
add support for dynamic sublists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
465
diff
changeset
|
192 | * |
|
7c78b0b8b77d
add support for dynamic sublists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
465
diff
changeset
|
193 | * sublists can be NULL, in which case sublists are dynamically loaded |
|
7c78b0b8b77d
add support for dynamic sublists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
465
diff
changeset
|
194 | * from dynamic_sublist/varname |
|
411
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
195 | */ |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
196 | UiSubList *sublists; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
197 | /* |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
198 | * optional number of sublists |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
199 | * if the value is 0, it is assumed, that sublists is null-terminated |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
200 | * (last item contains only NULL values) |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
201 | */ |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
202 | size_t numsublists; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
203 | |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
204 | /* |
|
466
7c78b0b8b77d
add support for dynamic sublists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
465
diff
changeset
|
205 | * list value, that contains UiSubList* elements |
|
7c78b0b8b77d
add support for dynamic sublists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
465
diff
changeset
|
206 | */ |
|
7c78b0b8b77d
add support for dynamic sublists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
465
diff
changeset
|
207 | UiList *dynamic_sublist; |
|
7c78b0b8b77d
add support for dynamic sublists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
465
diff
changeset
|
208 | |
|
7c78b0b8b77d
add support for dynamic sublists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
465
diff
changeset
|
209 | /* |
|
7c78b0b8b77d
add support for dynamic sublists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
465
diff
changeset
|
210 | * load sublists dynamically from a variable with the specified name |
|
7c78b0b8b77d
add support for dynamic sublists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
465
diff
changeset
|
211 | */ |
|
7c78b0b8b77d
add support for dynamic sublists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
465
diff
changeset
|
212 | const char *varname; |
|
7c78b0b8b77d
add support for dynamic sublists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
465
diff
changeset
|
213 | |
|
7c78b0b8b77d
add support for dynamic sublists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
465
diff
changeset
|
214 | |
|
7c78b0b8b77d
add support for dynamic sublists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
465
diff
changeset
|
215 | /* |
|
411
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
216 | * callback for each list item, that should fill all necessary |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
217 | * UiSubListItem fields |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
218 | */ |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
219 | ui_sublist_getvalue_func getvalue; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
220 | |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
221 | /* |
|
653
dc0eb8151254
add additional userdata parameter to sourcelist getvalue func
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
633
diff
changeset
|
222 | * getvalue_func userdata |
|
dc0eb8151254
add additional userdata parameter to sourcelist getvalue func
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
633
diff
changeset
|
223 | */ |
|
dc0eb8151254
add additional userdata parameter to sourcelist getvalue func
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
633
diff
changeset
|
224 | void *getvaluedata; |
|
dc0eb8151254
add additional userdata parameter to sourcelist getvalue func
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
633
diff
changeset
|
225 | |
|
dc0eb8151254
add additional userdata parameter to sourcelist getvalue func
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
633
diff
changeset
|
226 | /* |
|
411
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
227 | * activated when a list item is selected |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
228 | */ |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
229 | ui_callback onactivate; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
230 | void *onactivatedata; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
231 | |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
232 | /* |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
233 | * activated, when the additional list item button is clicked |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
234 | */ |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
235 | ui_callback onbuttonclick; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
236 | void *onbuttonclickdata; |
|
684
3c9b430fb160
add contextmenu to sourcelist (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
670
diff
changeset
|
237 | |
|
3c9b430fb160
add contextmenu to sourcelist (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
670
diff
changeset
|
238 | UiMenuBuilder *contextmenu; |
|
411
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
239 | }; |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
240 | |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
241 | #define UI_SUBLIST(...) (UiSubList){ __VA_ARGS__ } |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
242 | #define UI_SUBLISTS(...) (UiSubList[]){ __VA_ARGS__, (UiSubList){NULL,NULL,NULL,0} } |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
243 | |
|
3e91b7aff6a1
add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
394
diff
changeset
|
244 | |
|
715
2082c80fb010
add table widget (Cocoa)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
684
diff
changeset
|
245 | /* |
|
2082c80fb010
add table widget (Cocoa)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
684
diff
changeset
|
246 | * Creates an UiModel, that specifies columns for a table widget. |
|
2082c80fb010
add table widget (Cocoa)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
684
diff
changeset
|
247 | * |
|
2082c80fb010
add table widget (Cocoa)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
684
diff
changeset
|
248 | * For each column a column type (UiModelType) and a title string |
|
2082c80fb010
add table widget (Cocoa)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
684
diff
changeset
|
249 | * (char*) must be specified. The column list must be terminated |
|
2082c80fb010
add table widget (Cocoa)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
684
diff
changeset
|
250 | * with -1. |
|
2082c80fb010
add table widget (Cocoa)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
684
diff
changeset
|
251 | * |
|
2082c80fb010
add table widget (Cocoa)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
684
diff
changeset
|
252 | * UiModel *model = ui_model(ctx, UI_STRING, "Column 1", UI_STRING, "Column 2", -1); |
|
2082c80fb010
add table widget (Cocoa)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
684
diff
changeset
|
253 | */ |
|
201
7f67ebbb0c1c
add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
196
diff
changeset
|
254 | UIEXPORT UiModel* ui_model(UiContext *ctx, ...); |
|
728
011d236c4a05
add alternative UiModel creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
722
diff
changeset
|
255 | UIEXPORT UiModel* ui_model_new(UiContext *ctx); |
|
011d236c4a05
add alternative UiModel creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
722
diff
changeset
|
256 | UIEXPORT void ui_model_add_column(UiContext *ctx, UiModel *model, UiModelType type, const char *title, int width); |
|
215
1bd5534c395d
add support for icons in the table widget (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
204
diff
changeset
|
257 | UIEXPORT UiModel* ui_model_copy(UiContext *ctx, UiModel* model); |
|
201
7f67ebbb0c1c
add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
196
diff
changeset
|
258 | UIEXPORT void ui_model_free(UiContext *ctx, UiModel *mi); |
|
39
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
259 | |
|
594
fc854e0ab924
pass Args structs per pointer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
494
diff
changeset
|
260 | #define ui_listview(obj, ...) ui_listview_create(obj, &(UiListArgs) { __VA_ARGS__ } ) |
|
fc854e0ab924
pass Args structs per pointer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
494
diff
changeset
|
261 | #define ui_table(obj, ...) ui_table_create(obj, &(UiListArgs) { __VA_ARGS__ } ) |
|
fc854e0ab924
pass Args structs per pointer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
494
diff
changeset
|
262 | #define ui_combobox(obj, ...) ui_combobox_create(obj, &(UiListArgs) { __VA_ARGS__ } ) |
|
fc854e0ab924
pass Args structs per pointer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
494
diff
changeset
|
263 | #define ui_breadcrumbbar(obj, ...) ui_breadcrumbbar_create(obj, &(UiListArgs) { __VA_ARGS__ } ) |
|
fc854e0ab924
pass Args structs per pointer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
494
diff
changeset
|
264 | #define ui_sourcelist(obj, ...) ui_sourcelist_create(obj, &(UiSourceListArgs) { __VA_ARGS__ } ) |
|
39
4e66271541e8
added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
265 | |
|
594
fc854e0ab924
pass Args structs per pointer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
494
diff
changeset
|
266 | UIEXPORT UIWIDGET ui_listview_create(UiObject* obj, UiListArgs *args); |
|
fc854e0ab924
pass Args structs per pointer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
494
diff
changeset
|
267 | UIEXPORT UIWIDGET ui_table_create(UiObject* obj, UiListArgs *args); |
|
fc854e0ab924
pass Args structs per pointer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
494
diff
changeset
|
268 | UIEXPORT UIWIDGET ui_combobox_create(UiObject* obj, UiListArgs *args); |
|
fc854e0ab924
pass Args structs per pointer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
494
diff
changeset
|
269 | UIEXPORT UIWIDGET ui_breadcrumbbar_create(UiObject* obj, UiListArgs *args); |
|
196
320d85f3cd14
add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
150
diff
changeset
|
270 | |
|
494
15a0cfe47595
add ui_listview_select/ui_combobox_select
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
489
diff
changeset
|
271 | UIEXPORT void ui_listview_select(UIWIDGET listview, int index); |
|
15a0cfe47595
add ui_listview_select/ui_combobox_select
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
489
diff
changeset
|
272 | UIEXPORT void ui_combobox_select(UIWIDGET dropdown, int index); |
|
15a0cfe47595
add ui_listview_select/ui_combobox_select
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
489
diff
changeset
|
273 | |
|
594
fc854e0ab924
pass Args structs per pointer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
494
diff
changeset
|
274 | UIEXPORT UIWIDGET ui_sourcelist_create(UiObject *obj, UiSourceListArgs *args); |
|
147
2e384acc89a6
adds simple drag and drop support (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
146
diff
changeset
|
275 | |
|
654
e379d2e3c1b3
add sublist item setter functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
653
diff
changeset
|
276 | UIEXPORT void ui_sublist_item_set_icon(UiSubListItem *item, const char *icon); |
|
e379d2e3c1b3
add sublist item setter functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
653
diff
changeset
|
277 | UIEXPORT void ui_sublist_item_set_label(UiSubListItem *item, const char *label); |
|
e379d2e3c1b3
add sublist item setter functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
653
diff
changeset
|
278 | UIEXPORT void ui_sublist_item_set_button_icon(UiSubListItem *item, const char *button_icon); |
|
e379d2e3c1b3
add sublist item setter functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
653
diff
changeset
|
279 | UIEXPORT void ui_sublist_item_set_button_label(UiSubListItem *item, const char *button_label); |
|
e379d2e3c1b3
add sublist item setter functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
653
diff
changeset
|
280 | UIEXPORT void ui_sublist_item_set_badge(UiSubListItem *item, const char *badge); |
|
e379d2e3c1b3
add sublist item setter functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
653
diff
changeset
|
281 | UIEXPORT void ui_sublist_item_set_eventdata(UiSubListItem *item, void *eventdata); |
|
e379d2e3c1b3
add sublist item setter functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
653
diff
changeset
|
282 | |
|
241
c51dd0e9ecb7
add support for table string values, that need to be freed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
225
diff
changeset
|
283 | |
|
33
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
284 | #ifdef __cplusplus |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
285 | } |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
286 | #endif |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
287 | |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
288 | #endif /* UI_TREE_H */ |
|
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
289 |