diff options
author | Saurav Chirania <saurav.chir@gmail.com> | 2018-07-02 18:50:10 +0530 |
---|---|---|
committer | Saurav Chirania <saurav.chir@gmail.com> | 2018-07-07 08:32:28 +0200 |
commit | 2cff0e2ceb53b2986be8788c7505cabbd04d0288 (patch) | |
tree | 0a03f43a72aa7c9775ccba86d2183bbbe15915a6 | |
parent | e040894fbe0765883e13d51fd6d6331adb09832c (diff) |
uitest: complete wrapper for SpinField and SpinButton
Change-Id: Ibd28b656792018087478a3c6fb5f5f7ac6686131
Reviewed-on: https://gerrit.libreoffice.org/56813
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | include/vcl/uitest/uiobject.hxx | 4 | ||||
-rw-r--r-- | vcl/source/uitest/uiobject.cxx | 36 |
2 files changed, 38 insertions, 2 deletions
diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx index 5ff62735ea02..88bdf0bd6da1 100644 --- a/include/vcl/uitest/uiobject.hxx +++ b/include/vcl/uitest/uiobject.hxx @@ -350,6 +350,8 @@ public: static std::unique_ptr<UIObject> create(vcl::Window* pWindow); + virtual OUString get_action(VclEventId nEvent) const override; + protected: virtual OUString get_name() const override; @@ -371,6 +373,8 @@ public: static std::unique_ptr<UIObject> create(vcl::Window* pWindow); + virtual OUString get_action(VclEventId nEvent) const override; + protected: virtual OUString get_name() const override; diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index 5b72f2ab1945..1a292862ec52 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -1074,11 +1074,11 @@ void SpinUIObject::execute(const OUString& rAction, { if (rAction == "UP") { - /* code */ + mxSpinButton->Up(); } else if (rAction == "DOWN") { - /* code */ + mxSpinButton->Down(); } } @@ -1093,6 +1093,22 @@ StringMap SpinUIObject::get_state() return aMap; } +OUString SpinUIObject::get_action(VclEventId nEvent) const +{ + if (nEvent == VclEventId::SpinbuttonUp) + { + return this->get_type() + " Action:UP Id:" + mxSpinButton->get_id() + + " Parent:" + get_top_parent(mxSpinButton)->get_id(); + } + else if (nEvent == VclEventId::SpinbuttonDown) + { + return this->get_type() + " Action:DOWN Id:" + mxSpinButton->get_id() + + " Parent:" + get_top_parent(mxSpinButton)->get_id(); + } + else + return WindowUIObject::get_action(nEvent); +} + OUString SpinUIObject::get_name() const { return OUString("SpinUIObject"); @@ -1139,6 +1155,22 @@ StringMap SpinFieldUIObject::get_state() return aMap; } +OUString SpinFieldUIObject::get_action(VclEventId nEvent) const +{ + if (nEvent == VclEventId::SpinfieldUp) + { + return this->get_type() + " Action:UP Id:" + mxSpinField->get_id() + + " Parent:" + get_top_parent(mxSpinField)->get_id(); + } + else if (nEvent == VclEventId::SpinfieldDown) + { + return this->get_type() + " Action:DOWN Id:" + mxSpinField->get_id() + + " Parent:" + get_top_parent(mxSpinField)->get_id(); + } + else + return WindowUIObject::get_action(nEvent); +} + OUString SpinFieldUIObject::get_name() const { return OUString("SpinFieldUIObject"); |