12ee96f1cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
32ee96f1cSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
42ee96f1cSAndrew Rist * or more contributor license agreements. See the NOTICE file
52ee96f1cSAndrew Rist * distributed with this work for additional information
62ee96f1cSAndrew Rist * regarding copyright ownership. The ASF licenses this file
72ee96f1cSAndrew Rist * to you under the Apache License, Version 2.0 (the
82ee96f1cSAndrew Rist * "License"); you may not use this file except in compliance
92ee96f1cSAndrew Rist * with the License. You may obtain a copy of the License at
102ee96f1cSAndrew Rist *
112ee96f1cSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
122ee96f1cSAndrew Rist *
132ee96f1cSAndrew Rist * Unless required by applicable law or agreed to in writing,
142ee96f1cSAndrew Rist * software distributed under the License is distributed on an
152ee96f1cSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
162ee96f1cSAndrew Rist * KIND, either express or implied. See the License for the
172ee96f1cSAndrew Rist * specific language governing permissions and limitations
182ee96f1cSAndrew Rist * under the License.
192ee96f1cSAndrew Rist *
202ee96f1cSAndrew Rist *************************************************************/
212ee96f1cSAndrew Rist
222ee96f1cSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_cui.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir // include ---------------------------------------------------------------
28cdf0e10cSrcweir #include <svtools/colorcfg.hxx>
29cdf0e10cSrcweir #include <svtools/extcolorcfg.hxx>
30cdf0e10cSrcweir #include <svtools/headbar.hxx>
31cdf0e10cSrcweir #include <svtools/ctrlbox.hxx>
32cdf0e10cSrcweir #include <vcl/scrbar.hxx>
33cdf0e10cSrcweir #include <svx/xtable.hxx>
34cdf0e10cSrcweir #include <unotools/moduleoptions.hxx>
35cdf0e10cSrcweir #include <unotools/pathoptions.hxx>
36cdf0e10cSrcweir #include <vcl/msgbox.hxx>
37cdf0e10cSrcweir #include <boost/shared_ptr.hpp>
38cdf0e10cSrcweir #include <svx/svxdlg.hxx>
39cdf0e10cSrcweir #include <helpid.hrc>
40cdf0e10cSrcweir #include <dialmgr.hxx>
41cdf0e10cSrcweir #include "optcolor.hxx"
42cdf0e10cSrcweir #include <cuires.hrc>
43cdf0e10cSrcweir #include "optcolor.hrc"
44cdf0e10cSrcweir #include <svx/dlgutil.hxx>
45cdf0e10cSrcweir
46cdf0e10cSrcweir using namespace ::com::sun::star;
47cdf0e10cSrcweir using namespace ::svtools;
48cdf0e10cSrcweir
49cdf0e10cSrcweir #define GROUP_COUNT 7
50cdf0e10cSrcweir #define GROUP_UNKNOWN -1
51cdf0e10cSrcweir #define GROUP_GENERAL 0
52cdf0e10cSrcweir #define GROUP_WRITER 1
53cdf0e10cSrcweir #define GROUP_HTML 2
54cdf0e10cSrcweir #define GROUP_CALC 3
55cdf0e10cSrcweir #define GROUP_DRAW 4
56cdf0e10cSrcweir #define GROUP_BASIC 5
57cdf0e10cSrcweir #define GROUP_SQL 6
58cdf0e10cSrcweir
59195e5723SMathias Bauer const char* aColorLBHids[ColorConfigEntryCount] =
60cdf0e10cSrcweir {
61cdf0e10cSrcweir HID_COLORPAGE_DOCCOLOR_LB,
62cdf0e10cSrcweir HID_COLORPAGE_DOCBOUNDARIES_LB,
63cdf0e10cSrcweir HID_COLORPAGE_APPBACKGROUND_LB,
64cdf0e10cSrcweir HID_COLORPAGE_OBJECTBOUNDARIES_LB,
65cdf0e10cSrcweir HID_COLORPAGE_TABLEBOUNDARIES_LB,
66cdf0e10cSrcweir HID_COLORPAGE_FONTCOLOR_LB,
67cdf0e10cSrcweir HID_COLORPAGE_LINKS_LB,
68cdf0e10cSrcweir HID_COLORPAGE_LINKSVISITED_LB,
69cdf0e10cSrcweir HID_COLORPAGE_ANCHOR_LB,
70cdf0e10cSrcweir HID_COLORPAGE_SPELL_LB,
71195e5723SMathias Bauer HID_COLORPAGE_SMARTTAGS_LB,
72195e5723SMathias Bauer HID_COLORPAGE_WRITERTEXTGRID_LB,
73cdf0e10cSrcweir HID_COLORPAGE_WRITERFIELDSHADINGS_LB,
74cdf0e10cSrcweir HID_COLORPAGE_WRITERIDXSHADINGS_LB,
75cdf0e10cSrcweir HID_COLORPAGE_WRITERDIRECTCURSOR_LB,
76cdf0e10cSrcweir HID_COLORPAGE_WRITERSCRIPTINDICATOR_LB,
77cdf0e10cSrcweir HID_COLORPAGE_WRITERSECTIONBOUNDARIES_LB,
78cdf0e10cSrcweir HID_COLORPAGE_WRITERPAGEBREAKS_LB,
79cdf0e10cSrcweir HID_COLORPAGE_HTMLSGML_LB,
80cdf0e10cSrcweir HID_COLORPAGE_HTMLCOMMENT_LB,
81cdf0e10cSrcweir HID_COLORPAGE_HTMLKEYWORD_LB,
82cdf0e10cSrcweir HID_COLORPAGE_HTMLUNKNOWN_LB,
83cdf0e10cSrcweir HID_COLORPAGE_CALCGRID_LB,
84cdf0e10cSrcweir HID_COLORPAGE_CALCPAGEBREAK_LB,
85cdf0e10cSrcweir HID_COLORPAGE_CALCPAGEBREAKMANUAL_LB,
86cdf0e10cSrcweir HID_COLORPAGE_CALCPAGEBREAKAUTOMATIC_LB,
87cdf0e10cSrcweir HID_COLORPAGE_CALCDETECTIVE_LB,
88cdf0e10cSrcweir HID_COLORPAGE_CALCDETECTIVEERROR_LB,
89cdf0e10cSrcweir HID_COLORPAGE_CALCREFERENCE_LB,
90cdf0e10cSrcweir HID_COLORPAGE_CALCNOTESBACKGROUND_LB,
91cdf0e10cSrcweir HID_COLORPAGE_DRAWGRID_LB,
92cdf0e10cSrcweir HID_COLORPAGE_DRAWDRAWING_LB,
93cdf0e10cSrcweir HID_COLORPAGE_DRAWFILL_LB,
94cdf0e10cSrcweir HID_COLORPAGE_BASICIDENTIFIER_LB,
95cdf0e10cSrcweir HID_COLORPAGE_BASICCOMMENT_LB,
96cdf0e10cSrcweir HID_COLORPAGE_BASICNUMBER_LB,
97cdf0e10cSrcweir HID_COLORPAGE_BASICSTRING_LB,
98cdf0e10cSrcweir HID_COLORPAGE_BASICOPERATOR_LB,
99cdf0e10cSrcweir HID_COLORPAGE_BASICKEYWORD_LB,
100cdf0e10cSrcweir HID_COLORPAGE_BASICERROR_LB
101195e5723SMathias Bauer HID_COLORPAGE_SQLIDENTIFIER_LB,
102195e5723SMathias Bauer HID_COLORPAGE_SQLNUMBER_LB,
103195e5723SMathias Bauer HID_COLORPAGE_SQLSTRING_LB,
104195e5723SMathias Bauer HID_COLORPAGE_SQLOPERATOR_LB,
105195e5723SMathias Bauer HID_COLORPAGE_SQLKEYWORD_LB,
106195e5723SMathias Bauer HID_COLORPAGE_SQLPARAMETER_LB,
107195e5723SMathias Bauer HID_COLORPAGE_SQLCOMMENT_LB
108cdf0e10cSrcweir };
109cdf0e10cSrcweir
110195e5723SMathias Bauer const char* aColorCBHids[ColorConfigEntryCount] =
111cdf0e10cSrcweir {
112cdf0e10cSrcweir HID_COLORPAGE_DOCCOLOR_CB,
113cdf0e10cSrcweir HID_COLORPAGE_DOCBOUNDARIES_CB,
114cdf0e10cSrcweir HID_COLORPAGE_APPBACKGROUND_CB,
115cdf0e10cSrcweir HID_COLORPAGE_OBJECTBOUNDARIES_CB,
116cdf0e10cSrcweir HID_COLORPAGE_TABLEBOUNDARIES_CB,
117cdf0e10cSrcweir HID_COLORPAGE_FONTCOLOR_CB,
118cdf0e10cSrcweir HID_COLORPAGE_LINKS_CB,
119cdf0e10cSrcweir HID_COLORPAGE_LINKSVISITED_CB,
120cdf0e10cSrcweir HID_COLORPAGE_ANCHOR_CB,
121cdf0e10cSrcweir HID_COLORPAGE_SPELL_CB,
122195e5723SMathias Bauer HID_COLORPAGE_SMARTTAGS_CB,
123cdf0e10cSrcweir HID_COLORPAGE_WRITERTEXTGRID_CB,
124cdf0e10cSrcweir HID_COLORPAGE_WRITERFIELDSHADINGS_CB,
125cdf0e10cSrcweir HID_COLORPAGE_WRITERIDXSHADINGS_CB,
126cdf0e10cSrcweir HID_COLORPAGE_WRITERDIRECTCURSOR_CB,
127cdf0e10cSrcweir HID_COLORPAGE_WRITERSCRIPTINDICATOR_CB,
128cdf0e10cSrcweir HID_COLORPAGE_WRITERSECTIONBOUNDARIES_CB,
129cdf0e10cSrcweir HID_COLORPAGE_WRITERPAGEBREAKS_CB,
130cdf0e10cSrcweir HID_COLORPAGE_HTMLSGML_CB,
131cdf0e10cSrcweir HID_COLORPAGE_HTMLCOMMENT_CB,
132cdf0e10cSrcweir HID_COLORPAGE_HTMLKEYWORD_CB,
133cdf0e10cSrcweir HID_COLORPAGE_HTMLUNKNOWN_CB,
134cdf0e10cSrcweir HID_COLORPAGE_CALCGRID_CB,
135cdf0e10cSrcweir HID_COLORPAGE_CALCPAGEBREAK_CB,
136cdf0e10cSrcweir HID_COLORPAGE_CALCPAGEBREAKMANUAL_CB,
137cdf0e10cSrcweir HID_COLORPAGE_CALCPAGEBREAKAUTOMATIC_CB,
138cdf0e10cSrcweir HID_COLORPAGE_CALCDETECTIVE_CB,
139cdf0e10cSrcweir HID_COLORPAGE_CALCDETECTIVEERROR_CB,
140cdf0e10cSrcweir HID_COLORPAGE_CALCREFERENCE_CB,
141cdf0e10cSrcweir HID_COLORPAGE_CALCNOTESBACKGROUND_CB,
142cdf0e10cSrcweir HID_COLORPAGE_DRAWGRID_CB,
143cdf0e10cSrcweir HID_COLORPAGE_DRAWDRAWING_CB,
144cdf0e10cSrcweir HID_COLORPAGE_DRAWFILL_CB,
145cdf0e10cSrcweir HID_COLORPAGE_BASICIDENTIFIER_CB,
146cdf0e10cSrcweir HID_COLORPAGE_BASICCOMMENT_CB,
147cdf0e10cSrcweir HID_COLORPAGE_BASICNUMBER_CB,
148cdf0e10cSrcweir HID_COLORPAGE_BASICSTRING_CB,
149cdf0e10cSrcweir HID_COLORPAGE_BASICOPERATOR_CB,
150cdf0e10cSrcweir HID_COLORPAGE_BASICKEYWORD_CB,
151cdf0e10cSrcweir HID_COLORPAGE_BASICERROR_CB
152195e5723SMathias Bauer HID_COLORPAGE_SQLIDENTIFIER_CB,
153195e5723SMathias Bauer HID_COLORPAGE_SQLNUMBER_CB,
154195e5723SMathias Bauer HID_COLORPAGE_SQLSTRING_CB,
155195e5723SMathias Bauer HID_COLORPAGE_SQLOPERATOR_CB,
156195e5723SMathias Bauer HID_COLORPAGE_SQLKEYWORD_CB,
157195e5723SMathias Bauer HID_COLORPAGE_SQLPARAMETER_CB,
158195e5723SMathias Bauer HID_COLORPAGE_SQLCOMMENT_CB
159cdf0e10cSrcweir };
160cdf0e10cSrcweir
161cdf0e10cSrcweir /* -----------------------------2002/06/26 10:48------------------------------
162cdf0e10cSrcweir
163cdf0e10cSrcweir ---------------------------------------------------------------------------*/
164cdf0e10cSrcweir
165cdf0e10cSrcweir class SvxExtFixedText_Impl : public FixedText
166cdf0e10cSrcweir {
167cdf0e10cSrcweir private:
168cdf0e10cSrcweir long m_nGroupHeight;
169cdf0e10cSrcweir
170cdf0e10cSrcweir protected:
171cdf0e10cSrcweir virtual void DataChanged( const DataChangedEvent& rDCEvt );
172cdf0e10cSrcweir
173cdf0e10cSrcweir public:
SvxExtFixedText_Impl(Window * pParent,const ResId & rResId)174cdf0e10cSrcweir SvxExtFixedText_Impl(Window* pParent, const ResId& rResId) :
175cdf0e10cSrcweir FixedText(pParent, rResId), m_nGroupHeight(0) {}
176cdf0e10cSrcweir
GetGroupHeight()177cdf0e10cSrcweir inline long GetGroupHeight() { return m_nGroupHeight; }
SetGroupHeight(long _nHeight)178cdf0e10cSrcweir inline void SetGroupHeight( long _nHeight ) { m_nGroupHeight = _nHeight; }
179cdf0e10cSrcweir };
180cdf0e10cSrcweir
181cdf0e10cSrcweir /* -----------------------------25.03.2002 15:48------------------------------
182cdf0e10cSrcweir
183cdf0e10cSrcweir ---------------------------------------------------------------------------*/
184cdf0e10cSrcweir class ColorConfigCtrl_Impl;
185cdf0e10cSrcweir class ColorConfigWindow_Impl : public Window
186cdf0e10cSrcweir {
187cdf0e10cSrcweir friend class ColorConfigCtrl_Impl;
188cdf0e10cSrcweir Window aGeneralBackWN;
189cdf0e10cSrcweir SvxExtFixedText_Impl aGeneralFT;
190cdf0e10cSrcweir FixedText aDocColorFT;
191cdf0e10cSrcweir ColorListBox aDocColorLB;
192cdf0e10cSrcweir Window aDocColorWN;
193cdf0e10cSrcweir CheckBox aDocBoundCB;
194cdf0e10cSrcweir ColorListBox aDocBoundLB;
195cdf0e10cSrcweir Window aDocBoundWN;
196cdf0e10cSrcweir FixedText aAppBackFT;
197cdf0e10cSrcweir ColorListBox aAppBackLB;
198cdf0e10cSrcweir Window aAppBackWN;
199cdf0e10cSrcweir CheckBox aObjBoundCB;
200cdf0e10cSrcweir ColorListBox aObjBoundLB;
201cdf0e10cSrcweir Window aObjBoundWN;
202cdf0e10cSrcweir CheckBox aTableBoundCB;
203cdf0e10cSrcweir ColorListBox aTableBoundLB;
204cdf0e10cSrcweir Window aTableBoundWN;
205cdf0e10cSrcweir FixedText aFontColorFT;
206cdf0e10cSrcweir ColorListBox aFontColorLB;
207cdf0e10cSrcweir Window aFontColorWN;
208cdf0e10cSrcweir CheckBox aLinksCB;
209cdf0e10cSrcweir ColorListBox aLinksLB;
210cdf0e10cSrcweir Window aLinksWN;
211cdf0e10cSrcweir CheckBox aLinksVisitedCB;
212cdf0e10cSrcweir ColorListBox aLinksVisitedLB;
213cdf0e10cSrcweir Window aLinksVisitedWN;
214cdf0e10cSrcweir FixedText aSpellFT;
215cdf0e10cSrcweir ColorListBox aSpellLB;
216cdf0e10cSrcweir Window aSpellWN;
217cdf0e10cSrcweir FixedText aSmarttagsFT;
218cdf0e10cSrcweir ColorListBox aSmarttagsLB;
219cdf0e10cSrcweir Window aSmarttagsWN;
220cdf0e10cSrcweir Window aWriterBackWN;
221cdf0e10cSrcweir SvxExtFixedText_Impl aWriterFT;
222cdf0e10cSrcweir FixedText aWrtTextGridFT;
223cdf0e10cSrcweir ColorListBox aWrtTextGridLB;
224cdf0e10cSrcweir Window aWrtTextGridWN;
225cdf0e10cSrcweir CheckBox aWrtFieldCB;
226cdf0e10cSrcweir ColorListBox aWrtFieldLB;
227cdf0e10cSrcweir Window aWrtFieldWN;
228cdf0e10cSrcweir CheckBox aWrtIdxShadingBackCB;
229cdf0e10cSrcweir ColorListBox aWrtIdxShadingBackLB;
230cdf0e10cSrcweir Window aWrtIdxShadingBackWN;
231cdf0e10cSrcweir FixedText aWrtScriptIndicatorFT;
232cdf0e10cSrcweir ColorListBox aWrtScriptIndicatorLB;
233cdf0e10cSrcweir Window aWrtScriptIndicatorWN;
234cdf0e10cSrcweir CheckBox aWrtSectionBoundCB;
235cdf0e10cSrcweir ColorListBox aWrtSectionBoundLB;
236cdf0e10cSrcweir Window aWrtSectionBoundWN;
237cdf0e10cSrcweir FixedText aWrtPageBreaksFT;
238cdf0e10cSrcweir ColorListBox aWrtPageBreaksLB;
239cdf0e10cSrcweir Window aWrtPageBreaksWN;
240cdf0e10cSrcweir FixedText aWrtDirectCrsrFT;
241cdf0e10cSrcweir ColorListBox aWrtDirectCrsrLB;
242cdf0e10cSrcweir Window aWrtDirectCrsrWN;
243cdf0e10cSrcweir Window aHTMLBackWN;
244cdf0e10cSrcweir SvxExtFixedText_Impl aHTMLFT;
245cdf0e10cSrcweir FixedText aHTMLSGMLFT;
246cdf0e10cSrcweir ColorListBox aHTMLSGMLLB;
247cdf0e10cSrcweir Window aHTMLSGMLWN;
248cdf0e10cSrcweir FixedText aHTMLCommentFT;
249cdf0e10cSrcweir ColorListBox aHTMLCommentLB;
250cdf0e10cSrcweir Window aHTMLCommentWN;
251cdf0e10cSrcweir FixedText aHTMLKeywdFT;
252cdf0e10cSrcweir ColorListBox aHTMLKeywdLB;
253cdf0e10cSrcweir Window aHTMLKeywdWN;
254cdf0e10cSrcweir FixedText aHTMLUnknownFT;
255cdf0e10cSrcweir ColorListBox aHTMLUnknownLB;
256cdf0e10cSrcweir Window aHTMLUnknownWN;
257cdf0e10cSrcweir Window aCalcBackWN;
258cdf0e10cSrcweir SvxExtFixedText_Impl aCalcFT;
259cdf0e10cSrcweir FixedText aCalcGridFT;
260cdf0e10cSrcweir ColorListBox aCalcGridLB;
261cdf0e10cSrcweir Window aCalcGridWN;
262cdf0e10cSrcweir FixedText aCalcPageBreakFT;
263cdf0e10cSrcweir ColorListBox aCalcPageBreakLB;
264cdf0e10cSrcweir Window aCalcPageBreakWN;
265cdf0e10cSrcweir FixedText aCalcPageBreakManualFT;
266cdf0e10cSrcweir ColorListBox aCalcPageBreakManualLB;
267cdf0e10cSrcweir Window aCalcPageBreakManualWN;
268cdf0e10cSrcweir FixedText aCalcPageBreakAutoFT;
269cdf0e10cSrcweir ColorListBox aCalcPageBreakAutoLB;
270cdf0e10cSrcweir Window aCalcPageBreakAutoWN;
271cdf0e10cSrcweir FixedText aCalcDetectiveFT;
272cdf0e10cSrcweir ColorListBox aCalcDetectiveLB;
273cdf0e10cSrcweir Window aCalcDetectiveWN;
274cdf0e10cSrcweir FixedText aCalcDetectiveErrorFT;
275cdf0e10cSrcweir ColorListBox aCalcDetectiveErrorLB;
276cdf0e10cSrcweir Window aCalcDetectiveErrorWN;
277cdf0e10cSrcweir FixedText aCalcReferenceFT;
278cdf0e10cSrcweir ColorListBox aCalcReferenceLB;
279cdf0e10cSrcweir Window aCalcReferenceWN;
280cdf0e10cSrcweir FixedText aCalcNotesBackFT;
281cdf0e10cSrcweir ColorListBox aCalcNotesBackLB;
282cdf0e10cSrcweir Window aCalcNotesBackWN;
283cdf0e10cSrcweir Window aDrawBackWN;
284cdf0e10cSrcweir SvxExtFixedText_Impl aDrawFT;
285cdf0e10cSrcweir FixedText aDrawGridFT;
286cdf0e10cSrcweir ColorListBox aDrawGridLB;
287cdf0e10cSrcweir Window aDrawGridWN;
288cdf0e10cSrcweir Window aBasicBackWN;
289cdf0e10cSrcweir SvxExtFixedText_Impl aBasicFT;
290cdf0e10cSrcweir FixedText aBasicIdentifierFT;
291cdf0e10cSrcweir ColorListBox aBasicIdentifierLB;
292cdf0e10cSrcweir Window aBasicIdentifierWN;
293cdf0e10cSrcweir FixedText aBasicCommentFT;
294cdf0e10cSrcweir ColorListBox aBasicCommentLB;
295cdf0e10cSrcweir Window aBasicCommentWN;
296cdf0e10cSrcweir FixedText aBasicNumberFT;
297cdf0e10cSrcweir ColorListBox aBasicNumberLB;
298cdf0e10cSrcweir Window aBasicNumberWN;
299cdf0e10cSrcweir FixedText aBasicStringFT;
300cdf0e10cSrcweir ColorListBox aBasicStringLB;
301cdf0e10cSrcweir Window aBasicStringWN;
302cdf0e10cSrcweir FixedText aBasicOperatorFT;
303cdf0e10cSrcweir ColorListBox aBasicOperatorLB;
304cdf0e10cSrcweir Window aBasicOperatorWN;
305cdf0e10cSrcweir FixedText aBasicKeywordFT;
306cdf0e10cSrcweir ColorListBox aBasicKeywordLB;
307cdf0e10cSrcweir Window aBasicKeywordWN;
308cdf0e10cSrcweir FixedText aBasicErrorFT;
309cdf0e10cSrcweir ColorListBox aBasicErrorLB;
310cdf0e10cSrcweir Window aBasicErrorWN;
311cdf0e10cSrcweir Window aSQLBackWN;
312cdf0e10cSrcweir SvxExtFixedText_Impl aSQLFT;
313cdf0e10cSrcweir FixedText aSQLIdentifierFT;
314cdf0e10cSrcweir ColorListBox aSQLIdentifierLB;
315cdf0e10cSrcweir Window aSQLIdentifierWN;
316cdf0e10cSrcweir FixedText aSQLNumberFT;
317cdf0e10cSrcweir ColorListBox aSQLNumberLB;
318cdf0e10cSrcweir Window aSQLNumberWN;
319cdf0e10cSrcweir FixedText aSQLStringFT;
320cdf0e10cSrcweir ColorListBox aSQLStringLB;
321cdf0e10cSrcweir Window aSQLStringWN;
322cdf0e10cSrcweir FixedText aSQLOperatorFT;
323cdf0e10cSrcweir ColorListBox aSQLOperatorLB;
324cdf0e10cSrcweir Window aSQLOperatorWN;
325cdf0e10cSrcweir FixedText aSQLKeywordFT;
326cdf0e10cSrcweir ColorListBox aSQLKeywordLB;
327cdf0e10cSrcweir Window aSQLKeywordWN;
328cdf0e10cSrcweir FixedText aSQLParameterFT;
329cdf0e10cSrcweir ColorListBox aSQLParameterLB;
330cdf0e10cSrcweir Window aSQLParameterWN;
331cdf0e10cSrcweir FixedText aSQLCommentFT;
332cdf0e10cSrcweir ColorListBox aSQLCommentLB;
333cdf0e10cSrcweir Window aSQLCommentWN;
334cdf0e10cSrcweir
335cdf0e10cSrcweir ::std::vector< SvxExtFixedText_Impl*> aChapters;
336cdf0e10cSrcweir ::std::vector< Window* > aChapterWins;
337cdf0e10cSrcweir ::std::vector< FixedText* > aFixedTexts;
338cdf0e10cSrcweir ::std::vector< CheckBox* > aCheckBoxes;
339cdf0e10cSrcweir ::std::vector< ColorListBox* > aColorBoxes;
340cdf0e10cSrcweir ::std::vector< Window* > aWindows; // [ColorConfigEntryCount]
341cdf0e10cSrcweir ::std::vector< ::boost::shared_ptr<SvxExtFixedText_Impl> > m_aExtensionTitles;
342cdf0e10cSrcweir
343cdf0e10cSrcweir SvtModuleOptions m_aModuleOptions;
344cdf0e10cSrcweir
345cdf0e10cSrcweir void SetNewPosition( sal_Int32 _nFeature, Window* _pWin );
346cdf0e10cSrcweir
347cdf0e10cSrcweir virtual void Command( const CommandEvent& rCEvt );
348cdf0e10cSrcweir virtual void DataChanged( const DataChangedEvent& rDCEvt );
349cdf0e10cSrcweir
350cdf0e10cSrcweir public:
351cdf0e10cSrcweir ColorConfigWindow_Impl(Window* pParent, const ResId& rResId);
352cdf0e10cSrcweir ~ColorConfigWindow_Impl();
353cdf0e10cSrcweir
GetModuleOptions() const354cdf0e10cSrcweir inline const SvtModuleOptions& GetModuleOptions() const { return m_aModuleOptions; }
355cdf0e10cSrcweir };
356cdf0e10cSrcweir
lcl_isGroupVisible(sal_Int32 _nGroup,const SvtModuleOptions & _rModOptions)357cdf0e10cSrcweir sal_Bool lcl_isGroupVisible( sal_Int32 _nGroup, const SvtModuleOptions& _rModOptions )
358cdf0e10cSrcweir {
359cdf0e10cSrcweir sal_Bool bRet = sal_True;
360cdf0e10cSrcweir
361cdf0e10cSrcweir switch ( _nGroup )
362cdf0e10cSrcweir {
363cdf0e10cSrcweir case GROUP_WRITER :
364cdf0e10cSrcweir case GROUP_HTML :
365cdf0e10cSrcweir {
366cdf0e10cSrcweir bRet = _rModOptions.IsModuleInstalled( SvtModuleOptions::E_SWRITER );
367cdf0e10cSrcweir break;
368cdf0e10cSrcweir }
369cdf0e10cSrcweir
370cdf0e10cSrcweir case GROUP_CALC :
371cdf0e10cSrcweir {
372cdf0e10cSrcweir bRet = _rModOptions.IsModuleInstalled( SvtModuleOptions::E_SCALC );
373cdf0e10cSrcweir break;
374cdf0e10cSrcweir }
375cdf0e10cSrcweir
376cdf0e10cSrcweir case GROUP_DRAW :
377cdf0e10cSrcweir {
378cdf0e10cSrcweir bRet = ( _rModOptions.IsModuleInstalled( SvtModuleOptions::E_SDRAW ) ||
379cdf0e10cSrcweir _rModOptions.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS ) );
380cdf0e10cSrcweir break;
381cdf0e10cSrcweir }
382cdf0e10cSrcweir case GROUP_SQL :
383cdf0e10cSrcweir {
384cdf0e10cSrcweir bRet = _rModOptions.IsModuleInstalled( SvtModuleOptions::E_SDATABASE );
385cdf0e10cSrcweir break;
386cdf0e10cSrcweir }
387cdf0e10cSrcweir }
388cdf0e10cSrcweir
389cdf0e10cSrcweir return bRet;
390cdf0e10cSrcweir }
391cdf0e10cSrcweir
lcl_getGroup(sal_Int32 _nFeature)392cdf0e10cSrcweir sal_Int16 lcl_getGroup( sal_Int32 _nFeature )
393cdf0e10cSrcweir {
394cdf0e10cSrcweir if ( _nFeature >= ColorConfigEntryCount )
395cdf0e10cSrcweir return GROUP_COUNT; // feature of an extension
396cdf0e10cSrcweir
397cdf0e10cSrcweir sal_Int16 nRet = GROUP_UNKNOWN;
398cdf0e10cSrcweir
399cdf0e10cSrcweir switch ( _nFeature )
400cdf0e10cSrcweir {
401cdf0e10cSrcweir case DOCCOLOR :
402cdf0e10cSrcweir case DOCBOUNDARIES :
403cdf0e10cSrcweir case APPBACKGROUND :
404cdf0e10cSrcweir case OBJECTBOUNDARIES :
405cdf0e10cSrcweir case TABLEBOUNDARIES :
406cdf0e10cSrcweir case FONTCOLOR :
407cdf0e10cSrcweir case LINKS :
408cdf0e10cSrcweir case LINKSVISITED :
409cdf0e10cSrcweir case ANCHOR :
410cdf0e10cSrcweir case SPELL :
411cdf0e10cSrcweir case SMARTTAGS :
412cdf0e10cSrcweir {
413cdf0e10cSrcweir nRet = GROUP_GENERAL;
414cdf0e10cSrcweir break;
415cdf0e10cSrcweir }
416cdf0e10cSrcweir
417cdf0e10cSrcweir case WRITERTEXTGRID :
418cdf0e10cSrcweir case WRITERFIELDSHADINGS :
419cdf0e10cSrcweir case WRITERIDXSHADINGS :
420cdf0e10cSrcweir case WRITERDIRECTCURSOR :
421cdf0e10cSrcweir case WRITERSCRIPTINDICATOR :
422cdf0e10cSrcweir case WRITERSECTIONBOUNDARIES :
423cdf0e10cSrcweir case WRITERPAGEBREAKS :
424cdf0e10cSrcweir {
425cdf0e10cSrcweir nRet = GROUP_WRITER;
426cdf0e10cSrcweir break;
427cdf0e10cSrcweir }
428cdf0e10cSrcweir
429cdf0e10cSrcweir case HTMLSGML :
430cdf0e10cSrcweir case HTMLCOMMENT :
431cdf0e10cSrcweir case HTMLKEYWORD :
432cdf0e10cSrcweir case HTMLUNKNOWN :
433cdf0e10cSrcweir {
434cdf0e10cSrcweir nRet = GROUP_HTML;
435cdf0e10cSrcweir break;
436cdf0e10cSrcweir }
437cdf0e10cSrcweir
438cdf0e10cSrcweir case CALCGRID :
439cdf0e10cSrcweir case CALCPAGEBREAK :
440cdf0e10cSrcweir case CALCPAGEBREAKMANUAL :
441cdf0e10cSrcweir case CALCPAGEBREAKAUTOMATIC :
442cdf0e10cSrcweir case CALCDETECTIVE :
443cdf0e10cSrcweir case CALCDETECTIVEERROR :
444cdf0e10cSrcweir case CALCREFERENCE :
445cdf0e10cSrcweir case CALCNOTESBACKGROUND :
446cdf0e10cSrcweir {
447cdf0e10cSrcweir nRet = GROUP_CALC;
448cdf0e10cSrcweir break;
449cdf0e10cSrcweir }
450cdf0e10cSrcweir
451cdf0e10cSrcweir case DRAWGRID :
452cdf0e10cSrcweir case DRAWDRAWING :
453cdf0e10cSrcweir case DRAWFILL :
454cdf0e10cSrcweir {
455cdf0e10cSrcweir nRet = GROUP_DRAW;
456cdf0e10cSrcweir break;
457cdf0e10cSrcweir }
458cdf0e10cSrcweir
459cdf0e10cSrcweir case BASICIDENTIFIER :
460cdf0e10cSrcweir case BASICCOMMENT :
461cdf0e10cSrcweir case BASICNUMBER :
462cdf0e10cSrcweir case BASICSTRING :
463cdf0e10cSrcweir case BASICOPERATOR :
464cdf0e10cSrcweir case BASICKEYWORD :
465cdf0e10cSrcweir case BASICERROR :
466cdf0e10cSrcweir {
467cdf0e10cSrcweir nRet = GROUP_BASIC;
468cdf0e10cSrcweir break;
469cdf0e10cSrcweir }
470cdf0e10cSrcweir case SQLIDENTIFIER :
471cdf0e10cSrcweir case SQLNUMBER:
472cdf0e10cSrcweir case SQLSTRING:
473cdf0e10cSrcweir case SQLOPERATOR:
474cdf0e10cSrcweir case SQLKEYWORD:
475cdf0e10cSrcweir case SQLPARAMETER:
476cdf0e10cSrcweir case SQLCOMMENT:
477cdf0e10cSrcweir {
478cdf0e10cSrcweir nRet = GROUP_SQL;
479cdf0e10cSrcweir break;
480cdf0e10cSrcweir }
481cdf0e10cSrcweir }
482cdf0e10cSrcweir return nRet;
483cdf0e10cSrcweir }
484cdf0e10cSrcweir
485cdf0e10cSrcweir /* -----------------------------25.03.2002 17:05------------------------------
486cdf0e10cSrcweir
487cdf0e10cSrcweir ---------------------------------------------------------------------------*/
ColorConfigWindow_Impl(Window * pParent,const ResId & rResId)488cdf0e10cSrcweir ColorConfigWindow_Impl::ColorConfigWindow_Impl(Window* pParent, const ResId& rResId) :
489cdf0e10cSrcweir Window(pParent, rResId),
490cdf0e10cSrcweir aGeneralBackWN(this),
491cdf0e10cSrcweir aGeneralFT(&aGeneralBackWN, ResId( FT_GENERAL, *rResId.GetResMgr() )),
492cdf0e10cSrcweir aDocColorFT(this, ResId( FT_DOCCOLOR, *rResId.GetResMgr())),
493cdf0e10cSrcweir aDocColorLB(this, ResId( LB_DOCCOLOR, *rResId.GetResMgr())),
494cdf0e10cSrcweir aDocColorWN(this, ResId( WN_DOCCOLOR, *rResId.GetResMgr())),
495cdf0e10cSrcweir aDocBoundCB(this, ResId( CB_DOCBOUND, *rResId.GetResMgr())),
496cdf0e10cSrcweir aDocBoundLB(this, ResId( LB_DOCBOUND, *rResId.GetResMgr())),
497cdf0e10cSrcweir aDocBoundWN(this, ResId( WN_DOCBOUND, *rResId.GetResMgr())),
498cdf0e10cSrcweir aAppBackFT(this, ResId( FT_APPBACKGROUND, *rResId.GetResMgr())),
499cdf0e10cSrcweir aAppBackLB(this, ResId( LB_APPBACKGROUND, *rResId.GetResMgr())),
500cdf0e10cSrcweir aAppBackWN(this, ResId( WN_APPBACKGROUND, *rResId.GetResMgr())),
501cdf0e10cSrcweir aObjBoundCB(this, ResId( CB_OBJECTBOUNDARIES, *rResId.GetResMgr())),
502cdf0e10cSrcweir aObjBoundLB(this, ResId( LB_OBJECTBOUNDARIES, *rResId.GetResMgr())),
503cdf0e10cSrcweir aObjBoundWN(this, ResId( WN_OBJECTBOUNDARIES, *rResId.GetResMgr())),
504cdf0e10cSrcweir aTableBoundCB(this, ResId( CB_TABLEBOUNDARIES, *rResId.GetResMgr())),
505cdf0e10cSrcweir aTableBoundLB(this, ResId( LB_TABLEBOUNDARIES, *rResId.GetResMgr())),
506cdf0e10cSrcweir aTableBoundWN(this, ResId( WN_TABLEBOUNDARIES, *rResId.GetResMgr())),
507cdf0e10cSrcweir aFontColorFT(this, ResId( FT_FONTCOLOR, *rResId.GetResMgr())),
508cdf0e10cSrcweir aFontColorLB(this, ResId( LB_FONTCOLOR, *rResId.GetResMgr())),
509cdf0e10cSrcweir aFontColorWN(this, ResId( WN_FONTCOLOR, *rResId.GetResMgr())),
510cdf0e10cSrcweir aLinksCB(this, ResId( CB_LINKS, *rResId.GetResMgr())),
511cdf0e10cSrcweir aLinksLB(this, ResId( LB_LINKS, *rResId.GetResMgr())),
512cdf0e10cSrcweir aLinksWN(this, ResId( WN_LINKS, *rResId.GetResMgr())),
513cdf0e10cSrcweir aLinksVisitedCB(this, ResId( CB_LINKSVISITED, *rResId.GetResMgr())),
514cdf0e10cSrcweir aLinksVisitedLB(this, ResId( LB_LINKSVISITED, *rResId.GetResMgr())),
515cdf0e10cSrcweir aLinksVisitedWN(this, ResId( WN_LINKSVISITED, *rResId.GetResMgr())),
516cdf0e10cSrcweir aSpellFT(this, ResId( FT_SPELL, *rResId.GetResMgr())),
517cdf0e10cSrcweir aSpellLB(this, ResId( LB_SPELL, *rResId.GetResMgr())),
518cdf0e10cSrcweir aSpellWN(this, ResId( WN_SPELL, *rResId.GetResMgr())),
519cdf0e10cSrcweir aSmarttagsFT(this, ResId( FT_SMARTTAGS, *rResId.GetResMgr() )),
520cdf0e10cSrcweir aSmarttagsLB(this, ResId( LB_SMARTTAGS, *rResId.GetResMgr() )),
521cdf0e10cSrcweir aSmarttagsWN(this, ResId( WN_SMARTTAGS, *rResId.GetResMgr() )),
522cdf0e10cSrcweir aWriterBackWN(this),
523cdf0e10cSrcweir aWriterFT(this, ResId(FT_WRITER, *rResId.GetResMgr())),
524cdf0e10cSrcweir aWrtTextGridFT(this, ResId( FT_WRITERTEXTGRID, *rResId.GetResMgr())),
525cdf0e10cSrcweir aWrtTextGridLB(this, ResId( LB_WRITERTEXTGRID, *rResId.GetResMgr())),
526cdf0e10cSrcweir aWrtTextGridWN(this, ResId( WN_WRITERTEXTGRID, *rResId.GetResMgr())),
527cdf0e10cSrcweir aWrtFieldCB(this, ResId( CB_WRITERFIELDSHADINGS, *rResId.GetResMgr())),
528cdf0e10cSrcweir aWrtFieldLB(this, ResId( LB_WRITERFIELDSHADINGS, *rResId.GetResMgr())),
529cdf0e10cSrcweir aWrtFieldWN(this, ResId( WN_WRITERFIELDSHADINGS, *rResId.GetResMgr())),
530cdf0e10cSrcweir aWrtIdxShadingBackCB(this, ResId( CB_WRITERIDXSHADINGS, *rResId.GetResMgr())),
531cdf0e10cSrcweir aWrtIdxShadingBackLB(this, ResId( LB_WRITERIDXSHADINGS, *rResId.GetResMgr())),
532cdf0e10cSrcweir aWrtIdxShadingBackWN(this, ResId( WN_WRITERIDXSHADINGS, *rResId.GetResMgr())),
533cdf0e10cSrcweir aWrtScriptIndicatorFT(this, ResId( FT_WRITERSCRIPTINDICATOR, *rResId.GetResMgr())),
534cdf0e10cSrcweir aWrtScriptIndicatorLB(this, ResId( LB_WRITERSCRIPTINDICATOR, *rResId.GetResMgr())),
535cdf0e10cSrcweir aWrtScriptIndicatorWN(this, ResId( WN_WRITERSCRIPTINDICATOR, *rResId.GetResMgr())),
536cdf0e10cSrcweir aWrtSectionBoundCB(this, ResId( CB_WRITERSECTIONBOUNDARIES, *rResId.GetResMgr())),
537cdf0e10cSrcweir aWrtSectionBoundLB(this, ResId( LB_WRITERSECTIONBOUNDARIES, *rResId.GetResMgr())),
538cdf0e10cSrcweir aWrtSectionBoundWN(this, ResId( WN_WRITERSECTIONBOUNDARIES, *rResId.GetResMgr())),
539cdf0e10cSrcweir aWrtPageBreaksFT(this, ResId( FT_WRITERPAGEBREAKS, *rResId.GetResMgr())),
540cdf0e10cSrcweir aWrtPageBreaksLB(this, ResId( LB_WRITERPAGEBREAKS, *rResId.GetResMgr())),
541cdf0e10cSrcweir aWrtPageBreaksWN(this, ResId( WN_WRITERPAGEBREAKS, *rResId.GetResMgr())),
542cdf0e10cSrcweir aWrtDirectCrsrFT(this, ResId( FT_WRITERDIRECTCURSOR, *rResId.GetResMgr())),
543cdf0e10cSrcweir aWrtDirectCrsrLB(this, ResId( LB_WRITERDIRECTCURSOR, *rResId.GetResMgr())),
544cdf0e10cSrcweir aWrtDirectCrsrWN(this, ResId( WN_WRITERDIRECTCURSOR, *rResId.GetResMgr())),
545cdf0e10cSrcweir aHTMLBackWN(this),
546cdf0e10cSrcweir aHTMLFT(this, ResId( FT_HTML, *rResId.GetResMgr())),
547cdf0e10cSrcweir aHTMLSGMLFT(this, ResId( FT_HTMLSGML, *rResId.GetResMgr())),
548cdf0e10cSrcweir aHTMLSGMLLB(this, ResId( LB_HTMLSGML, *rResId.GetResMgr())),
549cdf0e10cSrcweir aHTMLSGMLWN(this, ResId( WN_HTMLSGML, *rResId.GetResMgr())),
550cdf0e10cSrcweir aHTMLCommentFT(this, ResId( FT_HTMLCOMMENT, *rResId.GetResMgr())),
551cdf0e10cSrcweir aHTMLCommentLB(this, ResId( LB_HTMLCOMMENT, *rResId.GetResMgr())),
552cdf0e10cSrcweir aHTMLCommentWN(this, ResId( WN_HTMLCOMMENT, *rResId.GetResMgr())),
553cdf0e10cSrcweir aHTMLKeywdFT(this, ResId( FT_HTMLKEYWORD, *rResId.GetResMgr())),
554cdf0e10cSrcweir aHTMLKeywdLB(this, ResId( LB_HTMLKEYWORD, *rResId.GetResMgr())),
555cdf0e10cSrcweir aHTMLKeywdWN(this, ResId( WN_HTMLKEYWORD, *rResId.GetResMgr())),
556cdf0e10cSrcweir aHTMLUnknownFT(this, ResId( FT_HTMLUNKNOWN, *rResId.GetResMgr())),
557cdf0e10cSrcweir aHTMLUnknownLB(this, ResId( LB_HTMLUNKNOWN, *rResId.GetResMgr())),
558cdf0e10cSrcweir aHTMLUnknownWN(this, ResId( WN_HTMLUNKNOWN, *rResId.GetResMgr())),
559cdf0e10cSrcweir aCalcBackWN(this),
560cdf0e10cSrcweir aCalcFT(this, ResId( FT_CALC, *rResId.GetResMgr())),
561cdf0e10cSrcweir aCalcGridFT(this, ResId( FT_CALCGRID, *rResId.GetResMgr())),
562cdf0e10cSrcweir aCalcGridLB(this, ResId( LB_CALCGRID, *rResId.GetResMgr())),
563cdf0e10cSrcweir aCalcGridWN(this, ResId( WN_CALCGRID, *rResId.GetResMgr())),
564cdf0e10cSrcweir aCalcPageBreakFT(this, ResId( FT_CALCPAGEBREAK, *rResId.GetResMgr())),
565cdf0e10cSrcweir aCalcPageBreakLB(this, ResId( LB_CALCPAGEBREAK, *rResId.GetResMgr())),
566cdf0e10cSrcweir aCalcPageBreakWN(this, ResId( WN_CALCPAGEBREAK, *rResId.GetResMgr())),
567cdf0e10cSrcweir aCalcPageBreakManualFT(this, ResId( FT_CALCPAGEBREAKMANUAL, *rResId.GetResMgr())),
568cdf0e10cSrcweir aCalcPageBreakManualLB(this, ResId( LB_CALCPAGEBREAKMANUAL, *rResId.GetResMgr())),
569cdf0e10cSrcweir aCalcPageBreakManualWN(this, ResId( WN_CALCPAGEBREAKMANUAL, *rResId.GetResMgr())),
570cdf0e10cSrcweir aCalcPageBreakAutoFT(this, ResId( FT_CALCPAGEBREAKAUTO, *rResId.GetResMgr())),
571cdf0e10cSrcweir aCalcPageBreakAutoLB(this, ResId( LB_CALCPAGEBREAKAUTO, *rResId.GetResMgr())),
572cdf0e10cSrcweir aCalcPageBreakAutoWN(this, ResId( WN_CALCPAGEBREAKAUTO, *rResId.GetResMgr())),
573cdf0e10cSrcweir aCalcDetectiveFT(this, ResId( FT_CALCDETECTIVE, *rResId.GetResMgr())),
574cdf0e10cSrcweir aCalcDetectiveLB(this, ResId( LB_CALCDETECTIVE, *rResId.GetResMgr())),
575cdf0e10cSrcweir aCalcDetectiveWN(this, ResId( WN_CALCDETECTIVE, *rResId.GetResMgr())),
576cdf0e10cSrcweir aCalcDetectiveErrorFT(this, ResId( FT_CALCDETECTIVEERROR, *rResId.GetResMgr())),
577cdf0e10cSrcweir aCalcDetectiveErrorLB(this, ResId( LB_CALCDETECTIVEERROR, *rResId.GetResMgr())),
578cdf0e10cSrcweir aCalcDetectiveErrorWN(this, ResId( WN_CALCDETECTIVEERROR, *rResId.GetResMgr())),
579cdf0e10cSrcweir aCalcReferenceFT(this, ResId( FT_CALCREFERENCE, *rResId.GetResMgr())),
580cdf0e10cSrcweir aCalcReferenceLB(this, ResId( LB_CALCREFERENCE, *rResId.GetResMgr())),
581cdf0e10cSrcweir aCalcReferenceWN(this, ResId( WN_CALCREFERENCE, *rResId.GetResMgr())),
582cdf0e10cSrcweir aCalcNotesBackFT(this, ResId( FT_CALCNOTESBACKGROUND, *rResId.GetResMgr())),
583cdf0e10cSrcweir aCalcNotesBackLB(this, ResId( LB_CALCNOTESBACKGROUND, *rResId.GetResMgr())),
584cdf0e10cSrcweir aCalcNotesBackWN(this, ResId( WN_CALCNOTESBACKGROUND, *rResId.GetResMgr())),
585cdf0e10cSrcweir aDrawBackWN(this),
586cdf0e10cSrcweir aDrawFT(this, ResId( FT_DRAW, *rResId.GetResMgr())),
587cdf0e10cSrcweir aDrawGridFT(this, ResId( FT_DRAWGRID, *rResId.GetResMgr())),
588cdf0e10cSrcweir aDrawGridLB(this, ResId( LB_DRAWGRID, *rResId.GetResMgr())),
589cdf0e10cSrcweir aDrawGridWN(this, ResId( WN_DRAWGRID, *rResId.GetResMgr())),
590cdf0e10cSrcweir aBasicBackWN(this),
591cdf0e10cSrcweir aBasicFT(this, ResId( FT_BASIC, *rResId.GetResMgr())),
592cdf0e10cSrcweir aBasicIdentifierFT(this, ResId( FT_BASICIDENTIFIER, *rResId.GetResMgr())),
593cdf0e10cSrcweir aBasicIdentifierLB(this, ResId( LB_BASICIDENTIFIER, *rResId.GetResMgr())),
594cdf0e10cSrcweir aBasicIdentifierWN(this, ResId( WN_BASICIDENTIFIER, *rResId.GetResMgr())),
595cdf0e10cSrcweir aBasicCommentFT(this, ResId( FT_BASICCOMMENT, *rResId.GetResMgr())),
596cdf0e10cSrcweir aBasicCommentLB(this, ResId( LB_BASICCOMMENT, *rResId.GetResMgr())),
597cdf0e10cSrcweir aBasicCommentWN(this, ResId( WN_BASICCOMMENT, *rResId.GetResMgr())),
598cdf0e10cSrcweir aBasicNumberFT(this, ResId( FT_BASICNUMBER, *rResId.GetResMgr())),
599cdf0e10cSrcweir aBasicNumberLB(this, ResId( LB_BASICNUMBER, *rResId.GetResMgr())),
600cdf0e10cSrcweir aBasicNumberWN(this, ResId( WN_BASICNUMBER, *rResId.GetResMgr())),
601cdf0e10cSrcweir aBasicStringFT(this, ResId( FT_BASICSTRING, *rResId.GetResMgr())),
602cdf0e10cSrcweir aBasicStringLB(this, ResId( LB_BASICSTRING, *rResId.GetResMgr())),
603cdf0e10cSrcweir aBasicStringWN(this, ResId( WN_BASICSTRING, *rResId.GetResMgr())),
604cdf0e10cSrcweir aBasicOperatorFT(this, ResId( FT_BASICOPERATOR, *rResId.GetResMgr())),
605cdf0e10cSrcweir aBasicOperatorLB(this, ResId( LB_BASICOPERATOR, *rResId.GetResMgr())),
606cdf0e10cSrcweir aBasicOperatorWN(this, ResId( WN_BASICOPERATOR, *rResId.GetResMgr())),
607cdf0e10cSrcweir aBasicKeywordFT(this, ResId( FT_BASICKEYWORD, *rResId.GetResMgr())),
608cdf0e10cSrcweir aBasicKeywordLB(this, ResId( LB_BASICKEYWORD, *rResId.GetResMgr())),
609cdf0e10cSrcweir aBasicKeywordWN(this, ResId( WN_BASICKEYWORD, *rResId.GetResMgr())),
610cdf0e10cSrcweir aBasicErrorFT(this, ResId( FT_BASICERROR, *rResId.GetResMgr())),
611cdf0e10cSrcweir aBasicErrorLB(this, ResId( LB_BASICERROR, *rResId.GetResMgr())),
612cdf0e10cSrcweir aBasicErrorWN(this, ResId( WN_BASICERROR, *rResId.GetResMgr())),
613cdf0e10cSrcweir
614cdf0e10cSrcweir aSQLBackWN(this),
615cdf0e10cSrcweir aSQLFT(this, ResId( FT_SQL_COMMAND, *rResId.GetResMgr())),
616cdf0e10cSrcweir aSQLIdentifierFT(this, ResId( FT_SQLIDENTIFIER, *rResId.GetResMgr())),
617cdf0e10cSrcweir aSQLIdentifierLB(this, ResId( LB_SQLIDENTIFIER, *rResId.GetResMgr())),
618cdf0e10cSrcweir aSQLIdentifierWN(this, ResId( WN_SQLIDENTIFIER, *rResId.GetResMgr())),
619cdf0e10cSrcweir
620cdf0e10cSrcweir aSQLNumberFT(this, ResId( FT_SQLNUMBER, *rResId.GetResMgr())),
621cdf0e10cSrcweir aSQLNumberLB(this, ResId( LB_SQLNUMBER, *rResId.GetResMgr())),
622cdf0e10cSrcweir aSQLNumberWN(this, ResId( WN_SQLNUMBER, *rResId.GetResMgr())),
623cdf0e10cSrcweir
624cdf0e10cSrcweir aSQLStringFT(this, ResId( FT_SQLSTRING, *rResId.GetResMgr())),
625cdf0e10cSrcweir aSQLStringLB(this, ResId( LB_SQLSTRING, *rResId.GetResMgr())),
626cdf0e10cSrcweir aSQLStringWN(this, ResId( WN_SQLSTRING, *rResId.GetResMgr())),
627cdf0e10cSrcweir
628cdf0e10cSrcweir aSQLOperatorFT(this, ResId( FT_SQLOPERATOR, *rResId.GetResMgr())),
629cdf0e10cSrcweir aSQLOperatorLB(this, ResId( LB_SQLOPERATOR, *rResId.GetResMgr())),
630cdf0e10cSrcweir aSQLOperatorWN(this, ResId( WN_SQLOPERATOR, *rResId.GetResMgr())),
631cdf0e10cSrcweir
632cdf0e10cSrcweir aSQLKeywordFT(this, ResId( FT_SQLKEYWORD, *rResId.GetResMgr())),
633cdf0e10cSrcweir aSQLKeywordLB(this, ResId( LB_SQLKEYWORD, *rResId.GetResMgr())),
634cdf0e10cSrcweir aSQLKeywordWN(this, ResId( WN_SQLKEYWORD, *rResId.GetResMgr())),
635cdf0e10cSrcweir
636cdf0e10cSrcweir aSQLParameterFT(this, ResId( FT_SQLPARAMETER, *rResId.GetResMgr())),
637cdf0e10cSrcweir aSQLParameterLB(this, ResId( LB_SQLPARAMETER, *rResId.GetResMgr())),
638cdf0e10cSrcweir aSQLParameterWN(this, ResId( WN_SQLPARAMETER, *rResId.GetResMgr())),
639cdf0e10cSrcweir
640cdf0e10cSrcweir aSQLCommentFT(this, ResId( FT_SQLCOMMENT, *rResId.GetResMgr())),
641cdf0e10cSrcweir aSQLCommentLB(this, ResId( LB_SQLCOMMENT, *rResId.GetResMgr())),
642cdf0e10cSrcweir aSQLCommentWN(this, ResId( WN_SQLCOMMENT, *rResId.GetResMgr()))
643cdf0e10cSrcweir {
644cdf0e10cSrcweir aFixedTexts.resize(ColorConfigEntryCount);
645cdf0e10cSrcweir aCheckBoxes.resize(ColorConfigEntryCount);
646cdf0e10cSrcweir aColorBoxes.resize(ColorConfigEntryCount);
647cdf0e10cSrcweir aWindows.resize(ColorConfigEntryCount);
648cdf0e10cSrcweir
649cdf0e10cSrcweir aFixedTexts[DOCCOLOR ] = &aDocColorFT;
650cdf0e10cSrcweir aCheckBoxes[DOCBOUNDARIES ] = &aDocBoundCB ;
651cdf0e10cSrcweir aFixedTexts[APPBACKGROUND ] = &aAppBackFT;
652cdf0e10cSrcweir aCheckBoxes[OBJECTBOUNDARIES ] = &aObjBoundCB ;
653cdf0e10cSrcweir aCheckBoxes[TABLEBOUNDARIES ] = &aTableBoundCB ;
654cdf0e10cSrcweir aFixedTexts[FONTCOLOR ] = &aFontColorFT ;
655cdf0e10cSrcweir aCheckBoxes[LINKS ] = &aLinksCB ;
656cdf0e10cSrcweir aCheckBoxes[LINKSVISITED ] = &aLinksVisitedCB ;
657cdf0e10cSrcweir aFixedTexts[SPELL ]=& aSpellFT;
658cdf0e10cSrcweir aFixedTexts[SMARTTAGS ]=& aSmarttagsFT;
659cdf0e10cSrcweir aFixedTexts[WRITERTEXTGRID ]=& aWrtTextGridFT;
660cdf0e10cSrcweir aCheckBoxes[WRITERFIELDSHADINGS ] = &aWrtFieldCB ;
661cdf0e10cSrcweir aCheckBoxes[WRITERIDXSHADINGS ] = &aWrtIdxShadingBackCB ;
662cdf0e10cSrcweir aFixedTexts[WRITERDIRECTCURSOR ]=& aWrtDirectCrsrFT;
663cdf0e10cSrcweir aFixedTexts[WRITERSCRIPTINDICATOR ]=& aWrtScriptIndicatorFT;
664cdf0e10cSrcweir aCheckBoxes[WRITERSECTIONBOUNDARIES ]=& aWrtSectionBoundCB;
665cdf0e10cSrcweir aFixedTexts[HTMLSGML ]=& aHTMLSGMLFT;
666cdf0e10cSrcweir aFixedTexts[HTMLCOMMENT ]=& aHTMLCommentFT;
667cdf0e10cSrcweir aFixedTexts[HTMLKEYWORD ]=& aHTMLKeywdFT;
668cdf0e10cSrcweir aFixedTexts[HTMLUNKNOWN ]=& aHTMLUnknownFT;
669cdf0e10cSrcweir aFixedTexts[CALCGRID ] = &aCalcGridFT ;
670cdf0e10cSrcweir aFixedTexts[CALCPAGEBREAK ] = &aCalcPageBreakFT;
671cdf0e10cSrcweir aFixedTexts[CALCPAGEBREAKMANUAL ] = &aCalcPageBreakManualFT;
672cdf0e10cSrcweir aFixedTexts[CALCPAGEBREAKAUTOMATIC ] = &aCalcPageBreakAutoFT;
673cdf0e10cSrcweir aFixedTexts[CALCDETECTIVE ]=& aCalcDetectiveFT;
674cdf0e10cSrcweir aFixedTexts[CALCDETECTIVEERROR ]=& aCalcDetectiveErrorFT;
675cdf0e10cSrcweir aFixedTexts[CALCREFERENCE ]=& aCalcReferenceFT;
676cdf0e10cSrcweir aFixedTexts[CALCNOTESBACKGROUND ]=& aCalcNotesBackFT;
677cdf0e10cSrcweir aFixedTexts[WRITERPAGEBREAKS] = &aWrtPageBreaksFT;
678cdf0e10cSrcweir aFixedTexts[DRAWGRID ] = &aDrawGridFT ;
679cdf0e10cSrcweir aFixedTexts[BASICIDENTIFIER ] = &aBasicIdentifierFT;
680cdf0e10cSrcweir aFixedTexts[BASICCOMMENT ] = &aBasicCommentFT;
681cdf0e10cSrcweir aFixedTexts[BASICNUMBER ] = &aBasicNumberFT;
682cdf0e10cSrcweir aFixedTexts[BASICSTRING ] = &aBasicStringFT;
683cdf0e10cSrcweir aFixedTexts[BASICOPERATOR ] = &aBasicOperatorFT;
684cdf0e10cSrcweir aFixedTexts[BASICKEYWORD ] = &aBasicKeywordFT;
685cdf0e10cSrcweir aFixedTexts[BASICERROR ] = &aBasicErrorFT;
686cdf0e10cSrcweir aFixedTexts[SQLIDENTIFIER ] = &aSQLIdentifierFT;
687cdf0e10cSrcweir aFixedTexts[SQLNUMBER ] = &aSQLNumberFT;
688cdf0e10cSrcweir aFixedTexts[SQLSTRING ] = &aSQLStringFT;
689cdf0e10cSrcweir aFixedTexts[SQLOPERATOR ] = &aSQLOperatorFT;
690cdf0e10cSrcweir aFixedTexts[SQLKEYWORD ] = &aSQLKeywordFT;
691cdf0e10cSrcweir aFixedTexts[SQLPARAMETER ] = &aSQLParameterFT;
692cdf0e10cSrcweir aFixedTexts[SQLCOMMENT ] = &aSQLCommentFT;
693cdf0e10cSrcweir
694cdf0e10cSrcweir aColorBoxes[DOCCOLOR ] = &aDocColorLB ;
695cdf0e10cSrcweir aColorBoxes[DOCBOUNDARIES ] = &aDocBoundLB ;
696cdf0e10cSrcweir aColorBoxes[APPBACKGROUND ] = &aAppBackLB ;
697cdf0e10cSrcweir aColorBoxes[OBJECTBOUNDARIES ] = &aObjBoundLB ;
698cdf0e10cSrcweir aColorBoxes[TABLEBOUNDARIES ] = &aTableBoundLB ;
699cdf0e10cSrcweir aColorBoxes[FONTCOLOR ] = &aFontColorLB ;
700cdf0e10cSrcweir aColorBoxes[LINKS ] = &aLinksLB ;
701cdf0e10cSrcweir aColorBoxes[LINKSVISITED ] = &aLinksVisitedLB ;
702cdf0e10cSrcweir aColorBoxes[SPELL ] = &aSpellLB ;
703cdf0e10cSrcweir aColorBoxes[SMARTTAGS ] = &aSmarttagsLB ;
704cdf0e10cSrcweir aColorBoxes[WRITERTEXTGRID ] = &aWrtTextGridLB ;
705cdf0e10cSrcweir aColorBoxes[WRITERFIELDSHADINGS ] = &aWrtFieldLB ;
706cdf0e10cSrcweir aColorBoxes[WRITERIDXSHADINGS ] = &aWrtIdxShadingBackLB ;
707cdf0e10cSrcweir aColorBoxes[WRITERDIRECTCURSOR ] = &aWrtDirectCrsrLB ;
708cdf0e10cSrcweir aColorBoxes[WRITERSCRIPTINDICATOR ] = &aWrtScriptIndicatorLB ;
709cdf0e10cSrcweir aColorBoxes[WRITERSECTIONBOUNDARIES ] = &aWrtSectionBoundLB ;
710cdf0e10cSrcweir aColorBoxes[WRITERPAGEBREAKS] = &aWrtPageBreaksLB;
711cdf0e10cSrcweir aColorBoxes[HTMLSGML ] = &aHTMLSGMLLB ;
712cdf0e10cSrcweir aColorBoxes[HTMLCOMMENT ] = &aHTMLCommentLB ;
713cdf0e10cSrcweir aColorBoxes[HTMLKEYWORD ] = &aHTMLKeywdLB ;
714cdf0e10cSrcweir aColorBoxes[HTMLUNKNOWN ] = &aHTMLUnknownLB ;
715cdf0e10cSrcweir aColorBoxes[CALCGRID ] = &aCalcGridLB ;
716cdf0e10cSrcweir aColorBoxes[CALCPAGEBREAK ] = &aCalcPageBreakLB ;
717cdf0e10cSrcweir aColorBoxes[CALCPAGEBREAKMANUAL ] = &aCalcPageBreakManualLB ;
718cdf0e10cSrcweir aColorBoxes[CALCPAGEBREAKAUTOMATIC]= &aCalcPageBreakAutoLB ;
719cdf0e10cSrcweir aColorBoxes[CALCDETECTIVE ] = &aCalcDetectiveLB ;
720cdf0e10cSrcweir aColorBoxes[CALCDETECTIVEERROR ] = &aCalcDetectiveErrorLB ;
721cdf0e10cSrcweir aColorBoxes[CALCREFERENCE ] = &aCalcReferenceLB ;
722cdf0e10cSrcweir aColorBoxes[CALCNOTESBACKGROUND ] = &aCalcNotesBackLB ;
723cdf0e10cSrcweir aColorBoxes[DRAWGRID ] = &aDrawGridLB ;
724cdf0e10cSrcweir aColorBoxes[BASICIDENTIFIER ] = &aBasicIdentifierLB;
725cdf0e10cSrcweir aColorBoxes[BASICCOMMENT ] = &aBasicCommentLB;
726cdf0e10cSrcweir aColorBoxes[BASICNUMBER ] = &aBasicNumberLB;
727cdf0e10cSrcweir aColorBoxes[BASICSTRING ] = &aBasicStringLB;
728cdf0e10cSrcweir aColorBoxes[BASICOPERATOR ] = &aBasicOperatorLB;
729cdf0e10cSrcweir aColorBoxes[BASICKEYWORD ] = &aBasicKeywordLB;
730cdf0e10cSrcweir aColorBoxes[BASICERROR ] = &aBasicErrorLB;
731cdf0e10cSrcweir aColorBoxes[SQLIDENTIFIER ] = &aSQLIdentifierLB;
732cdf0e10cSrcweir aColorBoxes[SQLNUMBER ] = &aSQLNumberLB;
733cdf0e10cSrcweir aColorBoxes[SQLSTRING ] = &aSQLStringLB;
734cdf0e10cSrcweir aColorBoxes[SQLOPERATOR ] = &aSQLOperatorLB;
735cdf0e10cSrcweir aColorBoxes[SQLKEYWORD ] = &aSQLKeywordLB;
736cdf0e10cSrcweir aColorBoxes[SQLPARAMETER ] = &aSQLParameterLB;
737cdf0e10cSrcweir aColorBoxes[SQLCOMMENT ] = &aSQLCommentLB;
738cdf0e10cSrcweir
739cdf0e10cSrcweir aWindows[DOCCOLOR ] = &aDocColorWN ;
740cdf0e10cSrcweir aWindows[DOCBOUNDARIES ] = &aDocBoundWN ;
741cdf0e10cSrcweir aWindows[APPBACKGROUND ] = &aAppBackWN ;
742cdf0e10cSrcweir aWindows[OBJECTBOUNDARIES ] = &aObjBoundWN ;
743cdf0e10cSrcweir aWindows[TABLEBOUNDARIES ] = &aTableBoundWN ;
744cdf0e10cSrcweir aWindows[FONTCOLOR ] = &aFontColorWN ;
745cdf0e10cSrcweir aWindows[LINKS ] = &aLinksWN ;
746cdf0e10cSrcweir aWindows[LINKSVISITED ] = &aLinksVisitedWN ;
747cdf0e10cSrcweir aWindows[SPELL ] = &aSpellWN ;
748cdf0e10cSrcweir aWindows[SMARTTAGS ] = &aSmarttagsWN ;
749cdf0e10cSrcweir aWindows[WRITERTEXTGRID ] = &aWrtTextGridWN ;
750cdf0e10cSrcweir aWindows[WRITERFIELDSHADINGS ] = &aWrtFieldWN ;
751cdf0e10cSrcweir aWindows[WRITERIDXSHADINGS ] = &aWrtIdxShadingBackWN ;
752cdf0e10cSrcweir aWindows[WRITERDIRECTCURSOR ] = &aWrtDirectCrsrWN ;
753cdf0e10cSrcweir aWindows[WRITERSCRIPTINDICATOR ] = &aWrtScriptIndicatorWN ;
754cdf0e10cSrcweir aWindows[WRITERSECTIONBOUNDARIES ] = &aWrtSectionBoundWN ;
755cdf0e10cSrcweir aWindows[WRITERPAGEBREAKS] = &aWrtPageBreaksWN;
756cdf0e10cSrcweir aWindows[HTMLSGML ] = &aHTMLSGMLWN ;
757cdf0e10cSrcweir aWindows[HTMLCOMMENT ] = &aHTMLCommentWN ;
758cdf0e10cSrcweir aWindows[HTMLKEYWORD ] = &aHTMLKeywdWN ;
759cdf0e10cSrcweir aWindows[HTMLUNKNOWN ] = &aHTMLUnknownWN ;
760cdf0e10cSrcweir aWindows[CALCGRID ] = &aCalcGridWN ;
761cdf0e10cSrcweir aWindows[CALCPAGEBREAK ] = &aCalcPageBreakWN ;
762cdf0e10cSrcweir aWindows[CALCPAGEBREAKMANUAL ] = &aCalcPageBreakManualWN ;
763cdf0e10cSrcweir aWindows[CALCPAGEBREAKAUTOMATIC] = &aCalcPageBreakAutoWN ;
764cdf0e10cSrcweir aWindows[CALCDETECTIVE ] = &aCalcDetectiveWN ;
765cdf0e10cSrcweir aWindows[CALCDETECTIVEERROR ] = &aCalcDetectiveErrorWN ;
766cdf0e10cSrcweir aWindows[CALCREFERENCE ] = &aCalcReferenceWN ;
767cdf0e10cSrcweir aWindows[CALCNOTESBACKGROUND ] = &aCalcNotesBackWN ;
768cdf0e10cSrcweir aWindows[DRAWGRID ] = &aDrawGridWN ;
769cdf0e10cSrcweir aWindows[BASICIDENTIFIER ] = &aBasicIdentifierWN;
770cdf0e10cSrcweir aWindows[BASICCOMMENT ] = &aBasicCommentWN;
771cdf0e10cSrcweir aWindows[BASICNUMBER ] = &aBasicNumberWN;
772cdf0e10cSrcweir aWindows[BASICSTRING ] = &aBasicStringWN;
773cdf0e10cSrcweir aWindows[BASICOPERATOR ] = &aBasicOperatorWN;
774cdf0e10cSrcweir aWindows[BASICKEYWORD ] = &aBasicKeywordWN;
775cdf0e10cSrcweir aWindows[BASICERROR ] = &aBasicErrorWN;
776cdf0e10cSrcweir aWindows[SQLIDENTIFIER ] = &aSQLIdentifierWN;
777cdf0e10cSrcweir aWindows[SQLNUMBER ] = &aSQLNumberWN;
778cdf0e10cSrcweir aWindows[SQLSTRING ] = &aSQLStringWN;
779cdf0e10cSrcweir aWindows[SQLOPERATOR ] = &aSQLOperatorWN;
780cdf0e10cSrcweir aWindows[SQLKEYWORD ] = &aSQLKeywordWN;
781cdf0e10cSrcweir aWindows[SQLPARAMETER ] = &aSQLParameterWN;
782cdf0e10cSrcweir aWindows[SQLCOMMENT ] = &aSQLCommentWN;
783cdf0e10cSrcweir
784cdf0e10cSrcweir aChapters.push_back(&aGeneralFT); aChapterWins.push_back(&aGeneralBackWN);
785cdf0e10cSrcweir aChapters.push_back(&aWriterFT); aChapterWins.push_back(&aWriterBackWN);
786cdf0e10cSrcweir aChapters.push_back(&aHTMLFT); aChapterWins.push_back(&aHTMLBackWN);
787cdf0e10cSrcweir aChapters.push_back(&aCalcFT); aChapterWins.push_back(&aCalcBackWN);
788cdf0e10cSrcweir aChapters.push_back(&aDrawFT); aChapterWins.push_back(&aDrawBackWN);
789cdf0e10cSrcweir aChapters.push_back(&aBasicFT); aChapterWins.push_back(&aBasicBackWN);
790cdf0e10cSrcweir aChapters.push_back(&aSQLFT); aChapterWins.push_back(&aSQLBackWN);
791cdf0e10cSrcweir
792cdf0e10cSrcweir // calculate heights of groups which can be hidden
793cdf0e10cSrcweir aChapters[GROUP_WRITER ]->SetGroupHeight( aChapters[GROUP_HTML]->GetPosPixel().Y() - aChapters[GROUP_WRITER]->GetPosPixel().Y() );
794cdf0e10cSrcweir aChapters[GROUP_HTML ]->SetGroupHeight( aChapters[GROUP_CALC]->GetPosPixel().Y() - aChapters[GROUP_HTML]->GetPosPixel().Y() );
795cdf0e10cSrcweir aChapters[GROUP_CALC ]->SetGroupHeight( aChapters[GROUP_DRAW]->GetPosPixel().Y() - aChapters[GROUP_CALC]->GetPosPixel().Y() );
796cdf0e10cSrcweir aChapters[GROUP_DRAW ]->SetGroupHeight( aChapters[GROUP_BASIC]->GetPosPixel().Y() - aChapters[GROUP_DRAW]->GetPosPixel().Y() );
797cdf0e10cSrcweir aChapters[GROUP_BASIC ]->SetGroupHeight( aChapters[GROUP_SQL]->GetPosPixel().Y() - aChapters[GROUP_BASIC]->GetPosPixel().Y() );
798cdf0e10cSrcweir
799cdf0e10cSrcweir ExtendedColorConfig aExtConfig;
800cdf0e10cSrcweir sal_Int32 nExtCount = aExtConfig.GetComponentCount();
801cdf0e10cSrcweir if ( nExtCount )
802cdf0e10cSrcweir {
803cdf0e10cSrcweir // calculate position behind last chapter
804cdf0e10cSrcweir sal_Int32 nLastY = aSQLCommentWN.GetPosPixel().Y() + aSQLCommentWN.GetSizePixel().Height();
805cdf0e10cSrcweir nLastY = nLastY + LogicToPixel( Size( 0, 3 ), MAP_APPFONT ).Height();
806cdf0e10cSrcweir // to calculate the number of lines
807cdf0e10cSrcweir sal_Int32 nHeight = LogicToPixel( Size( 0, _LINE_HEIGHT ), MAP_APPFONT ).Height();
808cdf0e10cSrcweir sal_Int32 nLineNum = nLastY / nHeight;
809cdf0e10cSrcweir
810cdf0e10cSrcweir Point aFixedPos = LogicToPixel( Point( _FT_XPOS, nLineNum * _LINE_HEIGHT ), MAP_APPFONT );
811cdf0e10cSrcweir Point aLBPos = LogicToPixel( Point( _LB_XPOS, nLineNum * _LINE_HEIGHT ), MAP_APPFONT );
812cdf0e10cSrcweir Size aFixedSize = LogicToPixel( Size( _FT_WIDTH , _FT_HEIGHT ), MAP_APPFONT );
813cdf0e10cSrcweir Size aLBSize = LogicToPixel( Size( _LB_WIDTH , _LB_HEIGHT ), MAP_APPFONT );
814cdf0e10cSrcweir Size aWinSize = LogicToPixel( Size( _WN_WIDTH , _WN_HEIGHT ), MAP_APPFONT );
815cdf0e10cSrcweir
816cdf0e10cSrcweir for (sal_Int32 j = 0; j < nExtCount; ++j)
817cdf0e10cSrcweir {
818cdf0e10cSrcweir ::rtl::OUString sComponentName = aExtConfig.GetComponentName(j);
819cdf0e10cSrcweir aChapterWins.push_back(new Window(this));
820cdf0e10cSrcweir ::boost::shared_ptr<SvxExtFixedText_Impl> pTitle(new SvxExtFixedText_Impl(this,ResId(FT_SQL_COMMAND, *rResId.GetResMgr())));
821cdf0e10cSrcweir m_aExtensionTitles.push_back(pTitle);
822cdf0e10cSrcweir pTitle->SetPosSizePixel(LogicToPixel( Point( _FT_XPOS, nLineNum * _LINE_HEIGHT ), MAP_APPFONT ),aFixedSize);
823cdf0e10cSrcweir pTitle->SetText(aExtConfig.GetComponentDisplayName(sComponentName));
824cdf0e10cSrcweir aChapters.push_back(pTitle.get());
825cdf0e10cSrcweir ++nLineNum;
826cdf0e10cSrcweir sal_Int32 nColorCount = aExtConfig.GetComponentColorCount(sComponentName);
827cdf0e10cSrcweir for (sal_Int32 i = 0; i < nColorCount; ++i,++nLineNum)
828cdf0e10cSrcweir {
829cdf0e10cSrcweir ExtendedColorConfigValue aColorEntry = aExtConfig.GetComponentColorConfigValue(sComponentName,i);
830cdf0e10cSrcweir FixedText* pFixedText = new FixedText(this,ResId(FT_BASICERROR, *rResId.GetResMgr()));
831cdf0e10cSrcweir pFixedText->SetPosSizePixel(LogicToPixel( Point( _FT_XPOS, nLineNum * _LINE_HEIGHT ), MAP_APPFONT ),aFixedSize);
832cdf0e10cSrcweir pFixedText->SetText(aColorEntry.getDisplayName());
833cdf0e10cSrcweir aFixedTexts.push_back(pFixedText);
834cdf0e10cSrcweir aCheckBoxes.push_back(NULL); // no checkboxes
835cdf0e10cSrcweir ColorListBox* pColorBox = new ColorListBox(this,ResId(LB_BASICERROR, *rResId.GetResMgr()));
836cdf0e10cSrcweir pColorBox->SetPosSizePixel(LogicToPixel( Point( _LB_XPOS, nLineNum * _LINE_HEIGHT ), MAP_APPFONT ),aLBSize);
837cdf0e10cSrcweir aColorBoxes.push_back(pColorBox);
838cdf0e10cSrcweir Window* pWin = new Window(this,ResId(WN_BASICERROR, *rResId.GetResMgr()));
839cdf0e10cSrcweir pWin->SetPosSizePixel(LogicToPixel( Point( _WN_XPOS, nLineNum * _LINE_HEIGHT ), MAP_APPFONT ),aWinSize);
840cdf0e10cSrcweir aWindows.push_back(pWin);
841cdf0e10cSrcweir } // for (sal_Int32 i = 0; i < nExtCount; ++i,++nLineNum)
842cdf0e10cSrcweir }
843cdf0e10cSrcweir }
844cdf0e10cSrcweir
845cdf0e10cSrcweir FreeResource();
846cdf0e10cSrcweir
847cdf0e10cSrcweir Color TempColor(COL_TRANSPARENT);
848cdf0e10cSrcweir Wallpaper aTransparentWall(TempColor);
849cdf0e10cSrcweir sal_Int32 nWinWidth = GetSizePixel().Width();
850cdf0e10cSrcweir sal_Int32 nFTHeight = aChapters[0]->GetSizePixel().Height();
851cdf0e10cSrcweir Color aBackColor;
852cdf0e10cSrcweir const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
853cdf0e10cSrcweir sal_Bool bHighContrast = rStyleSettings.GetHighContrastMode();
854cdf0e10cSrcweir if ( bHighContrast )
855cdf0e10cSrcweir aBackColor = rStyleSettings.GetShadowColor();
856cdf0e10cSrcweir else
857cdf0e10cSrcweir aBackColor = Color( COL_LIGHTGRAY);
858cdf0e10cSrcweir sal_Int32 nCount = aChapterWins.size();
859cdf0e10cSrcweir for(sal_Int32 i = 0; i < nCount; ++i)
860cdf0e10cSrcweir {
861cdf0e10cSrcweir if ( lcl_isGroupVisible( i, m_aModuleOptions ) )
862cdf0e10cSrcweir {
863cdf0e10cSrcweir Font aFont = aChapters[i]->GetFont();
864cdf0e10cSrcweir aFont.SetWeight(WEIGHT_BOLD);
865cdf0e10cSrcweir aChapters[i]->SetFont(aFont);
866cdf0e10cSrcweir aChapters[i]->SetBackground(aTransparentWall);
867cdf0e10cSrcweir aChapterWins[i]->SetPosSizePixel( Point(0, aChapters[i]->GetPosPixel().Y()),
868cdf0e10cSrcweir Size(nWinWidth, nFTHeight));
869cdf0e10cSrcweir aChapterWins[i]->SetBackground(Wallpaper(aBackColor));
870cdf0e10cSrcweir aChapterWins[i]->Show();
871cdf0e10cSrcweir }
872cdf0e10cSrcweir else
873cdf0e10cSrcweir {
874cdf0e10cSrcweir aChapters[i]->Hide();
875cdf0e10cSrcweir aChapterWins[i]->Hide();
876cdf0e10cSrcweir }
877cdf0e10cSrcweir }
878cdf0e10cSrcweir Color aTextColor;
879cdf0e10cSrcweir sal_Bool bSetTextColor = sal_False;
880cdf0e10cSrcweir //#104195# when the window color is the same as the text color it has to be changed
881cdf0e10cSrcweir Color aWinCol = rStyleSettings.GetWindowColor();
882cdf0e10cSrcweir Color aRCheckCol = rStyleSettings.GetRadioCheckTextColor();
883cdf0e10cSrcweir if(aWinCol == aRCheckCol )
884cdf0e10cSrcweir {
885cdf0e10cSrcweir bSetTextColor = sal_True;
886cdf0e10cSrcweir aRCheckCol.Invert();
887cdf0e10cSrcweir //if inversion didn't work (gray) then it's set to black
888cdf0e10cSrcweir if(aRCheckCol == aWinCol)
889cdf0e10cSrcweir aRCheckCol = Color(COL_BLACK);
890cdf0e10cSrcweir } // if(aWinCol == aRCheckCol )
891cdf0e10cSrcweir nCount = aFixedTexts.size();
892cdf0e10cSrcweir sal_Int16 nGroup = GROUP_UNKNOWN;
893cdf0e10cSrcweir for( sal_Int32 i = 0; i < nCount; i++ )
894cdf0e10cSrcweir {
895cdf0e10cSrcweir if(ANCHOR == i)
896cdf0e10cSrcweir continue;
897cdf0e10cSrcweir sal_Int16 nNewGroup = lcl_getGroup(i);
898cdf0e10cSrcweir sal_Bool bShow = lcl_isGroupVisible( nNewGroup, m_aModuleOptions );
899cdf0e10cSrcweir
900cdf0e10cSrcweir if ( nNewGroup > nGroup )
901cdf0e10cSrcweir {
902cdf0e10cSrcweir nGroup = nNewGroup;
903cdf0e10cSrcweir if ( bShow && nGroup >= GROUP_CALC )
904cdf0e10cSrcweir {
905cdf0e10cSrcweir SetNewPosition( i, aChapters[nGroup] );
906cdf0e10cSrcweir SetNewPosition( i, aChapterWins[nGroup] );
907cdf0e10cSrcweir }
908cdf0e10cSrcweir }
909cdf0e10cSrcweir if(aCheckBoxes[i])
910cdf0e10cSrcweir {
911cdf0e10cSrcweir if ( bShow )
912cdf0e10cSrcweir SetNewPosition( i, aCheckBoxes[i] );
913cdf0e10cSrcweir else
914cdf0e10cSrcweir aCheckBoxes[i]->Hide();
915cdf0e10cSrcweir aCheckBoxes[i]->SetBackground(aTransparentWall);
916cdf0e10cSrcweir aCheckBoxes[i]->SetHelpId( aColorCBHids[i] );
917cdf0e10cSrcweir if(bSetTextColor)
918cdf0e10cSrcweir aCheckBoxes[i]->SetTextColor(aRCheckCol);
919cdf0e10cSrcweir }
920cdf0e10cSrcweir if(aFixedTexts[i])
921cdf0e10cSrcweir {
922cdf0e10cSrcweir if ( bShow )
923cdf0e10cSrcweir SetNewPosition( i, aFixedTexts[i] );
924cdf0e10cSrcweir else
925cdf0e10cSrcweir aFixedTexts[i]->Hide();
926cdf0e10cSrcweir aFixedTexts[i]->SetBackground(aTransparentWall);
927cdf0e10cSrcweir if(bSetTextColor)
928cdf0e10cSrcweir aFixedTexts[i]->SetTextColor(aRCheckCol);
929cdf0e10cSrcweir }
930cdf0e10cSrcweir if(aWindows[i])
931cdf0e10cSrcweir {
932cdf0e10cSrcweir if ( bShow )
933cdf0e10cSrcweir SetNewPosition( i, aWindows[i] );
934cdf0e10cSrcweir else
935cdf0e10cSrcweir aWindows[i]->Hide();
936cdf0e10cSrcweir aWindows[i]->SetBorderStyle(WINDOW_BORDER_MONO);
937cdf0e10cSrcweir }
938cdf0e10cSrcweir
939cdf0e10cSrcweir if ( aColorBoxes[i] )
940cdf0e10cSrcweir {
941cdf0e10cSrcweir if ( bShow )
942cdf0e10cSrcweir SetNewPosition( i, aColorBoxes[i] );
943cdf0e10cSrcweir else
944cdf0e10cSrcweir aColorBoxes[i]->Hide();
945cdf0e10cSrcweir }
946cdf0e10cSrcweir }
947cdf0e10cSrcweir
948*c7be74b1SArmin Le Grand XColorListSharedPtr aColorTable(XPropertyListFactory::CreateSharedXColorList(SvtPathOptions().GetPalettePath()));
949cdf0e10cSrcweir aColorBoxes[0]->InsertAutomaticEntry();
950*c7be74b1SArmin Le Grand for( sal_Int32 i = 0; i < aColorTable->Count(); i++ )
951cdf0e10cSrcweir {
952*c7be74b1SArmin Le Grand XColorEntry* pEntry = aColorTable->GetColor(i);
953cdf0e10cSrcweir aColorBoxes[0]->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
954cdf0e10cSrcweir }
955cdf0e10cSrcweir
956cdf0e10cSrcweir aColorBoxes[0]->SetHelpId( aColorLBHids[0] );
95716a801ecSAriel Constenla-Haile aColorBoxes[0]->SetDropDownLineCount( 10 );
95816a801ecSAriel Constenla-Haile const sal_Int32 nColorLBHids = sizeof( aColorLBHids )/ sizeof( aColorLBHids[0] );
959cdf0e10cSrcweir
960cdf0e10cSrcweir for( sal_Int32 i = 1; i < nCount; i++ )
961cdf0e10cSrcweir {
96216a801ecSAriel Constenla-Haile if( !aColorBoxes[i] )
96316a801ecSAriel Constenla-Haile continue;
96416a801ecSAriel Constenla-Haile
96516a801ecSAriel Constenla-Haile aColorBoxes[i]->CopyEntries( *aColorBoxes[0] );
96616a801ecSAriel Constenla-Haile if( i < nColorLBHids )
96716a801ecSAriel Constenla-Haile aColorBoxes[i]->SetHelpId( aColorLBHids[i] );
96816a801ecSAriel Constenla-Haile aColorBoxes[i]->SetDropDownLineCount( 10 );
969cdf0e10cSrcweir }
970cdf0e10cSrcweir }
971cdf0e10cSrcweir /* -----------------------------27.03.2002 11:04------------------------------
972cdf0e10cSrcweir
973cdf0e10cSrcweir ---------------------------------------------------------------------------*/
~ColorConfigWindow_Impl()974cdf0e10cSrcweir ColorConfigWindow_Impl::~ColorConfigWindow_Impl()
975cdf0e10cSrcweir {
976cdf0e10cSrcweir aChapters.clear();
977cdf0e10cSrcweir ::std::vector< SvxExtFixedText_Impl*>().swap(aChapters);
978cdf0e10cSrcweir
979cdf0e10cSrcweir
980cdf0e10cSrcweir sal_Int32 nCount = aFixedTexts.size();
981cdf0e10cSrcweir for (sal_Int32 i = ColorConfigEntryCount; i < nCount; ++i)
982cdf0e10cSrcweir {
983cdf0e10cSrcweir delete aFixedTexts[i];
984cdf0e10cSrcweir delete aCheckBoxes[i];
985cdf0e10cSrcweir delete aColorBoxes[i];
986cdf0e10cSrcweir delete aWindows[i];
987cdf0e10cSrcweir }
988cdf0e10cSrcweir for (sal_uInt32 i = GROUP_COUNT; i < aChapterWins.size(); ++i)
989cdf0e10cSrcweir delete aChapterWins[i];
990cdf0e10cSrcweir aChapterWins.clear();
991cdf0e10cSrcweir ::std::vector< Window*>().swap(aChapterWins);
992cdf0e10cSrcweir }
993cdf0e10cSrcweir /* -----------------------------2002/06/20 12:48------------------------------
994cdf0e10cSrcweir
995cdf0e10cSrcweir ---------------------------------------------------------------------------*/
DataChanged(const DataChangedEvent & rDCEvt)996cdf0e10cSrcweir void ColorConfigWindow_Impl::DataChanged( const DataChangedEvent& rDCEvt )
997cdf0e10cSrcweir {
998cdf0e10cSrcweir Window::DataChanged( rDCEvt );
999cdf0e10cSrcweir if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
1000cdf0e10cSrcweir (rDCEvt.GetFlags() & SETTINGS_STYLE) )
1001cdf0e10cSrcweir {
1002cdf0e10cSrcweir const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
1003cdf0e10cSrcweir sal_Bool bHighContrast = rStyleSettings.GetHighContrastMode();
1004cdf0e10cSrcweir Color aBackColor( bHighContrast ? COL_TRANSPARENT : COL_LIGHTGRAY);
1005cdf0e10cSrcweir ::std::vector< Window* >::iterator aIter = aChapterWins.begin();
1006cdf0e10cSrcweir ::std::vector< Window* >::iterator aEnd = aChapterWins.end();
1007cdf0e10cSrcweir for(;aIter != aEnd; ++aIter )
1008cdf0e10cSrcweir (*aIter)->SetBackground(Wallpaper(aBackColor));
1009cdf0e10cSrcweir SetBackground(Wallpaper(rStyleSettings.GetWindowColor()));
1010cdf0e10cSrcweir }
1011cdf0e10cSrcweir }
1012cdf0e10cSrcweir /* -----------------------------2002/06/26 10:49------------------------------
1013cdf0e10cSrcweir
1014cdf0e10cSrcweir ---------------------------------------------------------------------------*/
DataChanged(const DataChangedEvent & rDCEvt)1015cdf0e10cSrcweir void SvxExtFixedText_Impl::DataChanged(const DataChangedEvent& rDCEvt)
1016cdf0e10cSrcweir {
1017cdf0e10cSrcweir FixedText::DataChanged(rDCEvt);
1018cdf0e10cSrcweir Color TempColor(COL_TRANSPARENT);
1019cdf0e10cSrcweir Wallpaper aTransparentWall(TempColor);
1020cdf0e10cSrcweir if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
1021cdf0e10cSrcweir (rDCEvt.GetFlags() & SETTINGS_STYLE) )
1022cdf0e10cSrcweir {
1023cdf0e10cSrcweir Font aFont = GetFont();
1024cdf0e10cSrcweir aFont.SetWeight(WEIGHT_BOLD);
1025cdf0e10cSrcweir SetFont(aFont);
1026cdf0e10cSrcweir SetBackground(aTransparentWall);
1027cdf0e10cSrcweir }
1028cdf0e10cSrcweir }
1029cdf0e10cSrcweir
SetNewPosition(sal_Int32 _nFeature,Window * _pWin)1030cdf0e10cSrcweir void ColorConfigWindow_Impl::SetNewPosition( sal_Int32 _nFeature, Window* _pWin )
1031cdf0e10cSrcweir {
1032cdf0e10cSrcweir DBG_ASSERT( _pWin, "ColorConfigWindow_Impl::SetNewPosition(): no window" );
1033cdf0e10cSrcweir
1034cdf0e10cSrcweir // calculate the overall height of the invisible groups
1035cdf0e10cSrcweir long nDelta = 0;
1036cdf0e10cSrcweir sal_Int16 nGroup = lcl_getGroup( _nFeature ) - 1;
1037cdf0e10cSrcweir while ( nGroup > 0 ) // GROUP_GENERAL (0) is always visible
1038cdf0e10cSrcweir {
1039cdf0e10cSrcweir if ( !lcl_isGroupVisible( nGroup, m_aModuleOptions ) )
1040cdf0e10cSrcweir nDelta += aChapters[nGroup]->GetGroupHeight();
1041cdf0e10cSrcweir nGroup--;
1042cdf0e10cSrcweir }
1043cdf0e10cSrcweir
1044cdf0e10cSrcweir // move this window to its new position
1045cdf0e10cSrcweir if ( nDelta > 0 )
1046cdf0e10cSrcweir {
1047cdf0e10cSrcweir Point aPos = _pWin->GetPosPixel();
1048cdf0e10cSrcweir aPos.Y() -= nDelta;
1049cdf0e10cSrcweir _pWin->SetPosPixel( aPos );
1050cdf0e10cSrcweir }
1051cdf0e10cSrcweir }
1052cdf0e10cSrcweir
1053cdf0e10cSrcweir /* -----------------------------08.04.2002 17:10------------------------------
1054cdf0e10cSrcweir
1055cdf0e10cSrcweir ---------------------------------------------------------------------------*/
Command(const CommandEvent & rCEvt)1056cdf0e10cSrcweir void ColorConfigWindow_Impl::Command( const CommandEvent& rCEvt )
1057cdf0e10cSrcweir {
1058cdf0e10cSrcweir GetParent()->Command(rCEvt);
1059cdf0e10cSrcweir }
1060cdf0e10cSrcweir /* -----------------------------25.03.2002 10:44------------------------------
1061cdf0e10cSrcweir
1062cdf0e10cSrcweir ---------------------------------------------------------------------------*/
1063cdf0e10cSrcweir class ColorConfigCtrl_Impl : public Control
1064cdf0e10cSrcweir {
1065cdf0e10cSrcweir HeaderBar aHeaderHB;
1066cdf0e10cSrcweir ScrollBar aVScroll;
1067cdf0e10cSrcweir
1068cdf0e10cSrcweir String sOn;
1069cdf0e10cSrcweir String sUIElem;
1070cdf0e10cSrcweir String sColSetting;
1071cdf0e10cSrcweir String sPreview;
1072cdf0e10cSrcweir ColorConfigWindow_Impl aScrollWindow;
1073cdf0e10cSrcweir
1074cdf0e10cSrcweir EditableColorConfig* pColorConfig;
1075cdf0e10cSrcweir EditableExtendedColorConfig* pExtColorConfig;
1076cdf0e10cSrcweir
1077cdf0e10cSrcweir long nScrollPos;
1078cdf0e10cSrcweir
1079cdf0e10cSrcweir DECL_LINK(ScrollHdl, ScrollBar*);
1080cdf0e10cSrcweir DECL_LINK(ClickHdl, CheckBox*);
1081cdf0e10cSrcweir DECL_LINK(ColorHdl, ColorListBox*);
1082cdf0e10cSrcweir DECL_LINK(ControlFocusHdl, Control*);
1083cdf0e10cSrcweir
1084cdf0e10cSrcweir virtual long PreNotify( NotifyEvent& rNEvt );
1085cdf0e10cSrcweir virtual void Command( const CommandEvent& rCEvt );
1086cdf0e10cSrcweir virtual void DataChanged( const DataChangedEvent& rDCEvt );
1087cdf0e10cSrcweir public:
1088cdf0e10cSrcweir ColorConfigCtrl_Impl(Window* pParent, const ResId& rResId );
1089cdf0e10cSrcweir ~ColorConfigCtrl_Impl();
1090cdf0e10cSrcweir
SetConfig(EditableColorConfig & rConfig)1091cdf0e10cSrcweir void SetConfig(EditableColorConfig& rConfig) {pColorConfig = &rConfig;}
SetExtendedConfig(EditableExtendedColorConfig & rConfig)1092cdf0e10cSrcweir void SetExtendedConfig(EditableExtendedColorConfig& rConfig) {pExtColorConfig = &rConfig;}
1093cdf0e10cSrcweir void Update();
GetScrollPosition()1094cdf0e10cSrcweir sal_Int32 GetScrollPosition() {return aVScroll.GetThumbPos();}
SetScrollPosition(sal_Int32 nSet)1095cdf0e10cSrcweir void SetScrollPosition(sal_Int32 nSet)
1096cdf0e10cSrcweir {
1097cdf0e10cSrcweir aVScroll.SetThumbPos(nSet);
1098cdf0e10cSrcweir ScrollHdl(&aVScroll);
1099cdf0e10cSrcweir }
1100cdf0e10cSrcweir };
1101cdf0e10cSrcweir /* -----------------------------25.03.2002 17:09------------------------------
1102cdf0e10cSrcweir
1103cdf0e10cSrcweir ---------------------------------------------------------------------------*/
ColorConfigCtrl_Impl(Window * pParent,const ResId & rResId)1104cdf0e10cSrcweir ColorConfigCtrl_Impl::ColorConfigCtrl_Impl(
1105cdf0e10cSrcweir Window* pParent, const ResId& rResId) :
1106cdf0e10cSrcweir Control(pParent, rResId),
1107cdf0e10cSrcweir
1108cdf0e10cSrcweir
1109cdf0e10cSrcweir aHeaderHB(this, WB_BUTTONSTYLE | WB_BOTTOMBORDER),
1110cdf0e10cSrcweir aVScroll(this, ResId(VB_VSCROLL, *rResId.GetResMgr())),
1111cdf0e10cSrcweir sOn( ResId(ST_ON, *rResId.GetResMgr())),
1112cdf0e10cSrcweir sUIElem( ResId(ST_UIELEM, *rResId.GetResMgr())),
1113cdf0e10cSrcweir sColSetting( ResId(ST_COLSET, *rResId.GetResMgr())),
1114cdf0e10cSrcweir sPreview( ResId(ST_PREVIEW, *rResId.GetResMgr())),
1115cdf0e10cSrcweir aScrollWindow(this, ResId(WN_SCROLL, *rResId.GetResMgr())),
1116cdf0e10cSrcweir
1117cdf0e10cSrcweir pColorConfig(0),
1118cdf0e10cSrcweir pExtColorConfig(0),
1119cdf0e10cSrcweir nScrollPos(0)
1120cdf0e10cSrcweir {
1121cdf0e10cSrcweir FreeResource();
1122cdf0e10cSrcweir
1123cdf0e10cSrcweir const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
1124cdf0e10cSrcweir aScrollWindow.SetBackground(Wallpaper(rStyleSettings.GetFieldColor()));
1125cdf0e10cSrcweir aScrollWindow.SetHelpId( HID_OPTIONS_COLORCONFIG_COLORLIST_WIN );
1126cdf0e10cSrcweir aVScroll.EnableDrag();
1127cdf0e10cSrcweir aVScroll.Show();
1128cdf0e10cSrcweir aHeaderHB.SetPosSizePixel(
1129cdf0e10cSrcweir Point(0,0),
1130cdf0e10cSrcweir Size(GetOutputSizePixel().Width(), aVScroll.GetPosPixel().Y()));
1131cdf0e10cSrcweir sal_Int32 nFirstWidth = aScrollWindow.aGeneralFT.GetPosPixel().X();
1132cdf0e10cSrcweir sal_Int32 nSecondWidth = aScrollWindow.aColorBoxes[0]->GetPosPixel().X() - nFirstWidth;
1133cdf0e10cSrcweir sal_Int32 nThirdWidth = aScrollWindow.aWindows[0]->GetPosPixel().X() - nFirstWidth - nSecondWidth;
1134cdf0e10cSrcweir
1135cdf0e10cSrcweir const WinBits nHeadBits = HIB_VCENTER | HIB_FIXED| HIB_FIXEDPOS;
1136cdf0e10cSrcweir aHeaderHB.InsertItem( 1, sOn, nFirstWidth, (sal_uInt16)nHeadBits|HIB_CENTER);
1137cdf0e10cSrcweir aHeaderHB.InsertItem( 2, sUIElem, nSecondWidth, (sal_uInt16)nHeadBits|HIB_LEFT);
1138cdf0e10cSrcweir aHeaderHB.InsertItem( 3, sColSetting, nThirdWidth, (sal_uInt16)nHeadBits|HIB_LEFT);
1139cdf0e10cSrcweir aHeaderHB.InsertItem( 4, sPreview,
1140cdf0e10cSrcweir aHeaderHB.GetSizePixel().Width() - nFirstWidth - nSecondWidth - nThirdWidth, (sal_uInt16)nHeadBits|HIB_LEFT);
1141cdf0e10cSrcweir aHeaderHB.Show();
1142cdf0e10cSrcweir
1143cdf0e10cSrcweir aVScroll.SetRangeMin(0);
1144cdf0e10cSrcweir sal_Int32 nScrollOffset = aScrollWindow.aColorBoxes[1]->GetPosPixel().Y() - aScrollWindow.aColorBoxes[0]->GetPosPixel().Y();
1145cdf0e10cSrcweir sal_Int32 nVisibleEntries = aScrollWindow.GetSizePixel().Height() / nScrollOffset;
1146cdf0e10cSrcweir
1147cdf0e10cSrcweir aVScroll.SetRangeMax(aScrollWindow.aCheckBoxes.size() + aScrollWindow.aChapters.size() );
1148cdf0e10cSrcweir // static: minus three for ANCHOR, DRAWFILL and DRAWDRAWING
1149cdf0e10cSrcweir aVScroll.SetRangeMax( aVScroll.GetRangeMax() - 3 );
1150cdf0e10cSrcweir // dynamic: calculate the hidden lines
1151cdf0e10cSrcweir long nInvisibleLines = 0;
1152cdf0e10cSrcweir sal_Int16 nGroup = GROUP_UNKNOWN;
1153cdf0e10cSrcweir sal_Int32 nCount = aScrollWindow.aCheckBoxes.size();
1154cdf0e10cSrcweir for ( sal_Int32 i = 0; i < nCount; i++ )
1155cdf0e10cSrcweir {
1156cdf0e10cSrcweir if ( ANCHOR == i || DRAWFILL == i || DRAWDRAWING == i ) // not used at the moment
1157cdf0e10cSrcweir continue;
1158cdf0e10cSrcweir sal_Int16 nNewGroup = lcl_getGroup(i);
1159cdf0e10cSrcweir sal_Bool bVisible = lcl_isGroupVisible( nNewGroup, aScrollWindow.GetModuleOptions() );
1160cdf0e10cSrcweir if ( !bVisible )
1161cdf0e10cSrcweir nInvisibleLines++;
1162cdf0e10cSrcweir if ( nNewGroup > nGroup )
1163cdf0e10cSrcweir {
1164cdf0e10cSrcweir nGroup = nNewGroup;
1165cdf0e10cSrcweir if ( !bVisible )
1166cdf0e10cSrcweir nInvisibleLines++;
1167cdf0e10cSrcweir }
1168cdf0e10cSrcweir }
1169cdf0e10cSrcweir aVScroll.SetRangeMax( aVScroll.GetRangeMax() - nInvisibleLines );
1170cdf0e10cSrcweir
1171cdf0e10cSrcweir aVScroll.SetPageSize( nVisibleEntries - 1 );
1172cdf0e10cSrcweir aVScroll.SetVisibleSize(nVisibleEntries);
1173cdf0e10cSrcweir Link aScrollLink = LINK(this, ColorConfigCtrl_Impl, ScrollHdl);
1174cdf0e10cSrcweir aVScroll.SetScrollHdl(aScrollLink);
1175cdf0e10cSrcweir aVScroll.SetEndScrollHdl(aScrollLink);
1176cdf0e10cSrcweir
1177cdf0e10cSrcweir Link aCheckLink = LINK(this, ColorConfigCtrl_Impl, ClickHdl);
1178cdf0e10cSrcweir Link aColorLink = LINK(this, ColorConfigCtrl_Impl, ColorHdl);
1179cdf0e10cSrcweir Link aGetFocusLink = LINK(this, ColorConfigCtrl_Impl, ControlFocusHdl);
1180cdf0e10cSrcweir for( sal_Int16 i = 0; i < nCount; i++ )
1181cdf0e10cSrcweir {
1182cdf0e10cSrcweir if(aScrollWindow.aColorBoxes[i])
1183cdf0e10cSrcweir {
1184cdf0e10cSrcweir aScrollWindow.aColorBoxes[i]->SetSelectHdl(aColorLink);
1185cdf0e10cSrcweir aScrollWindow.aColorBoxes[i]->SetGetFocusHdl(aGetFocusLink);
1186cdf0e10cSrcweir }
1187cdf0e10cSrcweir if(aScrollWindow.aCheckBoxes[i])
1188cdf0e10cSrcweir {
1189cdf0e10cSrcweir aScrollWindow.aCheckBoxes[i]->SetClickHdl(aCheckLink);
1190cdf0e10cSrcweir aScrollWindow.aCheckBoxes[i]->SetGetFocusHdl(aGetFocusLink);
1191cdf0e10cSrcweir }
1192cdf0e10cSrcweir }
1193cdf0e10cSrcweir }
1194cdf0e10cSrcweir /* -----------------------------27.03.2002 10:46------------------------------
1195cdf0e10cSrcweir
1196cdf0e10cSrcweir ---------------------------------------------------------------------------*/
~ColorConfigCtrl_Impl()1197cdf0e10cSrcweir ColorConfigCtrl_Impl::~ColorConfigCtrl_Impl()
1198cdf0e10cSrcweir {
1199cdf0e10cSrcweir }
1200cdf0e10cSrcweir /* -----------------------------25.03.2002 17:19------------------------------
1201cdf0e10cSrcweir
1202cdf0e10cSrcweir ---------------------------------------------------------------------------*/
Update()1203cdf0e10cSrcweir void ColorConfigCtrl_Impl::Update()
1204cdf0e10cSrcweir {
1205cdf0e10cSrcweir DBG_ASSERT(pColorConfig, "Configuration not set" );
1206cdf0e10cSrcweir sal_Int32 i;
1207cdf0e10cSrcweir for( i = 0; i < ColorConfigEntryCount; i++ )
1208cdf0e10cSrcweir {
1209cdf0e10cSrcweir if(ANCHOR == i)
1210cdf0e10cSrcweir continue;
1211cdf0e10cSrcweir const ColorConfigValue& rColorEntry = pColorConfig->GetColorValue(ColorConfigEntry(i));
1212cdf0e10cSrcweir if(COL_AUTO == (sal_uInt32)rColorEntry.nColor)
1213cdf0e10cSrcweir {
1214cdf0e10cSrcweir if(aScrollWindow.aColorBoxes[i])
1215cdf0e10cSrcweir aScrollWindow.aColorBoxes[i]->SelectEntryPos(0);
1216cdf0e10cSrcweir if(aScrollWindow.aWindows[i])
1217cdf0e10cSrcweir aScrollWindow.aWindows[i]->SetBackground(
1218cdf0e10cSrcweir Wallpaper(ColorConfig::GetDefaultColor((ColorConfigEntry) i)));
1219cdf0e10cSrcweir }
1220cdf0e10cSrcweir else
1221cdf0e10cSrcweir {
1222cdf0e10cSrcweir Color aColor(rColorEntry.nColor);
1223cdf0e10cSrcweir if(aScrollWindow.aColorBoxes[i])
1224cdf0e10cSrcweir aScrollWindow.aColorBoxes[i]->SelectEntry( aColor );
1225cdf0e10cSrcweir if(aScrollWindow.aWindows[i])
1226cdf0e10cSrcweir aScrollWindow.aWindows[i]->SetBackground(Wallpaper(aColor));
1227cdf0e10cSrcweir }
1228cdf0e10cSrcweir if(aScrollWindow.aWindows[i])
1229cdf0e10cSrcweir aScrollWindow.aWindows[i]->Invalidate();
1230cdf0e10cSrcweir if(aScrollWindow.aCheckBoxes[i])
1231cdf0e10cSrcweir aScrollWindow.aCheckBoxes[i]->Check(rColorEntry.bIsVisible);
1232cdf0e10cSrcweir } // for( i = 0; i < ColorConfigEntryCount; i++ )
1233cdf0e10cSrcweir
1234cdf0e10cSrcweir
1235cdf0e10cSrcweir sal_Int32 nExtCount = pExtColorConfig->GetComponentCount();
1236cdf0e10cSrcweir sal_Int32 nCount = aScrollWindow.aCheckBoxes.size();
1237cdf0e10cSrcweir sal_Int32 nPos = 0;
1238cdf0e10cSrcweir i = ColorConfigEntryCount;
1239cdf0e10cSrcweir for (sal_Int32 j = 0; j < nExtCount; ++j)
1240cdf0e10cSrcweir {
1241cdf0e10cSrcweir ::rtl::OUString sComponentName = pExtColorConfig->GetComponentName(j);
1242cdf0e10cSrcweir sal_Int32 nColorCount = pExtColorConfig->GetComponentColorCount(sComponentName);
1243cdf0e10cSrcweir
1244cdf0e10cSrcweir for( sal_Int32 k = 0; i < nCount && k < nColorCount; ++i ,++nPos,++k)
1245cdf0e10cSrcweir {
1246cdf0e10cSrcweir if(aScrollWindow.aColorBoxes[i])
1247cdf0e10cSrcweir {
1248cdf0e10cSrcweir ExtendedColorConfigValue aColorEntry = pExtColorConfig->GetComponentColorConfigValue(sComponentName,k);
1249cdf0e10cSrcweir Color aColor(aColorEntry.getColor());
1250cdf0e10cSrcweir if(aColorEntry.getDefaultColor() == aColorEntry.getColor() )
1251cdf0e10cSrcweir {
1252cdf0e10cSrcweir aScrollWindow.aColorBoxes[i]->SelectEntryPos(0);
1253cdf0e10cSrcweir }
1254cdf0e10cSrcweir else
1255cdf0e10cSrcweir {
1256cdf0e10cSrcweir aScrollWindow.aColorBoxes[i]->SelectEntry( aColor );
1257cdf0e10cSrcweir }
1258cdf0e10cSrcweir if(aScrollWindow.aWindows[i])
1259cdf0e10cSrcweir aScrollWindow.aWindows[i]->SetBackground(Wallpaper(aColor));
1260cdf0e10cSrcweir
1261cdf0e10cSrcweir if(aScrollWindow.aWindows[i])
1262cdf0e10cSrcweir aScrollWindow.aWindows[i]->Invalidate();
1263cdf0e10cSrcweir }
1264cdf0e10cSrcweir }
1265cdf0e10cSrcweir }
1266cdf0e10cSrcweir }
1267cdf0e10cSrcweir /* -----------------------------26.03.2002 12:55------------------------------
1268cdf0e10cSrcweir
1269cdf0e10cSrcweir ---------------------------------------------------------------------------*/
lcl_MoveAndShow(Window * pWindow,long nOffset,long nMaxVisible,bool _bShow)1270cdf0e10cSrcweir sal_Bool lcl_MoveAndShow(Window* pWindow, long nOffset, long nMaxVisible, bool _bShow)
1271cdf0e10cSrcweir {
1272cdf0e10cSrcweir sal_Bool bHide = sal_True;
1273cdf0e10cSrcweir if(pWindow)
1274cdf0e10cSrcweir {
1275cdf0e10cSrcweir Point aPos = pWindow->GetPosPixel();
1276cdf0e10cSrcweir aPos.Y() += nOffset;
1277cdf0e10cSrcweir pWindow->SetPosPixel(aPos);
1278cdf0e10cSrcweir if ( _bShow )
1279cdf0e10cSrcweir bHide = aPos.Y() > nMaxVisible || (aPos.Y() + pWindow->GetSizePixel().Height()) < 0;
1280cdf0e10cSrcweir pWindow->Show(!bHide);
1281cdf0e10cSrcweir }
1282cdf0e10cSrcweir return !bHide;
1283cdf0e10cSrcweir }
IMPL_LINK(ColorConfigCtrl_Impl,ScrollHdl,ScrollBar *,pScrollBar)1284cdf0e10cSrcweir IMPL_LINK(ColorConfigCtrl_Impl, ScrollHdl, ScrollBar*, pScrollBar)
1285cdf0e10cSrcweir {
1286cdf0e10cSrcweir aScrollWindow.SetUpdateMode(sal_True);
1287cdf0e10cSrcweir sal_Int16 i;
1288cdf0e10cSrcweir long nOffset = aScrollWindow.aColorBoxes[1]->GetPosPixel().Y() - aScrollWindow.aColorBoxes[0]->GetPosPixel().Y();
1289cdf0e10cSrcweir nOffset *= (nScrollPos - pScrollBar->GetThumbPos());
1290cdf0e10cSrcweir nScrollPos = pScrollBar->GetThumbPos();
1291cdf0e10cSrcweir const long nWindowHeight = aScrollWindow.GetSizePixel().Height();
1292cdf0e10cSrcweir sal_Int16 nFirstVisible = -1;
1293cdf0e10cSrcweir sal_Int16 nLastVisible = -1;
1294cdf0e10cSrcweir sal_Int32 nCount = aScrollWindow.aFixedTexts.size();
1295cdf0e10cSrcweir for( i = 0; i < nCount; i++ )
1296cdf0e10cSrcweir {
1297cdf0e10cSrcweir if(ANCHOR == i)
1298cdf0e10cSrcweir continue;
1299cdf0e10cSrcweir Point aPos;
1300cdf0e10cSrcweir //controls outside of the view need to be hidden to speed up accessibility tools
1301cdf0e10cSrcweir bool bShowCtrl = ( lcl_isGroupVisible(
1302cdf0e10cSrcweir lcl_getGroup(i), aScrollWindow.GetModuleOptions() ) != sal_False );
1303cdf0e10cSrcweir lcl_MoveAndShow(aScrollWindow.aCheckBoxes[i], nOffset, nWindowHeight, bShowCtrl);
1304cdf0e10cSrcweir lcl_MoveAndShow(aScrollWindow.aFixedTexts[i], nOffset, nWindowHeight, bShowCtrl);
1305cdf0e10cSrcweir lcl_MoveAndShow(aScrollWindow.aWindows[i] , nOffset, nWindowHeight, bShowCtrl);
1306cdf0e10cSrcweir sal_Bool bShow = lcl_MoveAndShow(aScrollWindow.aColorBoxes[i], nOffset, nWindowHeight, bShowCtrl);
1307cdf0e10cSrcweir if(bShow)
1308cdf0e10cSrcweir {
1309cdf0e10cSrcweir if(nFirstVisible == -1)
1310cdf0e10cSrcweir nFirstVisible = i;
1311cdf0e10cSrcweir else
1312cdf0e10cSrcweir nLastVisible = i;
1313cdf0e10cSrcweir }
1314cdf0e10cSrcweir }
1315cdf0e10cSrcweir //show the one prior to the first visible and the first after the last visble control
1316cdf0e10cSrcweir //to enable KEY_TAB travelling
1317cdf0e10cSrcweir
1318cdf0e10cSrcweir if(nFirstVisible)
1319cdf0e10cSrcweir {
1320cdf0e10cSrcweir //skip gaps where no controls exist for the related ColorConfigEntry
1321cdf0e10cSrcweir do
1322cdf0e10cSrcweir --nFirstVisible;
1323cdf0e10cSrcweir while(!aScrollWindow.aCheckBoxes[nFirstVisible] && !aScrollWindow.aColorBoxes[nFirstVisible] && nFirstVisible >= 0);
1324cdf0e10cSrcweir
1325cdf0e10cSrcweir if ( lcl_isGroupVisible(
1326cdf0e10cSrcweir lcl_getGroup( nFirstVisible ), aScrollWindow.GetModuleOptions() ) != sal_False )
1327cdf0e10cSrcweir {
1328cdf0e10cSrcweir if(aScrollWindow.aCheckBoxes[nFirstVisible])
1329cdf0e10cSrcweir aScrollWindow.aCheckBoxes[nFirstVisible]->Show();
1330cdf0e10cSrcweir if(aScrollWindow.aColorBoxes[nFirstVisible])
1331cdf0e10cSrcweir aScrollWindow.aColorBoxes[nFirstVisible]->Show();
1332cdf0e10cSrcweir }
1333cdf0e10cSrcweir }
1334cdf0e10cSrcweir
1335cdf0e10cSrcweir if(nLastVisible < nCount - 1)
1336cdf0e10cSrcweir {
1337cdf0e10cSrcweir nLastVisible++;
1338cdf0e10cSrcweir //skip gaps where no controls exist for the related ColorConfigEntry
1339cdf0e10cSrcweir while(!aScrollWindow.aCheckBoxes[nLastVisible] && !aScrollWindow.aColorBoxes[nLastVisible] &&
1340cdf0e10cSrcweir nLastVisible < nCount - 1 )
1341cdf0e10cSrcweir nLastVisible++;
1342cdf0e10cSrcweir if ( nLastVisible < nCount )
1343cdf0e10cSrcweir {
1344cdf0e10cSrcweir if ( lcl_isGroupVisible(
1345cdf0e10cSrcweir lcl_getGroup( nLastVisible ), aScrollWindow.GetModuleOptions() ) != sal_False )
1346cdf0e10cSrcweir {
1347cdf0e10cSrcweir if(aScrollWindow.aCheckBoxes[nLastVisible])
1348cdf0e10cSrcweir aScrollWindow.aCheckBoxes[nLastVisible]->Show();
1349cdf0e10cSrcweir if(aScrollWindow.aColorBoxes[nLastVisible])
1350cdf0e10cSrcweir aScrollWindow.aColorBoxes[nLastVisible]->Show();
1351cdf0e10cSrcweir }
1352cdf0e10cSrcweir }
1353cdf0e10cSrcweir } // if(nLastVisible < nCount - 1)
1354cdf0e10cSrcweir sal_Int32 nChapterCount = aScrollWindow.aChapters.size();
1355cdf0e10cSrcweir for( i = 0; i < nChapterCount; i++ )
1356cdf0e10cSrcweir {
1357cdf0e10cSrcweir Point aPos = aScrollWindow.aChapters[i]->GetPosPixel(); aPos.Y() += nOffset; aScrollWindow.aChapters[i]->SetPosPixel(aPos);
1358cdf0e10cSrcweir aPos = aScrollWindow.aChapterWins[i]->GetPosPixel(); aPos.Y() += nOffset; aScrollWindow.aChapterWins[i]->SetPosPixel(aPos);
1359cdf0e10cSrcweir }
1360cdf0e10cSrcweir aScrollWindow.SetUpdateMode(sal_True);
1361cdf0e10cSrcweir return 0;
1362cdf0e10cSrcweir }
1363cdf0e10cSrcweir /* -----------------------------29.04.2002 17:02------------------------------
1364cdf0e10cSrcweir
1365cdf0e10cSrcweir ---------------------------------------------------------------------------*/
PreNotify(NotifyEvent & rNEvt)1366cdf0e10cSrcweir long ColorConfigCtrl_Impl::PreNotify( NotifyEvent& rNEvt )
1367cdf0e10cSrcweir {
1368cdf0e10cSrcweir if(rNEvt.GetType() == EVENT_COMMAND)
1369cdf0e10cSrcweir {
1370cdf0e10cSrcweir const CommandEvent* pCEvt = rNEvt.GetCommandEvent();
1371cdf0e10cSrcweir sal_uInt16 nCmd = pCEvt->GetCommand();
1372cdf0e10cSrcweir if( COMMAND_WHEEL == nCmd )
1373cdf0e10cSrcweir {
1374cdf0e10cSrcweir Command(*pCEvt);
1375cdf0e10cSrcweir return 1;
1376cdf0e10cSrcweir }
1377cdf0e10cSrcweir }
1378cdf0e10cSrcweir return Control::PreNotify(rNEvt);
1379cdf0e10cSrcweir }
1380cdf0e10cSrcweir /* -----------------------------08.04.2002 16:37------------------------------
1381cdf0e10cSrcweir
1382cdf0e10cSrcweir ---------------------------------------------------------------------------*/
Command(const CommandEvent & rCEvt)1383cdf0e10cSrcweir void ColorConfigCtrl_Impl::Command( const CommandEvent& rCEvt )
1384cdf0e10cSrcweir {
1385cdf0e10cSrcweir switch ( rCEvt.GetCommand() )
1386cdf0e10cSrcweir {
1387cdf0e10cSrcweir
1388cdf0e10cSrcweir case COMMAND_WHEEL:
1389cdf0e10cSrcweir case COMMAND_STARTAUTOSCROLL:
1390cdf0e10cSrcweir case COMMAND_AUTOSCROLL:
1391cdf0e10cSrcweir {
1392cdf0e10cSrcweir const CommandWheelData* pWheelData = rCEvt.GetWheelData();
1393cdf0e10cSrcweir if(pWheelData && !pWheelData->IsHorz() && COMMAND_WHEEL_ZOOM != pWheelData->GetMode())
1394cdf0e10cSrcweir {
1395cdf0e10cSrcweir HandleScrollCommand( rCEvt, 0, &aVScroll );
1396cdf0e10cSrcweir }
1397cdf0e10cSrcweir }
1398cdf0e10cSrcweir break;
1399cdf0e10cSrcweir default:
1400cdf0e10cSrcweir Control::Command(rCEvt);
1401cdf0e10cSrcweir }
1402cdf0e10cSrcweir }
1403cdf0e10cSrcweir
1404cdf0e10cSrcweir /* -----------------------------14.12.2005 12:37------------------------------
1405cdf0e10cSrcweir
1406cdf0e10cSrcweir ---------------------------------------------------------------------------*/
DataChanged(const DataChangedEvent & rDCEvt)1407cdf0e10cSrcweir void ColorConfigCtrl_Impl::DataChanged( const DataChangedEvent& rDCEvt )
1408cdf0e10cSrcweir {
1409cdf0e10cSrcweir Window::DataChanged( rDCEvt );
1410cdf0e10cSrcweir if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
1411cdf0e10cSrcweir (rDCEvt.GetFlags() & SETTINGS_STYLE) )
1412cdf0e10cSrcweir {
1413cdf0e10cSrcweir const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
1414cdf0e10cSrcweir SetBackground(Wallpaper(rStyleSettings.GetFieldColor()));
1415cdf0e10cSrcweir }
1416cdf0e10cSrcweir }
1417cdf0e10cSrcweir
1418cdf0e10cSrcweir
1419cdf0e10cSrcweir /* -----------------------------27.03.2002 11:43------------------------------
1420cdf0e10cSrcweir
1421cdf0e10cSrcweir ---------------------------------------------------------------------------*/
IMPL_LINK(ColorConfigCtrl_Impl,ClickHdl,CheckBox *,pBox)1422cdf0e10cSrcweir IMPL_LINK(ColorConfigCtrl_Impl, ClickHdl, CheckBox*, pBox)
1423cdf0e10cSrcweir {
1424cdf0e10cSrcweir DBG_ASSERT(pColorConfig, "Configuration not set" );
1425cdf0e10cSrcweir
1426cdf0e10cSrcweir for( sal_Int32 i = 0; i < ColorConfigEntryCount; i++ )
1427cdf0e10cSrcweir {
1428cdf0e10cSrcweir if(ANCHOR == i)
1429cdf0e10cSrcweir continue;
1430cdf0e10cSrcweir if(aScrollWindow.aCheckBoxes[i] == pBox )
1431cdf0e10cSrcweir {
1432cdf0e10cSrcweir ColorConfigValue aBoundCol = pColorConfig->GetColorValue(ColorConfigEntry(i));
1433cdf0e10cSrcweir aBoundCol.bIsVisible = pBox->IsChecked();
1434cdf0e10cSrcweir pColorConfig->SetColorValue(ColorConfigEntry(i), aBoundCol);
1435cdf0e10cSrcweir break;
1436cdf0e10cSrcweir }
1437cdf0e10cSrcweir } // for( sal_Int32 i = 0; i < ColorConfigEntryCount; i++ )
1438cdf0e10cSrcweir return 0;
1439cdf0e10cSrcweir }
1440cdf0e10cSrcweir /* -----------------------------27.03.2002 11:43------------------------------
1441cdf0e10cSrcweir
1442cdf0e10cSrcweir ---------------------------------------------------------------------------*/
IMPL_LINK(ColorConfigCtrl_Impl,ColorHdl,ColorListBox *,pBox)1443cdf0e10cSrcweir IMPL_LINK(ColorConfigCtrl_Impl, ColorHdl, ColorListBox*, pBox)
1444cdf0e10cSrcweir {
1445cdf0e10cSrcweir DBG_ASSERT(pColorConfig, "Configuration not set" );
1446cdf0e10cSrcweir sal_Int32 i = 0;
1447cdf0e10cSrcweir for( ; i < ColorConfigEntryCount; i++ )
1448cdf0e10cSrcweir {
1449cdf0e10cSrcweir if(pBox && aScrollWindow.aColorBoxes[i] == pBox)
1450cdf0e10cSrcweir {
1451cdf0e10cSrcweir ColorConfigValue aColorEntry = pColorConfig->GetColorValue(ColorConfigEntry(i));
1452cdf0e10cSrcweir if(!pBox->GetSelectEntryPos())
1453cdf0e10cSrcweir {
1454cdf0e10cSrcweir aColorEntry.nColor = COL_AUTO;
1455cdf0e10cSrcweir if(aScrollWindow.aWindows[i])
1456cdf0e10cSrcweir aScrollWindow.aWindows[i]->SetBackground(
1457cdf0e10cSrcweir Wallpaper(ColorConfig::GetDefaultColor((ColorConfigEntry) i)));
1458cdf0e10cSrcweir }
1459cdf0e10cSrcweir else
1460cdf0e10cSrcweir {
1461cdf0e10cSrcweir Color aColor = pBox->GetSelectEntryColor(); // #i14869# no Color&, 'cause it's a ref to a temp object on the stack!
1462cdf0e10cSrcweir aColorEntry.nColor = aColor.GetColor();
1463cdf0e10cSrcweir if(aScrollWindow.aWindows[i])
1464cdf0e10cSrcweir aScrollWindow.aWindows[i]->SetBackground(Wallpaper(aColor));
1465cdf0e10cSrcweir }
1466cdf0e10cSrcweir if(aScrollWindow.aWindows[i])
1467cdf0e10cSrcweir aScrollWindow.aWindows[i]->Invalidate();
1468cdf0e10cSrcweir pColorConfig->SetColorValue(ColorConfigEntry(i), aColorEntry);
1469cdf0e10cSrcweir break;
1470cdf0e10cSrcweir }
1471cdf0e10cSrcweir } // for( sal_Int32 i = 0; i < ColorConfigEntryCount; i++ )
1472cdf0e10cSrcweir sal_Int32 nExtCount = pExtColorConfig->GetComponentCount();
1473cdf0e10cSrcweir sal_Int32 nCount = aScrollWindow.aCheckBoxes.size();
1474cdf0e10cSrcweir sal_Int32 nPos = 0;
1475cdf0e10cSrcweir i = ColorConfigEntryCount;
1476cdf0e10cSrcweir for (sal_Int32 j = 0; j < nExtCount; ++j)
1477cdf0e10cSrcweir {
1478cdf0e10cSrcweir ::rtl::OUString sComponentName = pExtColorConfig->GetComponentName(j);
1479cdf0e10cSrcweir sal_Int32 nColorCount = pExtColorConfig->GetComponentColorCount(sComponentName);
1480cdf0e10cSrcweir
1481cdf0e10cSrcweir for( sal_Int32 k = 0; i < nCount && k < nColorCount; ++i ,++nPos,++k)
1482cdf0e10cSrcweir {
1483cdf0e10cSrcweir if(pBox && aScrollWindow.aColorBoxes[i] == pBox)
1484cdf0e10cSrcweir {
1485cdf0e10cSrcweir ExtendedColorConfigValue aColorEntry = pExtColorConfig->GetComponentColorConfigValue(sComponentName,k);
1486cdf0e10cSrcweir Color aColor = pBox->GetSelectEntryColor(); // #i14869# no Color&, 'cause it's a ref to a temp object on the stack!
1487cdf0e10cSrcweir aColorEntry.setColor(aColor.GetColor());
1488cdf0e10cSrcweir if( !pBox->GetSelectEntryPos() ) // auto color
1489cdf0e10cSrcweir {
1490cdf0e10cSrcweir aColorEntry.setColor(aColorEntry.getDefaultColor());
1491cdf0e10cSrcweir aColor.SetColor(aColorEntry.getColor());
1492cdf0e10cSrcweir }
1493cdf0e10cSrcweir if ( aScrollWindow.aWindows[i] )
1494cdf0e10cSrcweir {
1495cdf0e10cSrcweir aScrollWindow.aWindows[i]->SetBackground(Wallpaper(aColor));
1496cdf0e10cSrcweir aScrollWindow.aWindows[i]->Invalidate();
1497cdf0e10cSrcweir }
1498cdf0e10cSrcweir pExtColorConfig->SetColorValue(sComponentName,aColorEntry);
1499cdf0e10cSrcweir break;
1500cdf0e10cSrcweir }
1501cdf0e10cSrcweir }
1502cdf0e10cSrcweir }
1503cdf0e10cSrcweir return 0;
1504cdf0e10cSrcweir }
IMPL_LINK(ColorConfigCtrl_Impl,ControlFocusHdl,Control *,pCtrl)1505cdf0e10cSrcweir IMPL_LINK(ColorConfigCtrl_Impl, ControlFocusHdl, Control*, pCtrl)
1506cdf0e10cSrcweir {
1507cdf0e10cSrcweir //determine whether a control is completely visible
1508cdf0e10cSrcweir //and make it visible
1509cdf0e10cSrcweir Point aCtrlPos(pCtrl->GetPosPixel());
1510cdf0e10cSrcweir sal_Int32 nWinHeight = aScrollWindow.GetSizePixel().Height();
1511cdf0e10cSrcweir if(0 != (GETFOCUS_TAB & pCtrl->GetGetFocusFlags() &&
1512cdf0e10cSrcweir (aCtrlPos.Y() < 0 ||
1513cdf0e10cSrcweir nWinHeight < aCtrlPos.Y() + aScrollWindow.aColorBoxes[0]->GetSizePixel().Height())))
1514cdf0e10cSrcweir {
1515cdf0e10cSrcweir long nThumbPos = aVScroll.GetThumbPos();
1516cdf0e10cSrcweir if(nWinHeight < aCtrlPos.Y() + aScrollWindow.aColorBoxes[0]->GetSizePixel().Height())
1517cdf0e10cSrcweir {
1518cdf0e10cSrcweir //scroll down
1519cdf0e10cSrcweir nThumbPos +=2;
1520cdf0e10cSrcweir }
1521cdf0e10cSrcweir else
1522cdf0e10cSrcweir {
1523cdf0e10cSrcweir //scroll up
1524cdf0e10cSrcweir nThumbPos -= 2;
1525cdf0e10cSrcweir if(nThumbPos < 0)
1526cdf0e10cSrcweir nThumbPos = 0;
1527cdf0e10cSrcweir }
1528cdf0e10cSrcweir aVScroll.SetThumbPos(nThumbPos);
1529cdf0e10cSrcweir ScrollHdl(&aVScroll);
1530cdf0e10cSrcweir }
1531cdf0e10cSrcweir return 0;
1532cdf0e10cSrcweir };
1533cdf0e10cSrcweir /* -----------------------------25.03.2002 10:47------------------------------
1534cdf0e10cSrcweir
1535cdf0e10cSrcweir ---------------------------------------------------------------------------*/
SvxColorOptionsTabPage(Window * pParent,const SfxItemSet & rCoreSet)1536cdf0e10cSrcweir SvxColorOptionsTabPage::SvxColorOptionsTabPage(
1537cdf0e10cSrcweir Window* pParent, const SfxItemSet& rCoreSet) :
1538cdf0e10cSrcweir SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_COLORCONFIG ), rCoreSet ),
1539cdf0e10cSrcweir aColorSchemeFL( this, CUI_RES( FL_COLORSCHEME ) ),
1540cdf0e10cSrcweir aColorSchemeFT( this, CUI_RES( FT_COLORSCHEME ) ),
1541cdf0e10cSrcweir aColorSchemeLB( this, CUI_RES( LB_COLORSCHEME ) ),
1542cdf0e10cSrcweir aSaveSchemePB( this, CUI_RES( PB_SAVESCHEME) ),
1543cdf0e10cSrcweir aDeleteSchemePB( this, CUI_RES( PB_DELETESCHEME ) ),
1544cdf0e10cSrcweir aCustomColorsFL( this, CUI_RES( FL_CUSTOMCOLORS ) ),
1545cdf0e10cSrcweir bFillItemSetCalled(sal_False),
1546cdf0e10cSrcweir pColorConfig(0),
1547cdf0e10cSrcweir pExtColorConfig(0),
1548cdf0e10cSrcweir pColorConfigCT( new ColorConfigCtrl_Impl(this, CUI_RES( CT_COLORCONFIG ) ))
1549cdf0e10cSrcweir {
1550cdf0e10cSrcweir FreeResource();
1551cdf0e10cSrcweir aColorSchemeLB.SetSelectHdl(LINK(this, SvxColorOptionsTabPage, SchemeChangedHdl_Impl));
1552cdf0e10cSrcweir Link aLk = LINK(this, SvxColorOptionsTabPage, SaveDeleteHdl_Impl );
1553cdf0e10cSrcweir aSaveSchemePB.SetClickHdl(aLk);
1554cdf0e10cSrcweir aDeleteSchemePB.SetClickHdl(aLk);
1555cdf0e10cSrcweir }
1556cdf0e10cSrcweir /* -----------------------------25.03.2002 10:47------------------------------
1557cdf0e10cSrcweir
1558cdf0e10cSrcweir ---------------------------------------------------------------------------*/
~SvxColorOptionsTabPage()1559cdf0e10cSrcweir SvxColorOptionsTabPage::~SvxColorOptionsTabPage()
1560cdf0e10cSrcweir {
1561cdf0e10cSrcweir //when the dialog is cancelled but the color scheme ListBox has been changed these
1562cdf0e10cSrcweir //changes need to be undone
1563cdf0e10cSrcweir if(!bFillItemSetCalled && aColorSchemeLB.GetSavedValue() != aColorSchemeLB.GetSelectEntryPos())
1564cdf0e10cSrcweir {
1565cdf0e10cSrcweir rtl::OUString sOldScheme = aColorSchemeLB.GetEntry(aColorSchemeLB.GetSavedValue());
1566cdf0e10cSrcweir if(sOldScheme.getLength())
1567cdf0e10cSrcweir {
1568cdf0e10cSrcweir pColorConfig->SetCurrentSchemeName(sOldScheme);
1569cdf0e10cSrcweir pExtColorConfig->SetCurrentSchemeName(sOldScheme);
1570cdf0e10cSrcweir }
1571cdf0e10cSrcweir }
1572cdf0e10cSrcweir delete pColorConfigCT;
1573cdf0e10cSrcweir pColorConfig->ClearModified();
1574cdf0e10cSrcweir pColorConfig->EnableBroadcast();
1575cdf0e10cSrcweir delete pColorConfig;
1576cdf0e10cSrcweir pExtColorConfig->ClearModified();
1577cdf0e10cSrcweir pExtColorConfig->EnableBroadcast();
1578cdf0e10cSrcweir delete pExtColorConfig;
1579cdf0e10cSrcweir }
1580cdf0e10cSrcweir /* -----------------------------25.03.2002 10:47------------------------------
1581cdf0e10cSrcweir
1582cdf0e10cSrcweir ---------------------------------------------------------------------------*/
Create(Window * pParent,const SfxItemSet & rAttrSet)1583cdf0e10cSrcweir SfxTabPage* SvxColorOptionsTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
1584cdf0e10cSrcweir {
1585cdf0e10cSrcweir return ( new SvxColorOptionsTabPage( pParent, rAttrSet ) );
1586cdf0e10cSrcweir }
1587cdf0e10cSrcweir /* -----------------------------25.03.2002 10:47------------------------------
1588cdf0e10cSrcweir
1589cdf0e10cSrcweir ---------------------------------------------------------------------------*/
FillItemSet(SfxItemSet &)1590cdf0e10cSrcweir sal_Bool SvxColorOptionsTabPage::FillItemSet( SfxItemSet& )
1591cdf0e10cSrcweir {
1592cdf0e10cSrcweir bFillItemSetCalled = sal_True;
1593cdf0e10cSrcweir if(aColorSchemeLB.GetSavedValue() != aColorSchemeLB.GetSelectEntryPos())
1594cdf0e10cSrcweir {
1595cdf0e10cSrcweir pColorConfig->SetModified();
1596cdf0e10cSrcweir pExtColorConfig->SetModified();
1597cdf0e10cSrcweir }
1598cdf0e10cSrcweir if(pColorConfig->IsModified())
1599cdf0e10cSrcweir pColorConfig->Commit();
1600cdf0e10cSrcweir if(pExtColorConfig->IsModified())
1601cdf0e10cSrcweir pExtColorConfig->Commit();
1602cdf0e10cSrcweir return sal_True;
1603cdf0e10cSrcweir }
1604cdf0e10cSrcweir /* -----------------------------25.03.2002 10:47------------------------------
1605cdf0e10cSrcweir
1606cdf0e10cSrcweir ---------------------------------------------------------------------------*/
Reset(const SfxItemSet &)1607cdf0e10cSrcweir void SvxColorOptionsTabPage::Reset( const SfxItemSet& )
1608cdf0e10cSrcweir {
1609cdf0e10cSrcweir if(pColorConfig)
1610cdf0e10cSrcweir {
1611cdf0e10cSrcweir pColorConfig->ClearModified();
1612cdf0e10cSrcweir pColorConfig->DisableBroadcast();
1613cdf0e10cSrcweir delete pColorConfig;
1614cdf0e10cSrcweir }
1615cdf0e10cSrcweir pColorConfig = new EditableColorConfig;
1616cdf0e10cSrcweir pColorConfigCT->SetConfig(*pColorConfig);
1617cdf0e10cSrcweir
1618cdf0e10cSrcweir if(pExtColorConfig)
1619cdf0e10cSrcweir {
1620cdf0e10cSrcweir pExtColorConfig->ClearModified();
1621cdf0e10cSrcweir pExtColorConfig->DisableBroadcast();
1622cdf0e10cSrcweir delete pExtColorConfig;
1623cdf0e10cSrcweir }
1624cdf0e10cSrcweir pExtColorConfig = new EditableExtendedColorConfig;
1625cdf0e10cSrcweir pColorConfigCT->SetExtendedConfig(*pExtColorConfig);
1626cdf0e10cSrcweir
1627cdf0e10cSrcweir String sUser = GetUserData();
1628cdf0e10cSrcweir //has to be called always to speed up accessibility tools
1629cdf0e10cSrcweir pColorConfigCT->SetScrollPosition(sUser.ToInt32());
1630cdf0e10cSrcweir aColorSchemeLB.Clear();
1631cdf0e10cSrcweir uno::Sequence< ::rtl::OUString > aSchemes = pColorConfig->GetSchemeNames();
1632cdf0e10cSrcweir const rtl::OUString* pSchemes = aSchemes.getConstArray();
1633cdf0e10cSrcweir for(sal_Int32 i = 0; i < aSchemes.getLength(); i++)
1634cdf0e10cSrcweir aColorSchemeLB.InsertEntry(pSchemes[i]);
1635cdf0e10cSrcweir aColorSchemeLB.SelectEntry(pColorConfig->GetCurrentSchemeName());
1636cdf0e10cSrcweir aColorSchemeLB.SaveValue();
1637cdf0e10cSrcweir aDeleteSchemePB.Enable( aSchemes.getLength() > 1 );
1638cdf0e10cSrcweir UpdateColorConfig();
1639cdf0e10cSrcweir }
1640cdf0e10cSrcweir /* -----------------------------25.03.2002 10:47------------------------------
1641cdf0e10cSrcweir
1642cdf0e10cSrcweir ---------------------------------------------------------------------------*/
DeactivatePage(SfxItemSet * _pSet)1643cdf0e10cSrcweir int SvxColorOptionsTabPage::DeactivatePage( SfxItemSet* _pSet )
1644cdf0e10cSrcweir {
1645cdf0e10cSrcweir if ( _pSet )
1646cdf0e10cSrcweir FillItemSet( *_pSet );
1647cdf0e10cSrcweir return( LEAVE_PAGE );
1648cdf0e10cSrcweir }
1649cdf0e10cSrcweir /* -----------------------------25.03.2002 15:32------------------------------
1650cdf0e10cSrcweir
1651cdf0e10cSrcweir ---------------------------------------------------------------------------*/
UpdateColorConfig()1652cdf0e10cSrcweir void SvxColorOptionsTabPage::UpdateColorConfig()
1653cdf0e10cSrcweir {
1654cdf0e10cSrcweir //update the color config control
1655cdf0e10cSrcweir pColorConfigCT->Update();
1656cdf0e10cSrcweir }
1657cdf0e10cSrcweir /* -----------------------------25.03.2002 15:30------------------------------
1658cdf0e10cSrcweir
1659cdf0e10cSrcweir ---------------------------------------------------------------------------*/
IMPL_LINK(SvxColorOptionsTabPage,SchemeChangedHdl_Impl,ListBox *,pBox)1660cdf0e10cSrcweir IMPL_LINK(SvxColorOptionsTabPage, SchemeChangedHdl_Impl, ListBox*, pBox)
1661cdf0e10cSrcweir {
1662cdf0e10cSrcweir pColorConfig->LoadScheme(pBox->GetSelectEntry());
1663cdf0e10cSrcweir pExtColorConfig->LoadScheme(pBox->GetSelectEntry());
1664cdf0e10cSrcweir UpdateColorConfig();
1665cdf0e10cSrcweir return 0;
1666cdf0e10cSrcweir }
1667cdf0e10cSrcweir /* -----------------------------09.04.2002 15:21------------------------------
1668cdf0e10cSrcweir
1669cdf0e10cSrcweir ---------------------------------------------------------------------------*/
IMPL_LINK(SvxColorOptionsTabPage,SaveDeleteHdl_Impl,PushButton *,pButton)1670cdf0e10cSrcweir IMPL_LINK(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, PushButton*, pButton )
1671cdf0e10cSrcweir {
1672cdf0e10cSrcweir if(&aSaveSchemePB == pButton)
1673cdf0e10cSrcweir {
1674cdf0e10cSrcweir String sName;
1675cdf0e10cSrcweir //CHINA001 SvxNameDialog aNameDlg(pButton,
1676cdf0e10cSrcweir //CHINA001 sName,
1677cdf0e10cSrcweir //CHINA001 String(CUI_RES(RID_SVXSTR_COLOR_CONFIG_SAVE2)));
1678cdf0e10cSrcweir SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
1679cdf0e10cSrcweir DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
1680cdf0e10cSrcweir AbstractSvxNameDialog* aNameDlg = pFact->CreateSvxNameDialog( pButton,
1681cdf0e10cSrcweir sName, String(CUI_RES(RID_SVXSTR_COLOR_CONFIG_SAVE2)) );
1682cdf0e10cSrcweir DBG_ASSERT(aNameDlg, "Dialogdiet fail!");//CHINA001
1683cdf0e10cSrcweir aNameDlg->SetCheckNameHdl( LINK(this, SvxColorOptionsTabPage, CheckNameHdl_Impl));
1684cdf0e10cSrcweir aNameDlg->SetText(String(CUI_RES(RID_SVXSTR_COLOR_CONFIG_SAVE1)));
1685cdf0e10cSrcweir aNameDlg->SetHelpId(HID_OPTIONS_COLORCONFIG_SAVE_SCHEME);
1686cdf0e10cSrcweir aNameDlg->SetEditHelpId(HID_OPTIONS_COLORCONFIG_NAME_SCHEME);
1687cdf0e10cSrcweir aNameDlg->SetCheckNameHdl( LINK(this, SvxColorOptionsTabPage, CheckNameHdl_Impl));
1688cdf0e10cSrcweir if(RET_OK == aNameDlg->Execute()) //CHINA001 if(RET_OK == aNameDlg.Execute())
1689cdf0e10cSrcweir {
1690cdf0e10cSrcweir aNameDlg->GetName(sName); //CHINA001 aNameDlg.GetName(sName);
1691cdf0e10cSrcweir pColorConfig->AddScheme(sName);
1692cdf0e10cSrcweir pExtColorConfig->AddScheme(sName);
1693cdf0e10cSrcweir aColorSchemeLB.InsertEntry(sName);
1694cdf0e10cSrcweir aColorSchemeLB.SelectEntry(sName);
1695cdf0e10cSrcweir aColorSchemeLB.GetSelectHdl().Call(&aColorSchemeLB);
1696cdf0e10cSrcweir }
1697cdf0e10cSrcweir delete aNameDlg; //add by CHINA001
1698cdf0e10cSrcweir }
1699cdf0e10cSrcweir else
1700cdf0e10cSrcweir {
1701cdf0e10cSrcweir DBG_ASSERT(aColorSchemeLB.GetEntryCount() > 1, "don't delete the last scheme");
1702cdf0e10cSrcweir QueryBox aQuery(pButton, CUI_RES(RID_SVXQB_DELETE_COLOR_CONFIG));
1703cdf0e10cSrcweir aQuery.SetText(String(CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE)));
1704cdf0e10cSrcweir if(RET_YES == aQuery.Execute())
1705cdf0e10cSrcweir {
1706cdf0e10cSrcweir rtl::OUString sDeleteScheme(aColorSchemeLB.GetSelectEntry());
1707cdf0e10cSrcweir aColorSchemeLB.RemoveEntry(aColorSchemeLB.GetSelectEntryPos());
1708cdf0e10cSrcweir aColorSchemeLB.SelectEntryPos(0);
1709cdf0e10cSrcweir aColorSchemeLB.GetSelectHdl().Call(&aColorSchemeLB);
1710cdf0e10cSrcweir //first select the new scheme and then delete the old one
1711cdf0e10cSrcweir pColorConfig->DeleteScheme(sDeleteScheme);
1712cdf0e10cSrcweir pExtColorConfig->DeleteScheme(sDeleteScheme);
1713cdf0e10cSrcweir }
1714cdf0e10cSrcweir }
1715cdf0e10cSrcweir aDeleteSchemePB.Enable( aColorSchemeLB.GetEntryCount() > 1 );
1716cdf0e10cSrcweir return 0;
1717cdf0e10cSrcweir }
1718cdf0e10cSrcweir /* -----------------------------09.04.2002 15:47------------------------------
1719cdf0e10cSrcweir
1720cdf0e10cSrcweir ---------------------------------------------------------------------------*/
IMPL_LINK(SvxColorOptionsTabPage,CheckNameHdl_Impl,AbstractSvxNameDialog *,pDialog)1721cdf0e10cSrcweir IMPL_LINK(SvxColorOptionsTabPage, CheckNameHdl_Impl, AbstractSvxNameDialog*, pDialog )
1722cdf0e10cSrcweir {
1723cdf0e10cSrcweir String sName;
1724cdf0e10cSrcweir pDialog->GetName(sName);
1725cdf0e10cSrcweir return sName.Len() && LISTBOX_ENTRY_NOTFOUND == aColorSchemeLB.GetEntryPos( sName );
1726cdf0e10cSrcweir }
1727cdf0e10cSrcweir /* -----------------------------25.04.2002 15:12------------------------------
1728cdf0e10cSrcweir
1729cdf0e10cSrcweir ---------------------------------------------------------------------------*/
FillUserData()1730cdf0e10cSrcweir void SvxColorOptionsTabPage::FillUserData()
1731cdf0e10cSrcweir {
1732cdf0e10cSrcweir SetUserData(String::CreateFromInt32(pColorConfigCT->GetScrollPosition()));
1733cdf0e10cSrcweir }
1734cdf0e10cSrcweir
1735