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: labfmt.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 "swuilabimp.hxx"
35 #include <vcl/msgbox.hxx>
38 // class SwLabPreview -------------------------------------------------------
40 class SwLabPreview
: public Window
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();}
81 SwLabPreview(const SwLabFmtPage
* pParent
, const ResId
& rResID
);
84 void Update(const SwLabItem
& rItem
);
87 // class SwLabFmtPage -------------------------------------------------------
89 class SwLabFmtPage
: public SfxTabPage
93 SwLabPreview aPreview
;
95 MetricField aHDistField
;
97 MetricField aVDistField
;
99 MetricField aWidthField
;
100 FixedText aHeightText
;
101 MetricField aHeightField
;
103 MetricField aLeftField
;
104 FixedText aUpperText
;
105 MetricField aUpperField
;
107 NumericField aColsField
;
109 NumericField aRowsField
;
117 SwLabFmtPage(Window
* pParent
, const SfxItemSet
& rSet
);
120 DECL_LINK( ModifyHdl
, Edit
* );
121 DECL_LINK( PreviewHdl
, Timer
* );
122 DECL_LINK( LoseFocusHdl
, Control
* );
123 DECL_LINK( SaveHdl
, PushButton
* );
127 using TabPage::ActivatePage
;
128 using TabPage::DeactivatePage
;
129 using Window::GetParent
;
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
;
155 CancelButton aCancelPB
;
161 SwLabFmtPage
* pLabPage
;
164 DECL_LINK(OkHdl
, OKButton
*);
165 DECL_LINK(ModifyHdl
, Edit
*);
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
);