diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2023-03-15 18:46:17 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2023-04-05 16:02:22 +0200 |
commit | c81306b7f5f2c12c3b4391dce4697276a0a3523b (patch) | |
tree | 228fcc0c28ac518f0dfad95a33b4baf37bfce5a1 /vcl | |
parent | 5cc69594e4382c258f0e3e3b1ef210567fce1bd8 (diff) |
jsdialog: dump menu for menubutton
Change-Id: I449ae3f8cf294e2ab81a5b47862278e325f2cb1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148937
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150041
Tested-by: Jenkins
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/jsdialog/executor.cxx | 5 | ||||
-rw-r--r-- | vcl/source/control/menubtn.cxx | 17 |
2 files changed, 22 insertions, 0 deletions
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index 9c81aa767be5..cb8dfa4d455c 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -166,6 +166,11 @@ bool ExecuteAction(const OUString& nWindowId, const OUString& rWidget, StringMap return true; } + else if (sAction == "select") + { + LOKTrigger::trigger_selected(*pButton, rData["data"]); + return true; + } } } else if (sControlType == "checkbox") diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx index cd9b2095985e..64aec098db0f 100644 --- a/vcl/source/control/menubtn.cxx +++ b/vcl/source/control/menubtn.cxx @@ -265,6 +265,23 @@ void MenuButton::SetCurItemId(){ msCurItemIdent = mpMenu->GetCurItemIdent(); } +void MenuButton::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) +{ + PushButton::DumpAsPropertyTree(rJsonWriter); + + if (mpMenu) + { + auto aMenuNode = rJsonWriter.startArray("menu"); + for (int i = 0; i < mpMenu->GetItemCount(); i++) + { + auto aEntryNode = rJsonWriter.startStruct(); + auto sId = mpMenu->GetItemId(i); + rJsonWriter.put("id", mpMenu->GetItemIdent(sId)); + rJsonWriter.put("text", mpMenu->GetItemText(sId)); + } + } +} + //class MenuToggleButton ---------------------------------------------------- MenuToggleButton::MenuToggleButton( vcl::Window* pParent, WinBits nWinBits ) |