From 43df38e5a8118013573479a3c58ddf51fc069157 Mon Sep 17 00:00:00 2001 From: nakst <> Date: Fri, 20 Aug 2021 15:17:19 +0100 Subject: [PATCH] checkboxes and radioboxes --- apps/test.cpp | 1 + desktop/gui.cpp | 2 ++ desktop/styles.header | 4 ++-- res/Theme Source.dat | Bin 44613 -> 48911 bytes res/Themes/Theme.dat | Bin 56696 -> 59124 bytes 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/test.cpp b/apps/test.cpp index 9c41609..8579645 100644 --- a/apps/test.cpp +++ b/apps/test.cpp @@ -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); }); diff --git a/desktop/gui.cpp b/desktop/gui.cpp index fccc656..02f26a7 100644 --- a/desktop/gui.cpp +++ b/desktop/gui.cpp @@ -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); diff --git a/desktop/styles.header b/desktop/styles.header index edebe24..9dfbd67 100644 --- a/desktop/styles.header +++ b/desktop/styles.header @@ -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)) diff --git a/res/Theme Source.dat b/res/Theme Source.dat index f4085c42c2d9f3cba40d29ed1b9fe298786a9e46..92586e245d663df5281231d3338be39d1e610502 100644 GIT binary patch delta 1015 zcmX?lhpGP`6RRi#1B2*BR%u477M?bdHoi8|wtnY~)a2}>{0cq4{G!~%9PTy-#ukA# z!8V~b;kJoz$)LoP%zU6K{r)}~@UU6m-2A0Ws z>JpPb1anM|o5M4CfdH#^S4e6_iJnhlQfdw(Z(BpNQ+@>l1K&?}1_mRe21cNRV4zub zvXqkiR#g382=Lh6Va{eA4rdaQzVQ5p+QFX z041=|CQxx?8s-29-Pi=t33Plz)8vQcVv`@tl%Kq>)r41&`Cn^O<2NAL+{iVVvDE?| z1`e(DOaeH=d2_VF%F*yb4==&C&6x_b8AXuO8zT^~1HoiLl^Q!CXrf{RCaNYZNvh4M zG$$vugn@1x-snl&=GIyZ>04wbd3;+NC delta 91 zcmeDG$8_`#6RRi#0|VDaR%u3~CbdS5#(w9F)a2}>{0cq4{G!~%oXi#mMzF+0xI|E5 kN@hM#MOMq^C`K)Amhwi%#>opUq&F|-;heZRZ{0!x0DM0n3IG5A diff --git a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