summaryrefslogtreecommitdiff
path: root/vcl/jsdialog
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-02-25 13:03:34 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2020-05-19 16:59:34 +0200
commitc529dd9b964e4176fed67d3c1594978c7d26ad7b (patch)
tree99d168d92dae686d4eb09076587cc4a2e2823d73 /vcl/jsdialog
parent5ea36f5975728fcd1fb2f92fccdfdeaeec4e028e (diff)
jsdialog: weld::ComboBox
Change-Id: I672d2fd170e94e0b3e05384461983e5ae4a0ab35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94072 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94488 Tested-by: Jenkins
Diffstat (limited to 'vcl/jsdialog')
-rw-r--r--vcl/jsdialog/jsdialogbuilder.cxx58
1 files changed, 58 insertions, 0 deletions
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 8429eae74e11..a3a8457b3145 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -70,6 +70,18 @@ std::unique_ptr<weld::Entry> JSInstanceBuilder::weld_entry(const OString& id, bo
: nullptr;
}
+std::unique_ptr<weld::ComboBox> JSInstanceBuilder::weld_combo_box(const OString& id,
+ bool bTakeOwnership)
+{
+ vcl::Window* pWidget = m_xBuilder->get<vcl::Window>(id);
+ ::ComboBox* pComboBox = dynamic_cast<::ComboBox*>(pWidget);
+ if (pComboBox)
+ return std::make_unique<JSComboBox>(m_aOwnedToplevel, pComboBox, this, bTakeOwnership);
+ ListBox* pListBox = dynamic_cast<ListBox*>(pWidget);
+ return pListBox ? std::make_unique<JSListBox>(m_aOwnedToplevel, pListBox, this, bTakeOwnership)
+ : nullptr;
+}
+
JSLabel::JSLabel(VclPtr<vcl::Window> aOwnedToplevel, FixedText* pLabel,
SalInstanceBuilder* pBuilder, bool bTakeOwnership)
: SalInstanceLabel(pLabel, pBuilder, bTakeOwnership)
@@ -95,3 +107,49 @@ void JSEntry::set_text(const OUString& rText)
SalInstanceEntry::set_text(rText);
notifyDialogState();
}
+
+JSListBox::JSListBox(VclPtr<vcl::Window> aOwnedToplevel, ::ListBox* pListBox,
+ SalInstanceBuilder* pBuilder, bool bTakeOwnership)
+ : SalInstanceComboBoxWithoutEdit(pListBox, pBuilder, bTakeOwnership)
+ , JSDialogSender(aOwnedToplevel)
+{
+}
+
+void JSListBox::insert(int pos, const OUString& rStr, const OUString* pId,
+ const OUString* pIconName, VirtualDevice* pImageSurface)
+{
+ SalInstanceComboBoxWithoutEdit::insert(pos, rStr, pId, pIconName, pImageSurface);
+ notifyDialogState();
+}
+
+void JSListBox::remove(int pos)
+{
+ SalInstanceComboBoxWithoutEdit::remove(pos);
+ notifyDialogState();
+}
+
+JSComboBox::JSComboBox(VclPtr<vcl::Window> aOwnedToplevel, ::ComboBox* pComboBox,
+ SalInstanceBuilder* pBuilder, bool bTakeOwnership)
+ : SalInstanceComboBoxWithEdit(pComboBox, pBuilder, bTakeOwnership)
+ , JSDialogSender(aOwnedToplevel)
+{
+}
+
+void JSComboBox::insert(int pos, const OUString& rStr, const OUString* pId,
+ const OUString* pIconName, VirtualDevice* pImageSurface)
+{
+ SalInstanceComboBoxWithEdit::insert(pos, rStr, pId, pIconName, pImageSurface);
+ notifyDialogState();
+}
+
+void JSComboBox::remove(int pos)
+{
+ SalInstanceComboBoxWithEdit::remove(pos);
+ notifyDialogState();
+}
+
+void JSComboBox::set_entry_text(const OUString& rText)
+{
+ SalInstanceComboBoxWithEdit::set_entry_text(rText);
+ notifyDialogState();
+}