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.hxx,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 ************************************************************************/
35 #ifndef _FIXED_HXX //autogen
36 #include <vcl/fixed.hxx>
38 #ifndef _FIELD_HXX //autogen
39 #include <vcl/field.hxx>
41 #ifndef _IMAGE_HXX //autogen
42 #include <vcl/image.hxx>
44 #ifndef _GROUP_HXX //autogen
45 #include <vcl/group.hxx>
47 #ifndef _LSTBOX_HXX //autogen
48 #include <vcl/lstbox.hxx>
50 #ifndef _BUTTON_HXX //autogen
51 #include <vcl/button.hxx>
53 #include <vcl/timer.hxx>
54 #ifndef _IMAGEBTN_HXX //autogen
55 #include <vcl/imagebtn.hxx>
57 #include <svtools/ctrlbox.hxx>
58 #include <svtools/valueset.hxx>
59 #include <sfx2/basedlgs.hxx>
60 #include <sfx2/tabdlg.hxx>
61 #include <fmtclbl.hxx>
63 #include <prcntfld.hxx>
65 const int nMaxCols
= 99;
69 /*--------------------------------------------------------------------
71 --------------------------------------------------------------------*/
73 class SwColumnDlg
: public SfxModalDialog
82 SwWrtShell
& rWrtShell
;
83 SwColumnPage
* pTabPage
;
85 SfxItemSet
* pSectionSet
;
86 SfxItemSet
* pSelectionSet
;
87 SfxItemSet
* pFrameSet
;
93 BOOL bPageChanged
: 1;
94 BOOL bSectionChanged
: 1;
95 BOOL bSelSectionChanged
: 1;
96 BOOL bFrameChanged
: 1;
99 DECL_LINK(ObjectHdl
, ListBox
*);
100 DECL_LINK(OkHdl
, OKButton
*);
103 SwColumnDlg(Window
* pParent
, SwWrtShell
& rSh
);
104 virtual ~SwColumnDlg();
106 SwWrtShell
& GetWrtShell() { return rWrtShell
; }
109 /*-----------------07.03.97 08.26-------------------
111 --------------------------------------------------*/
112 class ColumnValueSet
: public ValueSet
115 ColumnValueSet(Window
* pParent
, const ResId
& rResId
) :
116 ValueSet(pParent
, rResId
){}
119 virtual void UserDraw( const UserDrawEvent
& rUDEvt
);
120 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
123 /*--------------------------------------------------------------------
124 Beschreibung: Spaltendialog jetzt als TabPage
125 --------------------------------------------------------------------*/
126 class SwColumnPage
: public SfxTabPage
129 NumericField aCLNrEdt
;
130 ColumnValueSet aDefaultVS
;
131 ImageList aPreColsIL
;
132 CheckBox aBalanceColsCB
;
141 PercentField aDistEd1
;
144 PercentField aDistEd2
;
147 ImageButton aBtnDown
;
148 CheckBox aAutoWidthBox
;
152 FixedText aLineTypeLbl
;
153 LineListBox aLineTypeDLB
;
154 FixedText aLineHeightLbl
;
155 MetricField aLineHeightEdit
;
156 FixedText aLinePosLbl
;
158 FixedLine aFLLineType
;
161 FixedLine aPropertiesFL
;
162 FixedText aTextDirectionFT
;
163 ListBox aTextDirectionLB
;
166 SwColExample aPgeExampleWN
;
167 SwColumnOnlyExample aFrmExampleWN
;
173 long nColWidth
[nMaxCols
];
174 long nColDist
[nMaxCols
];
176 PercentField
*pModifiedField
;
183 DECL_LINK( ColModify
, NumericField
* );
184 DECL_LINK( GapModify
, PercentField
* );
185 DECL_LINK( EdModify
, PercentField
* );
186 DECL_LINK( AutoWidthHdl
, CheckBox
* );
187 DECL_LINK( Timeout
, Timer
* );
188 DECL_LINK( SetDefaultsHdl
, ValueSet
* );
190 DECL_LINK( Up
, Button
* );
191 DECL_LINK( Down
, Button
* );
192 void Apply(Button
*);
193 DECL_LINK( UpdateColMgr
, void* );
198 void ResetColWidth();
199 void SetLabels( USHORT nVis
);
201 using SfxTabPage::ActivatePage
;
202 using SfxTabPage::DeactivatePage
;
204 virtual void ActivatePage(const SfxItemSet
& rSet
);
205 virtual int DeactivatePage(SfxItemSet
*pSet
);
207 SwColumnPage(Window
*pParent
, const SfxItemSet
&rSet
);
210 virtual ~SwColumnPage();
212 static SfxTabPage
*Create(Window
*pParent
, const SfxItemSet
&rSet
);
213 static USHORT
* GetRanges();
215 virtual BOOL
FillItemSet(SfxItemSet
&rSet
);
216 virtual void Reset(const SfxItemSet
&rSet
);
218 void SetFrmMode(BOOL bMod
);
219 void SetPageWidth(long nPageWidth
);
221 void SetFormatUsed(BOOL bFmt
) { bFormat
= bFmt
; }
223 void ShowBalance(BOOL bShow
) {aBalanceColsCB
.Show(bShow
);}
224 void SetInSection(BOOL bSet
);
226 void ActivateColumnControl() {aCLNrEdt
.GrabFocus();}