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
c3eab4a8
Kaydet (Commit)
c3eab4a8
authored
Kas 11, 2014
tarafından
Michael Meeks
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
vcldemo: render an enlarged view on mouse click.
Change-Id: I9021ab4744b16f967eaa5006128d30621b421d7a
üst
1c526c9d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
9 deletions
+44
-9
vcldemo.cxx
vcl/workben/vcldemo.cxx
+44
-9
No files found.
vcl/workben/vcldemo.cxx
Dosyayı görüntüle @
c3eab4a8
...
...
@@ -52,6 +52,9 @@ class DemoWin : public DemoBase
Bitmap
maIntroBW
;
BitmapEx
maIntro
;
int
mnSegmentsX
;
int
mnSegmentsY
;
struct
RenderContext
{
RenderStyle
meStyle
;
bool
mbVDev
;
...
...
@@ -65,11 +68,15 @@ class DemoWin : public DemoBase
};
std
::
vector
<
RegionRenderer
*
>
maRenderers
;
sal_Int32
mnSelectedRenderer
;
void
InitRenderers
();
public
:
DemoWin
()
:
DemoBase
()
,
mnSegmentsX
(
4
)
,
mnSegmentsY
(
3
)
,
mnSelectedRenderer
(
-
1
)
,
mpButton
(
NULL
)
,
mpButtonWin
(
NULL
)
{
...
...
@@ -99,14 +106,12 @@ public:
std
::
vector
<
Rectangle
>
partitionAndClear
(
OutputDevice
&
rDev
,
int
nX
,
int
nY
);
void
drawBackground
(
OutputDevice
&
rDev
)
void
drawBackground
(
OutputDevice
&
rDev
,
Rectangle
r
)
{
Rectangle
r
(
Point
(
0
,
0
),
rDev
.
GetOutputSizePixel
());
Gradient
aGradient
;
aGradient
.
SetStartColor
(
COL_BLUE
);
aGradient
.
SetEndColor
(
COL_GREEN
);
aGradient
.
SetStyle
(
GradientStyle_LINEAR
);
// aGradient.SetBorder(r.GetSize().Width()/20);
rDev
.
DrawGradient
(
r
,
aGradient
);
}
...
...
@@ -358,15 +363,25 @@ public:
void
drawToDevice
(
OutputDevice
&
rDev
,
bool
bVdev
)
{
RenderContext
aCtx
;
aCtx
.
meStyle
=
RENDER_THUMB
;
aCtx
.
mbVDev
=
bVdev
;
aCtx
.
mpDemoWin
=
this
;
drawBackground
(
rDev
);
Rectangle
aWholeWin
(
Point
(
0
,
0
),
rDev
.
GetOutputSizePixel
());
drawBackground
(
rDev
,
aWholeWin
);
std
::
vector
<
Rectangle
>
aRegions
(
partitionAndClear
(
rDev
,
4
,
3
));
for
(
size_t
i
=
0
;
i
<
maRenderers
.
size
();
i
++
)
maRenderers
[
i
]
->
RenderRegion
(
rDev
,
aRegions
[
i
],
aCtx
);
if
(
mnSelectedRenderer
>=
0
)
{
aCtx
.
meStyle
=
RENDER_EXPANDED
;
maRenderers
[
mnSelectedRenderer
]
->
RenderRegion
(
rDev
,
aWholeWin
,
aCtx
);
}
else
{
aCtx
.
meStyle
=
RENDER_THUMB
;
std
::
vector
<
Rectangle
>
aRegions
(
partitionAndClear
(
rDev
,
mnSegmentsX
,
mnSegmentsY
));
for
(
size_t
i
=
0
;
i
<
maRenderers
.
size
();
i
++
)
maRenderers
[
i
]
->
RenderRegion
(
rDev
,
aRegions
[
i
],
aCtx
);
}
}
};
...
...
@@ -393,7 +408,27 @@ IMPL_LINK_NOARG(DemoWin,BounceTimerCb)
void
DemoWin
::
MouseButtonDown
(
const
MouseEvent
&
rMEvt
)
{
(
void
)
rMEvt
;
// click to zoom out
if
(
mnSelectedRenderer
>=
0
)
{
mnSelectedRenderer
=
-
1
;
Invalidate
();
return
;
}
// click on a region to zoom into it
std
::
vector
<
Rectangle
>
aRegions
(
partitionAndClear
(
*
this
,
mnSegmentsX
,
mnSegmentsY
));
for
(
size_t
i
=
0
;
i
<
aRegions
.
size
();
i
++
)
{
if
(
aRegions
[
i
].
IsInside
(
rMEvt
.
GetPosPixel
()))
{
mnSelectedRenderer
=
i
;
Invalidate
();
return
;
}
}
// otherwise bounce floating windows
if
(
!
mpButton
)
{
mpButtonWin
=
new
FloatingWindow
(
this
);
...
...
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