summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-03-28 20:58:13 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-06-18 17:01:47 +0200
commit00c7916459ee175e36dcea80c6f7d5db5caff3c5 (patch)
tree7fcf7e075d9c56709d2d78704a44d6f9e4c9543c /vcl/source
parentb35be797f53b388a0d95d6c8db27e683343bcea2 (diff)
uitest: add spinfield uitest support
Change-Id: Id2dae42396beaa4818c60a57ac8aa76e4eddf24d
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/uitest/factory.cxx14
-rw-r--r--vcl/source/uitest/uiobject.cxx38
2 files changed, 52 insertions, 0 deletions
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: */