Kaydet (Commit) 3f68a8c0 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

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
üst 5e6ebfc3
...@@ -57,23 +57,7 @@ AlignmentPropertyPanel::AlignmentPropertyPanel( ...@@ -57,23 +57,7 @@ AlignmentPropertyPanel::AlignmentPropertyPanel(
Window* pParent, Window* pParent,
const cssu::Reference<css::frame::XFrame>& rxFrame, const cssu::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings) SfxBindings* pBindings)
: Control( : PanelLayout(pParent, "AlignmentPropertyPanel", "modules/scalc/ui/sidebaralignment.ui", rxFrame),
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))),
maAlignHorControl(SID_H_ALIGNCELL, *pBindings, *this), maAlignHorControl(SID_H_ALIGNCELL, *pBindings, *this),
maAlignVerControl(SID_V_ALIGNCELL, *pBindings, *this), maAlignVerControl(SID_V_ALIGNCELL, *pBindings, *this),
maLeftIndentControl(SID_ATTR_ALIGN_INDENT, *pBindings, *this), maLeftIndentControl(SID_ATTR_ALIGN_INDENT, *pBindings, *this),
...@@ -88,8 +72,18 @@ AlignmentPropertyPanel::AlignmentPropertyPanel( ...@@ -88,8 +72,18 @@ AlignmentPropertyPanel::AlignmentPropertyPanel(
maContext(), maContext(),
mpBindings(pBindings) 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(); Initialize();
FreeResource();
mpFTLeftIndent->SetBackground(Wallpaper()); mpFTLeftIndent->SetBackground(Wallpaper());
mpFtRotate->SetBackground(Wallpaper()); mpFtRotate->SetBackground(Wallpaper());
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <sfx2/sidebar/ControllerItem.hxx> #include <sfx2/sidebar/ControllerItem.hxx>
#include <sfx2/sidebar/IContextChangeReceiver.hxx> #include <sfx2/sidebar/IContextChangeReceiver.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <vcl/fixed.hxx> #include <vcl/fixed.hxx>
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include <editeng/svxenum.hxx> #include <editeng/svxenum.hxx>
...@@ -33,7 +34,7 @@ namespace svx { namespace sidebar { class SidebarDialControl; }} ...@@ -33,7 +34,7 @@ namespace svx { namespace sidebar { class SidebarDialControl; }}
namespace sc { namespace sidebar { namespace sc { namespace sidebar {
class AlignmentPropertyPanel class AlignmentPropertyPanel
: public Control, : public PanelLayout,
public ::sfx2::sidebar::IContextChangeReceiver, public ::sfx2::sidebar::IContextChangeReceiver,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment