1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: column.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sw.hxx"
34 #ifdef SW_DLLIMPLEMENTATION
35 #undef SW_DLLIMPLEMENTATION
40 #include "hintids.hxx"
41 #include <svx/htmlmode.hxx>
42 #include <svx/borderline.hxx>
43 #include <svx/boxitem.hxx>
44 #include <svx/lrspitem.hxx>
45 #include <svx/sizeitem.hxx>
46 #include "svx/frmdiritem.hxx"
47 #include <svtools/ctloptions.hxx>
48 #include <sfx2/dispatch.hxx>
49 #include <vcl/msgbox.hxx>
50 #include <swmodule.hxx>
53 #include "globals.hrc"
54 #include "swtypes.hxx"
60 #include "viewopt.hxx"
65 #include "prcntfld.hxx"
68 #include "poolfmt.hrc"
70 #include <section.hxx>
72 #include <pagedesc.hxx>
74 #define FRAME_FORMAT_WIDTH 1000
77 SV_IMPL_PTRARR( SwColumns
, SwColumnPtr
)
79 /*--------------------------------------------------------------------
80 Beschreibung: Statische Daten
81 --------------------------------------------------------------------*/
83 static const USHORT __FAR_DATA nLines
[] = {
91 static const USHORT nLineCount
= sizeof(nLines
) / sizeof(nLines
[0]);
92 static const USHORT nVisCols
= 3;
94 inline BOOL
IsMarkInSameSection( SwWrtShell
& rWrtSh
, const SwSection
* pSect
)
97 BOOL bRet
= pSect
== rWrtSh
.GetCurrSection();
102 /*--------------------------------------------------------------------
104 --------------------------------------------------------------------*/
106 SwColumnDlg::SwColumnDlg(Window
* pParent
, SwWrtShell
& rSh
) :
107 SfxModalDialog(pParent
, SW_RES(DLG_COLUMN
)),
108 aOK(this, SW_RES(PB_OK
)),
109 aCancel(this, SW_RES(PB_CANCEL
)),
110 aHelp(this, SW_RES(PB_HELP
)),
111 aApplyToFT(this, SW_RES(FT_APPLY_TO
)),
112 aApplyToLB(this, SW_RES(LB_APPLY_TO
)),
121 bSectionChanged(FALSE
),
122 bSelSectionChanged(FALSE
),
128 rWrtShell
.CalcBoundRect(aRect
, FLY_IN_CNTNT
);
130 nSelectionWidth
= aRect
.Width();
132 SfxItemSet
* pColPgSet
= 0;
133 static USHORT __READONLY_DATA aSectIds
[] = { RES_COL
, RES_COL
,
134 RES_FRM_SIZE
, RES_FRM_SIZE
,
135 RES_COLUMNBALANCE
, RES_FRAMEDIR
,
138 const SwSection
* pCurrSection
= rWrtShell
.GetCurrSection();
139 USHORT nFullSectCnt
= rWrtShell
.GetFullSelectedSectionCount();
140 if( pCurrSection
&& ( !rWrtShell
.HasSelection() || 0 != nFullSectCnt
))
142 nSelectionWidth
= rSh
.GetSectionWidth(*pCurrSection
->GetFmt());
143 if ( !nSelectionWidth
)
144 nSelectionWidth
= USHRT_MAX
;
145 pSectionSet
= new SfxItemSet( rWrtShell
.GetAttrPool(), aSectIds
);
146 pSectionSet
->Put( pCurrSection
->GetFmt()->GetAttrSet() );
147 pColPgSet
= pSectionSet
;
148 aApplyToLB
.RemoveEntry( aApplyToLB
.GetEntryPos(
149 (void*)( 1 >= nFullSectCnt
151 : LISTBOX_SECTION
)));
155 aApplyToLB
.RemoveEntry(aApplyToLB
.GetEntryPos( (void*) LISTBOX_SECTION
));
156 aApplyToLB
.RemoveEntry(aApplyToLB
.GetEntryPos( (void*) LISTBOX_SECTIONS
));
159 if( rWrtShell
.HasSelection() && rWrtShell
.IsInsRegionAvailable() &&
160 ( !pCurrSection
|| ( 1 != nFullSectCnt
&&
161 IsMarkInSameSection( rWrtShell
, pCurrSection
) )))
163 pSelectionSet
= new SfxItemSet( rWrtShell
.GetAttrPool(), aSectIds
);
164 pColPgSet
= pSelectionSet
;
167 aApplyToLB
.RemoveEntry(aApplyToLB
.GetEntryPos( (void*) LISTBOX_SELECTION
));
169 if( rWrtShell
.GetFlyFrmFmt() )
171 const SwFrmFmt
* pFmt
= rSh
.GetFlyFrmFmt() ;
172 pFrameSet
= new SfxItemSet(rWrtShell
.GetAttrPool(), aSectIds
);
173 pFrameSet
->Put(pFmt
->GetFrmSize());
174 pFrameSet
->Put(pFmt
->GetCol());
175 pColPgSet
= pFrameSet
;
178 aApplyToLB
.RemoveEntry(aApplyToLB
.GetEntryPos( (void*) LISTBOX_FRAME
));
181 USHORT nPagePos
= aApplyToLB
.GetEntryPos( (void*) LISTBOX_PAGE
);
182 const SwPageDesc
* pPageDesc
= rWrtShell
.GetSelectedPageDescs();
185 pPageSet
= new SfxItemSet( rWrtShell
.GetAttrPool(),
187 RES_FRM_SIZE
, RES_FRM_SIZE
,
188 RES_LR_SPACE
, RES_LR_SPACE
,
191 String sPageStr
= aApplyToLB
.GetEntry(nPagePos
);
192 aApplyToLB
.RemoveEntry( nPagePos
);
193 sPageStr
+= pPageDesc
->GetName();
194 aApplyToLB
.InsertEntry( sPageStr
, nPagePos
);
195 aApplyToLB
.SetEntryData( nPagePos
, (void*) LISTBOX_PAGE
);
197 const SwFrmFmt
&rFmt
= pPageDesc
->GetMaster();
198 nPageWidth
= rFmt
.GetFrmSize().GetSize().Width();
200 const SvxLRSpaceItem
& rLRSpace
= (const SvxLRSpaceItem
&)rFmt
.GetLRSpace();
201 const SvxBoxItem
& rBox
= (const SvxBoxItem
&) rFmt
.GetBox();
202 nPageWidth
-= rLRSpace
.GetLeft() + rLRSpace
.GetRight() + rBox
.GetDistance();
204 pPageSet
->Put(rFmt
.GetCol());
205 pPageSet
->Put(rFmt
.GetLRSpace());
206 pColPgSet
= pPageSet
;
209 aApplyToLB
.RemoveEntry( nPagePos
);
212 ASSERT( pColPgSet
, "" );
214 SwColumnPage
* pPage
= (SwColumnPage
*) SwColumnPage::Create( this,
219 Size
aPageSize(pTabPage
->GetSizePixel());
220 Size
aDlgSize(GetOutputSizePixel());
221 aDlgSize
.Height() = aPageSize
.Height();
222 SetOutputSizePixel(aDlgSize
);
225 aApplyToLB
.SelectEntryPos(0);
228 aApplyToLB
.SetSelectHdl(LINK(this, SwColumnDlg
, ObjectHdl
));
229 aOK
.SetClickHdl(LINK(this, SwColumnDlg
, OkHdl
));
230 //#i80458# if no columns can be set then disable OK
231 if( !aApplyToLB
.GetEntryCount() )
232 aOK
.Enable( sal_False
);
233 //#i97810# set focus to the TabPage
234 pTabPage
->ActivateColumnControl();
237 /*--------------------------------------------------------------------
239 --------------------------------------------------------------------*/
241 SwColumnDlg::~SwColumnDlg()
246 delete pSelectionSet
;
249 /* -----------------26.05.99 11:40-------------------
251 * --------------------------------------------------*/
252 IMPL_LINK(SwColumnDlg
, ObjectHdl
, ListBox
*, pBox
)
254 SfxItemSet
* pSet
= 0;
255 switch(nOldSelection
)
257 case LISTBOX_SELECTION
:
258 pSet
= pSelectionSet
;
260 case LISTBOX_SECTION
:
262 bSectionChanged
= TRUE
;
264 case LISTBOX_SECTIONS
:
266 bSelSectionChanged
= TRUE
;
274 bFrameChanged
= TRUE
;
279 pTabPage
->FillItemSet(*pSet
);
281 nOldSelection
= (long)aApplyToLB
.GetEntryData(aApplyToLB
.GetSelectEntryPos());
282 long nWidth
= nSelectionWidth
;
283 switch(nOldSelection
)
285 case LISTBOX_SELECTION
:
286 pSet
= pSelectionSet
;
288 pSet
->Put(SwFmtFrmSize(ATT_VAR_SIZE
, nWidth
, nWidth
));
290 case LISTBOX_SECTION
:
291 case LISTBOX_SECTIONS
:
293 pSet
->Put(SwFmtFrmSize(ATT_VAR_SIZE
, nWidth
, nWidth
));
298 pSet
->Put(SwFmtFrmSize(ATT_VAR_SIZE
, nWidth
, nWidth
));
305 BOOL bIsSection
= pSet
== pSectionSet
|| pSet
== pSelectionSet
;
306 pTabPage
->ShowBalance(bIsSection
);
307 pTabPage
->SetInSection(bIsSection
);
308 pTabPage
->SetFrmMode(TRUE
);
309 pTabPage
->SetPageWidth(nWidth
);
311 pTabPage
->Reset(*pSet
);
314 /* -----------------26.05.99 12:32-------------------
316 * --------------------------------------------------*/
317 IMPL_LINK(SwColumnDlg
, OkHdl
, OKButton
*, EMPTYARG
)
319 //aktuelle Selektion auswerten
320 SfxItemSet
* pSet
= 0;
321 switch(nOldSelection
)
323 case LISTBOX_SELECTION
:
324 pSet
= pSelectionSet
;
326 case LISTBOX_SECTION
:
328 bSectionChanged
= TRUE
;
330 case LISTBOX_SECTIONS
:
332 bSelSectionChanged
= TRUE
;
340 bFrameChanged
= TRUE
;
343 pTabPage
->FillItemSet(*pSet
);
345 if(pSelectionSet
&& SFX_ITEM_SET
== pSelectionSet
->GetItemState(RES_COL
))
347 //Bereich mit Spalten einfuegen
348 const SwFmtCol
& rColItem
= (const SwFmtCol
&)pSelectionSet
->Get(RES_COL
);
349 //nur, wenn es auch Spalten gibt!
350 if(rColItem
.GetNumCols() > 1)
351 rWrtShell
.GetView().GetViewFrame()->GetDispatcher()->Execute(
352 FN_INSERT_REGION
, SFX_CALLMODE_ASYNCHRON
, *pSelectionSet
);
355 if(pSectionSet
&& pSectionSet
->Count() && bSectionChanged
)
357 const SwSection
* pCurrSection
= rWrtShell
.GetCurrSection();
358 const SwSectionFmt
* pFmt
= pCurrSection
->GetFmt();
359 USHORT nNewPos
= rWrtShell
.GetSectionFmtPos( *pFmt
);
360 rWrtShell
.ChgSection( nNewPos
, *pCurrSection
, pSectionSet
);
363 if(pSectionSet
&& pSectionSet
->Count() && bSelSectionChanged
)
365 rWrtShell
.SetSectionAttr( *pSectionSet
);
368 if(pPageSet
&& SFX_ITEM_SET
== pPageSet
->GetItemState(RES_COL
) && bPageChanged
)
370 // aktuellen PageDescriptor ermitteln und damit den Set fuellen
371 const USHORT nCurIdx
= rWrtShell
.GetCurPageDesc();
372 SwPageDesc
aPageDesc(rWrtShell
.GetPageDesc(nCurIdx
));
373 SwFrmFmt
&rFmt
= aPageDesc
.GetMaster();
374 rFmt
.SetFmtAttr(pPageSet
->Get(RES_COL
));
375 rWrtShell
.ChgPageDesc(nCurIdx
, aPageDesc
);
377 if(pFrameSet
&& SFX_ITEM_SET
== pFrameSet
->GetItemState(RES_COL
) && bFrameChanged
)
379 SfxItemSet
aTmp(*pFrameSet
->GetPool(), RES_COL
, RES_COL
);
380 aTmp
.Put(*pFrameSet
);
381 rWrtShell
.StartAction();
383 rWrtShell
.SetFlyFrmAttr( aTmp
);
384 //die Rahmenselektion wieder aufheben
385 if(rWrtShell
.IsFrmSelected())
387 rWrtShell
.UnSelectFrm();
388 rWrtShell
.LeaveSelFrmMode();
391 rWrtShell
.EndAction();
397 /*--------------------------------------------------------------------
399 --------------------------------------------------------------------*/
401 #if OSL_DEBUG_LEVEL < 2
404 USHORT
GetMaxWidth( SwColMgr
* pColMgr
, USHORT nCols
)
406 USHORT nMax
= pColMgr
->GetActualSize();
408 nMax
-= pColMgr
->GetGutterWidth() * nCols
;
412 static USHORT __FAR_DATA aPageRg
[] = {
422 USHORT
lcl_LineWidthToPos(ULONG nWidth
)
424 const USHORT nUShortWidth
= (USHORT
)nWidth
;
425 for(USHORT i
= 0; i
< nLineCount
; ++i
)
426 if(nUShortWidth
== nLines
[i
])
433 void SwColumnPage::ResetColWidth()
437 USHORT nWidth
= GetMaxWidth( pColMgr
, nCols
);
438 nWidth
= nWidth
/ nCols
;
440 for(USHORT i
= 0; i
< nCols
; ++i
)
441 nColWidth
[i
] = (long) nWidth
;
446 /*--------------------------------------------------------------------
447 Beschreibung: Jetzt als TabPage
448 --------------------------------------------------------------------*/
452 SwColumnPage::SwColumnPage(Window
*pParent
, const SfxItemSet
&rSet
)
454 : SfxTabPage(pParent
, SW_RES(TP_COLUMN
), rSet
),
456 aClNrLbl(this, SW_RES(FT_NUMBER
)),
457 aCLNrEdt(this, SW_RES(ED_NUMBER
)),
458 aDefaultVS(this, SW_RES(VS_DEFAULTS
)),
459 aBalanceColsCB(this, SW_RES(CB_BALANCECOLS
)),
460 aFLGroup(this, SW_RES(FL_COLUMNS
)),
462 aBtnUp(this, SW_RES(BTN_DOWN
)),
463 aColumnFT(this, SW_RES(FT_COLUMN
)),
464 aWidthFT(this, SW_RES(FT_WIDTH
)),
465 aDistFT(this, SW_RES(FT_DIST
)),
466 aLbl1(this, SW_RES(FT_1
)),
467 aEd1(this, SW_RES(ED_1
)),
468 aDistEd1(this, SW_RES(ED_DIST1
)),
469 aLbl2(this, SW_RES(FT_2
)),
470 aEd2(this, SW_RES(ED_2
)),
471 aDistEd2(this, SW_RES(ED_DIST2
)),
472 aLbl3(this, SW_RES(FT_3
)),
473 aEd3(this, SW_RES(ED_3
)),
474 aBtnDown(this, SW_RES(BTN_UP
)),
475 aAutoWidthBox(this, SW_RES(CB_AUTO_WIDTH
)),
477 aFLLayout(this, SW_RES(FL_LAYOUT
)),
479 aLineTypeLbl(this, SW_RES(FT_STYLE
)),
480 aLineTypeDLB(this, SW_RES(LB_STYLE
)),
481 aLineHeightLbl(this, SW_RES(FT_HEIGHT
)),
482 aLineHeightEdit(this, SW_RES(ED_HEIGHT
)),
483 aLinePosLbl(this, SW_RES(FT_POSITION
)),
484 aLinePosDLB(this, SW_RES(LB_POSITION
)),
485 aFLLineType(this, SW_RES(FL_LINETYPE
)),
487 aVertFL(this, SW_RES(FL_VERT
)),
488 aPropertiesFL( this, SW_RES( FL_PROPERTIES
)),
489 aTextDirectionFT( this, SW_RES( FT_TEXTDIRECTION
)),
490 aTextDirectionLB( this, SW_RES( LB_TEXTDIRECTION
)),
492 aPgeExampleWN(this, SW_RES(WN_BSP
)),
493 aFrmExampleWN(this, SW_RES(WN_BSP
)),
508 SetExchangeSupport();
510 aDefaultVS
.SetHelpId(HID_COLUMN_VALUESET
);
511 aDefaultVS
.SetColCount( 5 );
512 aDefaultVS
.SetStyle( aDefaultVS
.GetStyle()
516 for( i
= 0; i
< 5; i
++)
517 aDefaultVS
.InsertItem( i
+ 1, i
);
519 aDefaultVS
.SetSelectHdl(LINK(this, SwColumnPage
, SetDefaultsHdl
));
521 // Controls fuer Zusaetzebereich beim MoreButton anmelden
522 Link aCLNrLk
= LINK(this, SwColumnPage
, ColModify
);
523 aCLNrEdt
.SetLoseFocusHdl(aCLNrLk
);
524 aCLNrEdt
.SetUpHdl(aCLNrLk
);
525 aCLNrEdt
.SetDownHdl(aCLNrLk
);
526 Link aLk
= LINK(this, SwColumnPage
, GapModify
);
527 aDistEd1
.SetUpHdl(aLk
);
528 aDistEd1
.SetDownHdl(aLk
);
529 aDistEd1
.SetLoseFocusHdl(aLk
);
530 aDistEd2
.SetUpHdl(aLk
);
531 aDistEd2
.SetDownHdl(aLk
);
532 aDistEd2
.SetLoseFocusHdl(aLk
);
534 aLk
= LINK(this, SwColumnPage
, EdModify
);
537 aEd1
.SetDownHdl(aLk
);
538 aEd1
.SetLoseFocusHdl(aLk
);
541 aEd2
.SetDownHdl(aLk
);
542 aEd2
.SetLoseFocusHdl(aLk
);
545 aEd3
.SetDownHdl(aLk
);
546 aEd3
.SetLoseFocusHdl(aLk
);
548 aBtnUp
.SetClickHdl(LINK(this, SwColumnPage
, Up
));
549 aBtnDown
.SetClickHdl(LINK(this, SwColumnPage
, Down
));
550 aAutoWidthBox
.SetClickHdl(LINK(this, SwColumnPage
, AutoWidthHdl
));
552 aLk
= LINK( this, SwColumnPage
, UpdateColMgr
);
553 aLineTypeDLB
.SetSelectHdl( aLk
);
554 aLineHeightEdit
.SetModifyHdl( aLk
);
555 aLinePosDLB
.SetSelectHdl( aLk
);
558 aLineTypeDLB
.SetUnit( FUNIT_POINT
);
559 aLineTypeDLB
.SetSourceUnit( FUNIT_TWIP
);
560 for( i
= 0; i
< nLineCount
; ++i
)
561 aLineTypeDLB
.InsertEntry( 100 * nLines
[ i
] );
566 SwColumnPage::~SwColumnPage()
571 /*--------------------------------------------------------------------
573 --------------------------------------------------------------------*/
576 void SwColumnPage::SetPageWidth(long nPageWidth
)
578 long nNewMaxWidth
= static_cast< long >(aEd1
.NormalizePercent(nPageWidth
));
580 aDistEd1
.SetMax(nNewMaxWidth
, FUNIT_TWIP
);
581 aDistEd2
.SetMax(nNewMaxWidth
, FUNIT_TWIP
);
582 aEd1
.SetMax(nNewMaxWidth
, FUNIT_TWIP
);
583 aEd2
.SetMax(nNewMaxWidth
, FUNIT_TWIP
);
584 aEd3
.SetMax(nNewMaxWidth
, FUNIT_TWIP
);
587 /*--------------------------------------------------------------------
589 --------------------------------------------------------------------*/
593 void SwColumnPage::Reset(const SfxItemSet
&rSet
)
595 USHORT nHtmlMode
= ::GetHtmlMode((const SwDocShell
*)SfxObjectShell::Current());
596 if(nHtmlMode
& HTMLMODE_ON
)
599 aAutoWidthBox
.Enable(FALSE
);
601 FieldUnit aMetric
= ::GetDfltMetric(bHtmlMode
);
602 SetMetric(aEd1
, aMetric
);
603 SetMetric(aEd2
, aMetric
);
604 SetMetric(aEd3
, aMetric
);
605 SetMetric(aDistEd1
, aMetric
);
606 SetMetric(aDistEd2
, aMetric
);
609 pColMgr
= new SwColMgr(rSet
);
610 nCols
= pColMgr
->GetCount() ;
611 aCLNrEdt
.SetMax(Max((USHORT
)aCLNrEdt
.GetMax(), (USHORT
)nCols
));
612 aCLNrEdt
.SetLast(Max(nCols
,(USHORT
)aCLNrEdt
.GetMax()));
616 if(bFormat
) // hier gibt es keine Size
617 pColMgr
->SetActualWidth(FRAME_FORMAT_WIDTH
);
620 const SwFmtFrmSize
& rSize
= (const SwFmtFrmSize
&)rSet
.Get(RES_FRM_SIZE
);
621 const SvxBoxItem
& rBox
= (const SvxBoxItem
&) rSet
.Get(RES_BOX
);
622 pColMgr
->SetActualWidth((USHORT
)rSize
.GetSize().Width() - rBox
.GetDistance());
625 if(aBalanceColsCB
.IsVisible())
627 const SfxPoolItem
* pItem
;
628 if( SFX_ITEM_SET
== rSet
.GetItemState( RES_COLUMNBALANCE
, FALSE
, &pItem
))
629 aBalanceColsCB
.Check(!((const SwFmtNoBalancedColumns
*)pItem
)->GetValue());
631 aBalanceColsCB
.Check( TRUE
);
635 if( SFX_ITEM_AVAILABLE
<= rSet
.GetItemState( RES_FRAMEDIR
) )
637 const SvxFrameDirectionItem
& rItem
= (const SvxFrameDirectionItem
&)rSet
.Get(RES_FRAMEDIR
);
638 sal_uInt32 nVal
= rItem
.GetValue();
639 USHORT nPos
= aTextDirectionLB
.GetEntryPos( (void*) nVal
);
640 aTextDirectionLB
.SelectEntryPos( nPos
);
641 aTextDirectionLB
.SaveValue();
645 ActivatePage( rSet
);
648 /*--------------------------------------------------------------------
649 Beschreibung: TabPage erzeugen
650 --------------------------------------------------------------------*/
654 SfxTabPage
* SwColumnPage::Create(Window
*pParent
, const SfxItemSet
&rSet
)
656 return new SwColumnPage(pParent
, rSet
);
659 /*--------------------------------------------------------------------
660 Beschreibung: Attribute in den Set stopfen bei OK
661 --------------------------------------------------------------------*/
665 BOOL
SwColumnPage::FillItemSet(SfxItemSet
&rSet
)
667 if(aCLNrEdt
.HasChildPathFocus())
668 aCLNrEdt
.GetDownHdl().Call(&aCLNrEdt
);
670 // Die aktuellen Einstellungen sind
673 const SfxPoolItem
* pOldItem
;
674 const SwFmtCol
& rCol
= pColMgr
->GetColumns();
675 if(0 == (pOldItem
= GetOldItem( rSet
, RES_COL
)) ||
679 if(aBalanceColsCB
.IsVisible() )
681 rSet
.Put(SwFmtNoBalancedColumns(!aBalanceColsCB
.IsChecked() ));
684 if( aTextDirectionLB
.IsVisible() &&
685 ( nPos
= aTextDirectionLB
.GetSelectEntryPos() ) !=
686 aTextDirectionLB
.GetSavedValue() )
688 sal_uInt32 nDirection
= (sal_uInt32
)(sal_IntPtr
)aTextDirectionLB
.GetEntryData( nPos
);
689 rSet
.Put( SvxFrameDirectionItem( (SvxFrameDirection
)nDirection
, RES_FRAMEDIR
));
694 /*--------------------------------------------------------------------
695 Beschreibung: ColumnManager updaten
696 --------------------------------------------------------------------*/
700 IMPL_LINK( SwColumnPage
, UpdateColMgr
, void *, /*pField*/ )
702 long nGutterWidth
= pColMgr
->GetGutterWidth();
705 // Ermitteln, ob die schmalste Spalte zu schmal ist
706 // fuer den eingestellten Spaltenabstand
707 long nMin
= nColWidth
[0];
710 for( i
= 1; i
< nCols
; ++i
)
711 nMin
= Min(nMin
, nColWidth
[i
]);
713 BOOL bAutoWidth
= aAutoWidthBox
.IsChecked();
716 pColMgr
->SetAutoWidth(FALSE
);
717 // falls der Benutzer nicht die Gesamtbreite vergeben hat,
718 // den fehlenden Betrag auf die letzte Spalte addieren.
720 for(i
= 0; i
< nCols
; ++i
)
721 nSum
+= nColWidth
[i
];
723 for(i
= 0; i
< nCols
- 1; ++i
)
724 nGutterWidth
+= nColDist
[i
];
725 nSum
+= nGutterWidth
;
727 long nMaxW
= pColMgr
->GetActualSize();
730 nColWidth
[nCols
- 1] += nMaxW
- nSum
;
732 pColMgr
->SetColWidth( 0, static_cast< USHORT
>(nColWidth
[0] + (USHORT
)nColDist
[0]/2) );
733 for( i
= 1; i
< nCols
-1; ++i
)
735 long nActDist
= (nColDist
[i
] + nColDist
[i
- 1]) / 2;
736 pColMgr
->SetColWidth( i
, (USHORT
)nColWidth
[i
] + (USHORT
)nActDist
);
738 pColMgr
->SetColWidth( nCols
-1, static_cast< USHORT
>(nColWidth
[nCols
-1] + nColDist
[nCols
-2]/2) );
742 // keins ist ausgeschaltet
743 const USHORT nPos
= aLineTypeDLB
.GetSelectEntryPos();
744 BOOL bEnable
= 0 != nPos
;
745 aLineHeightEdit
.Enable( bEnable
);
746 aLineHeightLbl
.Enable( bEnable
);
748 pColMgr
->SetNoLine();
749 else if( LISTBOX_ENTRY_NOTFOUND
!= nPos
)
751 pColMgr
->SetLineWidthAndColor(nLines
[nPos
- 1], Color(COL_BLACK
) );
752 pColMgr
->SetAdjust( SwColLineAdj(
753 aLinePosDLB
.GetSelectEntryPos() + 1) );
754 pColMgr
->SetLineHeightPercent((short)aLineHeightEdit
.GetValue());
755 bEnable
= pColMgr
->GetLineHeightPercent() != 100;
757 aLinePosLbl
.Enable( bEnable
);
758 aLinePosDLB
.Enable( bEnable
);
766 //Maximalwerte setzen
767 aCLNrEdt
.SetMax(Max(1L,
768 Min(long(nMaxCols
), long( pColMgr
->GetActualSize() / (nGutterWidth
+ MINLAY
)) )));
769 aCLNrEdt
.SetLast(aCLNrEdt
.GetMax());
772 //Beispielfenster anregen
777 aFrmExampleWN
.SetColumns( pColMgr
->GetColumns() );
778 aFrmExampleWN
.Invalidate();
781 aPgeExampleWN
.Invalidate();
787 /*------------------------------------------------------------------------
788 Beschreibung: Initialisierung
789 ------------------------------------------------------------------------*/
793 void SwColumnPage::Init()
795 aCLNrEdt
.SetValue(nCols
);
797 BOOL bAutoWidth
= pColMgr
->IsAutoWidth() || bHtmlMode
;
798 aAutoWidthBox
.Check( bAutoWidth
);
800 sal_Int32 nColumnWidthSum
= 0;
801 // Setzen der Breiten
803 for(i
= 0; i
< nCols
; ++i
)
805 nColWidth
[i
] = pColMgr
->GetColWidth(i
);
806 nColumnWidthSum
+= nColWidth
[i
];
808 nColDist
[i
] = pColMgr
->GetGutterWidth(i
);
813 // #97495# make sure that the automatic column widht's are always equal
816 nColumnWidthSum
/= nCols
;
817 for(i
= 0; i
< nCols
; ++i
)
818 nColWidth
[i
] = nColumnWidthSum
;
820 SwColLineAdj eAdj
= pColMgr
->GetAdjust();
821 if( COLADJ_NONE
== eAdj
) // der Dialog kennt kein NONE!
824 //ohne Adjust auch kein Linientyp
825 aLineTypeDLB
.SelectEntryPos( 0 );
826 aLineHeightEdit
.SetValue( 100 );
830 aLineTypeDLB
.SelectEntryPos( lcl_LineWidthToPos(( pColMgr
->GetLineWidth() )) + 1);
831 aLineHeightEdit
.SetValue( pColMgr
->GetLineHeightPercent() );
833 aLinePosDLB
.SelectEntryPos( static_cast< USHORT
>(eAdj
- 1) );
837 aLinePosDLB
.SelectEntryPos( 0 );
838 aLineTypeDLB
.SelectEntryPos( 0 );
839 aLineHeightEdit
.SetValue( 100 );
845 // Maximale Spaltenzahl setzen
846 // Werte kleiner als 1 sind nicht erlaubt
847 aCLNrEdt
.SetMax(Max(1L,
848 Min(long(nMaxCols
), long( pColMgr
->GetActualSize() / nMinWidth
) )));
851 /*------------------------------------------------------------------------
852 Beschreibung: Die Anzahl der Spalten hat sich veraendert -- hier werden
853 die Controls fuer die Bearbeitung der Spalten entsprechend
854 der Spaltenzahl en- oder disabled.
855 Falls es mehr als nVisCols (= 3) Spalten gibt, werden
856 alle Edit enabled und die Buttons fuer das Scrollen
858 Andernfalls werden die Edits jeweils fuer die entsprechenden
859 Spaltenzahl enabled; eine Spalte kann nicht bearbeitet werden.
860 ------------------------------------------------------------------------*/
864 void SwColumnPage::UpdateCols()
866 BOOL bEnableBtns
= FALSE
;
867 BOOL bEnable12
= FALSE
;
868 BOOL bEnable3
= FALSE
;
869 const BOOL bEdit
= !aAutoWidthBox
.IsChecked();
870 if ( nCols
> nVisCols
)
872 bEnableBtns
= TRUE
&& !bHtmlMode
;
873 bEnable12
= bEnable3
= bEdit
;
877 // hier gibt es absichtlich kaum noch breaks
880 case 3: bEnable3
= TRUE
;
881 case 2: bEnable12
= TRUE
; break;
882 default: /* do nothing */;
885 aEd1
.Enable( bEnable12
);
886 aDistEd1
.Enable(nCols
> 1);
887 aEd2
.Enable( bEnable12
);
888 aDistEd2
.Enable(bEnable3
);
889 aEd3
.Enable( bEnable3
);
890 aLbl1
.Enable(bEnable12
);
891 aLbl2
.Enable(bEnable12
);
892 aLbl3
.Enable(bEnable3
);
893 aBtnUp
.Enable( bEnableBtns
);
894 aBtnDown
.Enable( bEnableBtns
);
896 const BOOL bEnable
= nCols
> 1;
899 aLinePosDLB
.Enable( FALSE
);
900 aLinePosLbl
.Enable( FALSE
);
902 aLineHeightEdit
.Enable( bEnable
);
903 aLineHeightLbl
.Enable( bEnable
);
904 aLineTypeDLB
.Enable( bEnable
);
905 aLineTypeLbl
.Enable( bEnable
);
906 aAutoWidthBox
.Enable( bEnable
&& !bHtmlMode
);
909 void SwColumnPage::SetLabels( USHORT nVis
)
913 String
sLbl2( String::CreateFromInt32( nVis
+ 1 ));
914 sLbl2
.Insert(sLbl
, sLbl2
.Len() - 1);
915 aLbl1
.SetText(sLbl2
);
917 sLbl2
= String::CreateFromInt32( nVis
+ 2 );
918 sLbl2
.Insert(sLbl
, sLbl2
.Len() - 1);
919 aLbl2
.SetText(sLbl2
);
921 sLbl2
= String::CreateFromInt32( nVis
+ 3 );
922 sLbl2
.Insert(sLbl
, sLbl2
.Len() - 1);
923 aLbl3
.SetText(sLbl2
);
926 /*------------------------------------------------------------------------
927 Beschreibung: Handler, der bei einer Veraenderung der Spaltenzahl
929 Eine Aenderung der Spaltenzahl ueberschreibt eventuelle
930 Breiteneinstellungen des Benutzers; alle Spalten sind
932 ------------------------------------------------------------------------*/
934 IMPL_LINK( SwColumnPage
, ColModify
, NumericField
*, pNF
)
936 nCols
= (USHORT
)aCLNrEdt
.GetValue();
937 //#107890# the handler is also called from LoseFocus()
938 //then no change has been made and thus no action should be taken
939 // #i17816# changing the displayed types within the ValueSet
940 //from two columns to two columns with different settings doesn't invalidate the
941 // example windows in ::ColModify()
942 if(!pNF
||(pColMgr
->GetCount() != nCols
))
945 aDefaultVS
.SetNoSelection();
946 long nDist
= static_cast< long >(aDistEd1
.DenormalizePercent(aDistEd1
.GetValue(FUNIT_TWIP
)));
947 pColMgr
->SetCount(nCols
, (USHORT
)nDist
);
948 for(USHORT i
= 0; i
< nCols
; i
++)
951 SetLabels( nFirstVis
);
960 /*------------------------------------------------------------------------
961 Beschreibung: Modify- Handler fuer eine Aenderung der Spaltenbreite
962 oder des Spaltenabstandes.
963 Diese Aenderungen wirken sich erst zeitversetzt aus.
964 Durch eine Aenderung der Spaltenbreite wird die automatische
965 Berechnung der Spaltenbreite ausser Kraft gesetzt; erst
966 eine Aenderung der Spaltenzahl kehrt wieder zu diesem
968 ------------------------------------------------------------------------*/
972 IMPL_LINK( SwColumnPage
, GapModify
, PercentField
*, pFld
)
974 long nActValue
= static_cast< long >(pFld
->DenormalizePercent(pFld
->GetValue(FUNIT_TWIP
)));
977 if(aAutoWidthBox
.IsChecked())
979 USHORT nMaxGap
= pColMgr
->GetActualSize() - nCols
* MINLAY
;
980 DBG_ASSERT(nCols
, "Abstand kann nicht ohne Spalten eingestellt werden");
981 nMaxGap
/= nCols
- 1;
982 if(nActValue
> nMaxGap
)
985 aDistEd1
.SetPrcntValue(aDistEd1
.NormalizePercent(nMaxGap
), FUNIT_TWIP
);
987 pColMgr
->SetGutterWidth((USHORT
)nActValue
);
988 for(USHORT i
= 0; i
< nCols
; i
++)
989 nColDist
[i
] = nActValue
;
998 if(pFld
== &aDistEd2
)
1002 long nDiff
= nActValue
- nColDist
[nFirstVis
+ nOffset
];
1005 long nLeft
= nColWidth
[nFirstVis
+ nOffset
];
1006 long nRight
= nColWidth
[nFirstVis
+ nOffset
+ 1];
1007 if(nLeft
+ nRight
+ 2 * MINLAY
< nDiff
)
1008 nDiff
= nLeft
+ nRight
- 2 * MINLAY
;
1009 if(nDiff
< nRight
- MINLAY
)
1015 long nTemp
= nDiff
- nRight
+ MINLAY
;
1017 if(nLeft
> nTemp
- MINLAY
)
1024 nTemp
-= nLeft
+ MINLAY
;
1029 nColWidth
[nFirstVis
+ nOffset
] = nLeft
;
1030 nColWidth
[nFirstVis
+ nOffset
+ 1] = nRight
;
1031 nColDist
[nFirstVis
+ nOffset
] += nDiff
;
1033 pColMgr
->SetColWidth( nFirstVis
+ nOffset
, USHORT(nLeft
) );
1034 pColMgr
->SetColWidth( nFirstVis
+ nOffset
+ 1, USHORT(nRight
) );
1035 pColMgr
->SetGutterWidth( USHORT(nColDist
[nFirstVis
+ nOffset
]), nFirstVis
+ nOffset
);
1043 /*------------------------------------------------------------------------
1045 ------------------------------------------------------------------------*/
1049 IMPL_LINK( SwColumnPage
, EdModify
, PercentField
*, pField
)
1051 pModifiedField
= pField
;
1055 /*------------------------------------------------------------------------
1056 Beschreibung: Handler hinter der Checkbox fuer automatische Breite.
1057 Ist die Box gecheckt, koennen keine expliziten Werte
1058 fuer die Spaltenbreite eingegeben werden.
1059 ------------------------------------------------------------------------*/
1063 IMPL_LINK( SwColumnPage
, AutoWidthHdl
, CheckBox
*, pBox
)
1065 long nDist
= static_cast< long >(aDistEd1
.DenormalizePercent(aDistEd1
.GetValue(FUNIT_TWIP
)));
1066 pColMgr
->SetCount(nCols
, (USHORT
)nDist
);
1067 for(USHORT i
= 0; i
< nCols
; i
++)
1068 nColDist
[i
] = nDist
;
1069 if(pBox
->IsChecked())
1071 pColMgr
->SetGutterWidth(USHORT(nDist
));
1074 pColMgr
->SetAutoWidth(pBox
->IsChecked(), USHORT(nDist
));
1080 /*------------------------------------------------------------------------
1081 Beschreibung: Raufscrollen der Inhalte der Edits.
1082 ------------------------------------------------------------------------*/
1084 IMPL_LINK( SwColumnPage
, Up
, Button
*, EMPTYARG
)
1089 SetLabels( nFirstVis
);
1094 /*------------------------------------------------------------------------
1095 Beschreibung: Runterscrollen der Inhalte der Edits.
1096 ------------------------------------------------------------------------*/
1098 IMPL_LINK( SwColumnPage
, Down
, Button
*, EMPTYARG
)
1100 if( nFirstVis
+ nVisCols
< nCols
)
1103 SetLabels( nFirstVis
);
1108 /*------------------------------------------------------------------------
1109 Beschreibung: Relikt aus alten Zeiten - jetzt direkt ohne time
1110 * Timer- Handler; angetriggert durch eine Aenderung der
1111 Spaltenbreite oder des Spaltenabstandes.
1112 ------------------------------------------------------------------------*/
1114 IMPL_LINK( SwColumnPage
, Timeout
, Timer
*, EMPTYARG
)
1116 DBG_PROFSTART(columnhdl
) ;
1119 // Finden der veraenderten Spalte
1120 USHORT nChanged
= nFirstVis
;
1121 if(pModifiedField
== &aEd2
)
1123 else if(pModifiedField
== &aEd3
)
1125 /*else if(pModifiedField == &aEd4)
1128 long nNewWidth
= (USHORT
)
1129 pModifiedField
->DenormalizePercent(pModifiedField
->GetValue(FUNIT_TWIP
));
1130 long nDiff
= nNewWidth
- nColWidth
[nChanged
];
1132 // wenn es die letzte Spalte ist
1133 if(nChanged
== nCols
- 1)
1135 nColWidth
[0] -= nDiff
;
1136 if(nColWidth
[0] < (long)nMinWidth
)
1138 nNewWidth
-= nMinWidth
- nColWidth
[0];
1139 nColWidth
[0] = nMinWidth
;
1145 nColWidth
[nChanged
+ 1] -= nDiff
;
1146 if(nColWidth
[nChanged
+ 1] < (long) nMinWidth
)
1148 nNewWidth
-= nMinWidth
- nColWidth
[nChanged
+ 1];
1149 nColWidth
[nChanged
+ 1] = nMinWidth
;
1152 nColWidth
[nChanged
] = nNewWidth
;
1156 DBG_PROFSTOP(columnhdl
) ;
1159 /*------------------------------------------------------------------------
1160 Beschreibung: Aktualisierung der Anzeige
1161 ------------------------------------------------------------------------*/
1165 void SwColumnPage::Update()
1167 aBalanceColsCB
.Enable(nCols
> 1);
1170 aEd1
.SetPrcntValue(aEd1
.NormalizePercent(nColWidth
[nFirstVis
]), FUNIT_TWIP
);
1171 aDistEd1
.SetPrcntValue(aDistEd1
.NormalizePercent(nColDist
[nFirstVis
]), FUNIT_TWIP
);
1172 aEd2
.SetPrcntValue(aEd2
.NormalizePercent(nColWidth
[nFirstVis
+ 1]), FUNIT_TWIP
);
1175 aDistEd2
.SetPrcntValue(aDistEd2
.NormalizePercent(nColDist
[nFirstVis
+ 1]), FUNIT_TWIP
);
1176 aEd3
.SetPrcntValue(aEd3
.NormalizePercent(nColWidth
[nFirstVis
+ 2]), FUNIT_TWIP
);
1180 aEd3
.SetText(aEmptyStr
);
1181 aDistEd2
.SetText(aEmptyStr
);
1186 aEd1
.SetText(aEmptyStr
);
1187 aEd2
.SetText(aEmptyStr
);
1188 aEd3
.SetText(aEmptyStr
);
1189 aDistEd1
.SetText(aEmptyStr
);
1190 aDistEd2
.SetText(aEmptyStr
);
1195 /*--------------------------------------------------------------------
1196 Beschreibung: Update Bsp
1197 --------------------------------------------------------------------*/
1201 void SwColumnPage::ActivatePage(const SfxItemSet
& rSet
)
1205 if( SFX_ITEM_SET
== rSet
.GetItemState( SID_ATTR_PAGE_SIZE
))
1207 const SvxSizeItem
& rSize
= (const SvxSizeItem
&)rSet
.Get(
1208 SID_ATTR_PAGE_SIZE
);
1209 const SvxLRSpaceItem
& rLRSpace
= (const SvxLRSpaceItem
&)rSet
.Get(
1211 const SvxBoxItem
& rBox
= (const SvxBoxItem
&) rSet
.Get(RES_BOX
);
1212 USHORT nActWidth
= static_cast< USHORT
>(rSize
.GetSize().Width()
1213 - rLRSpace
.GetLeft() - rLRSpace
.GetRight() - rBox
.GetDistance());
1215 if( pColMgr
->GetActualSize() != nActWidth
)
1217 pColMgr
->SetActualWidth(nActWidth
);
1222 aFrmExampleWN
.Hide();
1223 aPgeExampleWN
.UpdateExample( rSet
, pColMgr
);
1224 aPgeExampleWN
.Show();
1229 aPgeExampleWN
.Hide();
1230 aFrmExampleWN
.Show();
1233 const SwFmtFrmSize
& rSize
= (const SwFmtFrmSize
&)rSet
.Get(RES_FRM_SIZE
);
1234 const SvxBoxItem
& rBox
= (const SvxBoxItem
&) rSet
.Get(RES_BOX
);
1236 long nDistance
= rBox
.GetDistance();
1237 const USHORT nTotalWish
= bFormat
? FRAME_FORMAT_WIDTH
: USHORT(rSize
.GetWidth() - 2 * nDistance
);
1239 // Maximalwerte der Spaltenbreiten setzen
1240 SetPageWidth(nTotalWish
);
1242 if(pColMgr
->GetActualSize() != nTotalWish
)
1244 pColMgr
->SetActualWidth(nTotalWish
);
1248 // im Rahmenformat nur relative Angaben
1249 if ( bFormat
|| (rSize
.GetWidthPercent() && rSize
.GetWidthPercent() != 0xff) )
1251 // Wert fuer 100% setzen
1252 aEd1
.SetRefValue(nTotalWish
);
1253 aEd2
.SetRefValue(nTotalWish
);
1254 aEd3
.SetRefValue(nTotalWish
);
1255 aDistEd1
.SetRefValue(nTotalWish
);
1256 aDistEd2
.SetRefValue(nTotalWish
);
1258 // Auf %-Darstellung umschalten
1264 aEd1
.ShowPercent(bPercent
);
1265 aEd2
.ShowPercent(bPercent
);
1266 aEd3
.ShowPercent(bPercent
);
1267 aDistEd1
.ShowPercent(bPercent
);
1268 aDistEd2
.ShowPercent(bPercent
);
1269 aDistEd1
.MetricField::SetMin(0);
1270 aDistEd2
.MetricField::SetMin(0);
1275 /*--------------------------------------------------------------------
1277 --------------------------------------------------------------------*/
1281 int SwColumnPage::DeactivatePage(SfxItemSet
*_pSet
)
1284 FillItemSet(*_pSet
);
1291 USHORT
* SwColumnPage::GetRanges()
1296 /*--------------------------------------------------------------------
1298 --------------------------------------------------------------------*/
1302 IMPL_LINK( SwColumnPage
, SetDefaultsHdl
, ValueSet
*, pVS
)
1304 USHORT nItem
= pVS
->GetSelectItemId();
1307 aCLNrEdt
.SetValue( nItem
);
1308 aAutoWidthBox
.Check();
1309 aDistEd1
.SetPrcntValue(0);
1315 aCLNrEdt
.SetValue( 2 );
1316 aAutoWidthBox
.Check(FALSE
);
1317 aDistEd1
.SetPrcntValue(0);
1319 // jetzt noch das Breitenverhaeltnisse auf 2 : 1 bzw. 1 : 2 stellen
1320 USHORT nSmall
= pColMgr
->GetActualSize() / 3;
1323 aEd2
.SetPrcntValue(aEd2
.NormalizePercent(long(nSmall
)), FUNIT_TWIP
);
1324 pModifiedField
= &aEd2
;
1328 aEd1
.SetPrcntValue(aEd1
.NormalizePercent(long(nSmall
)), FUNIT_TWIP
);
1329 pModifiedField
= &aEd1
;
1331 bLockUpdate
= FALSE
;
1338 /*-----------------25.10.96 11.41-------------------
1340 --------------------------------------------------*/
1343 void SwColumnPage::SetFrmMode(BOOL bMod
)
1347 /* -----------------------------2002/06/19 13:08------------------------------
1349 ---------------------------------------------------------------------------*/
1350 void SwColumnPage::SetInSection(BOOL bSet
)
1352 if(!SW_MOD()->GetCTLOptions().IsCTLFontEnabled())
1356 aPropertiesFL
.Show(bSet
);
1357 aTextDirectionFT
.Show(bSet
);
1358 aTextDirectionLB
.Show(bSet
);
1361 //resize line type FixedLine
1362 Point aLtPos
= aFLLineType
.GetPosPixel();
1363 Point aPropPos
= aPropertiesFL
.GetPosPixel();
1364 Size aSz
= aFLLineType
.GetSizePixel();
1365 aSz
.Width() = aPropPos
.X() - aLtPos
.X() - LogicToPixel(Size(8, 8), MAP_APPFONT
).Width();
1366 aFLLineType
.SetSizePixel(aSz
);
1370 Size aSz
= aFLLineType
.GetSizePixel();
1371 aSz
.Width() = LogicToPixel(Size(248, 248), MAP_APPFONT
).Width();
1372 aFLLineType
.SetSizePixel(aSz
);
1376 /*-----------------07.03.97 08.33-------------------
1378 --------------------------------------------------*/
1381 void ColumnValueSet::UserDraw( const UserDrawEvent
& rUDEvt
)
1383 OutputDevice
* pDev
= rUDEvt
.GetDevice();
1384 const StyleSettings
& rStyleSettings
= GetSettings().GetStyleSettings();
1386 Rectangle aRect
= rUDEvt
.GetRect();
1387 USHORT nItemId
= rUDEvt
.GetItemId();
1388 long nRectWidth
= aRect
.GetWidth();
1389 long nRectHeight
= aRect
.GetHeight();
1391 Point aBLPos
= aRect
.TopLeft();
1392 Color
aFillColor(pDev
->GetFillColor());
1393 Color
aLineColor(pDev
->GetLineColor());
1394 pDev
->SetFillColor(rStyleSettings
.GetFieldColor());
1395 pDev
->SetLineColor(SwViewOption::GetFontColor());
1397 long nStep
= Abs(Abs(nRectHeight
* 95 /100) / 11);
1398 long nTop
= (nRectHeight
- 11 * nStep
) / 2;
1402 nStarts
[0] = nRectWidth
* 10 / 100;
1406 nEnds
[0] = nRectWidth
* 9 / 10;
1410 nEnds
[0] = nRectWidth
* 45 / 100;
1411 nStarts
[1] = nEnds
[0] + nStep
;
1412 nEnds
[1] = nRectWidth
* 9 / 10;
1415 nEnds
[0] = nRectWidth
* 30 / 100;
1416 nStarts
[1] = nEnds
[0] + nStep
;
1417 nEnds
[1] = nRectWidth
* 63 / 100;
1418 nStarts
[2] = nEnds
[1] + nStep
;
1419 nEnds
[2] = nRectWidth
* 9 / 10;
1422 nEnds
[0] = nRectWidth
* 63 / 100;
1423 nStarts
[1] = nEnds
[0] + nStep
;
1424 nEnds
[1] = nRectWidth
* 9 / 10;
1427 nEnds
[0] = nRectWidth
* 30 / 100;
1428 nStarts
[1] = nEnds
[0] + nStep
;
1429 nEnds
[1] = nRectWidth
* 9 / 10;
1432 for(USHORT j
= 0; j
< nCols
; j
++ )
1434 Point
aStart(aBLPos
.X() + nStarts
[j
], 0);
1435 Point
aEnd(aBLPos
.X() + nEnds
[j
], 0);
1436 for( USHORT i
= 0; i
< 12; i
++)
1438 aStart
.Y() = aEnd
.Y() = aBLPos
.Y() + nTop
+ i
* nStep
;
1439 pDev
->DrawLine(aStart
, aEnd
);
1442 pDev
->SetFillColor(aFillColor
);
1443 pDev
->SetLineColor(aLineColor
);
1446 /*-----------------07.03.97 08.48-------------------
1448 --------------------------------------------------*/
1450 ColumnValueSet::~ColumnValueSet()
1453 /* -----------------------------02.04.2002 16:01------------------------------
1455 ---------------------------------------------------------------------------*/
1456 void ColumnValueSet::DataChanged( const DataChangedEvent
& rDCEvt
)
1458 if ( (rDCEvt
.GetType() == DATACHANGED_SETTINGS
) &&
1459 (rDCEvt
.GetFlags() & SETTINGS_STYLE
) )
1463 ValueSet::DataChanged( rDCEvt
);