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
71c6ee42
Kaydet (Commit)
71c6ee42
authored
Tem 16, 2015
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
first parts in data series panel
Change-Id: Ia25460e6f57ff6d3c44bae1ddb33a36845ffcdd2
üst
75d50b71
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
0 deletions
+86
-0
ChartSeriesPanel.cxx
chart2/source/controller/sidebar/ChartSeriesPanel.cxx
+80
-0
ChartSeriesPanel.hxx
chart2/source/controller/sidebar/ChartSeriesPanel.hxx
+6
-0
No files found.
chart2/source/controller/sidebar/ChartSeriesPanel.cxx
Dosyayı görüntüle @
71c6ee42
...
...
@@ -21,6 +21,8 @@
#include <sfx2/sidebar/Theme.hxx>
#include <sfx2/sidebar/ControlFactory.hxx>
#include <com/sun/star/chart2/DataPointLabel.hpp>
#include "ChartSeriesPanel.hxx"
#include "ChartController.hxx"
#include <sfx2/bindings.hxx>
...
...
@@ -35,6 +37,7 @@
#include <comphelper/processfactory.hxx>
#include "ChartModel.hxx"
#include "DataSeriesHelper.hxx"
using
namespace
css
;
using
namespace
css
::
uno
;
...
...
@@ -42,6 +45,35 @@ using ::sfx2::sidebar::Theme;
namespace
chart
{
namespace
sidebar
{
namespace
{
bool
isDataLabelVisible
(
css
::
uno
::
Reference
<
css
::
frame
::
XModel
>
xModel
,
const
OUString
&
rCID
)
{
css
::
uno
::
Reference
<
css
::
chart2
::
XDataSeries
>
xSeries
(
ObjectIdentifier
::
getDataSeriesForCID
(
rCID
,
xModel
),
uno
::
UNO_QUERY
);
if
(
!
xSeries
.
is
())
return
false
;
return
DataSeriesHelper
::
hasDataLabelsAtSeries
(
xSeries
);
}
void
setDataLabelVisible
(
css
::
uno
::
Reference
<
css
::
frame
::
XModel
>
xModel
,
const
OUString
&
rCID
,
bool
bVisible
)
{
css
::
uno
::
Reference
<
css
::
chart2
::
XDataSeries
>
xSeries
(
ObjectIdentifier
::
getDataSeriesForCID
(
rCID
,
xModel
),
uno
::
UNO_QUERY
);
if
(
!
xSeries
.
is
())
return
;
if
(
bVisible
)
DataSeriesHelper
::
insertDataLabelsToSeriesAndAllPoints
(
xSeries
);
else
DataSeriesHelper
::
deleteDataLabelsFromSeriesAndAllPoints
(
xSeries
);
}
}
ChartSeriesPanel
::
ChartSeriesPanel
(
vcl
::
Window
*
pParent
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
,
...
...
@@ -53,6 +85,11 @@ ChartSeriesPanel::ChartSeriesPanel(
mpBindings
(
pBindings
),
mxModel
(
pController
->
getModel
())
{
get
(
mpCBLabel
,
"checkbutton_label"
);
get
(
mpCBTrendline
,
"checkbutton_trendline"
);
get
(
mpCBXError
,
"checkbutton_x_error"
);
get
(
mpCBYError
,
"checkbutton_y_error"
);
Initialize
();
}
...
...
@@ -69,11 +106,32 @@ void ChartSeriesPanel::dispose()
void
ChartSeriesPanel
::
Initialize
()
{
updateData
();
Link
<>
aLink
=
LINK
(
this
,
ChartSeriesPanel
,
CheckBoxHdl
);
mpCBLabel
->
SetClickHdl
(
aLink
);
mpCBTrendline
->
SetClickHdl
(
aLink
);
mpCBXError
->
SetClickHdl
(
aLink
);
mpCBYError
->
SetClickHdl
(
aLink
);
}
void
ChartSeriesPanel
::
updateData
()
{
css
::
uno
::
Reference
<
css
::
frame
::
XController
>
xController
(
mxModel
->
getCurrentController
());
css
::
uno
::
Reference
<
css
::
view
::
XSelectionSupplier
>
xSelectionSupplier
(
xController
,
css
::
uno
::
UNO_QUERY
);
if
(
!
xSelectionSupplier
.
is
())
return
;
uno
::
Any
aAny
=
xSelectionSupplier
->
getSelection
();
assert
(
aAny
.
hasValue
());
OUString
aCID
;
aAny
>>=
aCID
;
#ifdef DBG_UTIL
ObjectType
eType
=
ObjectIdentifier
::
getObjectType
(
aCID
);
assert
(
eType
==
OBJECTTYPE_DATA_SERIES
);
#endif
SolarMutexGuard
aGuard
;
mpCBLabel
->
Check
(
isDataLabelVisible
(
mxModel
,
aCID
));
}
VclPtr
<
vcl
::
Window
>
ChartSeriesPanel
::
Create
(
...
...
@@ -124,6 +182,28 @@ void ChartSeriesPanel::modelInvalid()
}
IMPL_LINK
(
ChartSeriesPanel
,
CheckBoxHdl
,
CheckBox
*
,
pCheckBox
)
{
bool
bChecked
=
pCheckBox
->
IsChecked
();
css
::
uno
::
Reference
<
css
::
frame
::
XController
>
xController
(
mxModel
->
getCurrentController
());
css
::
uno
::
Reference
<
css
::
view
::
XSelectionSupplier
>
xSelectionSupplier
(
xController
,
css
::
uno
::
UNO_QUERY
);
if
(
!
xSelectionSupplier
.
is
())
return
0
;
uno
::
Any
aAny
=
xSelectionSupplier
->
getSelection
();
assert
(
aAny
.
hasValue
());
OUString
aCID
;
aAny
>>=
aCID
;
#ifdef DBG_UTIL
ObjectType
eType
=
ObjectIdentifier
::
getObjectType
(
aCID
);
assert
(
eType
==
OBJECTTYPE_DATA_SERIES
);
#endif
if
(
pCheckBox
==
mpCBLabel
.
get
())
setDataLabelVisible
(
mxModel
,
aCID
,
bChecked
);
return
0
;
}
}}
// end of namespace ::chart::sidebar
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
chart2/source/controller/sidebar/ChartSeriesPanel.hxx
Dosyayı görüntüle @
71c6ee42
...
...
@@ -72,6 +72,10 @@ public:
private
:
//ui controls
VclPtr
<
CheckBox
>
mpCBLabel
;
VclPtr
<
CheckBox
>
mpCBTrendline
;
VclPtr
<
CheckBox
>
mpCBXError
;
VclPtr
<
CheckBox
>
mpCBYError
;
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>
mxFrame
;
::
sfx2
::
sidebar
::
EnumContext
maContext
;
...
...
@@ -81,6 +85,8 @@ private:
css
::
uno
::
Reference
<
css
::
util
::
XModifyListener
>
mxListener
;
void
Initialize
();
DECL_LINK
(
CheckBoxHdl
,
CheckBox
*
);
};
}
}
// end of namespace ::chart::sidebar
...
...
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