diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-03-28 20:58:13 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-18 17:01:47 +0200 |
commit | 00c7916459ee175e36dcea80c6f7d5db5caff3c5 (patch) | |
tree | 7fcf7e075d9c56709d2d78704a44d6f9e4c9543c /vcl | |
parent | b35be797f53b388a0d95d6c8db27e683343bcea2 (diff) |
uitest: add spinfield uitest support
Change-Id: Id2dae42396beaa4818c60a57ac8aa76e4eddf24d
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/uitest/uiobject_impl.hxx | 21 | ||||
-rw-r--r-- | vcl/source/uitest/factory.cxx | 14 | ||||
-rw-r--r-- | vcl/source/uitest/uiobject.cxx | 38 |
3 files changed, 73 insertions, 0 deletions
diff --git a/vcl/inc/uitest/uiobject_impl.hxx b/vcl/inc/uitest/uiobject_impl.hxx index a23d57fc31ae..4e86e34147ee 100644 --- a/vcl/inc/uitest/uiobject_impl.hxx +++ b/vcl/inc/uitest/uiobject_impl.hxx @@ -16,6 +16,7 @@ class TabPage; class ComboBox; class SpinButton; +class SpinField; class WindowUIObject : public UIObject { @@ -206,4 +207,24 @@ protected: virtual OUString get_name() const override; }; +class SpinFieldUIObject : public EditUIObject +{ + VclPtr<SpinField> mxSpinField; + +public: + + SpinFieldUIObject(VclPtr<SpinField> xEdit); + + virtual void execute(const OUString& rAction, + const StringMap& rParameters) override; + + virtual StringMap get_state() override; + + virtual UIObjectType get_type() const override; + +protected: + + virtual OUString get_name() const override; +}; + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/uitest/factory.cxx b/vcl/source/uitest/factory.cxx index 6cf151619158..beec04241ea8 100644 --- a/vcl/source/uitest/factory.cxx +++ b/vcl/source/uitest/factory.cxx @@ -14,6 +14,7 @@ #include <vcl/lstbox.hxx> #include <vcl/combobox.hxx> #include <vcl/spin.hxx> +#include <vcl/spinfld.hxx> std::unique_ptr<UIObject> UITestWrapperFactory::createObject(vcl::Window* pWindow) { @@ -98,6 +99,19 @@ std::unique_ptr<UIObject> UITestWrapperFactory::createObject(vcl::Window* pWindo return std::unique_ptr<UIObject>(new SpinUIObject(pSpinButton)); } break; + case WINDOW_SPINFIELD: + case WINDOW_PATTERNFIELD: + case WINDOW_NUMERICFIELD: + case WINDOW_METRICFIELD: + case WINDOW_CURRENCYFIELD: + case WINDOW_DATEFIELD: + case WINDOW_TIMEFIELD: + { + SpinField* pSpinField = dynamic_cast<SpinField*>(pWindow); + assert(pSpinField); + return std::unique_ptr<UIObject>(new SpinFieldUIObject(pSpinField)); + } + break; default: break; } diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index 209fb200c404..0d9c97a5a1b0 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -15,6 +15,7 @@ #include <vcl/lstbox.hxx> #include <vcl/combobox.hxx> #include <vcl/spin.hxx> +#include <vcl/spinfld.hxx> #include <rtl/ustrbuf.hxx> @@ -602,4 +603,41 @@ OUString SpinUIObject::get_name() const { return OUString("SpinUIObject"); } + +SpinFieldUIObject::SpinFieldUIObject(VclPtr<SpinField> xSpinField): + EditUIObject(xSpinField), + mxSpinField(xSpinField) +{ +} + +void SpinFieldUIObject::execute(const OUString& rAction, + const StringMap& /*rParameters*/) +{ + if (rAction == "UP") + { + mxSpinField->Up(); + } + else if (rAction == "DOWN") + { + mxSpinField->Down(); + } +} + +StringMap SpinFieldUIObject::get_state() +{ + StringMap aMap = EditUIObject::get_state(); + + return aMap; +} + +UIObjectType SpinFieldUIObject::get_type() const +{ + return UIObjectType::SPINFIELD; +} + +OUString SpinFieldUIObject::get_name() const +{ + return OUString("SpinFieldUIObject"); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |