diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-21 16:44:30 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-22 18:19:32 +0200 |
commit | 2e2d4a326e25b460b0590d1cccb0ae2834743fc0 (patch) | |
tree | 358c779fa7623566b39bf6502968a7a84ac56d37 /vcl/source/uitest | |
parent | 47b9dad7976fe0611b60efa8c38c148445c99949 (diff) |
uitest: add support for TabControl
Change-Id: I4cdffe62cdabaf110eaaeb0d31a45c44833d354a
Diffstat (limited to 'vcl/source/uitest')
-rw-r--r-- | vcl/source/uitest/uiobject.cxx | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index 27c7af59711a..4d33f9c08059 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -871,4 +871,52 @@ std::unique_ptr<UIObject> SpinFieldUIObject::create(vcl::Window* pWindow) return std::unique_ptr<UIObject>(new SpinFieldUIObject(pSpinField)); } +TabControlUIObject::TabControlUIObject(VclPtr<TabControl> xTabControl): + WindowUIObject(xTabControl), + mxTabControl(xTabControl) +{ +} + +TabControlUIObject::~TabControlUIObject() +{ +} + +void TabControlUIObject::execute(const OUString& rAction, + const StringMap& rParameters) +{ + if (rAction == "SELECT") + { + if (rParameters.find("POS") != rParameters.end()) + { + auto itr = rParameters.find("POS"); + sal_uInt32 nPos = itr->second.toUInt32(); + std::vector<sal_uInt16> aIds = mxTabControl->GetPageIDs(); + mxTabControl->SelectTabPage(aIds[nPos]); + } + } + else + WindowUIObject::execute(rAction, rParameters); +} + +StringMap TabControlUIObject::get_state() +{ + StringMap aMap = WindowUIObject::get_state(); + + return aMap; +} + +OUString TabControlUIObject::get_name() const +{ + return OUString("TabControlUIObject"); +} + +std::unique_ptr<UIObject> TabControlUIObject::create(vcl::Window* pWindow) +{ + TabControl* pTabControl = dynamic_cast<TabControl*>(pWindow); + assert(pTabControl); + return std::unique_ptr<UIObject>(new TabControlUIObject(pTabControl)); +} + + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |