| 86 void ui_textfield_eventproc(W32Widget *widget, HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { |
86 void ui_textfield_eventproc(W32Widget *widget, HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { |
| 87 |
87 |
| 88 } |
88 } |
| 89 |
89 |
| 90 char* ui_textfield_get(UiString *s) { |
90 char* ui_textfield_get(UiString *s) { |
| 91 return NULL; // TODO |
91 UiTextField *textfield = s->obj; |
| |
92 |
| |
93 if (s->value.free) { |
| |
94 s->value.free(s->value.ptr); |
| |
95 } |
| |
96 |
| |
97 int len = GetWindowTextLength(textfield->widget.widget.hwnd); |
| |
98 s->value.ptr = calloc(len+1, 1); |
| |
99 GetWindowText(textfield->widget.widget.hwnd, s->value.ptr, len+1); |
| |
100 |
| |
101 return s->value.ptr; |
| 92 } |
102 } |
| 93 |
103 |
| 94 void ui_textfield_set(UiString *s, const char *value) { |
104 void ui_textfield_set(UiString *s, const char *value) { |
| 95 // TODO |
105 UiTextField *textfield = s->obj; |
| |
106 if (s->value.free) { |
| |
107 s->value.free(s->value.ptr); |
| |
108 } |
| |
109 s->value.ptr = NULL; |
| |
110 SetWindowText(textfield->widget.widget.hwnd, value); |
| 96 } |
111 } |