1facb16e7SArmin Le Grand /**************************************************************
2facb16e7SArmin Le Grand *
3facb16e7SArmin Le Grand * Licensed to the Apache Software Foundation (ASF) under one
4facb16e7SArmin Le Grand * or more contributor license agreements. See the NOTICE file
5facb16e7SArmin Le Grand * distributed with this work for additional information
6facb16e7SArmin Le Grand * regarding copyright ownership. The ASF licenses this file
7facb16e7SArmin Le Grand * to you under the Apache License, Version 2.0 (the
8facb16e7SArmin Le Grand * "License"); you may not use this file except in compliance
9facb16e7SArmin Le Grand * with the License. You may obtain a copy of the License at
10facb16e7SArmin Le Grand *
11facb16e7SArmin Le Grand * http://www.apache.org/licenses/LICENSE-2.0
12facb16e7SArmin Le Grand *
13facb16e7SArmin Le Grand * Unless required by applicable law or agreed to in writing,
14facb16e7SArmin Le Grand * software distributed under the License is distributed on an
15facb16e7SArmin Le Grand * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16facb16e7SArmin Le Grand * KIND, either express or implied. See the License for the
17facb16e7SArmin Le Grand * specific language governing permissions and limitations
18facb16e7SArmin Le Grand * under the License.
19facb16e7SArmin Le Grand *
20facb16e7SArmin Le Grand *************************************************************/
21facb16e7SArmin Le Grand
22facb16e7SArmin Le Grand #include "precompiled_sc.hxx"
23facb16e7SArmin Le Grand
24d29c2fc2SAndre Fischer #include <sfx2/sidebar/ResourceDefinitions.hrc>
25facb16e7SArmin Le Grand #include <sfx2/sidebar/Theme.hxx>
26facb16e7SArmin Le Grand #include <sfx2/sidebar/ControlFactory.hxx>
27*6a606da0SAndre Fischer #include <sfx2/sidebar/Layouter.hxx>
28facb16e7SArmin Le Grand #include <AlignmentPropertyPanel.hxx>
29facb16e7SArmin Le Grand #include <AlignmentPropertyPanel.hrc>
30facb16e7SArmin Le Grand #include <svx/dialmgr.hxx>
31facb16e7SArmin Le Grand #include "sc.hrc"
32facb16e7SArmin Le Grand #include "scresid.hxx"
33facb16e7SArmin Le Grand #include <sfx2/bindings.hxx>
34facb16e7SArmin Le Grand #include <sfx2/dispatch.hxx>
35facb16e7SArmin Le Grand #include <svx/algitem.hxx>
36facb16e7SArmin Le Grand #include <svx/dlgutil.hxx>
37facb16e7SArmin Le Grand #include <vcl/toolbox.hxx>
38facb16e7SArmin Le Grand #include <svx/sidebar/SidebarDialControl.hxx>
39facb16e7SArmin Le Grand
40facb16e7SArmin Le Grand using namespace css;
41facb16e7SArmin Le Grand using namespace cssu;
42*6a606da0SAndre Fischer using ::sfx2::sidebar::Layouter;
4337fee4fdSAndre Fischer using ::sfx2::sidebar::ControlFactory;
44facb16e7SArmin Le Grand
45facb16e7SArmin Le Grand #define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
46facb16e7SArmin Le Grand
47facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
48facb16e7SArmin Le Grand // namespace open
49facb16e7SArmin Le Grand
50facb16e7SArmin Le Grand namespace sc { namespace sidebar {
51facb16e7SArmin Le Grand
52facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
53facb16e7SArmin Le Grand
AlignmentPropertyPanel(Window * pParent,const cssu::Reference<css::frame::XFrame> & rxFrame,SfxBindings * pBindings)54facb16e7SArmin Le Grand AlignmentPropertyPanel::AlignmentPropertyPanel(
55facb16e7SArmin Le Grand Window* pParent,
56facb16e7SArmin Le Grand const cssu::Reference<css::frame::XFrame>& rxFrame,
57facb16e7SArmin Le Grand SfxBindings* pBindings)
5837fee4fdSAndre Fischer : Control(
59facb16e7SArmin Le Grand pParent,
6037fee4fdSAndre Fischer ScResId(RID_PROPERTYPANEL_SC_ALIGNMENT)),
6137fee4fdSAndre Fischer mpTBHorizontalBackground(ControlFactory::CreateToolBoxBackground(this)),
6237fee4fdSAndre Fischer mpTBHorizontal(ControlFactory::CreateToolBox(
6337fee4fdSAndre Fischer mpTBHorizontalBackground.get(),
6437fee4fdSAndre Fischer ScResId(TBX_HORIZONTAL_ALIGNMENT))),
6537fee4fdSAndre Fischer mpTBVerticalBackground(ControlFactory::CreateToolBoxBackground(this)),
6637fee4fdSAndre Fischer mpTBVertical(ControlFactory::CreateToolBox(
6737fee4fdSAndre Fischer mpTBVerticalBackground.get(),
6837fee4fdSAndre Fischer ScResId(TBX_VERTICAL_ALIGN))),
6937fee4fdSAndre Fischer mpFTLeftIndent(new FixedText(this, ScResId(FT_LEFT_INDENT))),
7037fee4fdSAndre Fischer mpMFLeftIndent(new MetricField(this, ScResId(MF_LEFT_INDENT))),
7137fee4fdSAndre Fischer mpCBXWrapText(new CheckBox(this, ScResId(CBX_WRAP))),
7237fee4fdSAndre Fischer mpCBXMergeCell(new CheckBox(this, ScResId(CBX_MERGE))),
7337fee4fdSAndre Fischer mpFtRotate(new FixedText(this, ScResId(FT_ORIENT))),
7437fee4fdSAndre Fischer mpCtrlDial(new svx::sidebar::SidebarDialControl(this, ScResId(DIAL_CONTROL))), // , true)),
7537fee4fdSAndre Fischer mpMtrAngle(new MetricBox(this, ScResId(CBOX_ANGLE))),
7637fee4fdSAndre Fischer mpCbStacked(new CheckBox(this, ScResId(CBX_VERT))),
7737fee4fdSAndre Fischer maAlignHorControl(SID_H_ALIGNCELL, *pBindings, *this),
7837fee4fdSAndre Fischer maAlignVerControl(SID_V_ALIGNCELL, *pBindings, *this),
7937fee4fdSAndre Fischer maLeftIndentControl(SID_ATTR_ALIGN_INDENT, *pBindings, *this),
8037fee4fdSAndre Fischer maMergeCellControl(FID_MERGE_TOGGLE, *pBindings, *this),
8137fee4fdSAndre Fischer maWrapTextControl(SID_ATTR_ALIGN_LINEBREAK, *pBindings, *this),
8237fee4fdSAndre Fischer maAngleControl(SID_ATTR_ALIGN_DEGREES, *pBindings, *this),
8337fee4fdSAndre Fischer maStackControl(SID_ATTR_ALIGN_STACKED, *pBindings, *this),
8437fee4fdSAndre Fischer maIMGAlignLeft(ScResId(IMG_ALIGN_LEFT)),
8537fee4fdSAndre Fischer maIMGAlignCenter(ScResId(IMG_ALIGN_CENTER)),
8637fee4fdSAndre Fischer maIMGAlignRight(ScResId(IMG_ALIGN_RIGHT)),
8737fee4fdSAndre Fischer maIMGAlignJust(ScResId(IMG_ALIGN_JUST)),
8837fee4fdSAndre Fischer maIMGAlignTop(ScResId(IMG_ALIGN_TOP)),
8937fee4fdSAndre Fischer maIMGAlignCenterV(ScResId(IMG_ALIGN_CENTER_V)),
9037fee4fdSAndre Fischer maIMGAlignBottom(ScResId(IMG_ALIGN_BOTTOM)),
9137fee4fdSAndre Fischer meHorAlignState(SVX_HOR_JUSTIFY_STANDARD),
9237fee4fdSAndre Fischer meVerAlignState(SVX_VER_JUSTIFY_STANDARD),
9337fee4fdSAndre Fischer mbMultiDisable(false),
9437fee4fdSAndre Fischer mxFrame(rxFrame),
9537fee4fdSAndre Fischer maContext(),
9637fee4fdSAndre Fischer mpBindings(pBindings)
97facb16e7SArmin Le Grand {
98facb16e7SArmin Le Grand Initialize();
99facb16e7SArmin Le Grand FreeResource();
10037fee4fdSAndre Fischer
10137fee4fdSAndre Fischer mpFTLeftIndent->SetBackground(Wallpaper());
10237fee4fdSAndre Fischer mpFtRotate->SetBackground(Wallpaper());
103*6a606da0SAndre Fischer
104*6a606da0SAndre Fischer Layouter::PrepareForLayouting(*mpFTLeftIndent);
105*6a606da0SAndre Fischer Layouter::PrepareForLayouting(*mpFtRotate);
106*6a606da0SAndre Fischer Layouter::PrepareForLayouting(*mpCBXWrapText);
107*6a606da0SAndre Fischer Layouter::PrepareForLayouting(*mpCBXMergeCell);
108*6a606da0SAndre Fischer Layouter::PrepareForLayouting(*mpCbStacked);
109*6a606da0SAndre Fischer
110facb16e7SArmin Le Grand }
111facb16e7SArmin Le Grand
112facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
113facb16e7SArmin Le Grand
~AlignmentPropertyPanel()114facb16e7SArmin Le Grand AlignmentPropertyPanel::~AlignmentPropertyPanel()
115facb16e7SArmin Le Grand {
116facb16e7SArmin Le Grand }
117facb16e7SArmin Le Grand
118facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
119facb16e7SArmin Le Grand
Initialize()120facb16e7SArmin Le Grand void AlignmentPropertyPanel::Initialize()
121facb16e7SArmin Le Grand {
122facb16e7SArmin Le Grand mpTBHorizontal->SetItemImage(ID_SUBSTLEFT, maIMGAlignLeft);
123facb16e7SArmin Le Grand mpTBHorizontal->SetItemImage(ID_SUBSTCENTER, maIMGAlignCenter);
124facb16e7SArmin Le Grand mpTBHorizontal->SetItemImage(ID_SUBSTRIGHT, maIMGAlignRight);
125facb16e7SArmin Le Grand mpTBHorizontal->SetItemImage(ID_SUBSTJUSTIFY, maIMGAlignJust);
126facb16e7SArmin Le Grand Size aTbxSize( mpTBHorizontal->CalcWindowSizePixel() );
127facb16e7SArmin Le Grand mpTBHorizontal->SetOutputSizePixel( aTbxSize );
128facb16e7SArmin Le Grand mpTBHorizontal->SetBackground(Wallpaper());
129facb16e7SArmin Le Grand mpTBHorizontal->SetPaintTransparent(true);
130facb16e7SArmin Le Grand Link aLink = LINK(this, AlignmentPropertyPanel, TbxHorAlignSelectHdl);
131facb16e7SArmin Le Grand mpTBHorizontal->SetSelectHdl ( aLink );
132facb16e7SArmin Le Grand
133facb16e7SArmin Le Grand mpTBVertical->SetItemImage(IID_VERT_TOP, maIMGAlignTop);
134facb16e7SArmin Le Grand mpTBVertical->SetItemImage(IID_VERT_CENTER, maIMGAlignCenterV);
135facb16e7SArmin Le Grand mpTBVertical->SetItemImage(IID_VERT_BOTTOM, maIMGAlignBottom);
136facb16e7SArmin Le Grand Size aTbxSize2( mpTBVertical->CalcWindowSizePixel() );
137facb16e7SArmin Le Grand mpTBVertical->SetOutputSizePixel( aTbxSize2 );
138facb16e7SArmin Le Grand mpTBVertical->SetBackground(Wallpaper());
139facb16e7SArmin Le Grand mpTBVertical->SetPaintTransparent(true);
140facb16e7SArmin Le Grand aLink = LINK(this, AlignmentPropertyPanel, TbxVerAlignSelectHdl);
141facb16e7SArmin Le Grand mpTBVertical->SetSelectHdl ( aLink );
142facb16e7SArmin Le Grand
143facb16e7SArmin Le Grand mpFTLeftIndent->Disable();
144facb16e7SArmin Le Grand mpMFLeftIndent->Disable();
145facb16e7SArmin Le Grand mpMFLeftIndent->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Left Indent"))); //wj acc
146facb16e7SArmin Le Grand aLink = LINK(this, AlignmentPropertyPanel, MFLeftIndentMdyHdl);
147facb16e7SArmin Le Grand mpMFLeftIndent->SetModifyHdl ( aLink );
148facb16e7SArmin Le Grand
149facb16e7SArmin Le Grand aLink = LINK(this, AlignmentPropertyPanel, CBOXMergnCellClkHdl);
150facb16e7SArmin Le Grand mpCBXMergeCell->SetClickHdl ( aLink );
151facb16e7SArmin Le Grand
152facb16e7SArmin Le Grand aLink = LINK(this, AlignmentPropertyPanel, CBOXWrapTextClkHdl);
153facb16e7SArmin Le Grand mpCBXWrapText->SetClickHdl ( aLink );
154facb16e7SArmin Le Grand
155facb16e7SArmin Le Grand //rotation control
156facb16e7SArmin Le Grand mpCtrlDial->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Text Orientation"))); //wj acc
157facb16e7SArmin Le Grand mpCtrlDial->SetModifyHdl(LINK( this, AlignmentPropertyPanel, RotationHdl));
1584e8031e0SArmin Le Grand
1594e8031e0SArmin Le Grand //rotation
160facb16e7SArmin Le Grand mpMtrAngle->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Text Orientation"))); //wj acc
161facb16e7SArmin Le Grand mpMtrAngle->SetModifyHdl(LINK( this, AlignmentPropertyPanel, AngleModifiedHdl));
162facb16e7SArmin Le Grand mpMtrAngle->EnableAutocomplete( false );
1634e8031e0SArmin Le Grand
1644e8031e0SArmin Le Grand //Vertical stacked
165facb16e7SArmin Le Grand mpCbStacked->SetClickHdl( LINK( this, AlignmentPropertyPanel, ClickStackHdl ) );
166facb16e7SArmin Le Grand
167facb16e7SArmin Le Grand mpMtrAngle->InsertValue(0, FUNIT_CUSTOM);
168facb16e7SArmin Le Grand mpMtrAngle->InsertValue(45, FUNIT_CUSTOM);
169facb16e7SArmin Le Grand mpMtrAngle->InsertValue(90, FUNIT_CUSTOM);
170facb16e7SArmin Le Grand mpMtrAngle->InsertValue(135, FUNIT_CUSTOM);
171facb16e7SArmin Le Grand mpMtrAngle->InsertValue(180, FUNIT_CUSTOM);
172facb16e7SArmin Le Grand mpMtrAngle->InsertValue(225, FUNIT_CUSTOM);
173facb16e7SArmin Le Grand mpMtrAngle->InsertValue(270, FUNIT_CUSTOM);
174facb16e7SArmin Le Grand mpMtrAngle->InsertValue(315, FUNIT_CUSTOM);
175df46ddf6SArmin Le Grand mpMtrAngle->SetDropDownLineCount(mpMtrAngle->GetEntryCount());
176facb16e7SArmin Le Grand
1774e8031e0SArmin Le Grand mpTBHorizontal->SetAccessibleRelationLabeledBy(mpTBHorizontal.get());
178facb16e7SArmin Le Grand mpTBVertical->SetAccessibleRelationLabeledBy(mpTBVertical.get());
179facb16e7SArmin Le Grand mpMFLeftIndent->SetAccessibleRelationLabeledBy(mpFTLeftIndent.get());
180facb16e7SArmin Le Grand mpMtrAngle->SetAccessibleRelationLabeledBy(mpFtRotate.get());
181facb16e7SArmin Le Grand #ifdef HAS_IA2
182facb16e7SArmin Le Grand mpMtrAngle->SetMpSubEditAccLableBy(mpFtRotate.get());
183facb16e7SArmin Le Grand #endif
184facb16e7SArmin Le Grand }
185facb16e7SArmin Le Grand
186facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
187facb16e7SArmin Le Grand
IMPL_LINK(AlignmentPropertyPanel,AngleModifiedHdl,void *,EMPTYARG)188facb16e7SArmin Le Grand IMPL_LINK( AlignmentPropertyPanel, AngleModifiedHdl, void *, EMPTYARG )
189facb16e7SArmin Le Grand {
190facb16e7SArmin Le Grand String sTmp = mpMtrAngle->GetText();
191facb16e7SArmin Le Grand
192facb16e7SArmin Le Grand sal_Unicode nChar = sTmp.GetChar( 0 );
193facb16e7SArmin Le Grand if((sTmp.Len()== 1 && nChar == '-') ||
194facb16e7SArmin Le Grand (nChar != '-' && ((nChar < '0') || (nChar > '9') ) )) ////modify
195facb16e7SArmin Le Grand return 0;
196facb16e7SArmin Le Grand
197facb16e7SArmin Le Grand double dTmp = sTmp.ToDouble();
198facb16e7SArmin Le Grand FormatDegrees(dTmp);
199facb16e7SArmin Le Grand
200facb16e7SArmin Le Grand sal_Int64 nTmp = (sal_Int64)dTmp*100;
201facb16e7SArmin Le Grand SfxInt32Item aAngleItem( SID_ATTR_ALIGN_DEGREES,(sal_uInt32) nTmp);
202facb16e7SArmin Le Grand
203facb16e7SArmin Le Grand GetBindings()->GetDispatcher()->Execute(
204facb16e7SArmin Le Grand SID_ATTR_ALIGN_DEGREES, SFX_CALLMODE_RECORD, &aAngleItem, 0L );
205facb16e7SArmin Le Grand return 0;
206facb16e7SArmin Le Grand }
207facb16e7SArmin Le Grand
208facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
209facb16e7SArmin Le Grand
IMPL_LINK(AlignmentPropertyPanel,RotationHdl,void *,EMPTYARG)210facb16e7SArmin Le Grand IMPL_LINK( AlignmentPropertyPanel, RotationHdl, void *, EMPTYARG )
211facb16e7SArmin Le Grand {
212facb16e7SArmin Le Grand sal_Int32 nTmp = mpCtrlDial->GetRotation();
213facb16e7SArmin Le Grand SfxInt32Item aAngleItem( SID_ATTR_ALIGN_DEGREES,(sal_uInt32) nTmp);
214facb16e7SArmin Le Grand
215facb16e7SArmin Le Grand GetBindings()->GetDispatcher()->Execute(
216facb16e7SArmin Le Grand SID_ATTR_ALIGN_DEGREES, SFX_CALLMODE_RECORD, &aAngleItem, 0L );
217facb16e7SArmin Le Grand
218facb16e7SArmin Le Grand return 0;
219facb16e7SArmin Le Grand }
220facb16e7SArmin Le Grand
221facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
222facb16e7SArmin Le Grand
IMPL_LINK(AlignmentPropertyPanel,ClickStackHdl,void *,EMPTYARG)223facb16e7SArmin Le Grand IMPL_LINK( AlignmentPropertyPanel, ClickStackHdl, void *, EMPTYARG )
224facb16e7SArmin Le Grand {
225facb16e7SArmin Le Grand bool bVertical = mpCbStacked->IsChecked() ? true : false;
226facb16e7SArmin Le Grand SfxBoolItem aStackItem( SID_ATTR_ALIGN_STACKED, bVertical );
227facb16e7SArmin Le Grand GetBindings()->GetDispatcher()->Execute(
228facb16e7SArmin Le Grand SID_ATTR_ALIGN_STACKED, SFX_CALLMODE_RECORD, &aStackItem, 0L );
229facb16e7SArmin Le Grand return 0;
230facb16e7SArmin Le Grand }
231facb16e7SArmin Le Grand
232facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
233facb16e7SArmin Le Grand
IMPL_LINK(AlignmentPropertyPanel,TbxHorAlignSelectHdl,ToolBox *,pToolBox)234facb16e7SArmin Le Grand IMPL_LINK(AlignmentPropertyPanel, TbxHorAlignSelectHdl, ToolBox*, pToolBox)
235facb16e7SArmin Le Grand {
236facb16e7SArmin Le Grand sal_uInt16 nId = pToolBox->GetCurItemId();
237facb16e7SArmin Le Grand
238facb16e7SArmin Le Grand if(nId == ID_SUBSTLEFT)
239facb16e7SArmin Le Grand {
240facb16e7SArmin Le Grand if(meHorAlignState != SVX_HOR_JUSTIFY_LEFT)
241facb16e7SArmin Le Grand meHorAlignState = SVX_HOR_JUSTIFY_LEFT;
242facb16e7SArmin Le Grand else
243facb16e7SArmin Le Grand meHorAlignState = SVX_HOR_JUSTIFY_STANDARD;
244facb16e7SArmin Le Grand }
245facb16e7SArmin Le Grand else if( nId == ID_SUBSTCENTER )
246facb16e7SArmin Le Grand {
247facb16e7SArmin Le Grand if(meHorAlignState != SVX_HOR_JUSTIFY_CENTER)
248facb16e7SArmin Le Grand meHorAlignState = SVX_HOR_JUSTIFY_CENTER;
249facb16e7SArmin Le Grand else
250facb16e7SArmin Le Grand meHorAlignState = SVX_HOR_JUSTIFY_STANDARD;
251facb16e7SArmin Le Grand }
252facb16e7SArmin Le Grand else if( nId == ID_SUBSTRIGHT )
253facb16e7SArmin Le Grand {
254facb16e7SArmin Le Grand if(meHorAlignState != SVX_HOR_JUSTIFY_RIGHT)
255facb16e7SArmin Le Grand meHorAlignState = SVX_HOR_JUSTIFY_RIGHT;
256facb16e7SArmin Le Grand else
257facb16e7SArmin Le Grand meHorAlignState = SVX_HOR_JUSTIFY_STANDARD;
258facb16e7SArmin Le Grand }
259facb16e7SArmin Le Grand else if( nId == ID_SUBSTJUSTIFY )
260facb16e7SArmin Le Grand {
261facb16e7SArmin Le Grand if(meHorAlignState != SVX_HOR_JUSTIFY_BLOCK)
262facb16e7SArmin Le Grand meHorAlignState = SVX_HOR_JUSTIFY_BLOCK;
263facb16e7SArmin Le Grand else
264facb16e7SArmin Le Grand meHorAlignState = SVX_HOR_JUSTIFY_STANDARD;
265facb16e7SArmin Le Grand }
266facb16e7SArmin Le Grand SvxHorJustifyItem aHorItem(meHorAlignState, SID_H_ALIGNCELL);
267facb16e7SArmin Le Grand GetBindings()->GetDispatcher()->Execute(SID_H_ALIGNCELL, SFX_CALLMODE_RECORD, &aHorItem, 0L);
268facb16e7SArmin Le Grand UpdateHorAlign();
269facb16e7SArmin Le Grand return 0;
270facb16e7SArmin Le Grand }
271facb16e7SArmin Le Grand
272facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
273facb16e7SArmin Le Grand
IMPL_LINK(AlignmentPropertyPanel,TbxVerAlignSelectHdl,ToolBox *,pToolBox)274facb16e7SArmin Le Grand IMPL_LINK(AlignmentPropertyPanel, TbxVerAlignSelectHdl, ToolBox*, pToolBox)
275facb16e7SArmin Le Grand {
276facb16e7SArmin Le Grand sal_uInt16 nId = pToolBox->GetCurItemId();
277facb16e7SArmin Le Grand
278facb16e7SArmin Le Grand //Bold
279facb16e7SArmin Le Grand if(nId == IID_VERT_TOP)
280facb16e7SArmin Le Grand {
281facb16e7SArmin Le Grand if(meVerAlignState != SVX_VER_JUSTIFY_TOP)
282facb16e7SArmin Le Grand meVerAlignState = SVX_VER_JUSTIFY_TOP;
283facb16e7SArmin Le Grand else
284facb16e7SArmin Le Grand meVerAlignState = SVX_VER_JUSTIFY_STANDARD;
285facb16e7SArmin Le Grand }
286facb16e7SArmin Le Grand else if( nId == IID_VERT_CENTER )
287facb16e7SArmin Le Grand {
288facb16e7SArmin Le Grand if(meVerAlignState != SVX_VER_JUSTIFY_CENTER)
289facb16e7SArmin Le Grand meVerAlignState = SVX_VER_JUSTIFY_CENTER;
290facb16e7SArmin Le Grand else
291facb16e7SArmin Le Grand meVerAlignState = SVX_VER_JUSTIFY_STANDARD;
292facb16e7SArmin Le Grand }
293facb16e7SArmin Le Grand else if( nId == IID_VERT_BOTTOM )
294facb16e7SArmin Le Grand {
295facb16e7SArmin Le Grand if(meVerAlignState != SVX_VER_JUSTIFY_BOTTOM)
296facb16e7SArmin Le Grand meVerAlignState = SVX_VER_JUSTIFY_BOTTOM;
297facb16e7SArmin Le Grand else
298facb16e7SArmin Le Grand meVerAlignState = SVX_VER_JUSTIFY_STANDARD;
299facb16e7SArmin Le Grand }
300facb16e7SArmin Le Grand SvxVerJustifyItem aVerItem(meVerAlignState, SID_V_ALIGNCELL);
301facb16e7SArmin Le Grand GetBindings()->GetDispatcher()->Execute(SID_V_ALIGNCELL, SFX_CALLMODE_RECORD, &aVerItem, 0L);
302facb16e7SArmin Le Grand UpdateVerAlign();
303facb16e7SArmin Le Grand return 0;
304facb16e7SArmin Le Grand }
305facb16e7SArmin Le Grand
306facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
307facb16e7SArmin Le Grand
IMPL_LINK(AlignmentPropertyPanel,MFLeftIndentMdyHdl,void *,EMPTYARG)308facb16e7SArmin Le Grand IMPL_LINK(AlignmentPropertyPanel, MFLeftIndentMdyHdl, void*, EMPTYARG)
309facb16e7SArmin Le Grand {
310facb16e7SArmin Le Grand mpCBXWrapText->EnableTriState(false);
311facb16e7SArmin Le Grand sal_uInt16 nVal = (sal_uInt16)mpMFLeftIndent->GetValue();
312facb16e7SArmin Le Grand SfxUInt16Item aItem( SID_ATTR_ALIGN_INDENT, (sal_uInt16)CalcToUnit( nVal, SFX_MAPUNIT_TWIP ) );
313facb16e7SArmin Le Grand
314facb16e7SArmin Le Grand GetBindings()->GetDispatcher()->Execute(SID_ATTR_ALIGN_INDENT, SFX_CALLMODE_RECORD, &aItem, 0L);
315facb16e7SArmin Le Grand return( 0L );
316facb16e7SArmin Le Grand }
317facb16e7SArmin Le Grand
318facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
319facb16e7SArmin Le Grand
IMPL_LINK(AlignmentPropertyPanel,CBOXMergnCellClkHdl,void *,EMPTYARG)320facb16e7SArmin Le Grand IMPL_LINK(AlignmentPropertyPanel, CBOXMergnCellClkHdl, void*, EMPTYARG)
321facb16e7SArmin Le Grand {
322facb16e7SArmin Le Grand bool bState = mpCBXMergeCell->IsChecked();
323facb16e7SArmin Le Grand
324facb16e7SArmin Le Grand //Modified
325facb16e7SArmin Le Grand //SfxBoolItem aItem( FID_MERGE_TOGGLE , bState);
326facb16e7SArmin Le Grand //GetBindings()->GetDispatcher()->Execute(FID_MERGE_TOGGLE, SFX_CALLMODE_RECORD, &aItem, false, 0L);
327facb16e7SArmin Le Grand if(bState)
328facb16e7SArmin Le Grand GetBindings()->GetDispatcher()->Execute(FID_MERGE_ON, SFX_CALLMODE_RECORD);
329facb16e7SArmin Le Grand else
330facb16e7SArmin Le Grand GetBindings()->GetDispatcher()->Execute(FID_MERGE_OFF, SFX_CALLMODE_RECORD);
331facb16e7SArmin Le Grand GetBindings()->Invalidate(FID_MERGE_TOGGLE,true,false);
332facb16e7SArmin Le Grand //modified end
333facb16e7SArmin Le Grand
334facb16e7SArmin Le Grand return 0;
335facb16e7SArmin Le Grand }
336facb16e7SArmin Le Grand
337facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
338facb16e7SArmin Le Grand
IMPL_LINK(AlignmentPropertyPanel,CBOXWrapTextClkHdl,void *,EMPTYARG)339facb16e7SArmin Le Grand IMPL_LINK(AlignmentPropertyPanel, CBOXWrapTextClkHdl, void*, EMPTYARG)
340facb16e7SArmin Le Grand {
341facb16e7SArmin Le Grand bool bState = mpCBXWrapText->IsChecked();
342facb16e7SArmin Le Grand SfxBoolItem aItem( SID_ATTR_ALIGN_LINEBREAK , bState);
343facb16e7SArmin Le Grand GetBindings()->GetDispatcher()->Execute(SID_ATTR_ALIGN_LINEBREAK, SFX_CALLMODE_RECORD, &aItem, 0L);
344facb16e7SArmin Le Grand return 0;
345facb16e7SArmin Le Grand }
346facb16e7SArmin Le Grand
347facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
348facb16e7SArmin Le Grand
Create(Window * pParent,const cssu::Reference<css::frame::XFrame> & rxFrame,SfxBindings * pBindings)349facb16e7SArmin Le Grand AlignmentPropertyPanel* AlignmentPropertyPanel::Create (
350facb16e7SArmin Le Grand Window* pParent,
351facb16e7SArmin Le Grand const cssu::Reference<css::frame::XFrame>& rxFrame,
352facb16e7SArmin Le Grand SfxBindings* pBindings)
353facb16e7SArmin Le Grand {
354facb16e7SArmin Le Grand if (pParent == NULL)
355facb16e7SArmin Le Grand throw lang::IllegalArgumentException(A2S("no parent Window given to AlignmentPropertyPanel::Create"), NULL, 0);
356facb16e7SArmin Le Grand if ( ! rxFrame.is())
357facb16e7SArmin Le Grand throw lang::IllegalArgumentException(A2S("no XFrame given to AlignmentPropertyPanel::Create"), NULL, 1);
358facb16e7SArmin Le Grand if (pBindings == NULL)
359facb16e7SArmin Le Grand throw lang::IllegalArgumentException(A2S("no SfxBindings given to AlignmentPropertyPanel::Create"), NULL, 2);
360facb16e7SArmin Le Grand
361facb16e7SArmin Le Grand return new AlignmentPropertyPanel(
362facb16e7SArmin Le Grand pParent,
363facb16e7SArmin Le Grand rxFrame,
364facb16e7SArmin Le Grand pBindings);
365facb16e7SArmin Le Grand }
366facb16e7SArmin Le Grand
367facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
368facb16e7SArmin Le Grand
DataChanged(const DataChangedEvent & rEvent)369facb16e7SArmin Le Grand void AlignmentPropertyPanel::DataChanged(
370facb16e7SArmin Le Grand const DataChangedEvent& rEvent)
371facb16e7SArmin Le Grand {
372facb16e7SArmin Le Grand (void)rEvent;
373facb16e7SArmin Le Grand }
374facb16e7SArmin Le Grand
375facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
376facb16e7SArmin Le Grand
HandleContextChange(const::sfx2::sidebar::EnumContext aContext)377facb16e7SArmin Le Grand void AlignmentPropertyPanel::HandleContextChange(
378facb16e7SArmin Le Grand const ::sfx2::sidebar::EnumContext aContext)
379facb16e7SArmin Le Grand {
380facb16e7SArmin Le Grand if(maContext == aContext)
381facb16e7SArmin Le Grand {
382facb16e7SArmin Le Grand // Nothing to do.
383facb16e7SArmin Le Grand return;
384facb16e7SArmin Le Grand }
385facb16e7SArmin Le Grand
386facb16e7SArmin Le Grand maContext = aContext;
387facb16e7SArmin Le Grand
388facb16e7SArmin Le Grand
389facb16e7SArmin Le Grand
390facb16e7SArmin Le Grand // todo
391facb16e7SArmin Le Grand }
392facb16e7SArmin Le Grand
393facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
394facb16e7SArmin Le Grand
NotifyItemUpdate(sal_uInt16 nSID,SfxItemState eState,const SfxPoolItem * pState,const bool bIsEnabled)395facb16e7SArmin Le Grand void AlignmentPropertyPanel::NotifyItemUpdate(
396facb16e7SArmin Le Grand sal_uInt16 nSID,
397facb16e7SArmin Le Grand SfxItemState eState,
39845da7d5eSAndre Fischer const SfxPoolItem* pState,
39945da7d5eSAndre Fischer const bool bIsEnabled)
400facb16e7SArmin Le Grand {
40145da7d5eSAndre Fischer (void)bIsEnabled;
40245da7d5eSAndre Fischer
403facb16e7SArmin Le Grand switch(nSID)
404facb16e7SArmin Le Grand {
405facb16e7SArmin Le Grand case SID_H_ALIGNCELL:
406facb16e7SArmin Le Grand if(eState >= SFX_ITEM_DEFAULT && pState && pState->ISA(SvxHorJustifyItem) )
407facb16e7SArmin Le Grand {
408facb16e7SArmin Le Grand const SvxHorJustifyItem* pItem = (const SvxHorJustifyItem*)pState;
409facb16e7SArmin Le Grand meHorAlignState = (SvxCellHorJustify)pItem->GetValue();
410facb16e7SArmin Le Grand }
411facb16e7SArmin Le Grand else
412facb16e7SArmin Le Grand {
413facb16e7SArmin Le Grand meHorAlignState = SVX_HOR_JUSTIFY_STANDARD;
414facb16e7SArmin Le Grand }
415facb16e7SArmin Le Grand UpdateHorAlign();
416facb16e7SArmin Le Grand break;
417facb16e7SArmin Le Grand case SID_V_ALIGNCELL:
418facb16e7SArmin Le Grand if(eState >= SFX_ITEM_DEFAULT && pState && pState->ISA(SvxVerJustifyItem) )
419facb16e7SArmin Le Grand {
420facb16e7SArmin Le Grand const SvxVerJustifyItem* pItem = (const SvxVerJustifyItem*)pState;
421facb16e7SArmin Le Grand meVerAlignState = (SvxCellVerJustify)pItem->GetValue();
422facb16e7SArmin Le Grand }
423facb16e7SArmin Le Grand else
424facb16e7SArmin Le Grand {
425facb16e7SArmin Le Grand meVerAlignState = SVX_VER_JUSTIFY_STANDARD;
426facb16e7SArmin Le Grand }
427facb16e7SArmin Le Grand UpdateVerAlign();
428facb16e7SArmin Le Grand break;
429facb16e7SArmin Le Grand case SID_ATTR_ALIGN_INDENT:
430facb16e7SArmin Le Grand if(eState >= SFX_ITEM_DEFAULT && pState && pState->ISA(SfxUInt16Item) )
431facb16e7SArmin Le Grand {
432facb16e7SArmin Le Grand const SfxUInt16Item* pItem = (const SfxUInt16Item*)pState;
433facb16e7SArmin Le Grand sal_uInt16 nVal = pItem->GetValue();
434facb16e7SArmin Le Grand mpMFLeftIndent->SetValue( CalcToPoint(nVal, SFX_MAPUNIT_TWIP, 1) );
435facb16e7SArmin Le Grand }
436facb16e7SArmin Le Grand else
437facb16e7SArmin Le Grand {
438facb16e7SArmin Le Grand mpMFLeftIndent->SetValue(0);
439facb16e7SArmin Le Grand mpMFLeftIndent->SetText(String());
440facb16e7SArmin Le Grand }
441facb16e7SArmin Le Grand break;
442facb16e7SArmin Le Grand case FID_MERGE_TOGGLE:
443facb16e7SArmin Le Grand if(eState >= SFX_ITEM_DEFAULT && pState && pState->ISA(SfxBoolItem) )
444facb16e7SArmin Le Grand {
445facb16e7SArmin Le Grand mpCBXMergeCell->Enable();
446facb16e7SArmin Le Grand const SfxBoolItem* pItem = (const SfxBoolItem*)pState;
447facb16e7SArmin Le Grand bool bVal = pItem->GetValue();
448facb16e7SArmin Le Grand if(bVal)
449facb16e7SArmin Le Grand mpCBXMergeCell->Check(true);
450facb16e7SArmin Le Grand else
451facb16e7SArmin Le Grand mpCBXMergeCell->Check(false);
452facb16e7SArmin Le Grand }
453facb16e7SArmin Le Grand else
454facb16e7SArmin Le Grand {
455facb16e7SArmin Le Grand mpCBXMergeCell->Check(false);
456facb16e7SArmin Le Grand mpCBXMergeCell->Disable();
457facb16e7SArmin Le Grand }
458facb16e7SArmin Le Grand break;
459facb16e7SArmin Le Grand
460facb16e7SArmin Le Grand case SID_ATTR_ALIGN_LINEBREAK:
461facb16e7SArmin Le Grand if(eState == SFX_ITEM_DISABLED)
462facb16e7SArmin Le Grand {
463facb16e7SArmin Le Grand mpCBXWrapText->EnableTriState(false);
464facb16e7SArmin Le Grand mpCBXWrapText->Check(false);
465facb16e7SArmin Le Grand mpCBXWrapText->Disable();
466facb16e7SArmin Le Grand }
467facb16e7SArmin Le Grand else
468facb16e7SArmin Le Grand {
469facb16e7SArmin Le Grand mpCBXWrapText->Enable();
470facb16e7SArmin Le Grand if(eState >= SFX_ITEM_DEFAULT && pState && pState->ISA(SfxBoolItem) )
471facb16e7SArmin Le Grand {
472facb16e7SArmin Le Grand mpCBXWrapText->EnableTriState(false);
473facb16e7SArmin Le Grand const SfxBoolItem* pItem = (const SfxBoolItem*)pState;
474facb16e7SArmin Le Grand bool bVal = pItem->GetValue();
475facb16e7SArmin Le Grand if(bVal)
476facb16e7SArmin Le Grand mpCBXWrapText->Check(true);
477facb16e7SArmin Le Grand else
478facb16e7SArmin Le Grand mpCBXWrapText->Check(false);
479facb16e7SArmin Le Grand }
480facb16e7SArmin Le Grand else if(eState == SFX_ITEM_DONTCARE)
481facb16e7SArmin Le Grand {
482facb16e7SArmin Le Grand mpCBXWrapText->EnableTriState(true);
483facb16e7SArmin Le Grand mpCBXWrapText->SetState(STATE_DONTKNOW);
484facb16e7SArmin Le Grand }
485facb16e7SArmin Le Grand }
486facb16e7SArmin Le Grand break;
487facb16e7SArmin Le Grand case SID_ATTR_ALIGN_DEGREES:
488facb16e7SArmin Le Grand if (eState >= SFX_ITEM_AVAILABLE)
489facb16e7SArmin Le Grand {
490facb16e7SArmin Le Grand long nTmp = ((const SfxInt32Item*)pState)->GetValue();
491facb16e7SArmin Le Grand mpMtrAngle->SetValue( nTmp / 100); //wj
492facb16e7SArmin Le Grand mpCtrlDial->SetRotation( nTmp );
493facb16e7SArmin Le Grand switch(nTmp)
494facb16e7SArmin Le Grand {
495facb16e7SArmin Le Grand case 0:
496facb16e7SArmin Le Grand mpMtrAngle->SelectEntryPos(0);
497facb16e7SArmin Le Grand break;
498facb16e7SArmin Le Grand case 4500:
499facb16e7SArmin Le Grand mpMtrAngle->SelectEntryPos(1);
500facb16e7SArmin Le Grand break;
501facb16e7SArmin Le Grand case 9000:
502facb16e7SArmin Le Grand mpMtrAngle->SelectEntryPos(2);
503facb16e7SArmin Le Grand break;
504facb16e7SArmin Le Grand case 13500:
505facb16e7SArmin Le Grand mpMtrAngle->SelectEntryPos(3);
506facb16e7SArmin Le Grand break;
507facb16e7SArmin Le Grand case 18000:
508facb16e7SArmin Le Grand mpMtrAngle->SelectEntryPos(4);
509facb16e7SArmin Le Grand break;
510facb16e7SArmin Le Grand case 22500:
511facb16e7SArmin Le Grand mpMtrAngle->SelectEntryPos(5);
512facb16e7SArmin Le Grand break;
513facb16e7SArmin Le Grand case 27000:
514facb16e7SArmin Le Grand mpMtrAngle->SelectEntryPos(6);
515facb16e7SArmin Le Grand break;
516facb16e7SArmin Le Grand case 31500:
517facb16e7SArmin Le Grand mpMtrAngle->SelectEntryPos(7);
518facb16e7SArmin Le Grand }
519facb16e7SArmin Le Grand }
520facb16e7SArmin Le Grand else
521facb16e7SArmin Le Grand {
522facb16e7SArmin Le Grand mpMtrAngle->SetText( String() );
523facb16e7SArmin Le Grand mpCtrlDial->SetRotation( 0 );
524facb16e7SArmin Le Grand }
525facb16e7SArmin Le Grand break;
526facb16e7SArmin Le Grand case SID_ATTR_ALIGN_STACKED:
527facb16e7SArmin Le Grand if (eState >= SFX_ITEM_AVAILABLE)
528facb16e7SArmin Le Grand {
529facb16e7SArmin Le Grand mpCbStacked->EnableTriState(false);
530facb16e7SArmin Le Grand const SfxBoolItem* aStackItem = (const SfxBoolItem*)pState;
531facb16e7SArmin Le Grand bool IsChecked = (bool)aStackItem->GetValue();
532facb16e7SArmin Le Grand if(IsChecked)
533facb16e7SArmin Le Grand {
534facb16e7SArmin Le Grand mpCbStacked->Check(IsChecked);
535facb16e7SArmin Le Grand mpFtRotate->Disable();
536facb16e7SArmin Le Grand mpMtrAngle->Disable();
537facb16e7SArmin Le Grand mpCtrlDial->Disable();
538facb16e7SArmin Le Grand mbMultiDisable = true;
539facb16e7SArmin Le Grand }
540facb16e7SArmin Le Grand else
541facb16e7SArmin Le Grand {
542facb16e7SArmin Le Grand mpCbStacked->Check(IsChecked);
543facb16e7SArmin Le Grand mpFtRotate->Enable();
544facb16e7SArmin Le Grand mpMtrAngle->Enable();
545facb16e7SArmin Le Grand mpCtrlDial->Enable();
546facb16e7SArmin Le Grand mbMultiDisable = false;
547facb16e7SArmin Le Grand }
548facb16e7SArmin Le Grand }
549facb16e7SArmin Le Grand else
550facb16e7SArmin Le Grand {
551facb16e7SArmin Le Grand mbMultiDisable = true;
552facb16e7SArmin Le Grand mpFtRotate->Disable();
553facb16e7SArmin Le Grand mpMtrAngle->Disable();
554facb16e7SArmin Le Grand mpCtrlDial->Disable();
555facb16e7SArmin Le Grand mpCbStacked->EnableTriState(true);
556facb16e7SArmin Le Grand mpCbStacked->SetState(STATE_DONTKNOW);
557facb16e7SArmin Le Grand }
558facb16e7SArmin Le Grand }
559facb16e7SArmin Le Grand }
560facb16e7SArmin Le Grand
561facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
562facb16e7SArmin Le Grand
GetBindings()563facb16e7SArmin Le Grand SfxBindings* AlignmentPropertyPanel::GetBindings()
564facb16e7SArmin Le Grand {
565facb16e7SArmin Le Grand return mpBindings;
566facb16e7SArmin Le Grand }
567facb16e7SArmin Le Grand
568facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
569facb16e7SArmin Le Grand
FormatDegrees(double & dTmp)570facb16e7SArmin Le Grand void AlignmentPropertyPanel::FormatDegrees(double& dTmp)
571facb16e7SArmin Le Grand {
572facb16e7SArmin Le Grand while(dTmp<0)
573facb16e7SArmin Le Grand dTmp += 360;
574facb16e7SArmin Le Grand while (dTmp > 359) //modify
575facb16e7SArmin Le Grand dTmp = 359;
576facb16e7SArmin Le Grand }
577facb16e7SArmin Le Grand
578facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
579facb16e7SArmin Le Grand
UpdateHorAlign()580facb16e7SArmin Le Grand void AlignmentPropertyPanel::UpdateHorAlign()
581facb16e7SArmin Le Grand {
582facb16e7SArmin Le Grand mpTBHorizontal->SetItemState(ID_SUBSTLEFT, STATE_NOCHECK);
583facb16e7SArmin Le Grand mpTBHorizontal->SetItemState(ID_SUBSTCENTER, STATE_NOCHECK);
584facb16e7SArmin Le Grand mpTBHorizontal->SetItemState(ID_SUBSTRIGHT, STATE_NOCHECK);
585facb16e7SArmin Le Grand mpTBHorizontal->SetItemState(ID_SUBSTJUSTIFY,STATE_NOCHECK);
586facb16e7SArmin Le Grand mpFTLeftIndent->Disable();
587facb16e7SArmin Le Grand mpMFLeftIndent->Disable();
588facb16e7SArmin Le Grand if(meHorAlignState==SVX_HOR_JUSTIFY_REPEAT)
589facb16e7SArmin Le Grand {
590facb16e7SArmin Le Grand mpFtRotate->Disable();
591facb16e7SArmin Le Grand mpCtrlDial->Disable();
592facb16e7SArmin Le Grand mpMtrAngle->Disable();
593facb16e7SArmin Le Grand mpCbStacked->Disable();
594facb16e7SArmin Le Grand }
595facb16e7SArmin Le Grand else
596facb16e7SArmin Le Grand {
597facb16e7SArmin Le Grand if(!mbMultiDisable)
598facb16e7SArmin Le Grand {
599facb16e7SArmin Le Grand mpFtRotate->Enable();
600facb16e7SArmin Le Grand mpCtrlDial->Enable();
601facb16e7SArmin Le Grand mpMtrAngle->Enable();
602facb16e7SArmin Le Grand }
603facb16e7SArmin Le Grand else
604facb16e7SArmin Le Grand {
605facb16e7SArmin Le Grand mpFtRotate->Disable();
606facb16e7SArmin Le Grand mpCtrlDial->Disable();
607facb16e7SArmin Le Grand mpMtrAngle->Disable();
608facb16e7SArmin Le Grand }
609facb16e7SArmin Le Grand mpCbStacked->Enable();
610facb16e7SArmin Le Grand }
611facb16e7SArmin Le Grand switch(meHorAlignState)
612facb16e7SArmin Le Grand {
613facb16e7SArmin Le Grand case SVX_HOR_JUSTIFY_LEFT:
614facb16e7SArmin Le Grand mpTBHorizontal->SetItemState(ID_SUBSTLEFT, STATE_CHECK);
615facb16e7SArmin Le Grand mpFTLeftIndent->Enable();
616facb16e7SArmin Le Grand mpMFLeftIndent->Enable();
617facb16e7SArmin Le Grand break;
618facb16e7SArmin Le Grand case SVX_HOR_JUSTIFY_CENTER:mpTBHorizontal->SetItemState(ID_SUBSTCENTER, STATE_CHECK);break;
619facb16e7SArmin Le Grand case SVX_HOR_JUSTIFY_RIGHT: mpTBHorizontal->SetItemState(ID_SUBSTRIGHT, STATE_CHECK);break;
620facb16e7SArmin Le Grand case SVX_HOR_JUSTIFY_BLOCK: mpTBHorizontal->SetItemState(ID_SUBSTJUSTIFY,STATE_CHECK);break;
621facb16e7SArmin Le Grand default:;
622facb16e7SArmin Le Grand }
623facb16e7SArmin Le Grand }
624facb16e7SArmin Le Grand
625facb16e7SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
626facb16e7SArmin Le Grand
UpdateVerAlign()627facb16e7SArmin Le Grand void AlignmentPropertyPanel::UpdateVerAlign()
628facb16e7SArmin Le Grand {
629facb16e7SArmin Le Grand mpTBVertical->SetItemState(IID_VERT_TOP, STATE_NOCHECK);
630facb16e7SArmin Le Grand mpTBVertical->SetItemState(IID_VERT_CENTER, STATE_NOCHECK);
631facb16e7SArmin Le Grand mpTBVertical->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK);
632facb16e7SArmin Le Grand
633facb16e7SArmin Le Grand switch(meVerAlignState)
634facb16e7SArmin Le Grand {
635facb16e7SArmin Le Grand case SVX_VER_JUSTIFY_TOP: mpTBVertical->SetItemState(IID_VERT_TOP, STATE_CHECK);break;
636facb16e7SArmin Le Grand case SVX_VER_JUSTIFY_CENTER:mpTBVertical->SetItemState(IID_VERT_CENTER, STATE_CHECK);break;
637facb16e7SArmin Le Grand case SVX_VER_JUSTIFY_BOTTOM: mpTBVertical->SetItemState(IID_VERT_BOTTOM, STATE_CHECK);break;
638facb16e7SArmin Le Grand default:;
639facb16e7SArmin Le Grand }
640facb16e7SArmin Le Grand }
641facb16e7SArmin Le Grand
642facb16e7SArmin Le Grand
643facb16e7SArmin Le Grand
644*6a606da0SAndre Fischer
Resize(void)645*6a606da0SAndre Fischer void AlignmentPropertyPanel::Resize (void)
646*6a606da0SAndre Fischer {
647*6a606da0SAndre Fischer const sal_Int32 nRight (GetSizePixel().Width() - Layouter::MapWidth(*this, TB_BORDER));
648*6a606da0SAndre Fischer Layouter::SetRight(*mpFtRotate, nRight);
649*6a606da0SAndre Fischer Layouter::SetRight(*mpCBXWrapText, nRight);
650*6a606da0SAndre Fischer Layouter::SetRight(*mpCBXMergeCell, nRight);
651*6a606da0SAndre Fischer Layouter::SetRight(*mpCbStacked, nRight);
652*6a606da0SAndre Fischer }
653*6a606da0SAndre Fischer
654*6a606da0SAndre Fischer
655*6a606da0SAndre Fischer }} // end of namespace ::sc::sidebar
656