| 46 ctn->add(button); |
46 ctn->add(button); |
| 47 |
47 |
| 48 return button; |
48 return button; |
| 49 } |
49 } |
| 50 |
50 |
| |
51 void ui_button_set_label(UIWIDGET button, const char *label) { |
| |
52 QString str = QString::fromUtf8(label); |
| |
53 QAbstractButton *b = (QAbstractButton*)button; |
| |
54 b->setText(str); |
| |
55 } |
| |
56 |
| |
57 void ui_button_set_icon(UIWIDGET button, const char *icon) { |
| |
58 // TODO |
| |
59 } |
| |
60 |
| 51 static void togglebutton_event(UiEvent *event, UiEventWrapper *wrapper) { |
61 static void togglebutton_event(UiEvent *event, UiEventWrapper *wrapper) { |
| 52 QPushButton *button = (QPushButton*)wrapper->customdata1; |
62 QPushButton *button = (QPushButton*)wrapper->customdata1; |
| 53 event->intval = button->isChecked(); |
63 event->intval = button->isChecked(); |
| 54 if(wrapper->var) { |
64 if(wrapper->var) { |
| 55 event->eventdata = wrapper->var->value; |
65 event->eventdata = wrapper->var->value; |