checkboxes and radioboxes

This commit is contained in:
nakst 2021-08-20 15:17:19 +01:00
parent c4b48f0698
commit 43df38e5a8
5 changed files with 5 additions and 2 deletions

View File

@ -146,6 +146,7 @@ void InitialiseInstance(EsInstance *instance) {
// Test();
EsPanel *panel = EsPanelCreate(instance->window, ES_CELL_FILL, &stylePanel);
EsButtonCreate(panel, ES_BUTTON_CHECKBOX, 0, "Checkbox");
EsButtonOnCommand(EsButtonCreate(panel, ES_FLAGS_DEFAULT, 0, "Crash"), [] (EsInstance *, EsElement *, EsCommand *) { EsAssert(false); });
EsButtonOnCommand(EsButtonCreate(panel, ES_FLAGS_DEFAULT, 0, "Hang"), [] (EsInstance *, EsElement *, EsCommand *) { while (true); });
EsButtonOnCommand(EsButtonCreate(panel, ES_FLAGS_DEFAULT, 0, "Wait"), [] (EsInstance *, EsElement *, EsCommand *) { EsSleep(8000); });

View File

@ -3691,6 +3691,8 @@ int ProcessButtonMessage(EsElement *element, EsMessage *message) {
if (button->flags & ES_BUTTON_MENU_ITEM) {
button->window->Destroy();
} else {
button->MaybeRefreshStyle();
}
} else if (message->type == ES_MSG_RADIO_GROUP_UPDATED && (button->flags & ES_BUTTON_RADIOBOX)) {
EsButtonSetCheck(button, ES_CHECK_UNCHECKED);

View File

@ -8,8 +8,8 @@ define ES_STYLE_BUTTON_GROUP_CONTAINER (ES_STYLE_CAST(1229))
define ES_STYLE_BUTTON_GROUP_ITEM (ES_STYLE_CAST(1231))
define ES_STYLE_BUTTON_GROUP_SEPARATOR (ES_STYLE_CAST(1233))
define_private ES_STYLE_CANVAS_SHADOW (ES_STYLE_CAST(1451))
define_private ES_STYLE_CHECKBOX_NORMAL (ES_STYLE_CAST(1235))
define_private ES_STYLE_CHECKBOX_RADIOBOX (ES_STYLE_CAST(1237))
define_private ES_STYLE_CHECKBOX_NORMAL (ES_STYLE_CAST(1559))
define_private ES_STYLE_CHECKBOX_RADIOBOX (ES_STYLE_CAST(1567))
define_private ES_STYLE_COLOR_CHOSEN_POINT (ES_STYLE_CAST(1241))
define_private ES_STYLE_COLOR_CIRCLE (ES_STYLE_CAST(1243))
define_private ES_STYLE_COLOR_HEX_TEXTBOX (ES_STYLE_CAST(1245))

Binary file not shown.

Binary file not shown.