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
7c860af1
Kaydet (Commit)
7c860af1
authored
Nis 01, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
vcl: FixedHyper - take into account text alignment
Change-Id: Icc9b4d73cd2e4945299cbaaa1b55eebc3e1e3922
üst
e93a84d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
7 deletions
+30
-7
fixedhyper.hxx
include/vcl/fixedhyper.hxx
+4
-4
fixedhyper.cxx
vcl/source/control/fixedhyper.cxx
+26
-3
No files found.
include/vcl/fixedhyper.hxx
Dosyayı görüntüle @
7c860af1
...
@@ -23,10 +23,7 @@
...
@@ -23,10 +23,7 @@
#include <vcl/dllapi.h>
#include <vcl/dllapi.h>
#include <vcl/fixed.hxx>
#include <vcl/fixed.hxx>
class
VCL_DLLPUBLIC
FixedHyperlink
:
public
FixedText
//= FixedHyperlink
class
VCL_DLLPUBLIC
FixedHyperlink
:
public
FixedText
{
{
private
:
private
:
long
m_nTextLen
;
long
m_nTextLen
;
...
@@ -40,6 +37,9 @@
...
@@ -40,6 +37,9 @@
*/
*/
void
Initialize
();
void
Initialize
();
/** is position X positon hitting text */
SAL_DLLPRIVATE
bool
ImplIsOverText
(
Point
rPosition
);
protected
:
protected
:
/** overwrites Window::MouseMove().
/** overwrites Window::MouseMove().
...
...
vcl/source/control/fixedhyper.cxx
Dosyayı görüntüle @
7c860af1
...
@@ -52,10 +52,33 @@ void FixedHyperlink::Initialize()
...
@@ -52,10 +52,33 @@ void FixedHyperlink::Initialize()
m_nTextLen
=
GetCtrlTextWidth
(
GetText
()
);
m_nTextLen
=
GetCtrlTextWidth
(
GetText
()
);
}
}
bool
FixedHyperlink
::
ImplIsOverText
(
Point
aPosition
)
{
Size
aSize
=
GetOutputSizePixel
();
bool
bIsOver
=
false
;
if
(
GetStyle
()
&
WB_RIGHT
)
{
return
aPosition
.
X
()
>
(
aSize
.
Width
()
-
m_nTextLen
);
}
else
if
(
GetStyle
()
&
WB_CENTER
)
{
bIsOver
=
aPosition
.
X
()
>
(
aSize
.
Width
()
/
2
-
m_nTextLen
/
2
)
&&
aPosition
.
X
()
<
(
aSize
.
Width
()
/
2
+
m_nTextLen
/
2
);
}
else
{
bIsOver
=
aPosition
.
X
()
<
m_nTextLen
;
}
return
bIsOver
;
}
void
FixedHyperlink
::
MouseMove
(
const
MouseEvent
&
rMEvt
)
void
FixedHyperlink
::
MouseMove
(
const
MouseEvent
&
rMEvt
)
{
{
// changes the pointer if the control is enabled and the mouse is over the text.
// changes the pointer if the control is enabled and the mouse is over the text.
if
(
!
rMEvt
.
IsLeaveWindow
()
&&
IsEnabled
()
&&
GetPointerPosPixel
().
X
()
<
m_nTextLen
)
if
(
!
rMEvt
.
IsLeaveWindow
()
&&
IsEnabled
()
&&
ImplIsOverText
(
GetPointerPosPixel
())
)
SetPointer
(
POINTER_REFHAND
);
SetPointer
(
POINTER_REFHAND
);
else
else
SetPointer
(
m_aOldPointer
);
SetPointer
(
m_aOldPointer
);
...
@@ -64,13 +87,13 @@ void FixedHyperlink::MouseMove( const MouseEvent& rMEvt )
...
@@ -64,13 +87,13 @@ void FixedHyperlink::MouseMove( const MouseEvent& rMEvt )
void
FixedHyperlink
::
MouseButtonUp
(
const
MouseEvent
&
)
void
FixedHyperlink
::
MouseButtonUp
(
const
MouseEvent
&
)
{
{
// calls the link if the control is enabled and the mouse is over the text.
// calls the link if the control is enabled and the mouse is over the text.
if
(
IsEnabled
()
&&
GetPointerPosPixel
().
X
()
<
m_nTextLen
)
if
(
IsEnabled
()
&&
ImplIsOverText
(
GetPointerPosPixel
())
)
ImplCallEventListenersAndHandler
(
VCLEVENT_BUTTON_CLICK
,
m_aClickHdl
,
this
);
ImplCallEventListenersAndHandler
(
VCLEVENT_BUTTON_CLICK
,
m_aClickHdl
,
this
);
}
}
void
FixedHyperlink
::
RequestHelp
(
const
HelpEvent
&
rHEvt
)
void
FixedHyperlink
::
RequestHelp
(
const
HelpEvent
&
rHEvt
)
{
{
if
(
IsEnabled
()
&&
GetPointerPosPixel
().
X
()
<
m_nTextLen
)
if
(
IsEnabled
()
&&
ImplIsOverText
(
GetPointerPosPixel
())
)
FixedText
::
RequestHelp
(
rHEvt
);
FixedText
::
RequestHelp
(
rHEvt
);
}
}
...
...
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