Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
5ccbdd25
Kaydet (Commit)
5ccbdd25
authored
Mar 28, 2016
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
uitest: add initial support for combo boxes to uitesting
Change-Id: I82aa2d877216bc1bb984bd16e2d1d54a15fcc4fa
üst
d85d19d0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
0 deletions
+72
-0
uiobject.hxx
include/vcl/uitest/uiobject.hxx
+1
-0
uiobject_impl.hxx
vcl/inc/uitest/uiobject_impl.hxx
+23
-0
factory.cxx
vcl/source/uitest/factory.cxx
+8
-0
uiobject.cxx
vcl/source/uitest/uiobject.cxx
+40
-0
No files found.
include/vcl/uitest/uiobject.hxx
Dosyayı görüntüle @
5ccbdd25
...
...
@@ -22,6 +22,7 @@ enum class UIObjectType
EDIT
,
CHECKBOX
,
LISTBOX
,
COMBOBOX
,
TABPAGE
,
UNKNOWN
};
...
...
vcl/inc/uitest/uiobject_impl.hxx
Dosyayı görüntüle @
5ccbdd25
...
...
@@ -14,6 +14,7 @@
#include <vcl/edit.hxx>
class
TabPage
;
class
ComboBox
;
class
WindowUIObject
:
public
UIObject
{
...
...
@@ -160,4 +161,26 @@ protected:
virtual
OUString
get_name
()
const
override
;
};
// TODO: moggi: should it inherit from EditUIObject?
class
ComboBoxUIObject
:
public
WindowUIObject
{
private
:
VclPtr
<
ComboBox
>
mxComboBox
;
public
:
ComboBoxUIObject
(
VclPtr
<
ComboBox
>
xListBox
);
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: */
vcl/source/uitest/factory.cxx
Dosyayı görüntüle @
5ccbdd25
...
...
@@ -12,6 +12,7 @@
#include <vcl/tabpage.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/combobox.hxx>
std
::
unique_ptr
<
UIObject
>
UITestWrapperFactory
::
createObject
(
vcl
::
Window
*
pWindow
)
{
...
...
@@ -68,6 +69,13 @@ std::unique_ptr<UIObject> UITestWrapperFactory::createObject(vcl::Window* pWindo
return
std
::
unique_ptr
<
UIObject
>
(
new
CheckBoxUIObject
(
pCheckBox
));
}
break
;
case
WINDOW_COMBOBOX
:
{
ComboBox
*
pComboBox
=
dynamic_cast
<
ComboBox
*>
(
pWindow
);
assert
(
pComboBox
);
return
std
::
unique_ptr
<
UIObject
>
(
new
ComboBoxUIObject
(
pComboBox
));
}
break
;
case
WINDOW_LISTBOX
:
{
ListBox
*
pListBox
=
dynamic_cast
<
ListBox
*>
(
pWindow
);
...
...
vcl/source/uitest/uiobject.cxx
Dosyayı görüntüle @
5ccbdd25
...
...
@@ -13,6 +13,7 @@
#include <vcl/event.hxx>
#include <vcl/tabpage.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/combobox.hxx>
#include <rtl/ustrbuf.hxx>
...
...
@@ -508,4 +509,43 @@ OUString ListBoxUIObject::get_name() const
return
OUString
(
"ListBoxUIObject"
);
}
ComboBoxUIObject
::
ComboBoxUIObject
(
VclPtr
<
ComboBox
>
xComboBox
)
:
WindowUIObject
(
xComboBox
),
mxComboBox
(
xComboBox
)
{
}
void
ComboBoxUIObject
::
execute
(
const
OUString
&
rAction
,
const
StringMap
&
rParameters
)
{
if
(
rAction
==
"SELECT"
)
{
if
(
rParameters
.
find
(
"POS"
)
!=
rParameters
.
end
())
{
auto
itr
=
rParameters
.
find
(
"POS"
);
OUString
aVal
=
itr
->
second
;
sal_Int32
nPos
=
aVal
.
toInt32
();
mxComboBox
->
SelectEntryPos
(
nPos
);
}
mxComboBox
->
Select
();
}
}
StringMap
ComboBoxUIObject
::
get_state
()
{
StringMap
aMap
=
WindowUIObject
::
get_state
();
return
aMap
;
}
UIObjectType
ComboBoxUIObject
::
get_type
()
const
{
return
UIObjectType
::
COMBOBOX
;
}
OUString
ComboBoxUIObject
::
get_name
()
const
{
return
OUString
(
"ComboBoxUIObject"
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment