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
71c56174
Kaydet (Commit)
71c56174
authored
May 11, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
refactor Roadmap to use RenderContext, some cleanup
Change-Id: I4750c17ae7110b0102ebdd141a31ab2a52c4e774
üst
01f1a5b1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
57 deletions
+50
-57
roadmap.hxx
svtools/inc/roadmap.hxx
+17
-27
roadmap.cxx
svtools/source/control/roadmap.cxx
+33
-30
No files found.
svtools/inc/roadmap.hxx
Dosyayı görüntüle @
71c56174
...
@@ -25,37 +25,30 @@
...
@@ -25,37 +25,30 @@
#include <svtools/hyperlabel.hxx>
#include <svtools/hyperlabel.hxx>
class
Bitmap
;
class
Bitmap
;
namespace
svt
namespace
svt
{
{
struct
RoadmapTypes
struct
RoadmapTypes
{
{
public
:
public
:
typedef
sal_Int16
ItemId
;
typedef
sal_Int16
ItemId
;
typedef
sal_Int32
ItemIndex
;
typedef
sal_Int32
ItemIndex
;
};
};
class
RoadmapImpl
;
class
RoadmapItem
;
class
RoadmapImpl
;
class
RoadmapItem
;
//= Roadmap
class
SVT_DLLPUBLIC
ORoadmap
:
public
Control
,
public
RoadmapTypes
{
class
SVT_DLLPUBLIC
ORoadmap
:
public
Control
,
public
RoadmapTypes
protected
:
{
protected
:
RoadmapImpl
*
m_pImpl
;
RoadmapImpl
*
m_pImpl
;
// Window overridables
// Window overridables
void
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
_rRect
)
SAL_OVERRIDE
;
void
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
_rRect
)
SAL_OVERRIDE
;
void
implInit
(
);
void
implInit
(
vcl
::
RenderContext
&
rRenderContext
);
public
:
public
:
ORoadmap
(
vcl
::
Window
*
_pParent
,
WinBits
_nWinStyle
=
0
);
ORoadmap
(
vcl
::
Window
*
_pParent
,
WinBits
_nWinStyle
=
0
);
virtual
~
ORoadmap
(
);
virtual
~
ORoadmap
(
);
virtual
void
dispose
()
SAL_OVERRIDE
;
virtual
void
dispose
()
SAL_OVERRIDE
;
...
@@ -88,15 +81,14 @@ namespace svt
...
@@ -88,15 +81,14 @@ namespace svt
virtual
void
DataChanged
(
const
DataChangedEvent
&
rDCEvt
)
SAL_OVERRIDE
;
virtual
void
DataChanged
(
const
DataChangedEvent
&
rDCEvt
)
SAL_OVERRIDE
;
virtual
void
GetFocus
()
SAL_OVERRIDE
;
virtual
void
GetFocus
()
SAL_OVERRIDE
;
protected
:
protected
:
bool
PreNotify
(
NotifyEvent
&
rNEvt
)
SAL_OVERRIDE
;
bool
PreNotify
(
NotifyEvent
&
rNEvt
)
SAL_OVERRIDE
;
protected
:
protected
:
/// called when an item has been selected by any means
/// called when an item has been selected by any means
void
Select
();
void
Select
();
private
:
private
:
DECL_LINK
(
ImplClickHdl
,
HyperLabel
*
);
DECL_LINK
(
ImplClickHdl
,
HyperLabel
*
);
RoadmapItem
*
GetByIndex
(
ItemIndex
_nItemIndex
);
RoadmapItem
*
GetByIndex
(
ItemIndex
_nItemIndex
);
...
@@ -106,19 +98,17 @@ namespace svt
...
@@ -106,19 +98,17 @@ namespace svt
const
RoadmapItem
*
GetByID
(
ItemId
_nID
,
ItemIndex
_nStartIndex
=
0
)
const
;
const
RoadmapItem
*
GetByID
(
ItemId
_nID
,
ItemIndex
_nStartIndex
=
0
)
const
;
RoadmapItem
*
GetPreviousHyperLabel
(
ItemIndex
_Index
);
RoadmapItem
*
GetPreviousHyperLabel
(
ItemIndex
_Index
);
void
DrawHeadline
(
);
void
DrawHeadline
(
vcl
::
RenderContext
&
rRenderContext
);
void
DeselectOldRoadmapItems
();
void
DeselectOldRoadmapItems
();
ItemId
GetNextAvailableItemId
(
ItemIndex
_NewIndex
);
ItemId
GetNextAvailableItemId
(
ItemIndex
_NewIndex
);
ItemId
GetPreviousAvailableItemId
(
ItemIndex
_NewIndex
);
ItemId
GetPreviousAvailableItemId
(
ItemIndex
_NewIndex
);
RoadmapItem
*
GetByPointer
(
vcl
::
Window
*
pWindow
);
RoadmapItem
*
GetByPointer
(
vcl
::
Window
*
pWindow
);
RoadmapItem
*
InsertHyperLabel
(
ItemIndex
_Index
,
const
OUString
&
_aStr
,
ItemId
_RMID
,
bool
_bEnabled
,
bool
_bIncomplete
);
RoadmapItem
*
InsertHyperLabel
(
ItemIndex
_Index
,
const
OUString
&
_aStr
,
ItemId
_RMID
,
bool
_bEnabled
,
bool
_bIncomplete
);
void
UpdatefollowingHyperLabels
(
ItemIndex
_Index
);
void
UpdatefollowingHyperLabels
(
ItemIndex
_Index
);
};
};
}
// namespace svt
}
// namespace svt
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
svtools/source/control/roadmap.cxx
Dosyayı görüntüle @
71c56174
...
@@ -83,7 +83,6 @@ private:
...
@@ -83,7 +83,6 @@ private:
void
ImplUpdatePosSize
();
void
ImplUpdatePosSize
();
};
};
//= RoadmapImpl
//= RoadmapImpl
class
RoadmapImpl
:
public
RoadmapTypes
class
RoadmapImpl
:
public
RoadmapTypes
...
@@ -94,9 +93,11 @@ protected:
...
@@ -94,9 +93,11 @@ protected:
BitmapEx
m_aPicture
;
BitmapEx
m_aPicture
;
HL_Vector
m_aRoadmapSteps
;
HL_Vector
m_aRoadmapSteps
;
ItemId
m_iCurItemID
;
ItemId
m_iCurItemID
;
bool
m_bInteractive
;
bool
m_bInteractive
:
1
;
bool
m_bComplete
;
bool
m_bComplete
:
1
;
Size
m_aItemSizePixel
;
Size
m_aItemSizePixel
;
public
:
bool
m_bPaintInitialized
:
1
;
public
:
public
:
RoadmapImpl
(
const
ORoadmap
&
rAntiImpl
)
RoadmapImpl
(
const
ORoadmap
&
rAntiImpl
)
...
@@ -104,6 +105,7 @@ public:
...
@@ -104,6 +105,7 @@ public:
,
m_iCurItemID
(
-
1
)
,
m_iCurItemID
(
-
1
)
,
m_bInteractive
(
true
)
,
m_bInteractive
(
true
)
,
m_bComplete
(
true
)
,
m_bComplete
(
true
)
,
m_bPaintInitialized
(
false
)
,
InCompleteHyperLabel
(
NULL
)
,
InCompleteHyperLabel
(
NULL
)
{}
{}
...
@@ -198,25 +200,23 @@ void RoadmapImpl::initItemSize()
...
@@ -198,25 +200,23 @@ void RoadmapImpl::initItemSize()
ORoadmap
::
ORoadmap
(
vcl
::
Window
*
_pParent
,
WinBits
_nWinStyle
)
ORoadmap
::
ORoadmap
(
vcl
::
Window
*
_pParent
,
WinBits
_nWinStyle
)
:
Control
(
_pParent
,
_nWinStyle
)
:
Control
(
_pParent
,
_nWinStyle
)
,
m_pImpl
(
new
RoadmapImpl
(
*
this
))
,
m_pImpl
(
new
RoadmapImpl
(
*
this
))
{
{
implInit
();
}
}
void
ORoadmap
::
implInit
(
vcl
::
RenderContext
&
rRenderContext
)
void
ORoadmap
::
implInit
()
{
{
const
StyleSettings
&
rStyleSettings
=
GetSettings
().
GetStyleSettings
();
const
StyleSettings
&
rStyleSettings
=
rRenderContext
.
GetSettings
().
GetStyleSettings
();
Color
aTextColor
=
rStyleSettings
.
GetFieldTextColor
();
Color
aTextColor
=
rStyleSettings
.
GetFieldTextColor
();
vcl
::
Font
aFont
=
GetFont
(
);
vcl
::
Font
aFont
=
rRenderContext
.
GetFont
(
);
aFont
.
SetColor
(
aTextColor
);
aFont
.
SetColor
(
aTextColor
);
aFont
.
SetWeight
(
WEIGHT_BOLD
);
aFont
.
SetWeight
(
WEIGHT_BOLD
);
aFont
.
SetUnderline
(
UNDERLINE_SINGLE
);
aFont
.
SetUnderline
(
UNDERLINE_SINGLE
);
SetFont
(
aFont
);
rRenderContext
.
SetFont
(
aFont
);
SetBackground
(
Wallpaper
(
rStyleSettings
.
GetFieldColor
()
)
);
rRenderContext
.
SetBackground
(
Wallpaper
(
rStyleSettings
.
GetFieldColor
())
);
m_pImpl
->
InCompleteHyperLabel
=
NULL
;
m_pImpl
->
InCompleteHyperLabel
=
NULL
;
m_pImpl
->
setCurItemID
(
-
1
);
m_pImpl
->
setCurItemID
(
-
1
);
m_pImpl
->
setComplete
(
true
);
m_pImpl
->
setComplete
(
true
);
m_pImpl
->
m_bPaintInitialized
=
true
;
// Roadmap control should be reachable as one unit with a Tab key
// Roadmap control should be reachable as one unit with a Tab key
// the next Tab key should spring out of the control.
// the next Tab key should spring out of the control.
...
@@ -232,7 +232,7 @@ void ORoadmap::implInit()
...
@@ -232,7 +232,7 @@ void ORoadmap::implInit()
// on this with calculating a new bold font.
// on this with calculating a new bold font.
// Unfortunately, the OutputDevice does not offer a notify mechanism for a changed font.
// Unfortunately, the OutputDevice does not offer a notify mechanism for a changed font.
// So settings the font from outside is simply a forbidded scenario at the moment
// So settings the font from outside is simply a forbidded scenario at the moment
EnableMapMode
(
false
);
rRenderContext
.
EnableMapMode
(
false
);
}
}
ORoadmap
::~
ORoadmap
()
ORoadmap
::~
ORoadmap
()
...
@@ -561,36 +561,39 @@ bool ORoadmap::SelectRoadmapItemByID( ItemId _nNewID )
...
@@ -561,36 +561,39 @@ bool ORoadmap::SelectRoadmapItemByID( ItemId _nNewID )
void
ORoadmap
::
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
_rRect
)
void
ORoadmap
::
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
_rRect
)
{
{
if
(
!
m_pImpl
->
m_bPaintInitialized
)
implInit
(
rRenderContext
);
Control
::
Paint
(
rRenderContext
,
_rRect
);
Control
::
Paint
(
rRenderContext
,
_rRect
);
// draw the bitmap
// draw the bitmap
if
(
!!
m_pImpl
->
getPicture
()
)
if
(
!!
m_pImpl
->
getPicture
()
)
{
{
Size
aBitmapSize
=
m_pImpl
->
getPicture
().
GetSizePixel
();
Size
aBitmapSize
=
m_pImpl
->
getPicture
().
GetSizePixel
();
Size
aMySize
=
GetOutputSizePixel
();
Size
aMySize
=
rRenderContext
.
GetOutputSizePixel
();
Point
aBitmapPos
(
aMySize
.
Width
()
-
aBitmapSize
.
Width
(),
aMySize
.
Height
()
-
aBitmapSize
.
Height
()
);
Point
aBitmapPos
(
aMySize
.
Width
()
-
aBitmapSize
.
Width
(),
aMySize
.
Height
()
-
aBitmapSize
.
Height
()
);
// draw it
// draw it
DrawBitmapEx
(
aBitmapPos
,
m_pImpl
->
getPicture
()
);
rRenderContext
.
DrawBitmapEx
(
aBitmapPos
,
m_pImpl
->
getPicture
()
);
}
}
// draw the headline
// draw the headline
DrawHeadline
();
DrawHeadline
(
rRenderContext
);
}
}
void
ORoadmap
::
DrawHeadline
()
void
ORoadmap
::
DrawHeadline
(
vcl
::
RenderContext
&
rRenderContext
)
{
{
Point
aTextPos
=
LogicToPixel
(
Point
(
ROADMAP_INDENT_X
,
8
),
MAP_APPFONT
);
Point
aTextPos
=
LogicToPixel
(
Point
(
ROADMAP_INDENT_X
,
8
),
MAP_APPFONT
);
Size
aOutputSize
(
GetOutputSizePixel
()
);
Size
aOutputSize
(
rRenderContext
.
GetOutputSizePixel
()
);
// draw it
// draw it
DrawText
(
Rectangle
(
aTextPos
,
aOutputSize
),
GetText
(),
TEXT_DRAW_LEFT
|
TEXT_DRAW_TOP
|
TEXT_DRAW_MULTILINE
|
TEXT_DRAW_WORDBREAK
);
rRenderContext
.
DrawText
(
Rectangle
(
aTextPos
,
aOutputSize
),
GetText
(),
DrawTextLine
(
aTextPos
,
aOutputSize
.
Width
(),
STRIKEOUT_NONE
,
UNDERLINE_SINGLE
,
UNDERLINE_NONE
,
false
);
TEXT_DRAW_LEFT
|
TEXT_DRAW_TOP
|
TEXT_DRAW_MULTILINE
|
TEXT_DRAW_WORDBREAK
);
const
StyleSettings
&
rStyleSettings
=
GetSettings
().
GetStyleSettings
();
rRenderContext
.
DrawTextLine
(
aTextPos
,
aOutputSize
.
Width
(),
STRIKEOUT_NONE
,
UNDERLINE_SINGLE
,
UNDERLINE_NONE
,
false
);
SetLineColor
(
rStyleSettings
.
GetFieldTextColor
());
const
StyleSettings
&
rStyleSettings
=
rRenderContext
.
GetSettings
().
GetStyleSettings
();
SetTextColor
(
rStyleSettings
.
GetFieldTextColor
());
rRenderContext
.
SetLineColor
(
rStyleSettings
.
GetFieldTextColor
());
rRenderContext
.
SetTextColor
(
rStyleSettings
.
GetFieldTextColor
());
}
}
RoadmapItem
*
ORoadmap
::
GetByPointer
(
vcl
::
Window
*
pWindow
)
RoadmapItem
*
ORoadmap
::
GetByPointer
(
vcl
::
Window
*
pWindow
)
...
...
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