ui/winui/text.cpp

changeset 83
a612adaee43d
parent 77
5de33c2d94c6
equal deleted inserted replaced
82:6727ea0f8fbe 83:a612adaee43d
60 textarea.AcceptsReturn(true); 60 textarea.AcceptsReturn(true);
61 ScrollViewer::SetVerticalScrollBarVisibility(textarea, ScrollBarVisibility::Auto); 61 ScrollViewer::SetVerticalScrollBarVisibility(textarea, ScrollBarVisibility::Auto);
62 UIElement elm = textarea; 62 UIElement elm = textarea;
63 UiWidget* widget = new UiWidget(elm); 63 UiWidget* widget = new UiWidget(elm);
64 ui_context_add_widget_destructor(current->ctx, widget); 64 ui_context_add_widget_destructor(current->ctx, widget);
65 ui_set_widget_groups(current->ctx, widget, args.groups);
65 66
66 UiVar* var = uic_widget_var(obj->ctx, current->ctx, args.value, args.varname, UI_VAR_TEXT); 67 UiVar* var = uic_widget_var(obj->ctx, current->ctx, args.value, args.varname, UI_VAR_TEXT);
67 if (var) { 68 if (var) {
68 UiText* value = (UiText*)var->value; 69 UiText* value = (UiText*)var->value;
69 value->obj = widget; 70 value->obj = widget;
178 // create textbox and toolkit wrapper 179 // create textbox and toolkit wrapper
179 TextBox textfield = TextBox(); 180 TextBox textfield = TextBox();
180 UIElement elm = textfield; 181 UIElement elm = textfield;
181 UiWidget* widget = new UiWidget(elm); 182 UiWidget* widget = new UiWidget(elm);
182 ui_context_add_widget_destructor(current->ctx, widget); 183 ui_context_add_widget_destructor(current->ctx, widget);
184 ui_set_widget_groups(current->ctx, widget, args.groups);
183 185
184 UiVar* var = uic_widget_var(obj->ctx, current->ctx, args.value, args.varname, UI_VAR_STRING); 186 UiVar* var = uic_widget_var(obj->ctx, current->ctx, args.value, args.varname, UI_VAR_STRING);
185 if (var) { 187 if (var) {
186 UiString* value = (UiString*)var->value; 188 UiString* value = (UiString*)var->value;
187 value->obj = widget; 189 value->obj = widget;
210 // create textbox and toolkit wrapper 212 // create textbox and toolkit wrapper
211 PasswordBox textfield = PasswordBox(); 213 PasswordBox textfield = PasswordBox();
212 UIElement elm = textfield; 214 UIElement elm = textfield;
213 UiWidget* widget = new UiWidget(elm); 215 UiWidget* widget = new UiWidget(elm);
214 ui_context_add_widget_destructor(current->ctx, widget); 216 ui_context_add_widget_destructor(current->ctx, widget);
217 ui_set_widget_groups(current->ctx, widget, args.groups);
215 218
216 UiVar* var = uic_widget_var(obj->ctx, current->ctx, args.value, args.varname, UI_VAR_STRING); 219 UiVar* var = uic_widget_var(obj->ctx, current->ctx, args.value, args.varname, UI_VAR_STRING);
217 if (var) { 220 if (var) {
218 UiString* value = (UiString*)var->value; 221 UiString* value = (UiString*)var->value;
219 value->obj = widget; 222 value->obj = widget;

mercurial