Update ooo320-m1
[ooovba.git] / sw / source / ui / envelp / labfmt.hxx
blob35e9639383d228581e31ff9c56732e988b34750e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: labfmt.hxx,v $
10 * $Revision: 1.9 $
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 ************************************************************************/
30 #ifndef _LABFMT_HXX
31 #define _LABFMT_HXX
33 #include "swuilabimp.hxx"
34 #include "labimg.hxx"
35 #include <vcl/msgbox.hxx>
36 class SwLabFmtPage;
38 // class SwLabPreview -------------------------------------------------------
40 class SwLabPreview : public Window
42 long lOutWPix;
43 long lOutHPix;
44 long lOutWPix23;
45 long lOutHPix23;
47 Color aGrayColor;
49 String aHDistStr;
50 String aVDistStr;
51 String aWidthStr;
52 String aHeightStr;
53 String aLeftStr;
54 String aUpperStr;
55 String aColsStr;
56 String aRowsStr;
58 long lHDistWidth;
59 long lVDistWidth;
60 long lHeightWidth;
61 long lLeftWidth;
62 long lUpperWidth;
63 long lColsWidth;
65 long lXWidth;
66 long lXHeight;
68 SwLabItem aItem;
70 void Paint(const Rectangle&);
72 void DrawArrow(const Point& rP1, const Point& rP2, BOOL bArrow);
74 using Window::GetParent;
75 SwLabFmtPage* GetParent() {return (SwLabFmtPage*) Window::GetParent();}
77 using Window::Update;
79 public:
81 SwLabPreview(const SwLabFmtPage* pParent, const ResId& rResID);
82 ~SwLabPreview();
84 void Update(const SwLabItem& rItem);
87 // class SwLabFmtPage -------------------------------------------------------
89 class SwLabFmtPage : public SfxTabPage
91 FixedInfo aMakeFI;
92 FixedInfo aTypeFI;
93 SwLabPreview aPreview;
94 FixedText aHDistText;
95 MetricField aHDistField;
96 FixedText aVDistText;
97 MetricField aVDistField;
98 FixedText aWidthText;
99 MetricField aWidthField;
100 FixedText aHeightText;
101 MetricField aHeightField;
102 FixedText aLeftText;
103 MetricField aLeftField;
104 FixedText aUpperText;
105 MetricField aUpperField;
106 FixedText aColsText;
107 NumericField aColsField;
108 FixedText aRowsText;
109 NumericField aRowsField;
110 PushButton aSavePB;
112 Timer aPreviewTimer;
113 BOOL bModified;
115 SwLabItem aItem;
117 SwLabFmtPage(Window* pParent, const SfxItemSet& rSet);
118 ~SwLabFmtPage();
120 DECL_LINK( ModifyHdl, Edit * );
121 DECL_LINK( PreviewHdl, Timer * );
122 DECL_LINK( LoseFocusHdl, Control * );
123 DECL_LINK( SaveHdl, PushButton* );
125 void ChangeMinMax();
127 using TabPage::ActivatePage;
128 using TabPage::DeactivatePage;
129 using Window::GetParent;
131 public:
133 static SfxTabPage* Create(Window* pParent, const SfxItemSet& rSet);
135 virtual void ActivatePage(const SfxItemSet& rSet);
136 virtual int DeactivatePage(SfxItemSet* pSet = 0);
137 void FillItem(SwLabItem& rItem);
138 virtual BOOL FillItemSet(SfxItemSet& rSet);
139 virtual void Reset(const SfxItemSet& rSet);
141 SwLabDlg* GetParent() {return (SwLabDlg*) SfxTabPage::GetParent()->GetParent();}
143 /* -----------------------------23.01.01 10:26--------------------------------
145 ---------------------------------------------------------------------------*/
146 class SwSaveLabelDlg : public ModalDialog
148 FixedLine aOptionsFL;
149 FixedText aMakeFT;
150 ComboBox aMakeCB;
151 FixedText aTypeFT;
152 Edit aTypeED;
154 OKButton aOKPB;
155 CancelButton aCancelPB;
156 HelpButton aHelpPB;
158 QueryBox aQueryMB;
160 sal_Bool bSuccess;
161 SwLabFmtPage* pLabPage;
162 SwLabRec& rLabRec;
164 DECL_LINK(OkHdl, OKButton*);
165 DECL_LINK(ModifyHdl, Edit*);
167 public:
168 SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec);
170 void SetLabel(const rtl::OUString& rMake, const rtl::OUString& rType)
172 aMakeCB.SetText(String(rMake));
173 aTypeED.SetText(String(rType));
175 sal_Bool GetLabel(SwLabItem& rItem);
177 #endif