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
88031028
Kaydet (Commit)
88031028
authored
Kas 11, 2014
tarafından
Michael Meeks
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
vcldemo: click to invalidate bits and bounce a floatwin around.
Change-Id: I0c417842393eb32132fd430b8bf31e93e7ec3b27
üst
355770ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
vcldemo.cxx
vcl/workben/vcldemo.cxx
+61
-0
No files found.
vcl/workben/vcldemo.cxx
Dosyayı görüntüle @
88031028
...
...
@@ -23,6 +23,8 @@
#include <vcl/wrkwin.hxx>
#include <vcl/virdev.hxx>
#include <vcl/graphicfilter.hxx>
#include <vcl/button.hxx>
#include <vcl/floatwin.hxx>
#if 0
# define FIXME_SELF_INTERSECTING_WORKING
...
...
@@ -47,6 +49,8 @@ class DemoWin : public DemoBase
public
:
DemoWin
()
:
DemoBase
()
,
mpButton
(
NULL
)
,
mpButtonWin
(
NULL
)
{
if
(
!
Application
::
LoadBrandBitmap
(
"intro"
,
maIntro
))
Application
::
Abort
(
"Failed to load intro image"
);
...
...
@@ -54,6 +58,15 @@ public:
maIntroBW
.
Filter
(
BMP_FILTER_EMBOSS_GREY
);
}
// Bouncing windows on click ...
PushButton
*
mpButton
;
FloatingWindow
*
mpButtonWin
;
AutoTimer
maBounce
;
int
mnBounceX
,
mnBounceY
;
DECL_LINK
(
BounceTimerCb
,
void
*
);
virtual
void
MouseButtonDown
(
const
MouseEvent
&
rMEvt
)
SAL_OVERRIDE
;
void
drawToDevice
(
OutputDevice
&
r
,
bool
bVdev
);
virtual
void
Paint
(
const
Rectangle
&
rRect
)
SAL_OVERRIDE
...
...
@@ -272,6 +285,54 @@ public:
}
};
IMPL_LINK_NOARG
(
DemoWin
,
BounceTimerCb
)
{
mpButton
->
Check
(
mnBounceX
>
0
);
mpButton
->
SetPressed
(
mnBounceY
>
0
);
Point
aCur
=
mpButtonWin
->
GetPosPixel
();
static
const
int
nMovePix
=
10
;
aCur
.
Move
(
mnBounceX
*
nMovePix
,
mnBounceX
*
nMovePix
);
Size
aWinSize
=
GetSizePixel
();
if
(
aCur
.
X
()
<=
0
||
aCur
.
X
()
>=
aWinSize
.
Width
())
mnBounceX
*=
-
1
;
if
(
aCur
.
Y
()
<=
0
||
aCur
.
Y
()
>=
aWinSize
.
Height
())
mnBounceX
*=
-
1
;
mpButtonWin
->
SetPosPixel
(
aCur
);
// All smoke and mirrors to test sub-region invalidation underneath
Rectangle
aRect
(
aCur
,
mpButtonWin
->
GetSizePixel
());
Invalidate
(
aRect
);
return
0
;
}
void
DemoWin
::
MouseButtonDown
(
const
MouseEvent
&
rMEvt
)
{
(
void
)
rMEvt
;
if
(
!
mpButton
)
{
mpButtonWin
=
new
FloatingWindow
(
this
);
mpButton
=
new
PushButton
(
mpButtonWin
);
mpButton
->
SetSymbol
(
SymbolType
::
HELP
);
mpButton
->
SetText
(
"PushButton demo"
);
mpButton
->
SetPosSizePixel
(
Point
(
0
,
0
),
mpButton
->
GetOptimalSize
());
mpButton
->
Show
();
mpButtonWin
->
SetPosSizePixel
(
Point
(
0
,
0
),
mpButton
->
GetOptimalSize
());
mpButtonWin
->
Show
();
mnBounceX
=
1
;
mnBounceX
=
1
;
maBounce
.
SetTimeoutHdl
(
LINK
(
this
,
DemoWin
,
BounceTimerCb
));
maBounce
.
SetTimeout
(
55
);
maBounce
.
Start
();
}
else
{
maBounce
.
Stop
();
delete
mpButtonWin
;
mpButtonWin
=
NULL
;
mpButton
=
NULL
;
}
}
std
::
vector
<
Rectangle
>
DemoWin
::
partitionAndClear
(
OutputDevice
&
rDev
,
int
nX
,
int
nY
)
{
Rectangle
r
;
...
...
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