diff options
author | rash419 <rashesh.padia@collabora.com> | 2022-04-13 16:20:36 +0530 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2022-11-20 10:40:16 +0100 |
commit | ba5e0013e74f072300e808e4d8d679b6f42bff92 (patch) | |
tree | 46ed7479019c69119f415b7b072814749802bdd3 /cui | |
parent | 64d4275b60d50a87fb2bf4dd45be3c28902cec52 (diff) |
jsdialogs: added WidgetTestDialog to test different vcl widgets in online side
Signed-off-by: rash419 <rashesh.padia@collabora.com>
Change-Id: I27cbb72b4ccd486b58934503b1d3d5d7ff47cbfe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132865
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142970
Tested-by: Jenkins
Diffstat (limited to 'cui')
-rw-r--r-- | cui/Library_cui.mk | 1 | ||||
-rw-r--r-- | cui/UIConfig_cui.mk | 1 | ||||
-rw-r--r-- | cui/inc/widgettestdlg.hxx | 28 | ||||
-rw-r--r-- | cui/source/dialogs/widgettestdlg.cxx | 31 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 9 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 6 | ||||
-rw-r--r-- | cui/uiconfig/ui/widgettestdialog.ui | 496 |
7 files changed, 572 insertions, 0 deletions
diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk index 5918be60972c..e967e4491419 100644 --- a/cui/Library_cui.mk +++ b/cui/Library_cui.mk @@ -241,6 +241,7 @@ $(eval $(call gb_Library_add_exception_objects,cui,\ cui/source/tabpages/tptrans \ cui/source/tabpages/transfrm \ cui/source/util/FontFeatures \ + cui/source/dialogs/widgettestdlg \ )) # vim: set noet sw=4 ts=4: diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index 89c8869ade36..4c0f9a7f2a75 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -228,6 +228,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/wordcompletionpage \ cui/uiconfig/ui/spinbox \ cui/uiconfig/ui/zoomdialog \ + cui/uiconfig/ui/widgettestdialog \ )) # vim: set noet sw=4 ts=4: diff --git a/cui/inc/widgettestdlg.hxx b/cui/inc/widgettestdlg.hxx new file mode 100644 index 000000000000..dabc2ee14e75 --- /dev/null +++ b/cui/inc/widgettestdlg.hxx @@ -0,0 +1,28 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* +* This file is part of the LibreOffice project. +* +* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. +*/ + +#pragma once + +#include <tools/link.hxx> +#include <vcl/weld.hxx> +#include <vcl/weldutils.hxx> + +class WidgetTestDialog final : public weld::GenericDialogController +{ +private: + std::unique_ptr<weld::Button> m_xOKButton; + std::unique_ptr<weld::Button> m_xCancelButton; + + DECL_LINK(OkHdl, weld::Button&, void); + DECL_LINK(CancelHdl, weld::Button&, void); + +public: + WidgetTestDialog(weld::Window* pParent); + ~WidgetTestDialog(); +}; diff --git a/cui/source/dialogs/widgettestdlg.cxx b/cui/source/dialogs/widgettestdlg.cxx new file mode 100644 index 000000000000..5475151a9af2 --- /dev/null +++ b/cui/source/dialogs/widgettestdlg.cxx @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* +* This file is part of the LibreOffice project. +* +* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. +*/ + +#include <widgettestdlg.hxx> + +WidgetTestDialog::WidgetTestDialog(weld::Window* pParent) + : GenericDialogController(pParent, "cui/ui/widgettestdialog.ui", "WidgetTestDialog") +{ + m_xOKButton = m_xBuilder->weld_button("ok_btn"); + m_xCancelButton = m_xBuilder->weld_button("cancel_btn"); + + m_xOKButton->connect_clicked(LINK(this, WidgetTestDialog, OkHdl)); + m_xCancelButton->connect_clicked(LINK(this, WidgetTestDialog, CancelHdl)); +} + +WidgetTestDialog::~WidgetTestDialog() {} + +IMPL_LINK_NOARG(WidgetTestDialog, OkHdl, weld::Button&, void) { m_xDialog->response(RET_OK); } + +IMPL_LINK_NOARG(WidgetTestDialog, CancelHdl, weld::Button&, void) +{ + m_xDialog->response(RET_CANCEL); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 930452d64d09..0cd8d39688ad 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -89,6 +89,7 @@ #include <hyphen.hxx> #include <thesdlg.hxx> #include <tipofthedaydlg.hxx> +#include <widgettestdlg.hxx> #include <toolbarmodedlg.hxx> #include <DiagramDialog.hxx> #include <fileextcheckdlg.hxx> @@ -143,6 +144,7 @@ IMPL_ABSTDLG_CLASS_ASYNC(CuiAbstractControllerAsync,weld::DialogController) IMPL_ABSTDLG_CLASS_ASYNC(CuiAbstractTabController,SfxTabDialogController) IMPL_ABSTDLG_CLASS(CuiAbstractController) IMPL_ABSTDLG_CLASS(CuiAbstractSingleTabController) +IMPL_ABSTDLG_CLASS_ASYNC(CuiAbstractWidgetTestControllerAsync,weld::GenericDialogController) short AbstractHyphenWordDialog_Impl::Execute() { @@ -1519,6 +1521,13 @@ AbstractDialogFactory_Impl::CreateTipOfTheDayDialog(weld::Window* pParent) } VclPtr<VclAbstractDialog> +AbstractDialogFactory_Impl::CreateWidgetTestDialog(weld::Window* pParent) +{ + return VclPtr<CuiAbstractWidgetTestControllerAsync_Impl>::Create( + std::make_shared<WidgetTestDialog>(pParent)); +} + +VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateToolbarmodeDialog(weld::Window* pParent) { return VclPtr<CuiAbstractController_Impl>::Create( diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 1c60d075a3da..eb52630d0199 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -109,6 +109,10 @@ DECL_ABSTDLG_CLASS_UNIQUE(CuiAbstractController, VclAbstractDialog, weld::Dialog DECL_ABSTDLG_CLASS_SHARED_ASYNC(CuiAbstractControllerAsync, VclAbstractDialog, weld::DialogController) }; +// CuiAbstractWidgetTestControllerAsync_Impl +DECL_ABSTDLG_CLASS_SHARED_ASYNC(CuiAbstractWidgetTestControllerAsync, VclAbstractDialog, weld::GenericDialogController) +}; + // CuiAbstractSingleTabController_Impl DECL_ABSTDLG_CLASS_UNIQUE(CuiAbstractSingleTabController, SfxAbstractDialog, SfxSingleTabDialogController) virtual const SfxItemSet* GetOutputItemSet() const override; @@ -605,6 +609,8 @@ public: virtual VclPtr<VclAbstractDialog> CreateTipOfTheDayDialog(weld::Window* pParent) override; + virtual VclPtr<VclAbstractDialog> CreateWidgetTestDialog(weld::Window* pParent) override; + virtual VclPtr<VclAbstractDialog> CreateToolbarmodeDialog(weld::Window* pParent) override; virtual VclPtr<AbstractDiagramDialog> CreateDiagramDialog( diff --git a/cui/uiconfig/ui/widgettestdialog.ui b/cui/uiconfig/ui/widgettestdialog.ui new file mode 100644 index 000000000000..ce8e52879fec --- /dev/null +++ b/cui/uiconfig/ui/widgettestdialog.ui @@ -0,0 +1,496 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.38.2 --> +<interface domain="cui"> + <requires lib="gtk+" version="3.20"/> + <object class="GtkDialog" id="WidgetTestDialog"> + <property name="can-focus">False</property> + <property name="type-hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">5</property> + <child internal-child="action_area"> + <object class="GtkButtonBox"> + <property name="can-focus">False</property> + <property name="layout-style">end</property> + <child> + <object class="GtkButton" id="cancel_btn"> + <property name="label" translatable="no">Cancel</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="ok_btn"> + <property name="label" translatable="no">Ok</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <!-- n-columns=2 n-rows=7 --> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="row-spacing">5</property> + <property name="column-spacing">5</property> + <child> + <object class="GtkEntry" id="entry_box_1"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="text" translatable="no">Editable Entry</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">2</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="entry_box_2"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can-focus">True</property> + <property name="text" translatable="no">Disabled Entry</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">3</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="combo_box_disable"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can-focus">False</property> + <property name="model">liststore1</property> + <property name="button-sensitivity">off</property> + <property name="has-entry">True</property> + <property name="entry-text-column">0</property> + <child internal-child="entry"> + <object class="GtkEntry"> + <property name="sensitive">False</property> + <property name="can-focus">False</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkToggleButton" id="toggle_btn_1"> + <property name="label" translatable="no">Toggle Button</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkToggleButton" id="toggle_btn_2"> + <property name="label" translatable="no">Toggle Button</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkToggleButton" id="toggle_btn_3"> + <property name="label" translatable="no">Toggle Button</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + <property name="active">True</property> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">2</property> + </packing> + </child> + <child> + <object class="GtkLinkButton" id="link_btn_1"> + <property name="label" translatable="no">Collabora Office</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + <property name="relief">none</property> + <property name="uri">https://www.collaboraoffice.com/</property> + <property name="visited">True</property> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">5</property> + </packing> + </child> + <child> + <object class="GtkLinkButton" id="link_btn_2"> + <property name="label" translatable="no">Collabora Office</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + <property name="relief">none</property> + <property name="uri">https://www.collaboraoffice.com/</property> + <property name="visited">True</property> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">6</property> + </packing> + </child> + <child> + <!-- n-columns=4 n-rows=1 --> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can-focus">False</property> + <property name="row-spacing">5</property> + <property name="column-spacing">5</property> + <child> + <object class="GtkLabel" id="label_1"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="no">Label</property> + <property name="justify">center</property> + <property name="mnemonic-widget">spin_btn_1</property> + <property name="ellipsize">start</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="spin_btn_1"> + <property name="visible">True</property> + <property name="can-focus">True</property> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label_2"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can-focus">False</property> + <property name="label" translatable="no">Label</property> + <property name="justify">center</property> + <property name="mnemonic-widget">spin_btn_2</property> + <property name="ellipsize">start</property> + </object> + <packing> + <property name="left-attach">2</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="spin_btn_2"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can-focus">True</property> + </object> + <packing> + <property name="left-attach">3</property> + <property name="top-attach">0</property> + </packing> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">4</property> + </packing> + </child> + <child> + <object class="GtkSpinner" id="spinner_1"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="tooltip-text" translatable="no">switch_1</property> + <property name="active">True</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">5</property> + </packing> + </child> + <child> + <object class="GtkSpinner" id="spinner_2"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can-focus">False</property> + <property name="active">True</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">6</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="combo_box_enable"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="model">liststore1</property> + <property name="has-entry">True</property> + <property name="entry-text-column">0</property> + <child internal-child="entry"> + <object class="GtkEntry"> + <property name="can-focus">False</property> + <property name="text" translatable="no">Test 3</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkSeparator"> + <property name="visible">True</property> + <property name="can-focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <!-- n-columns=1 n-rows=1 --> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="row-spacing">5</property> + <property name="column-spacing">5</property> + <child> + <object class="GtkExpander" id="expander_1"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="expanded">True</property> + <child> + <!-- n-columns=2 n-rows=4 --> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="margin-top">5</property> + <property name="row-spacing">5</property> + <property name="column-spacing">5</property> + <child> + <object class="GtkCheckButton" id="check_btn_1"> + <property name="label" translatable="no">Check Button 1</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="active">True</property> + <property name="draw-indicator">True</property> + <property name="mnemonic-widget">entry_box_1</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="check_btn_2"> + <property name="label" translatable="no">Check Button 2</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="draw-indicator">True</property> + <property name="mnemonic-widget">entry_box_2</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="check_btn_4"> + <property name="label" translatable="no">Check Button 4</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="draw-indicator">True</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">3</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="check_btn_3"> + <property name="label" translatable="no">Check Button 3</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="active">True</property> + <property name="draw-indicator">True</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">2</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="radio_btn_1"> + <property name="label" translatable="no">Radio Button 1</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="active">True</property> + <property name="draw-indicator">True</property> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="radio_btn_2"> + <property name="label" translatable="no">Radio Button 2</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="draw-indicator">True</property> + <property name="group">radio_btn_1</property> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="radio_btn_3"> + <property name="label" translatable="no">Radio Button 3</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="active">True</property> + <property name="draw-indicator">True</property> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">2</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="radio_btn_4"> + <property name="label" translatable="no">Radio Button 4</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="draw-indicator">True</property> + <property name="group">radio_btn_3</property> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">3</property> + </packing> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="expander"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="no">Expander</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + </object> + <object class="GtkTextBuffer" id="textbuffer1"> + <property name="text" translatable="no">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy tex +t ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a + type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, + remaining essentially unchanged. + It was popularised in the 1960s with the release + of Letraset sheets containing Lorem + Ipsum passages, and more recently with desktop publishing + software like Aldus PageMaker including versions of Lorem Ipsum.</property> + </object> + <object class="GtkListStore" id="liststore1"> + <columns> + <!-- column-name gchararray1 --> + <column type="gchararray"/> + </columns> + <data> + <row> + <col id="0" translatable="no">Test 1</col> + </row> + <row> + <col id="0" translatable="no">Test 2</col> + </row> + <row> + <col id="0" translatable="no">Test 3</col> + </row> + <row> + <col id="0" translatable="no">Test 4</col> + </row> + <row> + <col id="0" translatable="no">Test 5</col> + </row> + </data> + </object> +</interface> |