include/vcl/uitest/uiobject.hxx |    4 ++++
 vcl/source/uitest/uiobject.cxx  |   31 +++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)

New commits:
commit da0e3d7a2dace5c29b7a252b744232e9a92e4f2e
Author: Saurav Chirania <saurav.c...@gmail.com>
Date:   Wed Jun 6 11:22:42 2018 +0530

    WIP: uitest: complete combobox, tabcontrol wrapper
    
    Change-Id: I3ba1b0d1b5412c30e540cf45fe21ef946839afed
    Reviewed-on: https://gerrit.libreoffice.org/55372
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx
index ea90b640824c..37f9f883f058 100644
--- a/include/vcl/uitest/uiobject.hxx
+++ b/include/vcl/uitest/uiobject.hxx
@@ -324,6 +324,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;
@@ -389,6 +391,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 c7c64f8c9189..adf26cbb2ac8 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -1014,6 +1014,19 @@ OUString ComboBoxUIObject::get_name() const
     return OUString("ComboBoxUIObject");
 }
 
+OUString ComboBoxUIObject::get_action(VclEventId nEvent) const
+{
+    if (nEvent == VclEventId::ComboboxSelect)
+    {
+        sal_Int32 nPos = mxComboBox->GetSelectedEntryPos();
+        return this->get_type() + " Action:SELECT Id:" +
+                mxComboBox->get_id() + " POS:" + OUString::number(nPos) +
+                " Parent:" + get_top_parent(mxComboBox)->get_id();
+    }
+    else
+        return WindowUIObject::get_action(nEvent);
+}
+
 std::unique_ptr<UIObject> ComboBoxUIObject::create(vcl::Window* pWindow)
 {
     ComboBox* pComboBox = dynamic_cast<ComboBox*>(pWindow);
@@ -1143,10 +1156,28 @@ void TabControlUIObject::execute(const OUString& 
rAction,
 StringMap TabControlUIObject::get_state()
 {
     StringMap aMap = WindowUIObject::get_state();
+    aMap["PageCount"] = OUString::number(mxTabControl->GetPageCount());
+
+    sal_uInt16 nPageId = mxTabControl->GetCurPageId();
+    aMap["CurrPageId"] = OUString::number(nPageId);
+    aMap["CurrPagePos"] = OUString::number(mxTabControl->GetPagePos(nPageId));
 
     return aMap;
 }
 
+OUString TabControlUIObject::get_action(VclEventId nEvent) const
+{
+    if (nEvent == VclEventId::TabpageActivate)
+    {
+        sal_Int32 nPageId = mxTabControl->GetCurPageId();
+        return this->get_type() + " Action:SELECT Id:" + 
mxTabControl->get_id() +
+            " POS:" + OUString::number(mxTabControl->GetPagePos(nPageId)) +
+            " Parent:" + get_top_parent(mxTabControl)->get_id();
+    }
+    else
+        return WindowUIObject::get_action(nEvent);
+}
+
 OUString TabControlUIObject::get_name() const
 {
     return OUString("TabControlUIObject");
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to