fix crash occurs when switch between radio button to checkbox(#375)
This commit is contained in:
parent
345d65f6c9
commit
e963c29646
@ -104,6 +104,7 @@ namespace drawerbase
|
|||||||
struct element_tag
|
struct element_tag
|
||||||
{
|
{
|
||||||
checkbox * uiobj;
|
checkbox * uiobj;
|
||||||
|
event_handle eh_clicked;
|
||||||
event_handle eh_checked;
|
event_handle eh_checked;
|
||||||
event_handle eh_destroy;
|
event_handle eh_destroy;
|
||||||
event_handle eh_keyboard;
|
event_handle eh_keyboard;
|
||||||
|
@ -216,6 +216,7 @@ namespace nana{ namespace drawerbase
|
|||||||
{
|
{
|
||||||
e.uiobj->radio(false);
|
e.uiobj->radio(false);
|
||||||
e.uiobj->react(true);
|
e.uiobj->react(true);
|
||||||
|
API::umake_event(e.eh_clicked);
|
||||||
API::umake_event(e.eh_checked);
|
API::umake_event(e.eh_checked);
|
||||||
API::umake_event(e.eh_destroy);
|
API::umake_event(e.eh_destroy);
|
||||||
API::umake_event(e.eh_keyboard);
|
API::umake_event(e.eh_keyboard);
|
||||||
@ -232,7 +233,7 @@ namespace nana{ namespace drawerbase
|
|||||||
|
|
||||||
el.uiobj = &uiobj;
|
el.uiobj = &uiobj;
|
||||||
|
|
||||||
uiobj.events().checked.connect_unignorable([this](const arg_checkbox& arg)
|
el.eh_checked = uiobj.events().checked.connect_unignorable([this](const arg_checkbox& arg)
|
||||||
{
|
{
|
||||||
if (arg.widget->checked())
|
if (arg.widget->checked())
|
||||||
{
|
{
|
||||||
@ -244,7 +245,7 @@ namespace nana{ namespace drawerbase
|
|||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
el.eh_checked = uiobj.events().click.connect_unignorable([this](const arg_click& arg)
|
el.eh_clicked = uiobj.events().click.connect_unignorable([this](const arg_click& arg)
|
||||||
{
|
{
|
||||||
for (auto & i : ui_container_)
|
for (auto & i : ui_container_)
|
||||||
i.uiobj->check(arg.window_handle == i.uiobj->handle());
|
i.uiobj->check(arg.window_handle == i.uiobj->handle());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user