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: pggrid.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 ************************************************************************/
33 #include <sfx2/tabdlg.hxx>
36 #include <vcl/field.hxx>
39 #include <vcl/fixed.hxx>
41 #include <svtools/ctrlbox.hxx>
42 /*--------------------------------------------------------------------
43 Description: TabPage Format/(Styles/)Page/Text grid
44 --------------------------------------------------------------------*/
46 class SwTextGridPage
: public SfxTabPage
48 FixedLine aGridTypeFL
;
49 RadioButton aNoGridRB
;
50 RadioButton aLinesGridRB
;
51 RadioButton aCharsGridRB
;
52 CheckBox aSnapToCharsCB
;
54 SwPageGridExample aExampleWN
;
58 FixedText aLinesPerPageFT
;
59 NumericField aLinesPerPageNF
;
60 FixedText aLinesRangeFT
;
62 FixedText aTextSizeFT
;
63 MetricField aTextSizeMF
;
65 FixedText aCharsPerLineFT
;
66 NumericField aCharsPerLineNF
;
67 FixedText aCharsRangeFT
;
69 FixedText aCharWidthFT
;
70 MetricField aCharWidthMF
;
72 FixedText aRubySizeFT
;
73 MetricField aRubySizeMF
;
75 CheckBox aRubyBelowCB
;
82 ColorListBox aColorLB
;
84 Window
* aControls
[20];
86 sal_Int32 m_nRubyUserValue
;
87 sal_Bool m_bRubyUserValue
;
90 sal_Bool m_bSquaredMode
;
91 sal_Bool m_bHRulerChanged
;
92 sal_Bool m_bVRulerChanged
;
94 SwTextGridPage(Window
*pParent
, const SfxItemSet
&rSet
);
97 void UpdatePageSize(const SfxItemSet
& rSet
);
98 void PutGridItem(SfxItemSet
& rSet
);
99 void SetLinesOrCharsRanges(FixedText
& rField
, const sal_Int32 nValue
);
101 DECL_LINK(GridTypeHdl
, RadioButton
*);
102 DECL_LINK(CharorLineChangedHdl
, SpinField
*);
103 DECL_LINK(TextSizeChangedHdl
, SpinField
*);
104 DECL_LINK(GridModifyHdl
, void*);
105 DECL_LINK(DisplayGridHdl
, CheckBox
*);
107 using SfxTabPage::ActivatePage
;
108 using SfxTabPage::DeactivatePage
;
111 static SfxTabPage
*Create(Window
*pParent
, const SfxItemSet
&rSet
);
112 static USHORT
* GetRanges();
114 virtual BOOL
FillItemSet(SfxItemSet
&rSet
);
115 virtual void Reset(const SfxItemSet
&rSet
);
117 virtual void ActivatePage( const SfxItemSet
& rSet
);
118 virtual int DeactivatePage( SfxItemSet
* pSet
= 0 );