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
6372309a
Kaydet (Commit)
6372309a
authored
Haz 13, 2013
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Starmath: ElementsDockingWindow vertical orientation of elements
Change-Id: I4161cacc95576a5f34205c92482a38bb60ecc9f2
üst
6934312f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
19 deletions
+79
-19
ElementsDockingWindow.hxx
starmath/inc/ElementsDockingWindow.hxx
+5
-0
ElementsDockingWindow.cxx
starmath/source/ElementsDockingWindow.cxx
+74
-19
No files found.
starmath/inc/ElementsDockingWindow.hxx
Dosyayı görüntüle @
6372309a
...
@@ -88,6 +88,7 @@ class SmElementsControl : public Control
...
@@ -88,6 +88,7 @@ class SmElementsControl : public Control
SmElementList
maElementList
;
SmElementList
maElementList
;
Size
maMaxElementDimensions
;
Size
maMaxElementDimensions
;
bool
mbVerticalMode
;
void
addElement
(
OUString
aElementVisual
,
OUString
aElementSource
);
void
addElement
(
OUString
aElementVisual
,
OUString
aElementSource
);
...
@@ -102,6 +103,8 @@ public:
...
@@ -102,6 +103,8 @@ public:
void
setElementSetId
(
sal_uInt16
aSetId
);
void
setElementSetId
(
sal_uInt16
aSetId
);
void
setVerticalMode
(
bool
bVertical
);
void
SetSelectHdl
(
const
Link
&
rLink
)
{
aSelectHdlLink
=
rLink
;
}
void
SetSelectHdl
(
const
Link
&
rLink
)
{
aSelectHdlLink
=
rLink
;
}
};
};
...
@@ -124,6 +127,8 @@ public:
...
@@ -124,6 +127,8 @@ public:
SfxChildWindow
*
pChildWindow
,
SfxChildWindow
*
pChildWindow
,
Window
*
pParent
);
Window
*
pParent
);
~
SmElementsDockingWindow
();
~
SmElementsDockingWindow
();
virtual
void
EndDocking
(
const
Rectangle
&
rReactangle
,
sal_Bool
bFloatMode
);
};
};
class
SmElementsDockingWindowWrapper
:
public
SfxChildWindow
class
SmElementsDockingWindowWrapper
:
public
SfxChildWindow
...
...
starmath/source/ElementsDockingWindow.cxx
Dosyayı görüntüle @
6372309a
...
@@ -172,11 +172,17 @@ const sal_uInt16 SmElementsControl::aOthers[] =
...
@@ -172,11 +172,17 @@ const sal_uInt16 SmElementsControl::aOthers[] =
SmElementsControl
::
SmElementsControl
(
Window
*
pParent
,
const
ResId
&
rResId
)
:
SmElementsControl
::
SmElementsControl
(
Window
*
pParent
,
const
ResId
&
rResId
)
:
Control
(
pParent
,
rResId
),
Control
(
pParent
,
rResId
),
mpDocShell
(
new
SmDocShell
(
SFXOBJECTSHELL_STD_NORMAL
)),
mpDocShell
(
new
SmDocShell
(
SFXOBJECTSHELL_STD_NORMAL
)),
mpCurrentElement
(
NULL
)
mpCurrentElement
(
NULL
),
mbVerticalMode
(
true
)
{
{
maFormat
.
SetBaseSize
(
PixelToLogic
(
Size
(
0
,
24
)));
maFormat
.
SetBaseSize
(
PixelToLogic
(
Size
(
0
,
24
)));
}
}
void
SmElementsControl
::
setVerticalMode
(
bool
bVerticalMode
)
{
mbVerticalMode
=
bVerticalMode
;
}
void
SmElementsControl
::
Paint
(
const
Rectangle
&
)
void
SmElementsControl
::
Paint
(
const
Rectangle
&
)
{
{
Push
();
Push
();
...
@@ -192,42 +198,77 @@ void SmElementsControl::Paint(const Rectangle&)
...
@@ -192,42 +198,77 @@ void SmElementsControl::Paint(const Rectangle&)
sal_Int32
x
=
0
;
sal_Int32
x
=
0
;
sal_Int32
y
=
0
;
sal_Int32
y
=
0
;
sal_Int32
perLine
=
GetOutputSizePixel
().
Width
()
/
boxX
;
sal_Int32
perLine
=
0
;
if
(
mbVerticalMode
)
perLine
=
GetOutputSizePixel
().
Height
()
/
boxY
;
else
perLine
=
GetOutputSizePixel
().
Width
()
/
boxX
;
if
(
perLine
<=
0
)
{
if
(
perLine
<=
0
)
{
perLine
=
1
;
perLine
=
1
;
}
}
boxX
=
GetOutputSizePixel
().
Width
()
/
perLine
;
if
(
mbVerticalMode
)
boxY
=
GetOutputSizePixel
().
Height
()
/
perLine
;
else
boxX
=
GetOutputSizePixel
().
Width
()
/
perLine
;
for
(
sal_uInt16
i
=
0
;
i
<
maElementList
.
size
()
;
i
++
)
for
(
sal_uInt16
i
=
0
;
i
<
maElementList
.
size
()
;
i
++
)
{
{
SmElement
*
element
=
maElementList
[
i
].
get
();
SmElement
*
element
=
maElementList
[
i
].
get
();
if
(
element
->
isSeparator
())
if
(
element
->
isSeparator
())
{
{
x
=
0
;
if
(
mbVerticalMode
)
y
+=
boxY
;
{
Rectangle
aSelectionRectangle
(
x
+=
boxX
;
x
+
5
,
y
+
5
-
1
,
y
=
0
;
GetOutputSizePixel
().
Width
()
-
5
,
y
+
5
+
1
);
Rectangle
aSelectionRectangle
(
DrawRect
(
PixelToLogic
(
aSelectionRectangle
));
x
+
5
-
1
,
y
+
5
,
y
+=
10
;
x
+
5
+
1
,
GetOutputSizePixel
().
Height
()
-
5
);
DrawRect
(
PixelToLogic
(
aSelectionRectangle
));
x
+=
10
;
}
else
{
x
=
0
;
y
+=
boxY
;
Rectangle
aSelectionRectangle
(
x
+
5
,
y
+
5
-
1
,
GetOutputSizePixel
().
Width
()
-
5
,
y
+
5
+
1
);
DrawRect
(
PixelToLogic
(
aSelectionRectangle
));
y
+=
10
;
}
}
}
else
else
{
{
Size
aSizePixel
=
LogicToPixel
(
Size
(
element
->
getNode
()
->
GetWidth
(),
element
->
getNode
()
->
GetHeight
()));
Size
aSizePixel
=
LogicToPixel
(
Size
(
element
->
getNode
()
->
GetWidth
(),
element
->
getNode
()
->
GetHeight
()));
if
(
x
+
boxX
>
GetOutputSizePixel
().
Width
()
)
if
(
mbVerticalMode
)
{
{
x
=
0
;
if
(
y
+
boxY
>
GetOutputSizePixel
().
Height
())
y
+=
boxY
;
{
x
+=
boxX
;
y
=
0
;
}
}
else
{
if
(
x
+
boxX
>
GetOutputSizePixel
().
Width
())
{
x
=
0
;
y
+=
boxY
;
}
}
}
if
(
mpCurrentElement
==
element
)
if
(
mpCurrentElement
==
element
)
{
{
Push
();
Push
();
SetFillColor
(
Color
(
230
,
230
,
230
)
);
SetFillColor
(
Color
(
230
,
230
,
230
)
);
SetLineColor
(
Color
(
230
,
230
,
230
)
);
SetLineColor
(
Color
(
230
,
230
,
230
)
);
DrawRect
(
PixelToLogic
(
Rectangle
(
x
+
2
,
y
+
2
,
x
+
boxX
-
2
,
y
+
boxY
-
2
)));
DrawRect
(
PixelToLogic
(
Rectangle
(
x
+
2
,
y
+
2
,
x
+
boxX
-
2
,
y
+
boxY
-
2
)));
Pop
();
Pop
();
...
@@ -239,10 +280,13 @@ void SmElementsControl::Paint(const Rectangle&)
...
@@ -239,10 +280,13 @@ void SmElementsControl::Paint(const Rectangle&)
element
->
mBoxLocation
=
Point
(
x
,
y
);
element
->
mBoxLocation
=
Point
(
x
,
y
);
element
->
mBoxSize
=
Size
(
boxX
,
boxY
);
element
->
mBoxSize
=
Size
(
boxX
,
boxY
);
x
+=
boxX
;
if
(
mbVerticalMode
)
y
+=
boxY
;
else
x
+=
boxX
;
}
}
}
}
Pop
();
Pop
();
}
}
...
@@ -448,12 +492,21 @@ SmElementsDockingWindow::SmElementsDockingWindow(SfxBindings* pInputBindings, Sf
...
@@ -448,12 +492,21 @@ SmElementsDockingWindow::SmElementsDockingWindow(SfxBindings* pInputBindings, Sf
maElementListBox
.
SelectEntry
(
OUString
(
SmResId
(
RID_CATEGORY_UNARY_BINARY_OPERATORS
)));
maElementListBox
.
SelectEntry
(
OUString
(
SmResId
(
RID_CATEGORY_UNARY_BINARY_OPERATORS
)));
maElementsControl
.
setElementSetId
(
RID_CATEGORY_UNARY_BINARY_OPERATORS
);
maElementsControl
.
setElementSetId
(
RID_CATEGORY_UNARY_BINARY_OPERATORS
);
Invalidate
();
}
}
SmElementsDockingWindow
::~
SmElementsDockingWindow
()
SmElementsDockingWindow
::~
SmElementsDockingWindow
()
{
{
}
}
void
SmElementsDockingWindow
::
EndDocking
(
const
Rectangle
&
rReactangle
,
sal_Bool
bFloatMode
)
{
SfxDockingWindow
::
EndDocking
(
rReactangle
,
bFloatMode
);
bool
bVertical
=
(
GetAlignment
()
==
SFX_ALIGN_TOP
||
GetAlignment
()
==
SFX_ALIGN_BOTTOM
);
maElementsControl
.
setVerticalMode
(
bVertical
);
}
IMPL_LINK
(
SmElementsDockingWindow
,
SelectClickHdl
,
SmElement
*
,
pElement
)
IMPL_LINK
(
SmElementsDockingWindow
,
SelectClickHdl
,
SmElement
*
,
pElement
)
{
{
SmViewShell
*
pViewSh
=
GetView
();
SmViewShell
*
pViewSh
=
GetView
();
...
@@ -490,6 +543,9 @@ SmViewShell* SmElementsDockingWindow::GetView()
...
@@ -490,6 +543,9 @@ SmViewShell* SmElementsDockingWindow::GetView()
void
SmElementsDockingWindow
::
Resize
()
void
SmElementsDockingWindow
::
Resize
()
{
{
bool
bVertical
=
(
GetAlignment
()
==
SFX_ALIGN_TOP
||
GetAlignment
()
==
SFX_ALIGN_BOTTOM
);
maElementsControl
.
setVerticalMode
(
bVertical
);
sal_uInt32
aWidth
=
GetOutputSizePixel
().
Width
();
sal_uInt32
aWidth
=
GetOutputSizePixel
().
Width
();
sal_uInt32
aHeight
=
GetOutputSizePixel
().
Height
();
sal_uInt32
aHeight
=
GetOutputSizePixel
().
Height
();
...
@@ -525,5 +581,4 @@ SmElementsDockingWindowWrapper::~SmElementsDockingWindowWrapper()
...
@@ -525,5 +581,4 @@ SmElementsDockingWindowWrapper::~SmElementsDockingWindowWrapper()
{
{
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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