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
f17f17c5
Kaydet (Commit)
f17f17c5
authored
May 08, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
refactor svtools - BrowseBox to use RenderContext
Change-Id: I2532b772d1bfff268a8f60a4d59dad5c8960352a
üst
bebe347c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
40 deletions
+35
-40
brwbox2.cxx
svtools/source/brwbox/brwbox2.cxx
+35
-40
No files found.
svtools/source/brwbox/brwbox2.cxx
Dosyayı görüntüle @
f17f17c5
...
@@ -612,13 +612,13 @@ void BrowseBox::Resize()
...
@@ -612,13 +612,13 @@ void BrowseBox::Resize()
void
BrowseBox
::
Paint
(
vcl
::
RenderContext
&
/*rRenderContext*/
,
const
Rectangle
&
rRect
)
void
BrowseBox
::
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
rRect
)
{
{
// initializations
// initializations
if
(
!
bBootstrapped
&&
IsReallyVisible
()
)
if
(
!
bBootstrapped
&&
IsReallyVisible
()
)
BrowseBox
::
StateChanged
(
StateChangedType
::
InitShow
);
BrowseBox
::
StateChanged
(
StateChangedType
::
InitShow
);
if
(
pCols
->
empty
()
)
if
(
pCols
->
empty
()
)
return
;
return
;
BrowserColumn
*
pFirstCol
=
(
*
pCols
)[
0
];
BrowserColumn
*
pFirstCol
=
(
*
pCols
)[
0
];
...
@@ -626,43 +626,41 @@ void BrowseBox::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle&
...
@@ -626,43 +626,41 @@ void BrowseBox::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle&
bool
bHeaderBar
=
getDataWindow
()
->
pHeaderBar
.
get
()
!=
NULL
;
bool
bHeaderBar
=
getDataWindow
()
->
pHeaderBar
.
get
()
!=
NULL
;
// draw delimitational lines
// draw delimitational lines
if
(
!
getDataWindow
()
->
bNoHScroll
)
if
(
!
getDataWindow
()
->
bNoHScroll
)
DrawLine
(
Point
(
0
,
aHScroll
->
GetPosPixel
().
Y
()
),
rRenderContext
.
DrawLine
(
Point
(
0
,
aHScroll
->
GetPosPixel
().
Y
()
),
Point
(
GetOutputSizePixel
().
Width
(),
Point
(
GetOutputSizePixel
().
Width
(),
aHScroll
->
GetPosPixel
().
Y
()
)
);
aHScroll
->
GetPosPixel
().
Y
())
);
if
(
nTitleLines
)
if
(
nTitleLines
)
{
{
if
(
!
bHeaderBar
)
if
(
!
bHeaderBar
)
DrawLine
(
Point
(
0
,
GetTitleHeight
()
-
1
),
rRenderContext
.
DrawLine
(
Point
(
0
,
GetTitleHeight
()
-
1
),
Point
(
GetOutputSizePixel
().
Width
(),
Point
(
rRenderContext
.
GetOutputSizePixel
().
Width
(),
GetTitleHeight
()
-
1
)
);
GetTitleHeight
()
-
1
)
);
else
if
(
bHandleCol
)
else
if
(
bHandleCol
)
DrawLine
(
Point
(
0
,
GetTitleHeight
()
-
1
),
rRenderContext
.
DrawLine
(
Point
(
0
,
GetTitleHeight
()
-
1
),
Point
(
pFirstCol
->
Width
(),
GetTitleHeight
()
-
1
)
);
Point
(
pFirstCol
->
Width
(),
GetTitleHeight
()
-
1
)
);
}
}
// Title Bar
// Title Bar
// If there is a handle column and if the header bar is available, only
// If there is a handle column and if the header bar is available, only
// take the HandleColumn into account
// take the HandleColumn into account
if
(
nTitleLines
&&
(
!
bHeaderBar
||
bHandleCol
)
)
if
(
nTitleLines
&&
(
!
bHeaderBar
||
bHandleCol
)
)
{
{
// iterate through columns to redraw
// iterate through columns to redraw
long
nX
=
0
;
long
nX
=
0
;
size_t
nCol
;
size_t
nCol
;
for
(
nCol
=
0
;
for
(
nCol
=
0
;
nCol
<
pCols
->
size
()
&&
nX
<
rRect
.
Right
();
++
nCol
)
nCol
<
pCols
->
size
()
&&
nX
<
rRect
.
Right
();
++
nCol
)
{
{
// skip invisible columns between frozen and scrollable area
// skip invisible columns between frozen and scrollable area
if
(
nCol
<
nFirstCol
&&
!
(
*
pCols
)[
nCol
]
->
IsFrozen
()
)
if
(
nCol
<
nFirstCol
&&
!
(
*
pCols
)[
nCol
]
->
IsFrozen
()
)
nCol
=
nFirstCol
;
nCol
=
nFirstCol
;
// only the handle column?
// only the handle column?
if
(
bHeaderBar
&&
bHandleCol
&&
nCol
>
0
)
if
(
bHeaderBar
&&
bHandleCol
&&
nCol
>
0
)
break
;
break
;
BrowserColumn
*
pCol
=
(
*
pCols
)[
nCol
];
BrowserColumn
*
pCol
=
(
*
pCols
)[
nCol
];
// draw the column and increment position
// draw the column and increment position
if
(
pCol
->
Width
()
>
4
)
if
(
pCol
->
Width
()
>
4
)
...
@@ -670,16 +668,16 @@ void BrowseBox::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle&
...
@@ -670,16 +668,16 @@ void BrowseBox::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle&
ButtonFrame
aButtonFrame
(
Point
(
nX
,
0
),
ButtonFrame
aButtonFrame
(
Point
(
nX
,
0
),
Size
(
pCol
->
Width
()
-
1
,
GetTitleHeight
()
-
1
),
Size
(
pCol
->
Width
()
-
1
,
GetTitleHeight
()
-
1
),
pCol
->
Title
(),
false
,
false
,
!
IsEnabled
());
pCol
->
Title
(),
false
,
false
,
!
IsEnabled
());
aButtonFrame
.
Draw
(
*
this
);
aButtonFrame
.
Draw
(
rRenderContext
);
DrawLine
(
Point
(
nX
+
pCol
->
Width
()
-
1
,
0
),
rRenderContext
.
DrawLine
(
Point
(
nX
+
pCol
->
Width
()
-
1
,
0
),
Point
(
nX
+
pCol
->
Width
()
-
1
,
GetTitleHeight
()
-
1
)
);
Point
(
nX
+
pCol
->
Width
()
-
1
,
GetTitleHeight
()
-
1
)
);
}
}
else
else
{
{
Color
aOldFillColor
=
GetFillColor
(
);
rRenderContext
.
Push
(
PushFlags
::
FILLCOLOR
);
SetFillColor
(
Color
(
COL_BLACK
)
);
rRenderContext
.
SetFillColor
(
Color
(
COL_BLACK
)
);
DrawRect
(
Rectangle
(
Point
(
nX
,
0
),
Size
(
pCol
->
Width
(),
GetTitleHeight
()
-
1
)
)
);
rRenderContext
.
DrawRect
(
Rectangle
(
Point
(
nX
,
0
),
Size
(
pCol
->
Width
(),
GetTitleHeight
()
-
1
))
);
SetFillColor
(
aOldFillColor
);
rRenderContext
.
Pop
(
);
}
}
// skip column
// skip column
...
@@ -689,17 +687,14 @@ void BrowseBox::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle&
...
@@ -689,17 +687,14 @@ void BrowseBox::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle&
// retouching
// retouching
if
(
!
bHeaderBar
&&
nCol
==
pCols
->
size
()
)
if
(
!
bHeaderBar
&&
nCol
==
pCols
->
size
()
)
{
{
const
StyleSettings
&
rSettings
=
GetSettings
().
GetStyleSettings
();
const
StyleSettings
&
rSettings
=
rRenderContext
.
GetSettings
().
GetStyleSettings
();
Color
aColFace
(
rSettings
.
GetFaceColor
()
);
Color
aColFace
(
rSettings
.
GetFaceColor
());
Color
aOldFillColor
=
GetFillColor
();
rRenderContext
.
Push
(
PushFlags
::
FILLCOLOR
|
PushFlags
::
LINECOLOR
);
Color
aOldLineColor
=
GetLineColor
();
rRenderContext
.
SetFillColor
(
aColFace
);
SetFillColor
(
aColFace
);
rRenderContext
.
SetLineColor
(
aColFace
);
SetLineColor
(
aColFace
);
rRenderContext
.
DrawRect
(
Rectangle
(
Point
(
nX
,
0
),
DrawRect
(
Rectangle
(
Point
(
rRect
.
Right
(),
GetTitleHeight
()
-
2
)));
Point
(
nX
,
0
),
rRenderContext
.
Pop
();
Point
(
rRect
.
Right
(),
GetTitleHeight
()
-
2
)
)
);
SetFillColor
(
aOldFillColor
);
SetLineColor
(
aOldLineColor
);
}
}
}
}
}
}
...
...
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