summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2013-06-05 12:37:52 +0200
committerJan Holesovsky <kendy@suse.cz>2013-06-05 18:32:57 +0200
commit3f68a8c05a5d8bcafe1355aecaeeba8346f7a1d9 (patch)
tree8bc0466966a251322bd8c63e6564a5f268e090b8
parent5e6ebfc35f4eab64a2ef2455771769314618e019 (diff)
sidebar conversion tutorial: Make use of the .ui.
The .ui-based panels have to have PanelLayout as the base class instead of the generic Control. We need to associate the id's from the .ui with the widgets using the get() method. Also we need to remove the call of FreeResource(). Change-Id: I61323b6a3dc622b4d594310edfd83c8d76f51d8f
-rw-r--r--sc/source/ui/sidebar/AlignmentPropertyPanel.cxx30
-rw-r--r--sc/source/ui/sidebar/AlignmentPropertyPanel.hxx3
2 files changed, 14 insertions, 19 deletions
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
index 8d3a77c286a4..a9b787a9dfe9 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
@@ -57,23 +57,7 @@ AlignmentPropertyPanel::AlignmentPropertyPanel(
Window* pParent,
const cssu::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
- : Control(
- pParent,
- ScResId(RID_PROPERTYPANEL_SC_ALIGNMENT)),
- mpTBHorizontal(ControlFactory::CreateToolBox(
- mpTBHorizontalBackground.get(),
- ScResId(TBX_HORIZONTAL_ALIGNMENT))),
- mpTBVertical(ControlFactory::CreateToolBox(
- mpTBVerticalBackground.get(),
- ScResId(TBX_VERTICAL_ALIGN))),
- mpFTLeftIndent(new FixedText(this, ScResId(FT_LEFT_INDENT))),
- mpMFLeftIndent(new MetricField(this, ScResId(MF_LEFT_INDENT))),
- mpCBXWrapText(new CheckBox(this, ScResId(CBX_WRAP))),
- mpCBXMergeCell(new CheckBox(this, ScResId(CBX_MERGE))),
- mpFtRotate(new FixedText(this, ScResId(FT_ORIENT))),
- mpCtrlDial(new svx::sidebar::SidebarDialControl(this, ScResId(DIAL_CONTROL))), // , true)),
- mpMtrAngle(new MetricBox(this, ScResId(CBOX_ANGLE))),
- mpCbStacked(new CheckBox(this, ScResId(CBX_VERT))),
+ : PanelLayout(pParent, "AlignmentPropertyPanel", "modules/scalc/ui/sidebaralignment.ui", rxFrame),
maAlignHorControl(SID_H_ALIGNCELL, *pBindings, *this),
maAlignVerControl(SID_V_ALIGNCELL, *pBindings, *this),
maLeftIndentControl(SID_ATTR_ALIGN_INDENT, *pBindings, *this),
@@ -88,8 +72,18 @@ AlignmentPropertyPanel::AlignmentPropertyPanel(
maContext(),
mpBindings(pBindings)
{
+ get(mpTBHorizontal, "horizontalalignment");
+ get(mpTBVertical, "verticalalignment");
+ get(mpFTLeftIndent, "leftindentlabel");
+ get(mpMFLeftIndent, "leftindent");
+ get(mpCBXWrapText, "wraptext");
+ get(mpCBXMergeCell, "mergecells");
+ get(mpFtRotate, "orientationlabel");
+ get(mpCtrlDial, "orientationcontrol");
+ get(mpMtrAngle, "orientationdegrees");
+ get(mpCbStacked, "verticallystacked");
+
Initialize();
- FreeResource();
mpFTLeftIndent->SetBackground(Wallpaper());
mpFtRotate->SetBackground(Wallpaper());
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
index b2e44901fa20..476633e4cff9 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
@@ -20,6 +20,7 @@
#include <sfx2/sidebar/ControllerItem.hxx>
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
+#include <svx/sidebar/PanelLayout.hxx>
#include <vcl/fixed.hxx>
#include <boost/scoped_ptr.hpp>
#include <editeng/svxenum.hxx>
@@ -33,7 +34,7 @@ namespace svx { namespace sidebar { class SidebarDialControl; }}
namespace sc { namespace sidebar {
class AlignmentPropertyPanel
-: public Control,
+: public PanelLayout,
public ::sfx2::sidebar::IContextChangeReceiver,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{