summaryrefslogtreecommitdiff
path: root/vcl/jsdialog/executor.cxx
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-01-19 09:19:03 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2021-01-20 15:05:47 +0100
commit38d01e5af250fb18aa41db8eeafaa644004a0ed4 (patch)
tree69daa3e9d21d01a7781bb7b665d9a27a9dba6fca /vcl/jsdialog/executor.cxx
parent14eda8305008f7e3f0425430527a1d4ce8698dbc (diff)
jsdialog: implemented RadioButton
Change-Id: Iad182d96cb4ff86b1a3fc8bfcca37ea62763fe67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109615 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'vcl/jsdialog/executor.cxx')
-rw-r--r--vcl/jsdialog/executor.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index f2d4d61ecf61..655104633410 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -316,6 +316,21 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat
}
}
}
+ else if (sControlType == "radiobutton")
+ {
+ auto pRadioButton = dynamic_cast<weld::RadioButton*>(pWidget);
+ if (pRadioButton)
+ {
+ if (sAction == "change")
+ {
+ bool bChecked = rData["data"] == "true";
+ pRadioButton->set_state(bChecked ? TRISTATE_TRUE : TRISTATE_FALSE);
+ LOKTrigger::trigger_clicked(*static_cast<weld::Button*>(pRadioButton));
+ LOKTrigger::trigger_toggled(*static_cast<weld::ToggleButton*>(pRadioButton));
+ return true;
+ }
+ }
+ }
}
return false;