Thu, 15 Feb 2024 21:33:08 +0100
port progressbar to new API (GTK)
3 | 1 | /* |
2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | |
3 | * | |
140
c03c338a7dcf
refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
108
diff
changeset
|
4 | * Copyright 2017 Olaf Wintermann. All rights reserved. |
3 | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions are met: | |
8 | * | |
9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | |
11 | * | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | |
15 | * | |
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | |
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
26 | * POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | |
28 | ||
29 | #include <stdio.h> | |
30 | #include <stdlib.h> | |
31 | ||
32 | #include "button.h" | |
4
39b9b86ec452
added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
33 | #include "container.h" |
174 | 34 | #include <cx/allocator.h> |
4
39b9b86ec452
added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
35 | #include "../common/context.h" |
33
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
21
diff
changeset
|
36 | #include "../common/object.h" |
3 | 37 | |
259
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
38 | static void button_set_icon(GtkWidget *button, const char *icon) { |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
39 | if(!icon) { |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
40 | return; |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
41 | } |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
42 | |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
43 | #ifdef UI_GTK4 |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
44 | gtk_button_set_icon_name(GTK_BUTTON(button), args.icon); |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
45 | #else |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
46 | #if GTK_CHECK_VERSION(2, 6, 0) |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
47 | GtkWidget *image = gtk_image_new_from_icon_name(icon, GTK_ICON_SIZE_BUTTON); |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
48 | if(image) { |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
49 | gtk_button_set_image(GTK_BUTTON(button), image); |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
50 | } |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
51 | #else |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
52 | // TODO |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
53 | #endif |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
54 | #endif |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
55 | } |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
56 | |
257
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
57 | UIWIDGET ui_button_create(UiObject *obj, UiButtonArgs args) { |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
58 | UiObject* current = uic_current_obj(obj); |
259
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
59 | GtkWidget *button = gtk_button_new(); |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
60 | if(args.label) { |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
61 | gtk_button_set_label(GTK_BUTTON(button), args.label); |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
62 | } |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
63 | button_set_icon(button, args.icon); |
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
64 | |
4
39b9b86ec452
added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
65 | |
257
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
66 | if(args.onclick) { |
65
4697592e24ba
added label, grid container, simple tabview and textfield (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
59
diff
changeset
|
67 | UiEventData *event = malloc(sizeof(UiEventData)); |
4
39b9b86ec452
added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
68 | event->obj = obj; |
257
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
69 | event->userdata = args.onclickdata; |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
70 | event->callback = args.onclick; |
16
a499c8a72c15
added menu item lists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
5
diff
changeset
|
71 | event->value = 0; |
4
39b9b86ec452
added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
72 | |
39b9b86ec452
added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
73 | g_signal_connect( |
39b9b86ec452
added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
74 | button, |
39b9b86ec452
added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
75 | "clicked", |
39b9b86ec452
added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
76 | G_CALLBACK(ui_button_clicked), |
39b9b86ec452
added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
77 | event); |
21
012418e7dc90
added groups for menu items (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
16
diff
changeset
|
78 | g_signal_connect( |
012418e7dc90
added groups for menu items (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
16
diff
changeset
|
79 | button, |
012418e7dc90
added groups for menu items (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
16
diff
changeset
|
80 | "destroy", |
012418e7dc90
added groups for menu items (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
16
diff
changeset
|
81 | G_CALLBACK(ui_destroy_userdata), |
012418e7dc90
added groups for menu items (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
16
diff
changeset
|
82 | event); |
4
39b9b86ec452
added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
83 | } |
39b9b86ec452
added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
84 | |
257
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
85 | UI_APPLY_LAYOUT1(current, args); |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
86 | current->container->add(current->container, button, FALSE); |
4
39b9b86ec452
added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
87 | |
39b9b86ec452
added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
88 | return button; |
39b9b86ec452
added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
89 | } |
3 | 90 | |
91 | ||
92 | void ui_button_clicked(GtkWidget *widget, UiEventData *event) { | |
93 | UiEvent e; | |
94 | e.obj = event->obj; | |
95 | e.window = event->obj->window; | |
52
25e5390cce41
added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
96 | e.document = event->obj->ctx->document; |
16
a499c8a72c15
added menu item lists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
5
diff
changeset
|
97 | e.eventdata = NULL; |
a499c8a72c15
added menu item lists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
5
diff
changeset
|
98 | e.intval = event->value; |
42
29b2821d1262
added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
33
diff
changeset
|
99 | event->callback(&e, event->userdata); |
3 | 100 | } |
33
458831c574f4
added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
21
diff
changeset
|
101 | |
144
29d98cff4f56
UiInteger uses int64 now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
143
diff
changeset
|
102 | int64_t ui_toggle_button_get(UiInteger *integer) { |
94
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
103 | GtkToggleButton *button = integer->obj; |
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
104 | integer->value = (int)gtk_toggle_button_get_active(button); |
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
105 | return integer->value; |
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
106 | } |
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
107 | |
144
29d98cff4f56
UiInteger uses int64 now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
143
diff
changeset
|
108 | void ui_toggle_button_set(UiInteger *integer, int64_t value) { |
94
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
109 | GtkToggleButton *button = integer->obj; |
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
110 | integer->value = value; |
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
111 | gtk_toggle_button_set_active(button, value != 0 ? TRUE : FALSE); |
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
112 | } |
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
113 | |
142
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
114 | void ui_toggled_obs(GtkToggleToolButton *widget, UiVarEventData *event) { |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
115 | UiEvent e; |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
116 | e.obj = event->obj; |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
117 | e.window = event->obj->window; |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
118 | e.document = event->obj->ctx->document; |
143
d499b29d7cb6
adds observer support for textarea and textfield (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
142
diff
changeset
|
119 | e.eventdata = event->var->value; |
142
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
120 | e.intval = gtk_toggle_tool_button_get_active(widget); |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
121 | |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
122 | UiInteger *i = event->var->value; |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
123 | ui_notify_evt(i->observers, &e); |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
124 | } |
94
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
125 | |
257
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
126 | static UIWIDGET togglebutton_create(UiObject *obj, GtkWidget *widget, UiToggleArgs args) { |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
127 | UiObject* current = uic_current_obj(obj); |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
128 | |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
129 | if(args.label) { |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
130 | gtk_button_set_label(GTK_BUTTON(widget), args.label); |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
131 | } |
259
8cce275d2847
implement button icon parameter (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
258
diff
changeset
|
132 | button_set_icon(widget, args.icon); |
94
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
133 | |
261
b39f0e61fd99
add new label (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
259
diff
changeset
|
134 | UiVar* var = uic_widget_var(obj->ctx, current->ctx, args.value, args.varname, UI_VAR_INTEGER); |
257
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
135 | if (var) { |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
136 | UiInteger* value = (UiInteger*)var->value; |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
137 | value->obj = widget; |
94
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
138 | value->get = ui_toggle_button_get; |
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
139 | value->set = ui_toggle_button_set; |
142
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
140 | |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
141 | UiVarEventData *event = malloc(sizeof(UiVarEventData)); |
94
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
142 | event->obj = obj; |
142
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
143 | event->var = var; |
145
853685152c1d
adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
144
diff
changeset
|
144 | event->observers = NULL; |
94
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
145 | |
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
146 | g_signal_connect( |
257
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
147 | widget, |
94
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
148 | "clicked", |
142
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
149 | G_CALLBACK(ui_toggled_obs), |
94
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
150 | event); |
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
151 | g_signal_connect( |
257
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
152 | widget, |
94
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
153 | "destroy", |
142
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
154 | G_CALLBACK(ui_destroy_vardata), |
94
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
155 | event); |
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
156 | } |
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
157 | |
257
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
158 | UI_APPLY_LAYOUT1(current, args); |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
159 | current->container->add(current->container, widget, FALSE); |
94
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
160 | |
257
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
161 | return widget; |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
162 | } |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
163 | |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
164 | UIWIDGET ui_togglebutton_create(UiObject* obj, UiToggleArgs args) { |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
165 | return togglebutton_create(obj, gtk_toggle_button_new(), args); |
94
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
166 | } |
d51e334c1439
added checkbox and labels with alignment (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
65
diff
changeset
|
167 | |
257
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
168 | UIWIDGET ui_checkbox_create(UiObject* obj, UiToggleArgs args) { |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
169 | return togglebutton_create(obj, gtk_check_button_new(), args); |
142
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
170 | } |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
171 | |
257
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
172 | UIWIDGET ui_switch_create(UiObject* obj, UiToggleArgs args) { |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
173 | #ifdef UI_GTK3 |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
174 | return NULL; // TODO |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
175 | #else |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
176 | return ui_checkbox_create(obj, args); |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
177 | #endif |
142
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
178 | } |
107
9aff1dc3990d
improved box container and added radio button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
179 | |
9aff1dc3990d
improved box container and added radio button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
180 | |
257
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
181 | |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
182 | |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
183 | |
a334f9ebc5d0
update button, togglebutton and checkbox to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
253
diff
changeset
|
184 | |
258
a252f68c665a
port radiobutton to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
257
diff
changeset
|
185 | UIWIDGET ui_radiobutton_create(UiObject *obj, UiToggleArgs args) { |
a252f68c665a
port radiobutton to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
257
diff
changeset
|
186 | UiObject* current = uic_current_obj(obj); |
a252f68c665a
port radiobutton to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
257
diff
changeset
|
187 | |
142
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
188 | GSList *rg = NULL; |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
189 | UiInteger *rgroup; |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
190 | |
258
a252f68c665a
port radiobutton to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
257
diff
changeset
|
191 | UiVar* var = NULL; |
a252f68c665a
port radiobutton to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
257
diff
changeset
|
192 | if (args.value) { |
a252f68c665a
port radiobutton to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
257
diff
changeset
|
193 | var = uic_create_value_var(current->ctx, args.value); |
a252f68c665a
port radiobutton to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
257
diff
changeset
|
194 | } else if (args.varname) { |
a252f68c665a
port radiobutton to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
257
diff
changeset
|
195 | var = uic_create_var(obj->ctx, args.varname, UI_VAR_INTEGER); |
a252f68c665a
port radiobutton to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
257
diff
changeset
|
196 | } |
a252f68c665a
port radiobutton to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
257
diff
changeset
|
197 | |
142
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
198 | if(var) { |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
199 | rgroup = var->value; |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
200 | rg = rgroup->obj; |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
201 | } |
108
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
202 | |
258
a252f68c665a
port radiobutton to the new API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
257
diff
changeset
|
203 | GtkWidget *rbutton = gtk_radio_button_new_with_label(rg, args.label ? args.label : ""); |
108
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
204 | rg = gtk_radio_button_get_group(GTK_RADIO_BUTTON(rbutton)); |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
205 | |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
206 | if(rgroup) { |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
207 | rgroup->obj = rg; |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
208 | rgroup->get = ui_radiobutton_get; |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
209 | rgroup->set = ui_radiobutton_set; |
142
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
210 | |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
211 | ui_radiobutton_set(rgroup, rgroup->value); |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
212 | |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
213 | UiVarEventData *event = malloc(sizeof(UiVarEventData)); |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
214 | event->obj = obj; |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
215 | event->var = var; |
145
853685152c1d
adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
144
diff
changeset
|
216 | event->observers = NULL; |
142
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
217 | |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
218 | g_signal_connect( |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
219 | rbutton, |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
220 | "clicked", |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
221 | G_CALLBACK(ui_radio_obs), |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
222 | event); |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
223 | g_signal_connect( |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
224 | rbutton, |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
225 | "destroy", |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
226 | G_CALLBACK(ui_destroy_vardata), |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
227 | event); |
107
9aff1dc3990d
improved box container and added radio button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
228 | } |
9aff1dc3990d
improved box container and added radio button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
229 | |
9aff1dc3990d
improved box container and added radio button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
230 | UiContainer *ct = uic_get_current_container(obj); |
9aff1dc3990d
improved box container and added radio button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
231 | ct->add(ct, rbutton, FALSE); |
9aff1dc3990d
improved box container and added radio button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
232 | |
9aff1dc3990d
improved box container and added radio button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
233 | return rbutton; |
9aff1dc3990d
improved box container and added radio button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
234 | } |
9aff1dc3990d
improved box container and added radio button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
94
diff
changeset
|
235 | |
142
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
236 | void ui_radio_obs(GtkToggleToolButton *widget, UiVarEventData *event) { |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
237 | UiInteger *i = event->var->value; |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
238 | |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
239 | UiEvent e; |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
240 | e.obj = event->obj; |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
241 | e.window = event->obj->window; |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
242 | e.document = event->obj->ctx->document; |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
243 | e.eventdata = NULL; |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
244 | e.intval = i->get(i); |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
245 | |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
246 | ui_notify_evt(i->observers, &e); |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
247 | } |
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
248 | |
144
29d98cff4f56
UiInteger uses int64 now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
143
diff
changeset
|
249 | int64_t ui_radiobutton_get(UiInteger *value) { |
108
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
250 | int selection = 0; |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
251 | GSList *ls = value->obj; |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
252 | int i = 0; |
142
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
253 | guint len = g_slist_length(ls); |
108
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
254 | while(ls) { |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
255 | if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ls->data))) { |
142
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
256 | selection = len - i - 1; |
108
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
257 | break; |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
258 | } |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
259 | ls = ls->next; |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
260 | i++; |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
261 | } |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
262 | |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
263 | value->value = selection; |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
264 | return selection; |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
265 | } |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
266 | |
144
29d98cff4f56
UiInteger uses int64 now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
143
diff
changeset
|
267 | void ui_radiobutton_set(UiInteger *value, int64_t i) { |
108
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
268 | GSList *ls = value->obj; |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
269 | int s = g_slist_length(ls) - 1 - i; |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
270 | int j = 0; |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
271 | while(ls) { |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
272 | if(j == s) { |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
273 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ls->data), TRUE); |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
274 | break; |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
275 | } |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
276 | ls = ls->next; |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
277 | j++; |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
278 | } |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
279 | |
142
46448d38885c
new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
140
diff
changeset
|
280 | value->value = i; |
108
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
281 | } |
fcf6d5fac8f5
radio buttons bind to UiInteger now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
282 |