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
2cb3587a
Kaydet (Commit)
2cb3587a
authored
Ock 19, 2016
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
uitest: add initial implementation for ListBox
Change-Id: I9fcc884afab63a9601c560f733a13551b5036cbe
üst
b590736b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
0 deletions
+80
-0
uiobject.hxx
include/vcl/uitest/uiobject.hxx
+1
-0
uiobject_impl.hxx
vcl/inc/uitest/uiobject_impl.hxx
+21
-0
factory.cxx
vcl/source/uitest/factory.cxx
+9
-0
uiobject.cxx
vcl/source/uitest/uiobject.cxx
+49
-0
No files found.
include/vcl/uitest/uiobject.hxx
Dosyayı görüntüle @
2cb3587a
...
@@ -21,6 +21,7 @@ enum class UIObjectType
...
@@ -21,6 +21,7 @@ enum class UIObjectType
BUTTON
,
BUTTON
,
EDIT
,
EDIT
,
CHECKBOX
,
CHECKBOX
,
LISTBOX
,
UNKNOWN
UNKNOWN
};
};
...
...
vcl/inc/uitest/uiobject_impl.hxx
Dosyayı görüntüle @
2cb3587a
...
@@ -117,4 +117,25 @@ protected:
...
@@ -117,4 +117,25 @@ protected:
virtual
OUString
get_name
()
const
override
;
virtual
OUString
get_name
()
const
override
;
};
};
class
ListBoxUIObject
:
public
WindowUIObject
{
private
:
VclPtr
<
ListBox
>
mxListBox
;
public
:
ListBoxUIObject
(
VclPtr
<
ListBox
>
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: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/source/uitest/factory.cxx
Dosyayı görüntüle @
2cb3587a
...
@@ -10,6 +10,8 @@
...
@@ -10,6 +10,8 @@
#include "uitest/factory.hxx"
#include "uitest/factory.hxx"
#include "uitest/uiobject_impl.hxx"
#include "uitest/uiobject_impl.hxx"
#include <vcl/lstbox.hxx>
std
::
unique_ptr
<
UIObject
>
UITestWrapperFactory
::
createObject
(
vcl
::
Window
*
pWindow
)
std
::
unique_ptr
<
UIObject
>
UITestWrapperFactory
::
createObject
(
vcl
::
Window
*
pWindow
)
{
{
if
(
!
pWindow
)
if
(
!
pWindow
)
...
@@ -65,6 +67,13 @@ std::unique_ptr<UIObject> UITestWrapperFactory::createObject(vcl::Window* pWindo
...
@@ -65,6 +67,13 @@ std::unique_ptr<UIObject> UITestWrapperFactory::createObject(vcl::Window* pWindo
return
std
::
unique_ptr
<
UIObject
>
(
new
CheckBoxUIObject
(
pCheckBox
));
return
std
::
unique_ptr
<
UIObject
>
(
new
CheckBoxUIObject
(
pCheckBox
));
}
}
break
;
break
;
case
WINDOW_LISTBOX
:
{
ListBox
*
pListBox
=
dynamic_cast
<
ListBox
*>
(
pWindow
);
assert
(
pListBox
);
return
std
::
unique_ptr
<
UIObject
>
(
new
ListBoxUIObject
(
pListBox
));
}
break
;
default
:
default
:
break
;
break
;
}
}
...
...
vcl/source/uitest/uiobject.cxx
Dosyayı görüntüle @
2cb3587a
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#include "uitest/factory.hxx"
#include "uitest/factory.hxx"
#include <vcl/event.hxx>
#include <vcl/event.hxx>
#include <vcl/lstbox.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/ustrbuf.hxx>
...
@@ -422,4 +423,52 @@ OUString CheckBoxUIObject::get_name() const
...
@@ -422,4 +423,52 @@ OUString CheckBoxUIObject::get_name() const
return
OUString
(
"CheckBoxUIObject"
);
return
OUString
(
"CheckBoxUIObject"
);
}
}
ListBoxUIObject
::
ListBoxUIObject
(
VclPtr
<
ListBox
>
xListBox
)
:
WindowUIObject
(
xListBox
),
mxListBox
(
xListBox
)
{
}
void
ListBoxUIObject
::
execute
(
const
OUString
&
rAction
,
const
StringMap
&
rParameters
)
{
if
(
rAction
==
"SELECT"
)
{
bool
bSelect
=
true
;
if
(
rParameters
.
find
(
"POS"
)
!=
rParameters
.
end
())
{
auto
itr
=
rParameters
.
find
(
"POS"
);
OUString
aVal
=
itr
->
second
;
sal_Int32
nPos
=
aVal
.
toInt32
();
mxListBox
->
SelectEntryPos
(
nPos
,
bSelect
);
}
else
if
(
rParameters
.
find
(
"TEXT"
)
!=
rParameters
.
end
())
{
auto
itr
=
rParameters
.
find
(
"TEXT"
);
OUString
aText
=
itr
->
second
;
mxListBox
->
SelectEntry
(
aText
,
bSelect
);
}
mxListBox
->
Select
();
}
}
StringMap
ListBoxUIObject
::
get_state
()
{
StringMap
aMap
=
WindowUIObject
::
get_state
();
aMap
[
"ReadOnly"
]
=
OUString
::
boolean
(
mxListBox
->
IsReadOnly
());
aMap
[
"MultiSelect"
]
=
OUString
::
boolean
(
mxListBox
->
IsMultiSelectionEnabled
());
return
aMap
;
}
UIObjectType
ListBoxUIObject
::
get_type
()
const
{
return
UIObjectType
::
LISTBOX
;
}
OUString
ListBoxUIObject
::
get_name
()
const
{
return
OUString
(
"ListBoxUIObject"
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* 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