1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_cui.hxx"
31 // include ---------------------------------------------------------------
32 #include <svtools/colorcfg.hxx>
33 #include <svtools/extcolorcfg.hxx>
34 #include <svtools/headbar.hxx>
35 #include <svtools/ctrlbox.hxx>
36 #include <vcl/scrbar.hxx>
37 #include <svx/xtable.hxx>
38 #include <unotools/moduleoptions.hxx>
39 #include <unotools/pathoptions.hxx>
40 #include <vcl/msgbox.hxx>
41 #include <boost/shared_ptr.hpp>
42 #include <svx/svxdlg.hxx>
44 #include <dialmgr.hxx>
45 #include "optcolor.hxx"
47 #include "optcolor.hrc"
48 #include <svx/dlgutil.hxx>
50 using namespace ::com::sun::star
;
51 using namespace ::svtools
;
54 #define GROUP_UNKNOWN -1
55 #define GROUP_GENERAL 0
56 #define GROUP_WRITER 1
63 const char* aColorLBHids
[] =
65 HID_COLORPAGE_DOCCOLOR_LB
,
66 HID_COLORPAGE_DOCBOUNDARIES_LB
,
67 HID_COLORPAGE_APPBACKGROUND_LB
,
68 HID_COLORPAGE_OBJECTBOUNDARIES_LB
,
69 HID_COLORPAGE_TABLEBOUNDARIES_LB
,
70 HID_COLORPAGE_FONTCOLOR_LB
,
71 HID_COLORPAGE_LINKS_LB
,
72 HID_COLORPAGE_LINKSVISITED_LB
,
73 HID_COLORPAGE_ANCHOR_LB
,
74 HID_COLORPAGE_SPELL_LB
,
75 HID_COLORPAGE_WRITERTEXTGRID_LB
,
76 HID_COLORPAGE_WRITERFIELDSHADINGS_LB
,
77 HID_COLORPAGE_WRITERIDXSHADINGS_LB
,
78 HID_COLORPAGE_WRITERDIRECTCURSOR_LB
,
79 HID_COLORPAGE_WRITERNOTESINDICATOR_LB
,
80 HID_COLORPAGE_WRITERSCRIPTINDICATOR_LB
,
81 HID_COLORPAGE_WRITERSECTIONBOUNDARIES_LB
,
82 HID_COLORPAGE_WRITERPAGEBREAKS_LB
,
83 HID_COLORPAGE_HTMLSGML_LB
,
84 HID_COLORPAGE_HTMLCOMMENT_LB
,
85 HID_COLORPAGE_HTMLKEYWORD_LB
,
86 HID_COLORPAGE_HTMLUNKNOWN_LB
,
87 HID_COLORPAGE_CALCGRID_LB
,
88 HID_COLORPAGE_CALCPAGEBREAK_LB
,
89 HID_COLORPAGE_CALCPAGEBREAKMANUAL_LB
,
90 HID_COLORPAGE_CALCPAGEBREAKAUTOMATIC_LB
,
91 HID_COLORPAGE_CALCDETECTIVE_LB
,
92 HID_COLORPAGE_CALCDETECTIVEERROR_LB
,
93 HID_COLORPAGE_CALCREFERENCE_LB
,
94 HID_COLORPAGE_CALCNOTESBACKGROUND_LB
,
95 HID_COLORPAGE_DRAWGRID_LB
,
96 HID_COLORPAGE_DRAWDRAWING_LB
,
97 HID_COLORPAGE_DRAWFILL_LB
,
98 HID_COLORPAGE_BASICIDENTIFIER_LB
,
99 HID_COLORPAGE_BASICCOMMENT_LB
,
100 HID_COLORPAGE_BASICNUMBER_LB
,
101 HID_COLORPAGE_BASICSTRING_LB
,
102 HID_COLORPAGE_BASICOPERATOR_LB
,
103 HID_COLORPAGE_BASICKEYWORD_LB
,
104 HID_COLORPAGE_BASICERROR_LB
107 const char* aColorCBHids
[] =
109 HID_COLORPAGE_DOCCOLOR_CB
,
110 HID_COLORPAGE_DOCBOUNDARIES_CB
,
111 HID_COLORPAGE_APPBACKGROUND_CB
,
112 HID_COLORPAGE_OBJECTBOUNDARIES_CB
,
113 HID_COLORPAGE_TABLEBOUNDARIES_CB
,
114 HID_COLORPAGE_FONTCOLOR_CB
,
115 HID_COLORPAGE_LINKS_CB
,
116 HID_COLORPAGE_LINKSVISITED_CB
,
117 HID_COLORPAGE_ANCHOR_CB
,
118 HID_COLORPAGE_SPELL_CB
,
119 HID_COLORPAGE_WRITERTEXTGRID_CB
,
120 HID_COLORPAGE_WRITERFIELDSHADINGS_CB
,
121 HID_COLORPAGE_WRITERIDXSHADINGS_CB
,
122 HID_COLORPAGE_WRITERDIRECTCURSOR_CB
,
123 HID_COLORPAGE_WRITERNOTESINDICATOR_CB
,
124 HID_COLORPAGE_WRITERSCRIPTINDICATOR_CB
,
125 HID_COLORPAGE_WRITERSECTIONBOUNDARIES_CB
,
126 HID_COLORPAGE_WRITERPAGEBREAKS_CB
,
127 HID_COLORPAGE_HTMLSGML_CB
,
128 HID_COLORPAGE_HTMLCOMMENT_CB
,
129 HID_COLORPAGE_HTMLKEYWORD_CB
,
130 HID_COLORPAGE_HTMLUNKNOWN_CB
,
131 HID_COLORPAGE_CALCGRID_CB
,
132 HID_COLORPAGE_CALCPAGEBREAK_CB
,
133 HID_COLORPAGE_CALCPAGEBREAKMANUAL_CB
,
134 HID_COLORPAGE_CALCPAGEBREAKAUTOMATIC_CB
,
135 HID_COLORPAGE_CALCDETECTIVE_CB
,
136 HID_COLORPAGE_CALCDETECTIVEERROR_CB
,
137 HID_COLORPAGE_CALCREFERENCE_CB
,
138 HID_COLORPAGE_CALCNOTESBACKGROUND_CB
,
139 HID_COLORPAGE_DRAWGRID_CB
,
140 HID_COLORPAGE_DRAWDRAWING_CB
,
141 HID_COLORPAGE_DRAWFILL_CB
,
142 HID_COLORPAGE_BASICIDENTIFIER_CB
,
143 HID_COLORPAGE_BASICCOMMENT_CB
,
144 HID_COLORPAGE_BASICNUMBER_CB
,
145 HID_COLORPAGE_BASICSTRING_CB
,
146 HID_COLORPAGE_BASICOPERATOR_CB
,
147 HID_COLORPAGE_BASICKEYWORD_CB
,
148 HID_COLORPAGE_BASICERROR_CB
151 /* -----------------------------2002/06/26 10:48------------------------------
153 ---------------------------------------------------------------------------*/
155 class SvxExtFixedText_Impl
: public FixedText
161 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
164 SvxExtFixedText_Impl(Window
* pParent
, const ResId
& rResId
) :
165 FixedText(pParent
, rResId
), m_nGroupHeight(0) {}
167 inline long GetGroupHeight() { return m_nGroupHeight
; }
168 inline void SetGroupHeight( long _nHeight
) { m_nGroupHeight
= _nHeight
; }
171 /* -----------------------------25.03.2002 15:48------------------------------
173 ---------------------------------------------------------------------------*/
174 class ColorConfigCtrl_Impl
;
175 class ColorConfigWindow_Impl
: public Window
177 friend class ColorConfigCtrl_Impl
;
178 Window aGeneralBackWN
;
179 SvxExtFixedText_Impl aGeneralFT
;
180 FixedText aDocColorFT
;
181 ColorListBox aDocColorLB
;
183 CheckBox aDocBoundCB
;
184 ColorListBox aDocBoundLB
;
186 FixedText aAppBackFT
;
187 ColorListBox aAppBackLB
;
189 CheckBox aObjBoundCB
;
190 ColorListBox aObjBoundLB
;
192 CheckBox aTableBoundCB
;
193 ColorListBox aTableBoundLB
;
194 Window aTableBoundWN
;
195 FixedText aFontColorFT
;
196 ColorListBox aFontColorLB
;
199 ColorListBox aLinksLB
;
201 CheckBox aLinksVisitedCB
;
202 ColorListBox aLinksVisitedLB
;
203 Window aLinksVisitedWN
;
205 ColorListBox aSpellLB
;
207 FixedText aSmarttagsFT
;
208 ColorListBox aSmarttagsLB
;
210 Window aWriterBackWN
;
211 SvxExtFixedText_Impl aWriterFT
;
212 FixedText aWrtTextGridFT
;
213 ColorListBox aWrtTextGridLB
;
214 Window aWrtTextGridWN
;
215 CheckBox aWrtFieldCB
;
216 ColorListBox aWrtFieldLB
;
218 CheckBox aWrtIdxShadingBackCB
;
219 ColorListBox aWrtIdxShadingBackLB
;
220 Window aWrtIdxShadingBackWN
;
221 FixedText aWrtScriptIndicatorFT
;
222 ColorListBox aWrtScriptIndicatorLB
;
223 Window aWrtScriptIndicatorWN
;
224 CheckBox aWrtSectionBoundCB
;
225 ColorListBox aWrtSectionBoundLB
;
226 Window aWrtSectionBoundWN
;
227 FixedText aWrtPageBreaksFT
;
228 ColorListBox aWrtPageBreaksLB
;
229 Window aWrtPageBreaksWN
;
230 FixedText aWrtDirectCrsrFT
;
231 ColorListBox aWrtDirectCrsrLB
;
232 Window aWrtDirectCrsrWN
;
234 SvxExtFixedText_Impl aHTMLFT
;
235 FixedText aHTMLSGMLFT
;
236 ColorListBox aHTMLSGMLLB
;
238 FixedText aHTMLCommentFT
;
239 ColorListBox aHTMLCommentLB
;
240 Window aHTMLCommentWN
;
241 FixedText aHTMLKeywdFT
;
242 ColorListBox aHTMLKeywdLB
;
244 FixedText aHTMLUnknownFT
;
245 ColorListBox aHTMLUnknownLB
;
246 Window aHTMLUnknownWN
;
248 SvxExtFixedText_Impl aCalcFT
;
249 FixedText aCalcGridFT
;
250 ColorListBox aCalcGridLB
;
252 FixedText aCalcPageBreakFT
;
253 ColorListBox aCalcPageBreakLB
;
254 Window aCalcPageBreakWN
;
255 FixedText aCalcPageBreakManualFT
;
256 ColorListBox aCalcPageBreakManualLB
;
257 Window aCalcPageBreakManualWN
;
258 FixedText aCalcPageBreakAutoFT
;
259 ColorListBox aCalcPageBreakAutoLB
;
260 Window aCalcPageBreakAutoWN
;
261 FixedText aCalcDetectiveFT
;
262 ColorListBox aCalcDetectiveLB
;
263 Window aCalcDetectiveWN
;
264 FixedText aCalcDetectiveErrorFT
;
265 ColorListBox aCalcDetectiveErrorLB
;
266 Window aCalcDetectiveErrorWN
;
267 FixedText aCalcReferenceFT
;
268 ColorListBox aCalcReferenceLB
;
269 Window aCalcReferenceWN
;
270 FixedText aCalcNotesBackFT
;
271 ColorListBox aCalcNotesBackLB
;
272 Window aCalcNotesBackWN
;
274 SvxExtFixedText_Impl aDrawFT
;
275 FixedText aDrawGridFT
;
276 ColorListBox aDrawGridLB
;
279 SvxExtFixedText_Impl aBasicFT
;
280 FixedText aBasicIdentifierFT
;
281 ColorListBox aBasicIdentifierLB
;
282 Window aBasicIdentifierWN
;
283 FixedText aBasicCommentFT
;
284 ColorListBox aBasicCommentLB
;
285 Window aBasicCommentWN
;
286 FixedText aBasicNumberFT
;
287 ColorListBox aBasicNumberLB
;
288 Window aBasicNumberWN
;
289 FixedText aBasicStringFT
;
290 ColorListBox aBasicStringLB
;
291 Window aBasicStringWN
;
292 FixedText aBasicOperatorFT
;
293 ColorListBox aBasicOperatorLB
;
294 Window aBasicOperatorWN
;
295 FixedText aBasicKeywordFT
;
296 ColorListBox aBasicKeywordLB
;
297 Window aBasicKeywordWN
;
298 FixedText aBasicErrorFT
;
299 ColorListBox aBasicErrorLB
;
300 Window aBasicErrorWN
;
302 SvxExtFixedText_Impl aSQLFT
;
303 FixedText aSQLIdentifierFT
;
304 ColorListBox aSQLIdentifierLB
;
305 Window aSQLIdentifierWN
;
306 FixedText aSQLNumberFT
;
307 ColorListBox aSQLNumberLB
;
309 FixedText aSQLStringFT
;
310 ColorListBox aSQLStringLB
;
312 FixedText aSQLOperatorFT
;
313 ColorListBox aSQLOperatorLB
;
314 Window aSQLOperatorWN
;
315 FixedText aSQLKeywordFT
;
316 ColorListBox aSQLKeywordLB
;
317 Window aSQLKeywordWN
;
318 FixedText aSQLParameterFT
;
319 ColorListBox aSQLParameterLB
;
320 Window aSQLParameterWN
;
321 FixedText aSQLCommentFT
;
322 ColorListBox aSQLCommentLB
;
323 Window aSQLCommentWN
;
325 ::std::vector
< SvxExtFixedText_Impl
*> aChapters
;
326 ::std::vector
< Window
* > aChapterWins
;
327 ::std::vector
< FixedText
* > aFixedTexts
;
328 ::std::vector
< CheckBox
* > aCheckBoxes
;
329 ::std::vector
< ColorListBox
* > aColorBoxes
;
330 ::std::vector
< Window
* > aWindows
; // [ColorConfigEntryCount]
331 ::std::vector
< ::boost::shared_ptr
<SvxExtFixedText_Impl
> > m_aExtensionTitles
;
333 SvtModuleOptions m_aModuleOptions
;
335 void SetNewPosition( sal_Int32 _nFeature
, Window
* _pWin
);
337 virtual void Command( const CommandEvent
& rCEvt
);
338 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
341 ColorConfigWindow_Impl(Window
* pParent
, const ResId
& rResId
);
342 ~ColorConfigWindow_Impl();
344 inline const SvtModuleOptions
& GetModuleOptions() const { return m_aModuleOptions
; }
347 sal_Bool
lcl_isGroupVisible( sal_Int32 _nGroup
, const SvtModuleOptions
& _rModOptions
)
349 sal_Bool bRet
= sal_True
;
356 bRet
= _rModOptions
.IsModuleInstalled( SvtModuleOptions::E_SWRITER
);
362 bRet
= _rModOptions
.IsModuleInstalled( SvtModuleOptions::E_SCALC
);
368 bRet
= ( _rModOptions
.IsModuleInstalled( SvtModuleOptions::E_SDRAW
) ||
369 _rModOptions
.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS
) );
374 bRet
= _rModOptions
.IsModuleInstalled( SvtModuleOptions::E_SDATABASE
);
382 sal_Int16
lcl_getGroup( sal_Int32 _nFeature
)
384 if ( _nFeature
>= ColorConfigEntryCount
)
385 return GROUP_COUNT
; // feature of an extension
387 sal_Int16 nRet
= GROUP_UNKNOWN
;
394 case OBJECTBOUNDARIES
:
395 case TABLEBOUNDARIES
:
403 nRet
= GROUP_GENERAL
;
407 case WRITERTEXTGRID
:
408 case WRITERFIELDSHADINGS
:
409 case WRITERIDXSHADINGS
:
410 case WRITERDIRECTCURSOR
:
411 case WRITERSCRIPTINDICATOR
:
412 case WRITERSECTIONBOUNDARIES
:
413 case WRITERPAGEBREAKS
:
430 case CALCPAGEBREAKMANUAL
:
431 case CALCPAGEBREAKAUTOMATIC
:
433 case CALCDETECTIVEERROR
:
435 case CALCNOTESBACKGROUND
:
449 case BASICIDENTIFIER
:
475 /* -----------------------------25.03.2002 17:05------------------------------
477 ---------------------------------------------------------------------------*/
478 ColorConfigWindow_Impl::ColorConfigWindow_Impl(Window
* pParent
, const ResId
& rResId
) :
479 Window(pParent
, rResId
),
480 aGeneralBackWN(this),
481 aGeneralFT(&aGeneralBackWN
, ResId( FT_GENERAL
, *rResId
.GetResMgr() )),
482 aDocColorFT(this, ResId( FT_DOCCOLOR
, *rResId
.GetResMgr())),
483 aDocColorLB(this, ResId( LB_DOCCOLOR
, *rResId
.GetResMgr())),
484 aDocColorWN(this, ResId( WN_DOCCOLOR
, *rResId
.GetResMgr())),
485 aDocBoundCB(this, ResId( CB_DOCBOUND
, *rResId
.GetResMgr())),
486 aDocBoundLB(this, ResId( LB_DOCBOUND
, *rResId
.GetResMgr())),
487 aDocBoundWN(this, ResId( WN_DOCBOUND
, *rResId
.GetResMgr())),
488 aAppBackFT(this, ResId( FT_APPBACKGROUND
, *rResId
.GetResMgr())),
489 aAppBackLB(this, ResId( LB_APPBACKGROUND
, *rResId
.GetResMgr())),
490 aAppBackWN(this, ResId( WN_APPBACKGROUND
, *rResId
.GetResMgr())),
491 aObjBoundCB(this, ResId( CB_OBJECTBOUNDARIES
, *rResId
.GetResMgr())),
492 aObjBoundLB(this, ResId( LB_OBJECTBOUNDARIES
, *rResId
.GetResMgr())),
493 aObjBoundWN(this, ResId( WN_OBJECTBOUNDARIES
, *rResId
.GetResMgr())),
494 aTableBoundCB(this, ResId( CB_TABLEBOUNDARIES
, *rResId
.GetResMgr())),
495 aTableBoundLB(this, ResId( LB_TABLEBOUNDARIES
, *rResId
.GetResMgr())),
496 aTableBoundWN(this, ResId( WN_TABLEBOUNDARIES
, *rResId
.GetResMgr())),
497 aFontColorFT(this, ResId( FT_FONTCOLOR
, *rResId
.GetResMgr())),
498 aFontColorLB(this, ResId( LB_FONTCOLOR
, *rResId
.GetResMgr())),
499 aFontColorWN(this, ResId( WN_FONTCOLOR
, *rResId
.GetResMgr())),
500 aLinksCB(this, ResId( CB_LINKS
, *rResId
.GetResMgr())),
501 aLinksLB(this, ResId( LB_LINKS
, *rResId
.GetResMgr())),
502 aLinksWN(this, ResId( WN_LINKS
, *rResId
.GetResMgr())),
503 aLinksVisitedCB(this, ResId( CB_LINKSVISITED
, *rResId
.GetResMgr())),
504 aLinksVisitedLB(this, ResId( LB_LINKSVISITED
, *rResId
.GetResMgr())),
505 aLinksVisitedWN(this, ResId( WN_LINKSVISITED
, *rResId
.GetResMgr())),
506 aSpellFT(this, ResId( FT_SPELL
, *rResId
.GetResMgr())),
507 aSpellLB(this, ResId( LB_SPELL
, *rResId
.GetResMgr())),
508 aSpellWN(this, ResId( WN_SPELL
, *rResId
.GetResMgr())),
509 aSmarttagsFT(this, ResId( FT_SMARTTAGS
, *rResId
.GetResMgr() )),
510 aSmarttagsLB(this, ResId( LB_SMARTTAGS
, *rResId
.GetResMgr() )),
511 aSmarttagsWN(this, ResId( WN_SMARTTAGS
, *rResId
.GetResMgr() )),
513 aWriterFT(this, ResId(FT_WRITER
, *rResId
.GetResMgr())),
514 aWrtTextGridFT(this, ResId( FT_WRITERTEXTGRID
, *rResId
.GetResMgr())),
515 aWrtTextGridLB(this, ResId( LB_WRITERTEXTGRID
, *rResId
.GetResMgr())),
516 aWrtTextGridWN(this, ResId( WN_WRITERTEXTGRID
, *rResId
.GetResMgr())),
517 aWrtFieldCB(this, ResId( CB_WRITERFIELDSHADINGS
, *rResId
.GetResMgr())),
518 aWrtFieldLB(this, ResId( LB_WRITERFIELDSHADINGS
, *rResId
.GetResMgr())),
519 aWrtFieldWN(this, ResId( WN_WRITERFIELDSHADINGS
, *rResId
.GetResMgr())),
520 aWrtIdxShadingBackCB(this, ResId( CB_WRITERIDXSHADINGS
, *rResId
.GetResMgr())),
521 aWrtIdxShadingBackLB(this, ResId( LB_WRITERIDXSHADINGS
, *rResId
.GetResMgr())),
522 aWrtIdxShadingBackWN(this, ResId( WN_WRITERIDXSHADINGS
, *rResId
.GetResMgr())),
523 aWrtScriptIndicatorFT(this, ResId( FT_WRITERSCRIPTINDICATOR
, *rResId
.GetResMgr())),
524 aWrtScriptIndicatorLB(this, ResId( LB_WRITERSCRIPTINDICATOR
, *rResId
.GetResMgr())),
525 aWrtScriptIndicatorWN(this, ResId( WN_WRITERSCRIPTINDICATOR
, *rResId
.GetResMgr())),
526 aWrtSectionBoundCB(this, ResId( CB_WRITERSECTIONBOUNDARIES
, *rResId
.GetResMgr())),
527 aWrtSectionBoundLB(this, ResId( LB_WRITERSECTIONBOUNDARIES
, *rResId
.GetResMgr())),
528 aWrtSectionBoundWN(this, ResId( WN_WRITERSECTIONBOUNDARIES
, *rResId
.GetResMgr())),
529 aWrtPageBreaksFT(this, ResId( FT_WRITERPAGEBREAKS
, *rResId
.GetResMgr())),
530 aWrtPageBreaksLB(this, ResId( LB_WRITERPAGEBREAKS
, *rResId
.GetResMgr())),
531 aWrtPageBreaksWN(this, ResId( WN_WRITERPAGEBREAKS
, *rResId
.GetResMgr())),
532 aWrtDirectCrsrFT(this, ResId( FT_WRITERDIRECTCURSOR
, *rResId
.GetResMgr())),
533 aWrtDirectCrsrLB(this, ResId( LB_WRITERDIRECTCURSOR
, *rResId
.GetResMgr())),
534 aWrtDirectCrsrWN(this, ResId( WN_WRITERDIRECTCURSOR
, *rResId
.GetResMgr())),
536 aHTMLFT(this, ResId( FT_HTML
, *rResId
.GetResMgr())),
537 aHTMLSGMLFT(this, ResId( FT_HTMLSGML
, *rResId
.GetResMgr())),
538 aHTMLSGMLLB(this, ResId( LB_HTMLSGML
, *rResId
.GetResMgr())),
539 aHTMLSGMLWN(this, ResId( WN_HTMLSGML
, *rResId
.GetResMgr())),
540 aHTMLCommentFT(this, ResId( FT_HTMLCOMMENT
, *rResId
.GetResMgr())),
541 aHTMLCommentLB(this, ResId( LB_HTMLCOMMENT
, *rResId
.GetResMgr())),
542 aHTMLCommentWN(this, ResId( WN_HTMLCOMMENT
, *rResId
.GetResMgr())),
543 aHTMLKeywdFT(this, ResId( FT_HTMLKEYWORD
, *rResId
.GetResMgr())),
544 aHTMLKeywdLB(this, ResId( LB_HTMLKEYWORD
, *rResId
.GetResMgr())),
545 aHTMLKeywdWN(this, ResId( WN_HTMLKEYWORD
, *rResId
.GetResMgr())),
546 aHTMLUnknownFT(this, ResId( FT_HTMLUNKNOWN
, *rResId
.GetResMgr())),
547 aHTMLUnknownLB(this, ResId( LB_HTMLUNKNOWN
, *rResId
.GetResMgr())),
548 aHTMLUnknownWN(this, ResId( WN_HTMLUNKNOWN
, *rResId
.GetResMgr())),
550 aCalcFT(this, ResId( FT_CALC
, *rResId
.GetResMgr())),
551 aCalcGridFT(this, ResId( FT_CALCGRID
, *rResId
.GetResMgr())),
552 aCalcGridLB(this, ResId( LB_CALCGRID
, *rResId
.GetResMgr())),
553 aCalcGridWN(this, ResId( WN_CALCGRID
, *rResId
.GetResMgr())),
554 aCalcPageBreakFT(this, ResId( FT_CALCPAGEBREAK
, *rResId
.GetResMgr())),
555 aCalcPageBreakLB(this, ResId( LB_CALCPAGEBREAK
, *rResId
.GetResMgr())),
556 aCalcPageBreakWN(this, ResId( WN_CALCPAGEBREAK
, *rResId
.GetResMgr())),
557 aCalcPageBreakManualFT(this, ResId( FT_CALCPAGEBREAKMANUAL
, *rResId
.GetResMgr())),
558 aCalcPageBreakManualLB(this, ResId( LB_CALCPAGEBREAKMANUAL
, *rResId
.GetResMgr())),
559 aCalcPageBreakManualWN(this, ResId( WN_CALCPAGEBREAKMANUAL
, *rResId
.GetResMgr())),
560 aCalcPageBreakAutoFT(this, ResId( FT_CALCPAGEBREAKAUTO
, *rResId
.GetResMgr())),
561 aCalcPageBreakAutoLB(this, ResId( LB_CALCPAGEBREAKAUTO
, *rResId
.GetResMgr())),
562 aCalcPageBreakAutoWN(this, ResId( WN_CALCPAGEBREAKAUTO
, *rResId
.GetResMgr())),
563 aCalcDetectiveFT(this, ResId( FT_CALCDETECTIVE
, *rResId
.GetResMgr())),
564 aCalcDetectiveLB(this, ResId( LB_CALCDETECTIVE
, *rResId
.GetResMgr())),
565 aCalcDetectiveWN(this, ResId( WN_CALCDETECTIVE
, *rResId
.GetResMgr())),
566 aCalcDetectiveErrorFT(this, ResId( FT_CALCDETECTIVEERROR
, *rResId
.GetResMgr())),
567 aCalcDetectiveErrorLB(this, ResId( LB_CALCDETECTIVEERROR
, *rResId
.GetResMgr())),
568 aCalcDetectiveErrorWN(this, ResId( WN_CALCDETECTIVEERROR
, *rResId
.GetResMgr())),
569 aCalcReferenceFT(this, ResId( FT_CALCREFERENCE
, *rResId
.GetResMgr())),
570 aCalcReferenceLB(this, ResId( LB_CALCREFERENCE
, *rResId
.GetResMgr())),
571 aCalcReferenceWN(this, ResId( WN_CALCREFERENCE
, *rResId
.GetResMgr())),
572 aCalcNotesBackFT(this, ResId( FT_CALCNOTESBACKGROUND
, *rResId
.GetResMgr())),
573 aCalcNotesBackLB(this, ResId( LB_CALCNOTESBACKGROUND
, *rResId
.GetResMgr())),
574 aCalcNotesBackWN(this, ResId( WN_CALCNOTESBACKGROUND
, *rResId
.GetResMgr())),
576 aDrawFT(this, ResId( FT_DRAW
, *rResId
.GetResMgr())),
577 aDrawGridFT(this, ResId( FT_DRAWGRID
, *rResId
.GetResMgr())),
578 aDrawGridLB(this, ResId( LB_DRAWGRID
, *rResId
.GetResMgr())),
579 aDrawGridWN(this, ResId( WN_DRAWGRID
, *rResId
.GetResMgr())),
581 aBasicFT(this, ResId( FT_BASIC
, *rResId
.GetResMgr())),
582 aBasicIdentifierFT(this, ResId( FT_BASICIDENTIFIER
, *rResId
.GetResMgr())),
583 aBasicIdentifierLB(this, ResId( LB_BASICIDENTIFIER
, *rResId
.GetResMgr())),
584 aBasicIdentifierWN(this, ResId( WN_BASICIDENTIFIER
, *rResId
.GetResMgr())),
585 aBasicCommentFT(this, ResId( FT_BASICCOMMENT
, *rResId
.GetResMgr())),
586 aBasicCommentLB(this, ResId( LB_BASICCOMMENT
, *rResId
.GetResMgr())),
587 aBasicCommentWN(this, ResId( WN_BASICCOMMENT
, *rResId
.GetResMgr())),
588 aBasicNumberFT(this, ResId( FT_BASICNUMBER
, *rResId
.GetResMgr())),
589 aBasicNumberLB(this, ResId( LB_BASICNUMBER
, *rResId
.GetResMgr())),
590 aBasicNumberWN(this, ResId( WN_BASICNUMBER
, *rResId
.GetResMgr())),
591 aBasicStringFT(this, ResId( FT_BASICSTRING
, *rResId
.GetResMgr())),
592 aBasicStringLB(this, ResId( LB_BASICSTRING
, *rResId
.GetResMgr())),
593 aBasicStringWN(this, ResId( WN_BASICSTRING
, *rResId
.GetResMgr())),
594 aBasicOperatorFT(this, ResId( FT_BASICOPERATOR
, *rResId
.GetResMgr())),
595 aBasicOperatorLB(this, ResId( LB_BASICOPERATOR
, *rResId
.GetResMgr())),
596 aBasicOperatorWN(this, ResId( WN_BASICOPERATOR
, *rResId
.GetResMgr())),
597 aBasicKeywordFT(this, ResId( FT_BASICKEYWORD
, *rResId
.GetResMgr())),
598 aBasicKeywordLB(this, ResId( LB_BASICKEYWORD
, *rResId
.GetResMgr())),
599 aBasicKeywordWN(this, ResId( WN_BASICKEYWORD
, *rResId
.GetResMgr())),
600 aBasicErrorFT(this, ResId( FT_BASICERROR
, *rResId
.GetResMgr())),
601 aBasicErrorLB(this, ResId( LB_BASICERROR
, *rResId
.GetResMgr())),
602 aBasicErrorWN(this, ResId( WN_BASICERROR
, *rResId
.GetResMgr())),
605 aSQLFT(this, ResId( FT_SQL_COMMAND
, *rResId
.GetResMgr())),
606 aSQLIdentifierFT(this, ResId( FT_SQLIDENTIFIER
, *rResId
.GetResMgr())),
607 aSQLIdentifierLB(this, ResId( LB_SQLIDENTIFIER
, *rResId
.GetResMgr())),
608 aSQLIdentifierWN(this, ResId( WN_SQLIDENTIFIER
, *rResId
.GetResMgr())),
610 aSQLNumberFT(this, ResId( FT_SQLNUMBER
, *rResId
.GetResMgr())),
611 aSQLNumberLB(this, ResId( LB_SQLNUMBER
, *rResId
.GetResMgr())),
612 aSQLNumberWN(this, ResId( WN_SQLNUMBER
, *rResId
.GetResMgr())),
614 aSQLStringFT(this, ResId( FT_SQLSTRING
, *rResId
.GetResMgr())),
615 aSQLStringLB(this, ResId( LB_SQLSTRING
, *rResId
.GetResMgr())),
616 aSQLStringWN(this, ResId( WN_SQLSTRING
, *rResId
.GetResMgr())),
618 aSQLOperatorFT(this, ResId( FT_SQLOPERATOR
, *rResId
.GetResMgr())),
619 aSQLOperatorLB(this, ResId( LB_SQLOPERATOR
, *rResId
.GetResMgr())),
620 aSQLOperatorWN(this, ResId( WN_SQLOPERATOR
, *rResId
.GetResMgr())),
622 aSQLKeywordFT(this, ResId( FT_SQLKEYWORD
, *rResId
.GetResMgr())),
623 aSQLKeywordLB(this, ResId( LB_SQLKEYWORD
, *rResId
.GetResMgr())),
624 aSQLKeywordWN(this, ResId( WN_SQLKEYWORD
, *rResId
.GetResMgr())),
626 aSQLParameterFT(this, ResId( FT_SQLPARAMETER
, *rResId
.GetResMgr())),
627 aSQLParameterLB(this, ResId( LB_SQLPARAMETER
, *rResId
.GetResMgr())),
628 aSQLParameterWN(this, ResId( WN_SQLPARAMETER
, *rResId
.GetResMgr())),
630 aSQLCommentFT(this, ResId( FT_SQLCOMMENT
, *rResId
.GetResMgr())),
631 aSQLCommentLB(this, ResId( LB_SQLCOMMENT
, *rResId
.GetResMgr())),
632 aSQLCommentWN(this, ResId( WN_SQLCOMMENT
, *rResId
.GetResMgr()))
634 aFixedTexts
.resize(ColorConfigEntryCount
);
635 aCheckBoxes
.resize(ColorConfigEntryCount
);
636 aColorBoxes
.resize(ColorConfigEntryCount
);
637 aWindows
.resize(ColorConfigEntryCount
);
639 aFixedTexts
[DOCCOLOR
] = &aDocColorFT
;
640 aCheckBoxes
[DOCBOUNDARIES
] = &aDocBoundCB
;
641 aFixedTexts
[APPBACKGROUND
] = &aAppBackFT
;
642 aCheckBoxes
[OBJECTBOUNDARIES
] = &aObjBoundCB
;
643 aCheckBoxes
[TABLEBOUNDARIES
] = &aTableBoundCB
;
644 aFixedTexts
[FONTCOLOR
] = &aFontColorFT
;
645 aCheckBoxes
[LINKS
] = &aLinksCB
;
646 aCheckBoxes
[LINKSVISITED
] = &aLinksVisitedCB
;
647 aFixedTexts
[SPELL
]=& aSpellFT
;
648 aFixedTexts
[SMARTTAGS
]=& aSmarttagsFT
;
649 aFixedTexts
[WRITERTEXTGRID
]=& aWrtTextGridFT
;
650 aCheckBoxes
[WRITERFIELDSHADINGS
] = &aWrtFieldCB
;
651 aCheckBoxes
[WRITERIDXSHADINGS
] = &aWrtIdxShadingBackCB
;
652 aFixedTexts
[WRITERDIRECTCURSOR
]=& aWrtDirectCrsrFT
;
653 aFixedTexts
[WRITERSCRIPTINDICATOR
]=& aWrtScriptIndicatorFT
;
654 aCheckBoxes
[WRITERSECTIONBOUNDARIES
]=& aWrtSectionBoundCB
;
655 aFixedTexts
[HTMLSGML
]=& aHTMLSGMLFT
;
656 aFixedTexts
[HTMLCOMMENT
]=& aHTMLCommentFT
;
657 aFixedTexts
[HTMLKEYWORD
]=& aHTMLKeywdFT
;
658 aFixedTexts
[HTMLUNKNOWN
]=& aHTMLUnknownFT
;
659 aFixedTexts
[CALCGRID
] = &aCalcGridFT
;
660 aFixedTexts
[CALCPAGEBREAK
] = &aCalcPageBreakFT
;
661 aFixedTexts
[CALCPAGEBREAKMANUAL
] = &aCalcPageBreakManualFT
;
662 aFixedTexts
[CALCPAGEBREAKAUTOMATIC
] = &aCalcPageBreakAutoFT
;
663 aFixedTexts
[CALCDETECTIVE
]=& aCalcDetectiveFT
;
664 aFixedTexts
[CALCDETECTIVEERROR
]=& aCalcDetectiveErrorFT
;
665 aFixedTexts
[CALCREFERENCE
]=& aCalcReferenceFT
;
666 aFixedTexts
[CALCNOTESBACKGROUND
]=& aCalcNotesBackFT
;
667 aFixedTexts
[WRITERPAGEBREAKS
] = &aWrtPageBreaksFT
;
668 aFixedTexts
[DRAWGRID
] = &aDrawGridFT
;
669 aFixedTexts
[BASICIDENTIFIER
] = &aBasicIdentifierFT
;
670 aFixedTexts
[BASICCOMMENT
] = &aBasicCommentFT
;
671 aFixedTexts
[BASICNUMBER
] = &aBasicNumberFT
;
672 aFixedTexts
[BASICSTRING
] = &aBasicStringFT
;
673 aFixedTexts
[BASICOPERATOR
] = &aBasicOperatorFT
;
674 aFixedTexts
[BASICKEYWORD
] = &aBasicKeywordFT
;
675 aFixedTexts
[BASICERROR
] = &aBasicErrorFT
;
676 aFixedTexts
[SQLIDENTIFIER
] = &aSQLIdentifierFT
;
677 aFixedTexts
[SQLNUMBER
] = &aSQLNumberFT
;
678 aFixedTexts
[SQLSTRING
] = &aSQLStringFT
;
679 aFixedTexts
[SQLOPERATOR
] = &aSQLOperatorFT
;
680 aFixedTexts
[SQLKEYWORD
] = &aSQLKeywordFT
;
681 aFixedTexts
[SQLPARAMETER
] = &aSQLParameterFT
;
682 aFixedTexts
[SQLCOMMENT
] = &aSQLCommentFT
;
684 aColorBoxes
[DOCCOLOR
] = &aDocColorLB
;
685 aColorBoxes
[DOCBOUNDARIES
] = &aDocBoundLB
;
686 aColorBoxes
[APPBACKGROUND
] = &aAppBackLB
;
687 aColorBoxes
[OBJECTBOUNDARIES
] = &aObjBoundLB
;
688 aColorBoxes
[TABLEBOUNDARIES
] = &aTableBoundLB
;
689 aColorBoxes
[FONTCOLOR
] = &aFontColorLB
;
690 aColorBoxes
[LINKS
] = &aLinksLB
;
691 aColorBoxes
[LINKSVISITED
] = &aLinksVisitedLB
;
692 aColorBoxes
[SPELL
] = &aSpellLB
;
693 aColorBoxes
[SMARTTAGS
] = &aSmarttagsLB
;
694 aColorBoxes
[WRITERTEXTGRID
] = &aWrtTextGridLB
;
695 aColorBoxes
[WRITERFIELDSHADINGS
] = &aWrtFieldLB
;
696 aColorBoxes
[WRITERIDXSHADINGS
] = &aWrtIdxShadingBackLB
;
697 aColorBoxes
[WRITERDIRECTCURSOR
] = &aWrtDirectCrsrLB
;
698 aColorBoxes
[WRITERSCRIPTINDICATOR
] = &aWrtScriptIndicatorLB
;
699 aColorBoxes
[WRITERSECTIONBOUNDARIES
] = &aWrtSectionBoundLB
;
700 aColorBoxes
[WRITERPAGEBREAKS
] = &aWrtPageBreaksLB
;
701 aColorBoxes
[HTMLSGML
] = &aHTMLSGMLLB
;
702 aColorBoxes
[HTMLCOMMENT
] = &aHTMLCommentLB
;
703 aColorBoxes
[HTMLKEYWORD
] = &aHTMLKeywdLB
;
704 aColorBoxes
[HTMLUNKNOWN
] = &aHTMLUnknownLB
;
705 aColorBoxes
[CALCGRID
] = &aCalcGridLB
;
706 aColorBoxes
[CALCPAGEBREAK
] = &aCalcPageBreakLB
;
707 aColorBoxes
[CALCPAGEBREAKMANUAL
] = &aCalcPageBreakManualLB
;
708 aColorBoxes
[CALCPAGEBREAKAUTOMATIC
]= &aCalcPageBreakAutoLB
;
709 aColorBoxes
[CALCDETECTIVE
] = &aCalcDetectiveLB
;
710 aColorBoxes
[CALCDETECTIVEERROR
] = &aCalcDetectiveErrorLB
;
711 aColorBoxes
[CALCREFERENCE
] = &aCalcReferenceLB
;
712 aColorBoxes
[CALCNOTESBACKGROUND
] = &aCalcNotesBackLB
;
713 aColorBoxes
[DRAWGRID
] = &aDrawGridLB
;
714 aColorBoxes
[BASICIDENTIFIER
] = &aBasicIdentifierLB
;
715 aColorBoxes
[BASICCOMMENT
] = &aBasicCommentLB
;
716 aColorBoxes
[BASICNUMBER
] = &aBasicNumberLB
;
717 aColorBoxes
[BASICSTRING
] = &aBasicStringLB
;
718 aColorBoxes
[BASICOPERATOR
] = &aBasicOperatorLB
;
719 aColorBoxes
[BASICKEYWORD
] = &aBasicKeywordLB
;
720 aColorBoxes
[BASICERROR
] = &aBasicErrorLB
;
721 aColorBoxes
[SQLIDENTIFIER
] = &aSQLIdentifierLB
;
722 aColorBoxes
[SQLNUMBER
] = &aSQLNumberLB
;
723 aColorBoxes
[SQLSTRING
] = &aSQLStringLB
;
724 aColorBoxes
[SQLOPERATOR
] = &aSQLOperatorLB
;
725 aColorBoxes
[SQLKEYWORD
] = &aSQLKeywordLB
;
726 aColorBoxes
[SQLPARAMETER
] = &aSQLParameterLB
;
727 aColorBoxes
[SQLCOMMENT
] = &aSQLCommentLB
;
729 aWindows
[DOCCOLOR
] = &aDocColorWN
;
730 aWindows
[DOCBOUNDARIES
] = &aDocBoundWN
;
731 aWindows
[APPBACKGROUND
] = &aAppBackWN
;
732 aWindows
[OBJECTBOUNDARIES
] = &aObjBoundWN
;
733 aWindows
[TABLEBOUNDARIES
] = &aTableBoundWN
;
734 aWindows
[FONTCOLOR
] = &aFontColorWN
;
735 aWindows
[LINKS
] = &aLinksWN
;
736 aWindows
[LINKSVISITED
] = &aLinksVisitedWN
;
737 aWindows
[SPELL
] = &aSpellWN
;
738 aWindows
[SMARTTAGS
] = &aSmarttagsWN
;
739 aWindows
[WRITERTEXTGRID
] = &aWrtTextGridWN
;
740 aWindows
[WRITERFIELDSHADINGS
] = &aWrtFieldWN
;
741 aWindows
[WRITERIDXSHADINGS
] = &aWrtIdxShadingBackWN
;
742 aWindows
[WRITERDIRECTCURSOR
] = &aWrtDirectCrsrWN
;
743 aWindows
[WRITERSCRIPTINDICATOR
] = &aWrtScriptIndicatorWN
;
744 aWindows
[WRITERSECTIONBOUNDARIES
] = &aWrtSectionBoundWN
;
745 aWindows
[WRITERPAGEBREAKS
] = &aWrtPageBreaksWN
;
746 aWindows
[HTMLSGML
] = &aHTMLSGMLWN
;
747 aWindows
[HTMLCOMMENT
] = &aHTMLCommentWN
;
748 aWindows
[HTMLKEYWORD
] = &aHTMLKeywdWN
;
749 aWindows
[HTMLUNKNOWN
] = &aHTMLUnknownWN
;
750 aWindows
[CALCGRID
] = &aCalcGridWN
;
751 aWindows
[CALCPAGEBREAK
] = &aCalcPageBreakWN
;
752 aWindows
[CALCPAGEBREAKMANUAL
] = &aCalcPageBreakManualWN
;
753 aWindows
[CALCPAGEBREAKAUTOMATIC
] = &aCalcPageBreakAutoWN
;
754 aWindows
[CALCDETECTIVE
] = &aCalcDetectiveWN
;
755 aWindows
[CALCDETECTIVEERROR
] = &aCalcDetectiveErrorWN
;
756 aWindows
[CALCREFERENCE
] = &aCalcReferenceWN
;
757 aWindows
[CALCNOTESBACKGROUND
] = &aCalcNotesBackWN
;
758 aWindows
[DRAWGRID
] = &aDrawGridWN
;
759 aWindows
[BASICIDENTIFIER
] = &aBasicIdentifierWN
;
760 aWindows
[BASICCOMMENT
] = &aBasicCommentWN
;
761 aWindows
[BASICNUMBER
] = &aBasicNumberWN
;
762 aWindows
[BASICSTRING
] = &aBasicStringWN
;
763 aWindows
[BASICOPERATOR
] = &aBasicOperatorWN
;
764 aWindows
[BASICKEYWORD
] = &aBasicKeywordWN
;
765 aWindows
[BASICERROR
] = &aBasicErrorWN
;
766 aWindows
[SQLIDENTIFIER
] = &aSQLIdentifierWN
;
767 aWindows
[SQLNUMBER
] = &aSQLNumberWN
;
768 aWindows
[SQLSTRING
] = &aSQLStringWN
;
769 aWindows
[SQLOPERATOR
] = &aSQLOperatorWN
;
770 aWindows
[SQLKEYWORD
] = &aSQLKeywordWN
;
771 aWindows
[SQLPARAMETER
] = &aSQLParameterWN
;
772 aWindows
[SQLCOMMENT
] = &aSQLCommentWN
;
774 aChapters
.push_back(&aGeneralFT
); aChapterWins
.push_back(&aGeneralBackWN
);
775 aChapters
.push_back(&aWriterFT
); aChapterWins
.push_back(&aWriterBackWN
);
776 aChapters
.push_back(&aHTMLFT
); aChapterWins
.push_back(&aHTMLBackWN
);
777 aChapters
.push_back(&aCalcFT
); aChapterWins
.push_back(&aCalcBackWN
);
778 aChapters
.push_back(&aDrawFT
); aChapterWins
.push_back(&aDrawBackWN
);
779 aChapters
.push_back(&aBasicFT
); aChapterWins
.push_back(&aBasicBackWN
);
780 aChapters
.push_back(&aSQLFT
); aChapterWins
.push_back(&aSQLBackWN
);
782 // calculate heights of groups which can be hidden
783 aChapters
[GROUP_WRITER
]->SetGroupHeight( aChapters
[GROUP_HTML
]->GetPosPixel().Y() - aChapters
[GROUP_WRITER
]->GetPosPixel().Y() );
784 aChapters
[GROUP_HTML
]->SetGroupHeight( aChapters
[GROUP_CALC
]->GetPosPixel().Y() - aChapters
[GROUP_HTML
]->GetPosPixel().Y() );
785 aChapters
[GROUP_CALC
]->SetGroupHeight( aChapters
[GROUP_DRAW
]->GetPosPixel().Y() - aChapters
[GROUP_CALC
]->GetPosPixel().Y() );
786 aChapters
[GROUP_DRAW
]->SetGroupHeight( aChapters
[GROUP_BASIC
]->GetPosPixel().Y() - aChapters
[GROUP_DRAW
]->GetPosPixel().Y() );
787 aChapters
[GROUP_BASIC
]->SetGroupHeight( aChapters
[GROUP_SQL
]->GetPosPixel().Y() - aChapters
[GROUP_BASIC
]->GetPosPixel().Y() );
789 ExtendedColorConfig aExtConfig
;
790 sal_Int32 nExtCount
= aExtConfig
.GetComponentCount();
793 // calculate position behind last chapter
794 sal_Int32 nLastY
= aSQLCommentWN
.GetPosPixel().Y() + aSQLCommentWN
.GetSizePixel().Height();
795 nLastY
= nLastY
+ LogicToPixel( Size( 0, 3 ), MAP_APPFONT
).Height();
796 // to calculate the number of lines
797 sal_Int32 nHeight
= LogicToPixel( Size( 0, _LINE_HEIGHT
), MAP_APPFONT
).Height();
798 sal_Int32 nLineNum
= nLastY
/ nHeight
;
800 Point aFixedPos
= LogicToPixel( Point( _FT_XPOS
, nLineNum
* _LINE_HEIGHT
), MAP_APPFONT
);
801 Point aLBPos
= LogicToPixel( Point( _LB_XPOS
, nLineNum
* _LINE_HEIGHT
), MAP_APPFONT
);
802 Size aFixedSize
= LogicToPixel( Size( _FT_WIDTH
, _FT_HEIGHT
), MAP_APPFONT
);
803 Size aLBSize
= LogicToPixel( Size( _LB_WIDTH
, _LB_HEIGHT
), MAP_APPFONT
);
804 Size aWinSize
= LogicToPixel( Size( _WN_WIDTH
, _WN_HEIGHT
), MAP_APPFONT
);
806 for (sal_Int32 j
= 0; j
< nExtCount
; ++j
)
808 ::rtl::OUString sComponentName
= aExtConfig
.GetComponentName(j
);
809 aChapterWins
.push_back(new Window(this));
810 ::boost::shared_ptr
<SvxExtFixedText_Impl
> pTitle(new SvxExtFixedText_Impl(this,ResId(FT_SQL_COMMAND
, *rResId
.GetResMgr())));
811 m_aExtensionTitles
.push_back(pTitle
);
812 pTitle
->SetPosSizePixel(LogicToPixel( Point( _FT_XPOS
, nLineNum
* _LINE_HEIGHT
), MAP_APPFONT
),aFixedSize
);
813 pTitle
->SetText(aExtConfig
.GetComponentDisplayName(sComponentName
));
814 aChapters
.push_back(pTitle
.get());
816 sal_Int32 nColorCount
= aExtConfig
.GetComponentColorCount(sComponentName
);
817 for (sal_Int32 i
= 0; i
< nColorCount
; ++i
,++nLineNum
)
819 ExtendedColorConfigValue aColorEntry
= aExtConfig
.GetComponentColorConfigValue(sComponentName
,i
);
820 FixedText
* pFixedText
= new FixedText(this,ResId(FT_BASICERROR
, *rResId
.GetResMgr()));
821 pFixedText
->SetPosSizePixel(LogicToPixel( Point( _FT_XPOS
, nLineNum
* _LINE_HEIGHT
), MAP_APPFONT
),aFixedSize
);
822 pFixedText
->SetText(aColorEntry
.getDisplayName());
823 aFixedTexts
.push_back(pFixedText
);
824 aCheckBoxes
.push_back(NULL
); // no checkboxes
825 ColorListBox
* pColorBox
= new ColorListBox(this,ResId(LB_BASICERROR
, *rResId
.GetResMgr()));
826 pColorBox
->SetPosSizePixel(LogicToPixel( Point( _LB_XPOS
, nLineNum
* _LINE_HEIGHT
), MAP_APPFONT
),aLBSize
);
827 aColorBoxes
.push_back(pColorBox
);
828 Window
* pWin
= new Window(this,ResId(WN_BASICERROR
, *rResId
.GetResMgr()));
829 pWin
->SetPosSizePixel(LogicToPixel( Point( _WN_XPOS
, nLineNum
* _LINE_HEIGHT
), MAP_APPFONT
),aWinSize
);
830 aWindows
.push_back(pWin
);
831 } // for (sal_Int32 i = 0; i < nExtCount; ++i,++nLineNum)
837 Color
TempColor(COL_TRANSPARENT
);
838 Wallpaper
aTransparentWall(TempColor
);
839 sal_Int32 nWinWidth
= GetSizePixel().Width();
840 sal_Int32 nFTHeight
= aChapters
[0]->GetSizePixel().Height();
842 const StyleSettings
& rStyleSettings
= GetSettings().GetStyleSettings();
843 sal_Bool bHighContrast
= rStyleSettings
.GetHighContrastMode();
845 aBackColor
= rStyleSettings
.GetShadowColor();
847 aBackColor
= Color( COL_LIGHTGRAY
);
848 sal_Int32 nCount
= aChapterWins
.size();
849 for(sal_Int32 i
= 0; i
< nCount
; ++i
)
851 if ( lcl_isGroupVisible( i
, m_aModuleOptions
) )
853 Font aFont
= aChapters
[i
]->GetFont();
854 aFont
.SetWeight(WEIGHT_BOLD
);
855 aChapters
[i
]->SetFont(aFont
);
856 aChapters
[i
]->SetBackground(aTransparentWall
);
857 aChapterWins
[i
]->SetPosSizePixel( Point(0, aChapters
[i
]->GetPosPixel().Y()),
858 Size(nWinWidth
, nFTHeight
));
859 aChapterWins
[i
]->SetBackground(Wallpaper(aBackColor
));
860 aChapterWins
[i
]->Show();
864 aChapters
[i
]->Hide();
865 aChapterWins
[i
]->Hide();
869 sal_Bool bSetTextColor
= sal_False
;
870 //#104195# when the window color is the same as the text color it has to be changed
871 Color aWinCol
= rStyleSettings
.GetWindowColor();
872 Color aRCheckCol
= rStyleSettings
.GetRadioCheckTextColor();
873 if(aWinCol
== aRCheckCol
)
875 bSetTextColor
= sal_True
;
877 //if inversion didn't work (gray) then it's set to black
878 if(aRCheckCol
== aWinCol
)
879 aRCheckCol
= Color(COL_BLACK
);
880 } // if(aWinCol == aRCheckCol )
881 nCount
= aFixedTexts
.size();
882 sal_Int16 nGroup
= GROUP_UNKNOWN
;
883 for( sal_Int32 i
= 0; i
< nCount
; i
++ )
887 sal_Int16 nNewGroup
= lcl_getGroup(i
);
888 sal_Bool bShow
= lcl_isGroupVisible( nNewGroup
, m_aModuleOptions
);
890 if ( nNewGroup
> nGroup
)
893 if ( bShow
&& nGroup
>= GROUP_CALC
)
895 SetNewPosition( i
, aChapters
[nGroup
] );
896 SetNewPosition( i
, aChapterWins
[nGroup
] );
902 SetNewPosition( i
, aCheckBoxes
[i
] );
904 aCheckBoxes
[i
]->Hide();
905 aCheckBoxes
[i
]->SetBackground(aTransparentWall
);
906 aCheckBoxes
[i
]->SetHelpId( aColorCBHids
[i
] );
908 aCheckBoxes
[i
]->SetTextColor(aRCheckCol
);
913 SetNewPosition( i
, aFixedTexts
[i
] );
915 aFixedTexts
[i
]->Hide();
916 aFixedTexts
[i
]->SetBackground(aTransparentWall
);
918 aFixedTexts
[i
]->SetTextColor(aRCheckCol
);
923 SetNewPosition( i
, aWindows
[i
] );
926 aWindows
[i
]->SetBorderStyle(WINDOW_BORDER_MONO
);
929 if ( aColorBoxes
[i
] )
932 SetNewPosition( i
, aColorBoxes
[i
] );
934 aColorBoxes
[i
]->Hide();
938 XColorTable
aColorTable( SvtPathOptions().GetPalettePath() );
939 aColorBoxes
[0]->InsertAutomaticEntry();
940 for( sal_Int32 i
= 0; i
< aColorTable
.Count(); i
++ )
942 XColorEntry
* pEntry
= aColorTable
.GetColor(i
);
943 aColorBoxes
[0]->InsertEntry( pEntry
->GetColor(), pEntry
->GetName() );
946 aColorBoxes
[0]->SetHelpId( aColorLBHids
[0] );
948 OSL_ENSURE( nCount
< sal_Int32(sizeof(aColorLBHids
)/sizeof(aColorLBHids
[0])), "too few helpIDs for color listboxes" );
949 for( sal_Int32 i
= 1; i
< nCount
; i
++ )
953 aColorBoxes
[i
]->CopyEntries( *aColorBoxes
[0] );
954 if( i
< sal_Int32(sizeof(aColorLBHids
)/sizeof(aColorLBHids
[0])) )
955 aColorBoxes
[i
]->SetHelpId( aColorLBHids
[i
] );
959 /* -----------------------------27.03.2002 11:04------------------------------
961 ---------------------------------------------------------------------------*/
962 ColorConfigWindow_Impl::~ColorConfigWindow_Impl()
965 ::std::vector
< SvxExtFixedText_Impl
*>().swap(aChapters
);
968 sal_Int32 nCount
= aFixedTexts
.size();
969 for (sal_Int32 i
= ColorConfigEntryCount
; i
< nCount
; ++i
)
971 delete aFixedTexts
[i
];
972 delete aCheckBoxes
[i
];
973 delete aColorBoxes
[i
];
976 for (sal_uInt32 i
= GROUP_COUNT
; i
< aChapterWins
.size(); ++i
)
977 delete aChapterWins
[i
];
978 aChapterWins
.clear();
979 ::std::vector
< Window
*>().swap(aChapterWins
);
981 /* -----------------------------2002/06/20 12:48------------------------------
983 ---------------------------------------------------------------------------*/
984 void ColorConfigWindow_Impl::DataChanged( const DataChangedEvent
& rDCEvt
)
986 Window::DataChanged( rDCEvt
);
987 if ( (rDCEvt
.GetType() == DATACHANGED_SETTINGS
) &&
988 (rDCEvt
.GetFlags() & SETTINGS_STYLE
) )
990 const StyleSettings
& rStyleSettings
= GetSettings().GetStyleSettings();
991 sal_Bool bHighContrast
= rStyleSettings
.GetHighContrastMode();
992 Color
aBackColor( bHighContrast
? COL_TRANSPARENT
: COL_LIGHTGRAY
);
993 ::std::vector
< Window
* >::iterator aIter
= aChapterWins
.begin();
994 ::std::vector
< Window
* >::iterator aEnd
= aChapterWins
.end();
995 for(;aIter
!= aEnd
; ++aIter
)
996 (*aIter
)->SetBackground(Wallpaper(aBackColor
));
997 SetBackground(Wallpaper(rStyleSettings
.GetWindowColor()));
1000 /* -----------------------------2002/06/26 10:49------------------------------
1002 ---------------------------------------------------------------------------*/
1003 void SvxExtFixedText_Impl::DataChanged(const DataChangedEvent
& rDCEvt
)
1005 FixedText::DataChanged(rDCEvt
);
1006 Color
TempColor(COL_TRANSPARENT
);
1007 Wallpaper
aTransparentWall(TempColor
);
1008 if ( (rDCEvt
.GetType() == DATACHANGED_SETTINGS
) &&
1009 (rDCEvt
.GetFlags() & SETTINGS_STYLE
) )
1011 Font aFont
= GetFont();
1012 aFont
.SetWeight(WEIGHT_BOLD
);
1014 SetBackground(aTransparentWall
);
1018 void ColorConfigWindow_Impl::SetNewPosition( sal_Int32 _nFeature
, Window
* _pWin
)
1020 DBG_ASSERT( _pWin
, "ColorConfigWindow_Impl::SetNewPosition(): no window" );
1022 // calculate the overall height of the invisible groups
1024 sal_Int16 nGroup
= lcl_getGroup( _nFeature
) - 1;
1025 while ( nGroup
> 0 ) // GROUP_GENERAL (0) is always visible
1027 if ( !lcl_isGroupVisible( nGroup
, m_aModuleOptions
) )
1028 nDelta
+= aChapters
[nGroup
]->GetGroupHeight();
1032 // move this window to its new position
1035 Point aPos
= _pWin
->GetPosPixel();
1037 _pWin
->SetPosPixel( aPos
);
1041 /* -----------------------------08.04.2002 17:10------------------------------
1043 ---------------------------------------------------------------------------*/
1044 void ColorConfigWindow_Impl::Command( const CommandEvent
& rCEvt
)
1046 GetParent()->Command(rCEvt
);
1048 /* -----------------------------25.03.2002 10:44------------------------------
1050 ---------------------------------------------------------------------------*/
1051 class ColorConfigCtrl_Impl
: public Control
1053 HeaderBar aHeaderHB
;
1060 ColorConfigWindow_Impl aScrollWindow
;
1062 EditableColorConfig
* pColorConfig
;
1063 EditableExtendedColorConfig
* pExtColorConfig
;
1067 DECL_LINK(ScrollHdl
, ScrollBar
*);
1068 DECL_LINK(ClickHdl
, CheckBox
*);
1069 DECL_LINK(ColorHdl
, ColorListBox
*);
1070 DECL_LINK(ControlFocusHdl
, Control
*);
1072 virtual long PreNotify( NotifyEvent
& rNEvt
);
1073 virtual void Command( const CommandEvent
& rCEvt
);
1074 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
1076 ColorConfigCtrl_Impl(Window
* pParent
, const ResId
& rResId
);
1077 ~ColorConfigCtrl_Impl();
1079 void SetConfig(EditableColorConfig
& rConfig
) {pColorConfig
= &rConfig
;}
1080 void SetExtendedConfig(EditableExtendedColorConfig
& rConfig
) {pExtColorConfig
= &rConfig
;}
1082 sal_Int32
GetScrollPosition() {return aVScroll
.GetThumbPos();}
1083 void SetScrollPosition(sal_Int32 nSet
)
1085 aVScroll
.SetThumbPos(nSet
);
1086 ScrollHdl(&aVScroll
);
1089 /* -----------------------------25.03.2002 17:09------------------------------
1091 ---------------------------------------------------------------------------*/
1092 ColorConfigCtrl_Impl::ColorConfigCtrl_Impl(
1093 Window
* pParent
, const ResId
& rResId
) :
1094 Control(pParent
, rResId
),
1097 aHeaderHB(this, WB_BUTTONSTYLE
| WB_BOTTOMBORDER
),
1098 aVScroll(this, ResId(VB_VSCROLL
, *rResId
.GetResMgr())),
1099 sOn( ResId(ST_ON
, *rResId
.GetResMgr())),
1100 sUIElem( ResId(ST_UIELEM
, *rResId
.GetResMgr())),
1101 sColSetting( ResId(ST_COLSET
, *rResId
.GetResMgr())),
1102 sPreview( ResId(ST_PREVIEW
, *rResId
.GetResMgr())),
1103 aScrollWindow(this, ResId(WN_SCROLL
, *rResId
.GetResMgr())),
1111 const StyleSettings
& rStyleSettings
= GetSettings().GetStyleSettings();
1112 aScrollWindow
.SetBackground(Wallpaper(rStyleSettings
.GetFieldColor()));
1113 aScrollWindow
.SetHelpId( HID_OPTIONS_COLORCONFIG_COLORLIST_WIN
);
1114 aVScroll
.EnableDrag();
1116 aHeaderHB
.SetPosSizePixel(
1118 Size(GetOutputSizePixel().Width(), aVScroll
.GetPosPixel().Y()));
1119 sal_Int32 nFirstWidth
= aScrollWindow
.aGeneralFT
.GetPosPixel().X();
1120 sal_Int32 nSecondWidth
= aScrollWindow
.aColorBoxes
[0]->GetPosPixel().X() - nFirstWidth
;
1121 sal_Int32 nThirdWidth
= aScrollWindow
.aWindows
[0]->GetPosPixel().X() - nFirstWidth
- nSecondWidth
;
1123 const WinBits nHeadBits
= HIB_VCENTER
| HIB_FIXED
| HIB_FIXEDPOS
;
1124 aHeaderHB
.InsertItem( 1, sOn
, nFirstWidth
, (sal_uInt16
)nHeadBits
|HIB_CENTER
);
1125 aHeaderHB
.InsertItem( 2, sUIElem
, nSecondWidth
, (sal_uInt16
)nHeadBits
|HIB_LEFT
);
1126 aHeaderHB
.InsertItem( 3, sColSetting
, nThirdWidth
, (sal_uInt16
)nHeadBits
|HIB_LEFT
);
1127 aHeaderHB
.InsertItem( 4, sPreview
,
1128 aHeaderHB
.GetSizePixel().Width() - nFirstWidth
- nSecondWidth
- nThirdWidth
, (sal_uInt16
)nHeadBits
|HIB_LEFT
);
1131 aVScroll
.SetRangeMin(0);
1132 sal_Int32 nScrollOffset
= aScrollWindow
.aColorBoxes
[1]->GetPosPixel().Y() - aScrollWindow
.aColorBoxes
[0]->GetPosPixel().Y();
1133 sal_Int32 nVisibleEntries
= aScrollWindow
.GetSizePixel().Height() / nScrollOffset
;
1135 aVScroll
.SetRangeMax(aScrollWindow
.aCheckBoxes
.size() + aScrollWindow
.aChapters
.size() );
1136 // static: minus three for ANCHOR, DRAWFILL and DRAWDRAWING
1137 aVScroll
.SetRangeMax( aVScroll
.GetRangeMax() - 3 );
1138 // dynamic: calculate the hidden lines
1139 long nInvisibleLines
= 0;
1140 sal_Int16 nGroup
= GROUP_UNKNOWN
;
1141 sal_Int32 nCount
= aScrollWindow
.aCheckBoxes
.size();
1142 for ( sal_Int32 i
= 0; i
< nCount
; i
++ )
1144 if ( ANCHOR
== i
|| DRAWFILL
== i
|| DRAWDRAWING
== i
) // not used at the moment
1146 sal_Int16 nNewGroup
= lcl_getGroup(i
);
1147 sal_Bool bVisible
= lcl_isGroupVisible( nNewGroup
, aScrollWindow
.GetModuleOptions() );
1150 if ( nNewGroup
> nGroup
)
1157 aVScroll
.SetRangeMax( aVScroll
.GetRangeMax() - nInvisibleLines
);
1159 aVScroll
.SetPageSize( nVisibleEntries
- 1 );
1160 aVScroll
.SetVisibleSize(nVisibleEntries
);
1161 Link aScrollLink
= LINK(this, ColorConfigCtrl_Impl
, ScrollHdl
);
1162 aVScroll
.SetScrollHdl(aScrollLink
);
1163 aVScroll
.SetEndScrollHdl(aScrollLink
);
1165 Link aCheckLink
= LINK(this, ColorConfigCtrl_Impl
, ClickHdl
);
1166 Link aColorLink
= LINK(this, ColorConfigCtrl_Impl
, ColorHdl
);
1167 Link aGetFocusLink
= LINK(this, ColorConfigCtrl_Impl
, ControlFocusHdl
);
1168 for( sal_Int16 i
= 0; i
< nCount
; i
++ )
1170 if(aScrollWindow
.aColorBoxes
[i
])
1172 aScrollWindow
.aColorBoxes
[i
]->SetSelectHdl(aColorLink
);
1173 aScrollWindow
.aColorBoxes
[i
]->SetGetFocusHdl(aGetFocusLink
);
1175 if(aScrollWindow
.aCheckBoxes
[i
])
1177 aScrollWindow
.aCheckBoxes
[i
]->SetClickHdl(aCheckLink
);
1178 aScrollWindow
.aCheckBoxes
[i
]->SetGetFocusHdl(aGetFocusLink
);
1182 /* -----------------------------27.03.2002 10:46------------------------------
1184 ---------------------------------------------------------------------------*/
1185 ColorConfigCtrl_Impl::~ColorConfigCtrl_Impl()
1188 /* -----------------------------25.03.2002 17:19------------------------------
1190 ---------------------------------------------------------------------------*/
1191 void ColorConfigCtrl_Impl::Update()
1193 DBG_ASSERT(pColorConfig
, "Configuration not set" );
1195 for( i
= 0; i
< ColorConfigEntryCount
; i
++ )
1199 const ColorConfigValue
& rColorEntry
= pColorConfig
->GetColorValue(ColorConfigEntry(i
));
1200 if(COL_AUTO
== (sal_uInt32
)rColorEntry
.nColor
)
1202 if(aScrollWindow
.aColorBoxes
[i
])
1203 aScrollWindow
.aColorBoxes
[i
]->SelectEntryPos(0);
1204 if(aScrollWindow
.aWindows
[i
])
1205 aScrollWindow
.aWindows
[i
]->SetBackground(
1206 Wallpaper(ColorConfig::GetDefaultColor((ColorConfigEntry
) i
)));
1210 Color
aColor(rColorEntry
.nColor
);
1211 if(aScrollWindow
.aColorBoxes
[i
])
1212 aScrollWindow
.aColorBoxes
[i
]->SelectEntry( aColor
);
1213 if(aScrollWindow
.aWindows
[i
])
1214 aScrollWindow
.aWindows
[i
]->SetBackground(Wallpaper(aColor
));
1216 if(aScrollWindow
.aWindows
[i
])
1217 aScrollWindow
.aWindows
[i
]->Invalidate();
1218 if(aScrollWindow
.aCheckBoxes
[i
])
1219 aScrollWindow
.aCheckBoxes
[i
]->Check(rColorEntry
.bIsVisible
);
1220 } // for( i = 0; i < ColorConfigEntryCount; i++ )
1223 sal_Int32 nExtCount
= pExtColorConfig
->GetComponentCount();
1224 sal_Int32 nCount
= aScrollWindow
.aCheckBoxes
.size();
1226 i
= ColorConfigEntryCount
;
1227 for (sal_Int32 j
= 0; j
< nExtCount
; ++j
)
1229 ::rtl::OUString sComponentName
= pExtColorConfig
->GetComponentName(j
);
1230 sal_Int32 nColorCount
= pExtColorConfig
->GetComponentColorCount(sComponentName
);
1232 for( sal_Int32 k
= 0; i
< nCount
&& k
< nColorCount
; ++i
,++nPos
,++k
)
1234 if(aScrollWindow
.aColorBoxes
[i
])
1236 ExtendedColorConfigValue aColorEntry
= pExtColorConfig
->GetComponentColorConfigValue(sComponentName
,k
);
1237 Color
aColor(aColorEntry
.getColor());
1238 if(aColorEntry
.getDefaultColor() == aColorEntry
.getColor() )
1240 aScrollWindow
.aColorBoxes
[i
]->SelectEntryPos(0);
1244 aScrollWindow
.aColorBoxes
[i
]->SelectEntry( aColor
);
1246 if(aScrollWindow
.aWindows
[i
])
1247 aScrollWindow
.aWindows
[i
]->SetBackground(Wallpaper(aColor
));
1249 if(aScrollWindow
.aWindows
[i
])
1250 aScrollWindow
.aWindows
[i
]->Invalidate();
1255 /* -----------------------------26.03.2002 12:55------------------------------
1257 ---------------------------------------------------------------------------*/
1258 sal_Bool
lcl_MoveAndShow(Window
* pWindow
, long nOffset
, long nMaxVisible
, bool _bShow
)
1260 sal_Bool bHide
= sal_True
;
1263 Point aPos
= pWindow
->GetPosPixel();
1264 aPos
.Y() += nOffset
;
1265 pWindow
->SetPosPixel(aPos
);
1267 bHide
= aPos
.Y() > nMaxVisible
|| (aPos
.Y() + pWindow
->GetSizePixel().Height()) < 0;
1268 pWindow
->Show(!bHide
);
1272 IMPL_LINK(ColorConfigCtrl_Impl
, ScrollHdl
, ScrollBar
*, pScrollBar
)
1274 aScrollWindow
.SetUpdateMode(sal_True
);
1276 long nOffset
= aScrollWindow
.aColorBoxes
[1]->GetPosPixel().Y() - aScrollWindow
.aColorBoxes
[0]->GetPosPixel().Y();
1277 nOffset
*= (nScrollPos
- pScrollBar
->GetThumbPos());
1278 nScrollPos
= pScrollBar
->GetThumbPos();
1279 const long nWindowHeight
= aScrollWindow
.GetSizePixel().Height();
1280 sal_Int16 nFirstVisible
= -1;
1281 sal_Int16 nLastVisible
= -1;
1282 sal_Int32 nCount
= aScrollWindow
.aFixedTexts
.size();
1283 for( i
= 0; i
< nCount
; i
++ )
1288 //controls outside of the view need to be hidden to speed up accessibility tools
1289 bool bShowCtrl
= ( lcl_isGroupVisible(
1290 lcl_getGroup(i
), aScrollWindow
.GetModuleOptions() ) != sal_False
);
1291 lcl_MoveAndShow(aScrollWindow
.aCheckBoxes
[i
], nOffset
, nWindowHeight
, bShowCtrl
);
1292 lcl_MoveAndShow(aScrollWindow
.aFixedTexts
[i
], nOffset
, nWindowHeight
, bShowCtrl
);
1293 lcl_MoveAndShow(aScrollWindow
.aWindows
[i
] , nOffset
, nWindowHeight
, bShowCtrl
);
1294 sal_Bool bShow
= lcl_MoveAndShow(aScrollWindow
.aColorBoxes
[i
], nOffset
, nWindowHeight
, bShowCtrl
);
1297 if(nFirstVisible
== -1)
1303 //show the one prior to the first visible and the first after the last visble control
1304 //to enable KEY_TAB travelling
1308 //skip gaps where no controls exist for the related ColorConfigEntry
1311 while(!aScrollWindow
.aCheckBoxes
[nFirstVisible
] && !aScrollWindow
.aColorBoxes
[nFirstVisible
] && nFirstVisible
>= 0);
1313 if ( lcl_isGroupVisible(
1314 lcl_getGroup( nFirstVisible
), aScrollWindow
.GetModuleOptions() ) != sal_False
)
1316 if(aScrollWindow
.aCheckBoxes
[nFirstVisible
])
1317 aScrollWindow
.aCheckBoxes
[nFirstVisible
]->Show();
1318 if(aScrollWindow
.aColorBoxes
[nFirstVisible
])
1319 aScrollWindow
.aColorBoxes
[nFirstVisible
]->Show();
1323 if(nLastVisible
< nCount
- 1)
1326 //skip gaps where no controls exist for the related ColorConfigEntry
1327 while(!aScrollWindow
.aCheckBoxes
[nLastVisible
] && !aScrollWindow
.aColorBoxes
[nLastVisible
] &&
1328 nLastVisible
< nCount
- 1 )
1330 if ( nLastVisible
< nCount
)
1332 if ( lcl_isGroupVisible(
1333 lcl_getGroup( nLastVisible
), aScrollWindow
.GetModuleOptions() ) != sal_False
)
1335 if(aScrollWindow
.aCheckBoxes
[nLastVisible
])
1336 aScrollWindow
.aCheckBoxes
[nLastVisible
]->Show();
1337 if(aScrollWindow
.aColorBoxes
[nLastVisible
])
1338 aScrollWindow
.aColorBoxes
[nLastVisible
]->Show();
1341 } // if(nLastVisible < nCount - 1)
1342 sal_Int32 nChapterCount
= aScrollWindow
.aChapters
.size();
1343 for( i
= 0; i
< nChapterCount
; i
++ )
1345 Point aPos
= aScrollWindow
.aChapters
[i
]->GetPosPixel(); aPos
.Y() += nOffset
; aScrollWindow
.aChapters
[i
]->SetPosPixel(aPos
);
1346 aPos
= aScrollWindow
.aChapterWins
[i
]->GetPosPixel(); aPos
.Y() += nOffset
; aScrollWindow
.aChapterWins
[i
]->SetPosPixel(aPos
);
1348 aScrollWindow
.SetUpdateMode(sal_True
);
1351 /* -----------------------------29.04.2002 17:02------------------------------
1353 ---------------------------------------------------------------------------*/
1354 long ColorConfigCtrl_Impl::PreNotify( NotifyEvent
& rNEvt
)
1356 if(rNEvt
.GetType() == EVENT_COMMAND
)
1358 const CommandEvent
* pCEvt
= rNEvt
.GetCommandEvent();
1359 sal_uInt16 nCmd
= pCEvt
->GetCommand();
1360 if( COMMAND_WHEEL
== nCmd
)
1366 return Control::PreNotify(rNEvt
);
1368 /* -----------------------------08.04.2002 16:37------------------------------
1370 ---------------------------------------------------------------------------*/
1371 void ColorConfigCtrl_Impl::Command( const CommandEvent
& rCEvt
)
1373 switch ( rCEvt
.GetCommand() )
1377 case COMMAND_STARTAUTOSCROLL
:
1378 case COMMAND_AUTOSCROLL
:
1380 const CommandWheelData
* pWheelData
= rCEvt
.GetWheelData();
1381 if(pWheelData
&& !pWheelData
->IsHorz() && COMMAND_WHEEL_ZOOM
!= pWheelData
->GetMode())
1383 HandleScrollCommand( rCEvt
, 0, &aVScroll
);
1388 Control::Command(rCEvt
);
1392 /* -----------------------------14.12.2005 12:37------------------------------
1394 ---------------------------------------------------------------------------*/
1395 void ColorConfigCtrl_Impl::DataChanged( const DataChangedEvent
& rDCEvt
)
1397 Window::DataChanged( rDCEvt
);
1398 if ( (rDCEvt
.GetType() == DATACHANGED_SETTINGS
) &&
1399 (rDCEvt
.GetFlags() & SETTINGS_STYLE
) )
1401 const StyleSettings
& rStyleSettings
= GetSettings().GetStyleSettings();
1402 SetBackground(Wallpaper(rStyleSettings
.GetFieldColor()));
1407 /* -----------------------------27.03.2002 11:43------------------------------
1409 ---------------------------------------------------------------------------*/
1410 IMPL_LINK(ColorConfigCtrl_Impl
, ClickHdl
, CheckBox
*, pBox
)
1412 DBG_ASSERT(pColorConfig
, "Configuration not set" );
1414 for( sal_Int32 i
= 0; i
< ColorConfigEntryCount
; i
++ )
1418 if(aScrollWindow
.aCheckBoxes
[i
] == pBox
)
1420 ColorConfigValue aBoundCol
= pColorConfig
->GetColorValue(ColorConfigEntry(i
));
1421 aBoundCol
.bIsVisible
= pBox
->IsChecked();
1422 pColorConfig
->SetColorValue(ColorConfigEntry(i
), aBoundCol
);
1425 } // for( sal_Int32 i = 0; i < ColorConfigEntryCount; i++ )
1428 /* -----------------------------27.03.2002 11:43------------------------------
1430 ---------------------------------------------------------------------------*/
1431 IMPL_LINK(ColorConfigCtrl_Impl
, ColorHdl
, ColorListBox
*, pBox
)
1433 DBG_ASSERT(pColorConfig
, "Configuration not set" );
1435 for( ; i
< ColorConfigEntryCount
; i
++ )
1437 if(pBox
&& aScrollWindow
.aColorBoxes
[i
] == pBox
)
1439 ColorConfigValue aColorEntry
= pColorConfig
->GetColorValue(ColorConfigEntry(i
));
1440 if(!pBox
->GetSelectEntryPos())
1442 aColorEntry
.nColor
= COL_AUTO
;
1443 if(aScrollWindow
.aWindows
[i
])
1444 aScrollWindow
.aWindows
[i
]->SetBackground(
1445 Wallpaper(ColorConfig::GetDefaultColor((ColorConfigEntry
) i
)));
1449 Color aColor
= pBox
->GetSelectEntryColor(); // #i14869# no Color&, 'cause it's a ref to a temp object on the stack!
1450 aColorEntry
.nColor
= aColor
.GetColor();
1451 if(aScrollWindow
.aWindows
[i
])
1452 aScrollWindow
.aWindows
[i
]->SetBackground(Wallpaper(aColor
));
1454 if(aScrollWindow
.aWindows
[i
])
1455 aScrollWindow
.aWindows
[i
]->Invalidate();
1456 pColorConfig
->SetColorValue(ColorConfigEntry(i
), aColorEntry
);
1459 } // for( sal_Int32 i = 0; i < ColorConfigEntryCount; i++ )
1460 sal_Int32 nExtCount
= pExtColorConfig
->GetComponentCount();
1461 sal_Int32 nCount
= aScrollWindow
.aCheckBoxes
.size();
1463 i
= ColorConfigEntryCount
;
1464 for (sal_Int32 j
= 0; j
< nExtCount
; ++j
)
1466 ::rtl::OUString sComponentName
= pExtColorConfig
->GetComponentName(j
);
1467 sal_Int32 nColorCount
= pExtColorConfig
->GetComponentColorCount(sComponentName
);
1469 for( sal_Int32 k
= 0; i
< nCount
&& k
< nColorCount
; ++i
,++nPos
,++k
)
1471 if(pBox
&& aScrollWindow
.aColorBoxes
[i
] == pBox
)
1473 ExtendedColorConfigValue aColorEntry
= pExtColorConfig
->GetComponentColorConfigValue(sComponentName
,k
);
1474 Color aColor
= pBox
->GetSelectEntryColor(); // #i14869# no Color&, 'cause it's a ref to a temp object on the stack!
1475 aColorEntry
.setColor(aColor
.GetColor());
1476 if( !pBox
->GetSelectEntryPos() ) // auto color
1478 aColorEntry
.setColor(aColorEntry
.getDefaultColor());
1479 aColor
.SetColor(aColorEntry
.getColor());
1481 if ( aScrollWindow
.aWindows
[i
] )
1483 aScrollWindow
.aWindows
[i
]->SetBackground(Wallpaper(aColor
));
1484 aScrollWindow
.aWindows
[i
]->Invalidate();
1486 pExtColorConfig
->SetColorValue(sComponentName
,aColorEntry
);
1493 IMPL_LINK(ColorConfigCtrl_Impl
, ControlFocusHdl
, Control
*, pCtrl
)
1495 //determine whether a control is completely visible
1496 //and make it visible
1497 Point
aCtrlPos(pCtrl
->GetPosPixel());
1498 sal_Int32 nWinHeight
= aScrollWindow
.GetSizePixel().Height();
1499 if(0 != (GETFOCUS_TAB
& pCtrl
->GetGetFocusFlags() &&
1500 (aCtrlPos
.Y() < 0 ||
1501 nWinHeight
< aCtrlPos
.Y() + aScrollWindow
.aColorBoxes
[0]->GetSizePixel().Height())))
1503 long nThumbPos
= aVScroll
.GetThumbPos();
1504 if(nWinHeight
< aCtrlPos
.Y() + aScrollWindow
.aColorBoxes
[0]->GetSizePixel().Height())
1516 aVScroll
.SetThumbPos(nThumbPos
);
1517 ScrollHdl(&aVScroll
);
1521 /* -----------------------------25.03.2002 10:47------------------------------
1523 ---------------------------------------------------------------------------*/
1524 SvxColorOptionsTabPage::SvxColorOptionsTabPage(
1525 Window
* pParent
, const SfxItemSet
& rCoreSet
) :
1526 SfxTabPage( pParent
, CUI_RES( RID_SVXPAGE_COLORCONFIG
), rCoreSet
),
1527 aColorSchemeFL( this, CUI_RES( FL_COLORSCHEME
) ),
1528 aColorSchemeFT( this, CUI_RES( FT_COLORSCHEME
) ),
1529 aColorSchemeLB( this, CUI_RES( LB_COLORSCHEME
) ),
1530 aSaveSchemePB( this, CUI_RES( PB_SAVESCHEME
) ),
1531 aDeleteSchemePB( this, CUI_RES( PB_DELETESCHEME
) ),
1532 aCustomColorsFL( this, CUI_RES( FL_CUSTOMCOLORS
) ),
1533 bFillItemSetCalled(sal_False
),
1536 pColorConfigCT( new ColorConfigCtrl_Impl(this, CUI_RES( CT_COLORCONFIG
) ))
1539 aColorSchemeLB
.SetSelectHdl(LINK(this, SvxColorOptionsTabPage
, SchemeChangedHdl_Impl
));
1540 Link aLk
= LINK(this, SvxColorOptionsTabPage
, SaveDeleteHdl_Impl
);
1541 aSaveSchemePB
.SetClickHdl(aLk
);
1542 aDeleteSchemePB
.SetClickHdl(aLk
);
1544 /* -----------------------------25.03.2002 10:47------------------------------
1546 ---------------------------------------------------------------------------*/
1547 SvxColorOptionsTabPage::~SvxColorOptionsTabPage()
1549 //when the dialog is cancelled but the color scheme ListBox has been changed these
1550 //changes need to be undone
1551 if(!bFillItemSetCalled
&& aColorSchemeLB
.GetSavedValue() != aColorSchemeLB
.GetSelectEntryPos())
1553 rtl::OUString sOldScheme
= aColorSchemeLB
.GetEntry(aColorSchemeLB
.GetSavedValue());
1554 if(sOldScheme
.getLength())
1556 pColorConfig
->SetCurrentSchemeName(sOldScheme
);
1557 pExtColorConfig
->SetCurrentSchemeName(sOldScheme
);
1560 delete pColorConfigCT
;
1561 pColorConfig
->ClearModified();
1562 pColorConfig
->EnableBroadcast();
1563 delete pColorConfig
;
1564 pExtColorConfig
->ClearModified();
1565 pExtColorConfig
->EnableBroadcast();
1566 delete pExtColorConfig
;
1568 /* -----------------------------25.03.2002 10:47------------------------------
1570 ---------------------------------------------------------------------------*/
1571 SfxTabPage
* SvxColorOptionsTabPage::Create( Window
* pParent
, const SfxItemSet
& rAttrSet
)
1573 return ( new SvxColorOptionsTabPage( pParent
, rAttrSet
) );
1575 /* -----------------------------25.03.2002 10:47------------------------------
1577 ---------------------------------------------------------------------------*/
1578 sal_Bool
SvxColorOptionsTabPage::FillItemSet( SfxItemSet
& )
1580 bFillItemSetCalled
= sal_True
;
1581 if(aColorSchemeLB
.GetSavedValue() != aColorSchemeLB
.GetSelectEntryPos())
1583 pColorConfig
->SetModified();
1584 pExtColorConfig
->SetModified();
1586 if(pColorConfig
->IsModified())
1587 pColorConfig
->Commit();
1588 if(pExtColorConfig
->IsModified())
1589 pExtColorConfig
->Commit();
1592 /* -----------------------------25.03.2002 10:47------------------------------
1594 ---------------------------------------------------------------------------*/
1595 void SvxColorOptionsTabPage::Reset( const SfxItemSet
& )
1599 pColorConfig
->ClearModified();
1600 pColorConfig
->DisableBroadcast();
1601 delete pColorConfig
;
1603 pColorConfig
= new EditableColorConfig
;
1604 pColorConfigCT
->SetConfig(*pColorConfig
);
1608 pExtColorConfig
->ClearModified();
1609 pExtColorConfig
->DisableBroadcast();
1610 delete pExtColorConfig
;
1612 pExtColorConfig
= new EditableExtendedColorConfig
;
1613 pColorConfigCT
->SetExtendedConfig(*pExtColorConfig
);
1615 String sUser
= GetUserData();
1616 //has to be called always to speed up accessibility tools
1617 pColorConfigCT
->SetScrollPosition(sUser
.ToInt32());
1618 aColorSchemeLB
.Clear();
1619 uno::Sequence
< ::rtl::OUString
> aSchemes
= pColorConfig
->GetSchemeNames();
1620 const rtl::OUString
* pSchemes
= aSchemes
.getConstArray();
1621 for(sal_Int32 i
= 0; i
< aSchemes
.getLength(); i
++)
1622 aColorSchemeLB
.InsertEntry(pSchemes
[i
]);
1623 aColorSchemeLB
.SelectEntry(pColorConfig
->GetCurrentSchemeName());
1624 aColorSchemeLB
.SaveValue();
1625 aDeleteSchemePB
.Enable( aSchemes
.getLength() > 1 );
1626 UpdateColorConfig();
1628 /* -----------------------------25.03.2002 10:47------------------------------
1630 ---------------------------------------------------------------------------*/
1631 int SvxColorOptionsTabPage::DeactivatePage( SfxItemSet
* _pSet
)
1634 FillItemSet( *_pSet
);
1635 return( LEAVE_PAGE
);
1637 /* -----------------------------25.03.2002 15:32------------------------------
1639 ---------------------------------------------------------------------------*/
1640 void SvxColorOptionsTabPage::UpdateColorConfig()
1642 //update the color config control
1643 pColorConfigCT
->Update();
1645 /* -----------------------------25.03.2002 15:30------------------------------
1647 ---------------------------------------------------------------------------*/
1648 IMPL_LINK(SvxColorOptionsTabPage
, SchemeChangedHdl_Impl
, ListBox
*, pBox
)
1650 pColorConfig
->LoadScheme(pBox
->GetSelectEntry());
1651 pExtColorConfig
->LoadScheme(pBox
->GetSelectEntry());
1652 UpdateColorConfig();
1655 /* -----------------------------09.04.2002 15:21------------------------------
1657 ---------------------------------------------------------------------------*/
1658 IMPL_LINK(SvxColorOptionsTabPage
, SaveDeleteHdl_Impl
, PushButton
*, pButton
)
1660 if(&aSaveSchemePB
== pButton
)
1663 //CHINA001 SvxNameDialog aNameDlg(pButton,
1665 //CHINA001 String(CUI_RES(RID_SVXSTR_COLOR_CONFIG_SAVE2)));
1666 SvxAbstractDialogFactory
* pFact
= SvxAbstractDialogFactory::Create();
1667 DBG_ASSERT(pFact
, "Dialogdiet fail!");//CHINA001
1668 AbstractSvxNameDialog
* aNameDlg
= pFact
->CreateSvxNameDialog( pButton
,
1669 sName
, String(CUI_RES(RID_SVXSTR_COLOR_CONFIG_SAVE2
)) );
1670 DBG_ASSERT(aNameDlg
, "Dialogdiet fail!");//CHINA001
1671 aNameDlg
->SetCheckNameHdl( LINK(this, SvxColorOptionsTabPage
, CheckNameHdl_Impl
));
1672 aNameDlg
->SetText(String(CUI_RES(RID_SVXSTR_COLOR_CONFIG_SAVE1
)));
1673 aNameDlg
->SetHelpId(HID_OPTIONS_COLORCONFIG_SAVE_SCHEME
);
1674 aNameDlg
->SetEditHelpId(HID_OPTIONS_COLORCONFIG_NAME_SCHEME
);
1675 aNameDlg
->SetCheckNameHdl( LINK(this, SvxColorOptionsTabPage
, CheckNameHdl_Impl
));
1676 if(RET_OK
== aNameDlg
->Execute()) //CHINA001 if(RET_OK == aNameDlg.Execute())
1678 aNameDlg
->GetName(sName
); //CHINA001 aNameDlg.GetName(sName);
1679 pColorConfig
->AddScheme(sName
);
1680 pExtColorConfig
->AddScheme(sName
);
1681 aColorSchemeLB
.InsertEntry(sName
);
1682 aColorSchemeLB
.SelectEntry(sName
);
1683 aColorSchemeLB
.GetSelectHdl().Call(&aColorSchemeLB
);
1685 delete aNameDlg
; //add by CHINA001
1689 DBG_ASSERT(aColorSchemeLB
.GetEntryCount() > 1, "don't delete the last scheme");
1690 QueryBox
aQuery(pButton
, CUI_RES(RID_SVXQB_DELETE_COLOR_CONFIG
));
1691 aQuery
.SetText(String(CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE
)));
1692 if(RET_YES
== aQuery
.Execute())
1694 rtl::OUString
sDeleteScheme(aColorSchemeLB
.GetSelectEntry());
1695 aColorSchemeLB
.RemoveEntry(aColorSchemeLB
.GetSelectEntryPos());
1696 aColorSchemeLB
.SelectEntryPos(0);
1697 aColorSchemeLB
.GetSelectHdl().Call(&aColorSchemeLB
);
1698 //first select the new scheme and then delete the old one
1699 pColorConfig
->DeleteScheme(sDeleteScheme
);
1700 pExtColorConfig
->DeleteScheme(sDeleteScheme
);
1703 aDeleteSchemePB
.Enable( aColorSchemeLB
.GetEntryCount() > 1 );
1706 /* -----------------------------09.04.2002 15:47------------------------------
1708 ---------------------------------------------------------------------------*/
1709 IMPL_LINK(SvxColorOptionsTabPage
, CheckNameHdl_Impl
, AbstractSvxNameDialog
*, pDialog
)
1712 pDialog
->GetName(sName
);
1713 return sName
.Len() && LISTBOX_ENTRY_NOTFOUND
== aColorSchemeLB
.GetEntryPos( sName
);
1715 /* -----------------------------25.04.2002 15:12------------------------------
1717 ---------------------------------------------------------------------------*/
1718 void SvxColorOptionsTabPage::FillUserData()
1720 SetUserData(String::CreateFromInt32(pColorConfigCT
->GetScrollPosition()));