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
1956ad6d
Kaydet (Commit)
1956ad6d
authored
Mar 18, 2015
tarafından
Michael Meeks
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
vcldemo: create --popup mode demonstrating Windows GL issue.
Change-Id: I562dc891173fbbc151adab39a0dfae42918f88af
üst
2e46594e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
18 deletions
+46
-18
vcldemo.cxx
vcl/workben/vcldemo.cxx
+46
-18
No files found.
vcl/workben/vcldemo.cxx
Dosyayı görüntüle @
1956ad6d
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
#include <vcl/salbtype.hxx>
#include <vcl/salbtype.hxx>
#include <vcl/bmpacc.hxx>
#include <vcl/bmpacc.hxx>
#include <vcl/help.hxx>
#include <vcl/help.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <vcldemo-debug.hxx>
#include <vcldemo-debug.hxx>
...
@@ -1448,9 +1449,6 @@ class DemoWidgets : public WorkWindow
...
@@ -1448,9 +1449,6 @@ class DemoWidgets : public WorkWindow
ToolBox
*
mpToolbox
;
ToolBox
*
mpToolbox
;
PushButton
*
mpButton
;
PushButton
*
mpButton
;
Timer
maHelpTimer
;
DECL_LINK
(
HelpTimerCb
,
void
*
);
public
:
public
:
DemoWidgets
()
:
DemoWidgets
()
:
WorkWindow
(
NULL
,
WB_STDWORK
),
WorkWindow
(
NULL
,
WB_STDWORK
),
...
@@ -1478,17 +1476,15 @@ public:
...
@@ -1478,17 +1476,15 @@ public:
mpButton
->
Show
();
mpButton
->
Show
();
Show
();
Show
();
maHelpTimer
.
SetTimeoutHdl
(
LINK
(
this
,
DemoWidgets
,
HelpTimerCb
));
maHelpTimer
.
SetTimeout
(
1000
);
maHelpTimer
.
Start
();
}
}
virtual
~
DemoWidgets
()
virtual
~
DemoWidgets
()
{
{
delete
mpButton
;
delete
mpButton
;
delete
mpToolbox
;
delete
mpToolbox
;
delete
mpBox
;
delete
mpBox
;
}
}
virtual
void
Paint
(
const
Rectangle
&
)
SAL_OVERRIDE
virtual
void
Paint
(
const
Rectangle
&
)
SAL_OVERRIDE
{
{
Rectangle
aWholeSize
(
Point
(
0
,
0
),
GetOutputSizePixel
());
Rectangle
aWholeSize
(
Point
(
0
,
0
),
GetOutputSizePixel
());
...
@@ -1516,17 +1512,44 @@ public:
...
@@ -1516,17 +1512,44 @@ public:
}
}
};
};
// Horrible code to manually provoke a help event
class
DemoPopup
:
public
FloatingWindow
IMPL_LINK_NOARG
(
DemoWidgets
,
HelpTimerCb
)
{
{
Point
aPos
=
mpToolbox
->
GetPosPixel
();
public
:
aPos
.
Move
(
10
,
10
);
DemoPopup
()
:
FloatingWindow
(
NULL
,
WB_SYSTEMWINDOW
|
WB_TOOLTIPWIN
)
HelpEvent
aHelpEvent
(
aPos
,
HelpEventMode
::
BALLOON
);
{
// pSVData->maHelpData.mbRequestingHelp = true;
SetType
(
WINDOW_HELPTEXTWINDOW
);
mpToolbox
->
RequestHelp
(
aHelpEvent
);
// pSVData->maHelpData.mbRequestingHelp = false;
SetOutputSizePixel
(
Size
(
300
,
30
)
);
return
0
;
SetBackground
(
Wallpaper
(
COL_YELLOW
));
}
Show
(
true
,
SHOW_NOACTIVATE
);
Update
();
}
virtual
void
Paint
(
const
Rectangle
&
)
SAL_OVERRIDE
{
// Interestingly in GL mode on Windows, this doesn't render.
Size
aSize
=
GetOutputSizePixel
();
Rectangle
aTextRect
(
Point
(
6
,
6
),
aSize
);
SetTextColor
(
COL_BLACK
);
SetTextAlign
(
ALIGN_TOP
);
DrawText
(
aTextRect
,
"This is a standalone help text test"
,
TEXT_DRAW_MULTILINE
|
TEXT_DRAW_WORDBREAK
|
TEXT_DRAW_LEFT
|
TEXT_DRAW_TOP
);
SetLineColor
(
COL_BLACK
);
SetFillColor
();
DrawRect
(
Rectangle
(
Point
(),
aSize
)
);
aSize
.
Width
()
-=
2
;
aSize
.
Height
()
-=
2
;
Color
aColor
(
GetLineColor
()
);
SetLineColor
(
(
COL_GRAY
)
);
DrawRect
(
Rectangle
(
Point
(
1
,
1
),
aSize
)
);
SetLineColor
(
aColor
);
}
};
class
DemoApp
:
public
Application
class
DemoApp
:
public
Application
{
{
...
@@ -1552,7 +1575,7 @@ public:
...
@@ -1552,7 +1575,7 @@ public:
{
{
try
try
{
{
bool
bWidgets
=
false
,
bThreads
=
false
;
bool
bWidgets
=
false
,
bThreads
=
false
,
bPopup
=
false
;
DemoRenderer
aRenderer
;
DemoRenderer
aRenderer
;
for
(
sal_Int32
i
=
0
;
i
<
GetCommandLineParamCount
();
i
++
)
for
(
sal_Int32
i
=
0
;
i
<
GetCommandLineParamCount
();
i
++
)
...
@@ -1577,6 +1600,8 @@ public:
...
@@ -1577,6 +1600,8 @@ public:
}
}
else
if
(
aArg
==
"--widgets"
)
else
if
(
aArg
==
"--widgets"
)
bWidgets
=
true
;
bWidgets
=
true
;
else
if
(
aArg
==
"--popup"
)
bPopup
=
true
;
else
if
(
aArg
==
"--threads"
)
else
if
(
aArg
==
"--threads"
)
bThreads
=
true
;
bThreads
=
true
;
else
if
(
aArg
.
startsWith
(
"--"
))
else
if
(
aArg
.
startsWith
(
"--"
))
...
@@ -1589,11 +1614,14 @@ public:
...
@@ -1589,11 +1614,14 @@ public:
DemoWin
aMainWin
(
aRenderer
,
bThreads
);
DemoWin
aMainWin
(
aRenderer
,
bThreads
);
std
::
unique_ptr
<
DemoWidgets
>
xWidgets
;
std
::
unique_ptr
<
DemoWidgets
>
xWidgets
;
std
::
unique_ptr
<
DemoPopup
>
xPopup
;
aMainWin
.
SetText
(
"Interactive VCL demo #1"
);
aMainWin
.
SetText
(
"Interactive VCL demo #1"
);
if
(
bWidgets
)
if
(
bWidgets
)
xWidgets
.
reset
(
new
DemoWidgets
());
xWidgets
.
reset
(
new
DemoWidgets
());
else
if
(
bPopup
)
xPopup
.
reset
(
new
DemoPopup
());
else
else
aMainWin
.
Show
();
aMainWin
.
Show
();
...
...
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