valueset.cxx (ca6f8f21) valueset.cxx (a68b38df)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 24 unchanged lines hidden (view full) ---

33#ifndef _HELP_HXX
34#include <vcl/help.hxx>
35#endif
36#include <com/sun/star/accessibility/AccessibleEventObject.hpp>
37#include <com/sun/star/accessibility/AccessibleEventId.hpp>
38#include <com/sun/star/accessibility/AccessibleStateType.hpp>
39#include <com/sun/star/lang/XComponent.hpp>
40#include <rtl/ustring.hxx>
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 24 unchanged lines hidden (view full) ---

33#ifndef _HELP_HXX
34#include <vcl/help.hxx>
35#endif
36#include <com/sun/star/accessibility/AccessibleEventObject.hpp>
37#include <com/sun/star/accessibility/AccessibleEventId.hpp>
38#include <com/sun/star/accessibility/AccessibleStateType.hpp>
39#include <com/sun/star/lang/XComponent.hpp>
40#include <rtl/ustring.hxx>
41#include <svtools/accessibilityoptions.hxx>
42#include "valueimp.hxx"
43
44#define _SV_VALUESET_CXX
45#include <svtools/valueset.hxx>
46
47// ------------
48// - ValueSet -
49// ------------

--- 15 unchanged lines hidden (view full) ---

65 mnHighItemId = 0;
66 mnDropPos = VALUESET_ITEM_NOTFOUND;
67 mnCols = 0;
68 mnCurCol = 0;
69 mnUserCols = 0;
70 mnUserVisLines = 0;
71 mnSpacing = 0;
72 mnFrameStyle = 0;
41#include "valueimp.hxx"
42
43#define _SV_VALUESET_CXX
44#include <svtools/valueset.hxx>
45
46// ------------
47// - ValueSet -
48// ------------

--- 15 unchanged lines hidden (view full) ---

64 mnHighItemId = 0;
65 mnDropPos = VALUESET_ITEM_NOTFOUND;
66 mnCols = 0;
67 mnCurCol = 0;
68 mnUserCols = 0;
69 mnUserVisLines = 0;
70 mnSpacing = 0;
71 mnFrameStyle = 0;
73 mbFormat = sal_True;
74 mbHighlight = sal_False ;
75 mbSelection = sal_False;
76 mbNoSelection = sal_True;
77 mbDrawSelection = sal_True;
78 mbBlackSel = sal_False;
79 mbDoubleSel = sal_False;
80 mbScroll = sal_False;
81 mbDropPos = sal_False;
82 mbFullMode = sal_True;
72 mbFormat = true;
73 mbHighlight = false;
74 mbSelection = false;
75 mbNoSelection = true;
76 mbDrawSelection = true;
77 mbBlackSel = false;
78 mbDoubleSel = false;
79 mbScroll = false;
80 mbDropPos = false;
81 mbFullMode = true;
82 mbEdgeBlending = false;
83
84 // #106446#, #106601# force mirroring of virtual device
85 maVirDev.EnableRTL( GetParent()->IsRTLEnabled() );
86
87 ImplInitSettings( sal_True, sal_True, sal_True );
88}
89
90// -----------------------------------------------------------------------

--- 56 unchanged lines hidden (view full) ---

147 delete pItem;
148 }
149
150 mpImpl->mpItemList->Clear();
151}
152
153// -----------------------------------------------------------------------
154
83
84 // #106446#, #106601# force mirroring of virtual device
85 maVirDev.EnableRTL( GetParent()->IsRTLEnabled() );
86
87 ImplInitSettings( sal_True, sal_True, sal_True );
88}
89
90// -----------------------------------------------------------------------

--- 56 unchanged lines hidden (view full) ---

147 delete pItem;
148 }
149
150 mpImpl->mpItemList->Clear();
151}
152
153// -----------------------------------------------------------------------
154
155void ValueSet::ImplInitSettings( sal_Bool bFont,
156 sal_Bool bForeground, sal_Bool bBackground )
155void ValueSet::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
157{
158 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
159
160 if ( bFont )
161 {
162 Font aFont;
163 aFont = rStyleSettings.GetAppFont();
164 if ( IsControlFont() )

--- 86 unchanged lines hidden (view full) ---

251 }
252 }
253
254 if ( pItem == mpNoneItem )
255 pItem->maText = GetText();
256
257 if ( (aRect.GetHeight() > 0) && (aRect.GetWidth() > 0) )
258 {
156{
157 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
158
159 if ( bFont )
160 {
161 Font aFont;
162 aFont = rStyleSettings.GetAppFont();
163 if ( IsControlFont() )

--- 86 unchanged lines hidden (view full) ---

250 }
251 }
252
253 if ( pItem == mpNoneItem )
254 pItem->maText = GetText();
255
256 if ( (aRect.GetHeight() > 0) && (aRect.GetWidth() > 0) )
257 {
258 const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
259
259 if ( pItem == mpNoneItem )
260 {
260 if ( pItem == mpNoneItem )
261 {
261 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
262 maVirDev.SetFont( GetFont() );
263 maVirDev.SetTextColor( ( nStyle & WB_MENUSTYLEVALUESET ) ? rStyleSettings.GetMenuTextColor() : rStyleSettings.GetWindowTextColor() );
264 maVirDev.SetTextFillColor();
265 maVirDev.SetFillColor( ( nStyle & WB_MENUSTYLEVALUESET ) ? rStyleSettings.GetMenuColor() : rStyleSettings.GetWindowColor() );
266 maVirDev.DrawRect( aRect );
267 Point aTxtPos( aRect.Left()+2, aRect.Top() );
268 long nTxtWidth = GetTextWidth( pItem->maText );
269 if ( nStyle & WB_RADIOSEL )

--- 9 unchanged lines hidden (view full) ---

279 }
280 else
281 maVirDev.DrawText( aTxtPos, pItem->maText );
282 }
283 else if ( pItem->meType == VALUESETITEM_COLOR )
284 {
285 maVirDev.SetFillColor( pItem->maColor );
286 maVirDev.DrawRect( aRect );
262 maVirDev.SetFont( GetFont() );
263 maVirDev.SetTextColor( ( nStyle & WB_MENUSTYLEVALUESET ) ? rStyleSettings.GetMenuTextColor() : rStyleSettings.GetWindowTextColor() );
264 maVirDev.SetTextFillColor();
265 maVirDev.SetFillColor( ( nStyle & WB_MENUSTYLEVALUESET ) ? rStyleSettings.GetMenuColor() : rStyleSettings.GetWindowColor() );
266 maVirDev.DrawRect( aRect );
267 Point aTxtPos( aRect.Left()+2, aRect.Top() );
268 long nTxtWidth = GetTextWidth( pItem->maText );
269 if ( nStyle & WB_RADIOSEL )

--- 9 unchanged lines hidden (view full) ---

279 }
280 else
281 maVirDev.DrawText( aTxtPos, pItem->maText );
282 }
283 else if ( pItem->meType == VALUESETITEM_COLOR )
284 {
285 maVirDev.SetFillColor( pItem->maColor );
286 maVirDev.DrawRect( aRect );
287
288 const SvtAccessibilityOptions aOptions;
289 const sal_Int16 nEdgeBlendingPercent(aOptions.GetEdgeBlending());
290 static bool bTest(false);
291
292 if(nEdgeBlendingPercent && bTest)
293 {
294 Bitmap aBitmap(maVirDev.GetBitmap(aRect.TopLeft(), aRect.GetSize()));
295
296 if(!aBitmap.IsEmpty())
297 {
298 const Color aTopLeft(COL_WHITE);
299 const Color aBottomRight(COL_BLACK);
300 const sal_uInt8 nAlpha((nEdgeBlendingPercent * 255) / 100);
301
302 aBitmap.DrawBlendFrame(nAlpha, aTopLeft, aBottomRight);
303 maVirDev.DrawBitmap(aRect.TopLeft(), aBitmap);
304 }
305 }
306 }
307 else
308 {
287 }
288 else
289 {
309 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
310 if ( IsColor() )
311 maVirDev.SetFillColor( maColor );
312 else if ( nStyle & WB_MENUSTYLEVALUESET )
313 maVirDev.SetFillColor( rStyleSettings.GetMenuColor() );
314 else if ( IsEnabled() )
315 maVirDev.SetFillColor( rStyleSettings.GetWindowColor() );
316 else
317 maVirDev.SetFillColor( rStyleSettings.GetFaceColor() );

--- 22 unchanged lines hidden (view full) ---

340 maVirDev.SetClipRegion( Region( aRect ) );
341 maVirDev.DrawImage( aPos, pItem->maImage, nImageStyle);
342 maVirDev.SetClipRegion();
343 }
344 else
345 maVirDev.DrawImage( aPos, pItem->maImage, nImageStyle );
346 }
347 }
290 if ( IsColor() )
291 maVirDev.SetFillColor( maColor );
292 else if ( nStyle & WB_MENUSTYLEVALUESET )
293 maVirDev.SetFillColor( rStyleSettings.GetMenuColor() );
294 else if ( IsEnabled() )
295 maVirDev.SetFillColor( rStyleSettings.GetWindowColor() );
296 else
297 maVirDev.SetFillColor( rStyleSettings.GetFaceColor() );

--- 22 unchanged lines hidden (view full) ---

320 maVirDev.SetClipRegion( Region( aRect ) );
321 maVirDev.DrawImage( aPos, pItem->maImage, nImageStyle);
322 maVirDev.SetClipRegion();
323 }
324 else
325 maVirDev.DrawImage( aPos, pItem->maImage, nImageStyle );
326 }
327 }
328
329 const sal_uInt16 nEdgeBlendingPercent(GetEdgeBlending() ? rStyleSettings.GetEdgeBlending() : 0);
330
331 if(nEdgeBlendingPercent)
332 {
333 Bitmap aBitmap(maVirDev.GetBitmap(aRect.TopLeft(), aRect.GetSize()));
334
335 if(!aBitmap.IsEmpty())
336 {
337 const Color& rTopLeft(rStyleSettings.GetEdgeBlendingTopLeftColor());
338 const Color& rBottomRight(rStyleSettings.GetEdgeBlendingBottomRightColor());
339 const sal_uInt8 nAlpha((nEdgeBlendingPercent * 255) / 100);
340
341 aBitmap.DrawBlendFrame(nAlpha, rTopLeft, rBottomRight);
342 maVirDev.DrawBitmap(aRect.TopLeft(), aBitmap);
343 }
344 }
348 }
349}
350
351// -----------------------------------------------------------------------
352
353::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ValueSet::CreateAccessible()
354{
355 return new ValueSetAcc( this, mpImpl->mbIsTransientChildrenDisabled );

--- 90 unchanged lines hidden (view full) ---

446 }
447 else
448 mnCols = 1;
449 }
450 else
451 mnCols = mnUserCols;
452
453 // Zeilenanzahl berechnen
345 }
346}
347
348// -----------------------------------------------------------------------
349
350::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ValueSet::CreateAccessible()
351{
352 return new ValueSetAcc( this, mpImpl->mbIsTransientChildrenDisabled );

--- 90 unchanged lines hidden (view full) ---

443 }
444 else
445 mnCols = 1;
446 }
447 else
448 mnCols = mnUserCols;
449
450 // Zeilenanzahl berechnen
454 mbScroll = sal_False;
451 mbScroll = false;
455 mnLines = (long)mpImpl->mpItemList->Count() / mnCols;
456 if ( mpImpl->mpItemList->Count() % mnCols )
457 mnLines++;
458 else if ( !mnLines )
459 mnLines = 1;
460
461 long nCalcHeight = aWinSize.Height()-nNoneHeight;
462 if ( mnUserVisLines )
463 mnVisLines = mnUserVisLines;
464 else if ( mnUserItemHeight )
465 {
466 mnVisLines = (nCalcHeight-nNoneSpace+nSpace) / (mnUserItemHeight+nSpace);
467 if ( !mnVisLines )
468 mnVisLines = 1;
469 }
470 else
471 mnVisLines = mnLines;
472 if ( mnLines > mnVisLines )
452 mnLines = (long)mpImpl->mpItemList->Count() / mnCols;
453 if ( mpImpl->mpItemList->Count() % mnCols )
454 mnLines++;
455 else if ( !mnLines )
456 mnLines = 1;
457
458 long nCalcHeight = aWinSize.Height()-nNoneHeight;
459 if ( mnUserVisLines )
460 mnVisLines = mnUserVisLines;
461 else if ( mnUserItemHeight )
462 {
463 mnVisLines = (nCalcHeight-nNoneSpace+nSpace) / (mnUserItemHeight+nSpace);
464 if ( !mnVisLines )
465 mnVisLines = 1;
466 }
467 else
468 mnVisLines = mnLines;
469 if ( mnLines > mnVisLines )
473 mbScroll = sal_True;
470 mbScroll = true;
474 if ( mnLines <= mnVisLines )
475 mnFirstLine = 0;
476 else
477 {
478 if ( mnFirstLine > (sal_uInt16)(mnLines-mnVisLines) )
479 mnFirstLine = (sal_uInt16)(mnLines-mnVisLines);
480 }
481

--- 63 unchanged lines hidden (view full) ---

545 // Gegebenenfalls die Farben anpassen, damit man die Selektion besser
546 // erkennen kann
547 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
548 Color aHighColor( rStyleSettings.GetHighlightColor() );
549 if ( ((aHighColor.GetRed() > 0x80) || (aHighColor.GetGreen() > 0x80) ||
550 (aHighColor.GetBlue() > 0x80)) ||
551 ((aHighColor.GetRed() == 0x80) && (aHighColor.GetGreen() == 0x80) &&
552 (aHighColor.GetBlue() == 0x80)) )
471 if ( mnLines <= mnVisLines )
472 mnFirstLine = 0;
473 else
474 {
475 if ( mnFirstLine > (sal_uInt16)(mnLines-mnVisLines) )
476 mnFirstLine = (sal_uInt16)(mnLines-mnVisLines);
477 }
478

--- 63 unchanged lines hidden (view full) ---

542 // Gegebenenfalls die Farben anpassen, damit man die Selektion besser
543 // erkennen kann
544 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
545 Color aHighColor( rStyleSettings.GetHighlightColor() );
546 if ( ((aHighColor.GetRed() > 0x80) || (aHighColor.GetGreen() > 0x80) ||
547 (aHighColor.GetBlue() > 0x80)) ||
548 ((aHighColor.GetRed() == 0x80) && (aHighColor.GetGreen() == 0x80) &&
549 (aHighColor.GetBlue() == 0x80)) )
553 mbBlackSel = sal_True;
550 mbBlackSel = true;
554 else
551 else
555 mbBlackSel = sal_False;
552 mbBlackSel = false;
556
557 // Wenn die Items groesser sind, dann die Selektion doppelt so breit
558 // zeichnen
559 if ( (nStyle & WB_DOUBLEBORDER) &&
560 ((nItemWidth >= 25) && (nItemHeight >= 20)) )
553
554 // Wenn die Items groesser sind, dann die Selektion doppelt so breit
555 // zeichnen
556 if ( (nStyle & WB_DOUBLEBORDER) &&
557 ((nItemWidth >= 25) && (nItemHeight >= 20)) )
561 mbDoubleSel = sal_True;
558 mbDoubleSel = true;
562 else
559 else
563 mbDoubleSel = sal_False;
560 mbDoubleSel = false;
564
565 // Calculate offsets
566 long nStartX;
567 long nStartY;
568 if ( mbFullMode )
569 {
570 long nAllItemWidth = (nItemWidth*mnCols)+nColSpace;
571 long nAllItemHeight = (nItemHeight*mnVisLines)+nNoneHeight+nLineSpace;

--- 105 unchanged lines hidden (view full) ---

677 if ( nPageSize < 1 )
678 nPageSize = 1;
679 mpScrBar->SetPageSize( nPageSize );
680 mpScrBar->Show();
681 }
682 }
683
684 // Jetzt haben wir formatiert und warten auf das naechste
561
562 // Calculate offsets
563 long nStartX;
564 long nStartY;
565 if ( mbFullMode )
566 {
567 long nAllItemWidth = (nItemWidth*mnCols)+nColSpace;
568 long nAllItemHeight = (nItemHeight*mnVisLines)+nNoneHeight+nLineSpace;

--- 105 unchanged lines hidden (view full) ---

674 if ( nPageSize < 1 )
675 nPageSize = 1;
676 mpScrBar->SetPageSize( nPageSize );
677 mpScrBar->Show();
678 }
679 }
680
681 // Jetzt haben wir formatiert und warten auf das naechste
685 mbFormat = sal_False;
682 mbFormat = false;
686
687 // ScrollBar loeschen
688 if ( pDelScrBar )
689 delete pDelScrBar;
690}
691
692// -----------------------------------------------------------------------
693

--- 248 unchanged lines hidden (view full) ---

942 if ( mnHighItemId != nItemId )
943 {
944 // Alten merken, um vorherige Selektion zu entfernen
945 sal_uInt16 nOldItem = mnHighItemId;
946 mnHighItemId = nItemId;
947
948 // Wenn keiner selektiert ist, dann Selektion nicht malen
949 if ( !bIsSelection && mbNoSelection )
683
684 // ScrollBar loeschen
685 if ( pDelScrBar )
686 delete pDelScrBar;
687}
688
689// -----------------------------------------------------------------------
690

--- 248 unchanged lines hidden (view full) ---

939 if ( mnHighItemId != nItemId )
940 {
941 // Alten merken, um vorherige Selektion zu entfernen
942 sal_uInt16 nOldItem = mnHighItemId;
943 mnHighItemId = nItemId;
944
945 // Wenn keiner selektiert ist, dann Selektion nicht malen
946 if ( !bIsSelection && mbNoSelection )
950 mbDrawSelection = sal_False;
947 mbDrawSelection = false;
951
952 // Neu ausgeben und alte Selection wegnehmen
953 ImplHideSelect( nOldItem );
954 ImplDrawSelect();
948
949 // Neu ausgeben und alte Selection wegnehmen
950 ImplHideSelect( nOldItem );
951 ImplDrawSelect();
955 mbDrawSelection = sal_True;
952 mbDrawSelection = true;
956 }
957}
958
959// -----------------------------------------------------------------------
960
961void ValueSet::ImplDrawDropPos( sal_Bool bShow )
962{
963 if ( (mnDropPos != VALUESET_ITEM_NOTFOUND) && mpImpl->mpItemList->Count() )

--- 171 unchanged lines hidden (view full) ---

1135 {
1136 long nBottomPos = mpImpl->mpItemList->GetObject( (mnFirstLine+mnVisLines-1)*mnCols )->maRect.Bottom();
1137 if ( (rPos.Y() >= nBottomPos-nScrollOffset) && (rPos.Y() <= nBottomPos) )
1138 mnFirstLine++;
1139 }
1140
1141 if ( mnFirstLine != nOldLine )
1142 {
953 }
954}
955
956// -----------------------------------------------------------------------
957
958void ValueSet::ImplDrawDropPos( sal_Bool bShow )
959{
960 if ( (mnDropPos != VALUESET_ITEM_NOTFOUND) && mpImpl->mpItemList->Count() )

--- 171 unchanged lines hidden (view full) ---

1132 {
1133 long nBottomPos = mpImpl->mpItemList->GetObject( (mnFirstLine+mnVisLines-1)*mnCols )->maRect.Bottom();
1134 if ( (rPos.Y() >= nBottomPos-nScrollOffset) && (rPos.Y() <= nBottomPos) )
1135 mnFirstLine++;
1136 }
1137
1138 if ( mnFirstLine != nOldLine )
1139 {
1143 mbFormat = sal_True;
1140 mbFormat = true;
1144 ImplDraw();
1145 return sal_True;
1146 }
1147 else
1148 return sal_False;
1149}
1150
1151// -----------------------------------------------------------------------

--- 118 unchanged lines hidden (view full) ---

1270// -----------------------------------------------------------------------
1271
1272IMPL_LINK( ValueSet,ImplScrollHdl, ScrollBar*, pScrollBar )
1273{
1274 sal_uInt16 nNewFirstLine = (sal_uInt16)pScrollBar->GetThumbPos();
1275 if ( nNewFirstLine != mnFirstLine )
1276 {
1277 mnFirstLine = nNewFirstLine;
1141 ImplDraw();
1142 return sal_True;
1143 }
1144 else
1145 return sal_False;
1146}
1147
1148// -----------------------------------------------------------------------

--- 118 unchanged lines hidden (view full) ---

1267// -----------------------------------------------------------------------
1268
1269IMPL_LINK( ValueSet,ImplScrollHdl, ScrollBar*, pScrollBar )
1270{
1271 sal_uInt16 nNewFirstLine = (sal_uInt16)pScrollBar->GetThumbPos();
1272 if ( nNewFirstLine != mnFirstLine )
1273 {
1274 mnFirstLine = nNewFirstLine;
1278 mbFormat = sal_True;
1275 mbFormat = true;
1279 ImplDraw();
1280 }
1281 return 0;
1282}
1283
1284// -----------------------------------------------------------------------
1285
1286IMPL_LINK( ValueSet,ImplTimerHdl, Timer*, EMPTYARG )

--- 18 unchanged lines hidden (view full) ---

1305 }
1306 }
1307 }
1308
1309 ValueSetItem* pItem = ImplGetItem( ImplGetItem( rPos ) );
1310 if ( pItem && (pItem->meType != VALUESETITEM_SPACE) )
1311 {
1312 if( GetStyle() & WB_MENUSTYLEVALUESET )
1276 ImplDraw();
1277 }
1278 return 0;
1279}
1280
1281// -----------------------------------------------------------------------
1282
1283IMPL_LINK( ValueSet,ImplTimerHdl, Timer*, EMPTYARG )

--- 18 unchanged lines hidden (view full) ---

1302 }
1303 }
1304 }
1305
1306 ValueSetItem* pItem = ImplGetItem( ImplGetItem( rPos ) );
1307 if ( pItem && (pItem->meType != VALUESETITEM_SPACE) )
1308 {
1309 if( GetStyle() & WB_MENUSTYLEVALUESET )
1313 mbHighlight = sal_True;
1310 mbHighlight = true;
1314
1315 ImplHighlightItem( pItem->mnId );
1316 }
1317 else
1318 {
1319 if( GetStyle() & WB_MENUSTYLEVALUESET )
1311
1312 ImplHighlightItem( pItem->mnId );
1313 }
1314 else
1315 {
1316 if( GetStyle() & WB_MENUSTYLEVALUESET )
1320 mbHighlight = sal_True;
1317 mbHighlight = true;
1321
1322 ImplHighlightItem( mnSelItemId, sal_False );
1323 }
1324}
1325
1326// -----------------------------------------------------------------------
1327
1328void ValueSet::ImplEndTracking( const Point& rPos, sal_Bool bCancel )

--- 6 unchanged lines hidden (view full) ---

1335 else
1336 pItem = ImplGetItem( ImplGetItem( rPos ) );
1337
1338 if ( pItem && (pItem->meType != VALUESETITEM_SPACE) )
1339 {
1340 SelectItem( pItem->mnId );
1341 if ( !mbSelection && !(GetStyle() & WB_NOPOINTERFOCUS) )
1342 GrabFocus();
1318
1319 ImplHighlightItem( mnSelItemId, sal_False );
1320 }
1321}
1322
1323// -----------------------------------------------------------------------
1324
1325void ValueSet::ImplEndTracking( const Point& rPos, sal_Bool bCancel )

--- 6 unchanged lines hidden (view full) ---

1332 else
1333 pItem = ImplGetItem( ImplGetItem( rPos ) );
1334
1335 if ( pItem && (pItem->meType != VALUESETITEM_SPACE) )
1336 {
1337 SelectItem( pItem->mnId );
1338 if ( !mbSelection && !(GetStyle() & WB_NOPOINTERFOCUS) )
1339 GrabFocus();
1343 mbHighlight = sal_False;
1344 mbSelection = sal_False;
1340 mbHighlight = false;
1341 mbSelection = false;
1345 Select();
1346 }
1347 else
1348 {
1349 ImplHighlightItem( mnSelItemId, sal_False );
1342 Select();
1343 }
1344 else
1345 {
1346 ImplHighlightItem( mnSelItemId, sal_False );
1350 mbHighlight = sal_False;
1351 mbSelection = sal_False;
1347 mbHighlight = false;
1348 mbSelection = false;
1352 }
1353}
1354
1355// -----------------------------------------------------------------------
1356
1357void ValueSet::MouseButtonDown( const MouseEvent& rMEvt )
1358{
1359 if ( rMEvt.IsLeft() )
1360 {
1361 ValueSetItem* pItem = ImplGetItem( ImplGetItem( rMEvt.GetPosPixel() ) );
1362 if ( mbSelection )
1363 {
1349 }
1350}
1351
1352// -----------------------------------------------------------------------
1353
1354void ValueSet::MouseButtonDown( const MouseEvent& rMEvt )
1355{
1356 if ( rMEvt.IsLeft() )
1357 {
1358 ValueSetItem* pItem = ImplGetItem( ImplGetItem( rMEvt.GetPosPixel() ) );
1359 if ( mbSelection )
1360 {
1364 mbHighlight = sal_True;
1361 mbHighlight = true;
1365 if ( pItem && (pItem->meType != VALUESETITEM_SPACE) )
1366 {
1367 mnOldItemId = mnSelItemId;
1368 mnHighItemId = mnSelItemId;
1369 ImplHighlightItem( pItem->mnId );
1370 }
1371
1372 return;
1373 }
1374 else
1375 {
1376 if ( pItem && (pItem->meType != VALUESETITEM_SPACE) && !rMEvt.IsMod2() )
1377 {
1378 if ( (pItem->mnBits & VIB_NODOUBLECLICK) || (rMEvt.GetClicks() == 1) )
1379 {
1380 mnOldItemId = mnSelItemId;
1362 if ( pItem && (pItem->meType != VALUESETITEM_SPACE) )
1363 {
1364 mnOldItemId = mnSelItemId;
1365 mnHighItemId = mnSelItemId;
1366 ImplHighlightItem( pItem->mnId );
1367 }
1368
1369 return;
1370 }
1371 else
1372 {
1373 if ( pItem && (pItem->meType != VALUESETITEM_SPACE) && !rMEvt.IsMod2() )
1374 {
1375 if ( (pItem->mnBits & VIB_NODOUBLECLICK) || (rMEvt.GetClicks() == 1) )
1376 {
1377 mnOldItemId = mnSelItemId;
1381 mbHighlight = sal_True;
1378 mbHighlight = true;
1382 mnHighItemId = mnSelItemId;
1383 ImplHighlightItem( pItem->mnId );
1384 StartTracking( STARTTRACK_SCROLLREPEAT );
1385 }
1386 else if ( rMEvt.GetClicks() == 2 )
1387 DoubleClick();
1388
1389 return;

--- 317 unchanged lines hidden (view full) ---

1707 if( pAcc )
1708 pAcc->LoseFocus();
1709}
1710
1711// -----------------------------------------------------------------------
1712
1713void ValueSet::Resize()
1714{
1379 mnHighItemId = mnSelItemId;
1380 ImplHighlightItem( pItem->mnId );
1381 StartTracking( STARTTRACK_SCROLLREPEAT );
1382 }
1383 else if ( rMEvt.GetClicks() == 2 )
1384 DoubleClick();
1385
1386 return;

--- 317 unchanged lines hidden (view full) ---

1704 if( pAcc )
1705 pAcc->LoseFocus();
1706}
1707
1708// -----------------------------------------------------------------------
1709
1710void ValueSet::Resize()
1711{
1715 mbFormat = sal_True;
1712 mbFormat = true;
1716 if ( IsReallyVisible() && IsUpdateMode() )
1717 Invalidate();
1718 Control::Resize();
1719}
1720
1721// -----------------------------------------------------------------------
1722
1723void ValueSet::RequestHelp( const HelpEvent& rHEvt )

--- 57 unchanged lines hidden (view full) ---

1781 }
1782 else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
1783 {
1784 ImplInitSettings( sal_False, sal_False, sal_True );
1785 Invalidate();
1786 }
1787 else if ( (nType == STATE_CHANGE_STYLE) || (nType == STATE_CHANGE_ENABLE) )
1788 {
1713 if ( IsReallyVisible() && IsUpdateMode() )
1714 Invalidate();
1715 Control::Resize();
1716}
1717
1718// -----------------------------------------------------------------------
1719
1720void ValueSet::RequestHelp( const HelpEvent& rHEvt )

--- 57 unchanged lines hidden (view full) ---

1778 }
1779 else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
1780 {
1781 ImplInitSettings( sal_False, sal_False, sal_True );
1782 Invalidate();
1783 }
1784 else if ( (nType == STATE_CHANGE_STYLE) || (nType == STATE_CHANGE_ENABLE) )
1785 {
1789 mbFormat = sal_True;
1786 mbFormat = true;
1790 ImplInitSettings( sal_False, sal_False, sal_True );
1791 Invalidate();
1792 }
1793}
1794
1795// -----------------------------------------------------------------------
1796
1797void ValueSet::DataChanged( const DataChangedEvent& rDCEvt )
1798{
1799 Control::DataChanged( rDCEvt );
1800
1801 if ( (rDCEvt.GetType() == DATACHANGED_FONTS) ||
1802 (rDCEvt.GetType() == DATACHANGED_DISPLAY) ||
1803 (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
1804 ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
1805 (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
1806 {
1787 ImplInitSettings( sal_False, sal_False, sal_True );
1788 Invalidate();
1789 }
1790}
1791
1792// -----------------------------------------------------------------------
1793
1794void ValueSet::DataChanged( const DataChangedEvent& rDCEvt )
1795{
1796 Control::DataChanged( rDCEvt );
1797
1798 if ( (rDCEvt.GetType() == DATACHANGED_FONTS) ||
1799 (rDCEvt.GetType() == DATACHANGED_DISPLAY) ||
1800 (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
1801 ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
1802 (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
1803 {
1807 mbFormat = sal_True;
1804 mbFormat = true;
1808 ImplInitSettings( sal_True, sal_True, sal_True );
1809 Invalidate();
1810 }
1811}
1812
1813// -----------------------------------------------------------------------
1814
1815void ValueSet::Select()

--- 23 unchanged lines hidden (view full) ---

1839 "ValueSet::InsertItem(): ItemId already exists" );
1840
1841 ValueSetItem* pItem = new ValueSetItem( *this );
1842 pItem->mnId = nItemId;
1843 pItem->meType = VALUESETITEM_IMAGE;
1844 pItem->maImage = rImage;
1845 mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos );
1846
1805 ImplInitSettings( sal_True, sal_True, sal_True );
1806 Invalidate();
1807 }
1808}
1809
1810// -----------------------------------------------------------------------
1811
1812void ValueSet::Select()

--- 23 unchanged lines hidden (view full) ---

1836 "ValueSet::InsertItem(): ItemId already exists" );
1837
1838 ValueSetItem* pItem = new ValueSetItem( *this );
1839 pItem->mnId = nItemId;
1840 pItem->meType = VALUESETITEM_IMAGE;
1841 pItem->maImage = rImage;
1842 mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos );
1843
1847 mbFormat = sal_True;
1844 mbFormat = true;
1848 if ( IsReallyVisible() && IsUpdateMode() )
1849 Invalidate();
1850}
1851
1852// -----------------------------------------------------------------------
1853
1854void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor, sal_uInt16 nPos )
1855{
1856 DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
1857 DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
1858 "ValueSet::InsertItem(): ItemId already exists" );
1859
1860 ValueSetItem* pItem = new ValueSetItem( *this );
1861 pItem->mnId = nItemId;
1862 pItem->meType = VALUESETITEM_COLOR;
1863 pItem->maColor = rColor;
1864 mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos );
1865
1845 if ( IsReallyVisible() && IsUpdateMode() )
1846 Invalidate();
1847}
1848
1849// -----------------------------------------------------------------------
1850
1851void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor, sal_uInt16 nPos )
1852{
1853 DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
1854 DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
1855 "ValueSet::InsertItem(): ItemId already exists" );
1856
1857 ValueSetItem* pItem = new ValueSetItem( *this );
1858 pItem->mnId = nItemId;
1859 pItem->meType = VALUESETITEM_COLOR;
1860 pItem->maColor = rColor;
1861 mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos );
1862
1866 mbFormat = sal_True;
1863 mbFormat = true;
1867 if ( IsReallyVisible() && IsUpdateMode() )
1868 Invalidate();
1869}
1870
1871// -----------------------------------------------------------------------
1872
1873void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage,
1874 const XubString& rText, sal_uInt16 nPos )

--- 4 unchanged lines hidden (view full) ---

1879
1880 ValueSetItem* pItem = new ValueSetItem( *this );
1881 pItem->mnId = nItemId;
1882 pItem->meType = VALUESETITEM_IMAGE;
1883 pItem->maImage = rImage;
1884 pItem->maText = rText;
1885 mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos );
1886
1864 if ( IsReallyVisible() && IsUpdateMode() )
1865 Invalidate();
1866}
1867
1868// -----------------------------------------------------------------------
1869
1870void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage,
1871 const XubString& rText, sal_uInt16 nPos )

--- 4 unchanged lines hidden (view full) ---

1876
1877 ValueSetItem* pItem = new ValueSetItem( *this );
1878 pItem->mnId = nItemId;
1879 pItem->meType = VALUESETITEM_IMAGE;
1880 pItem->maImage = rImage;
1881 pItem->maText = rText;
1882 mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos );
1883
1887 mbFormat = sal_True;
1884 mbFormat = true;
1888 if ( IsReallyVisible() && IsUpdateMode() )
1889 Invalidate();
1890}
1891
1892// -----------------------------------------------------------------------
1893
1894void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor,
1895 const XubString& rText, sal_uInt16 nPos )

--- 4 unchanged lines hidden (view full) ---

1900
1901 ValueSetItem* pItem = new ValueSetItem( *this );
1902 pItem->mnId = nItemId;
1903 pItem->meType = VALUESETITEM_COLOR;
1904 pItem->maColor = rColor;
1905 pItem->maText = rText;
1906 mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos );
1907
1885 if ( IsReallyVisible() && IsUpdateMode() )
1886 Invalidate();
1887}
1888
1889// -----------------------------------------------------------------------
1890
1891void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor,
1892 const XubString& rText, sal_uInt16 nPos )

--- 4 unchanged lines hidden (view full) ---

1897
1898 ValueSetItem* pItem = new ValueSetItem( *this );
1899 pItem->mnId = nItemId;
1900 pItem->meType = VALUESETITEM_COLOR;
1901 pItem->maColor = rColor;
1902 pItem->maText = rText;
1903 mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos );
1904
1908 mbFormat = sal_True;
1905 mbFormat = true;
1909 if ( IsReallyVisible() && IsUpdateMode() )
1910 Invalidate();
1911}
1912
1913// -----------------------------------------------------------------------
1914
1915void ValueSet::InsertItem( sal_uInt16 nItemId, sal_uInt16 nPos )
1916{
1917 DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
1918 DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
1919 "ValueSet::InsertItem(): ItemId already exists" );
1920
1921 ValueSetItem* pItem = new ValueSetItem( *this );
1922 pItem->mnId = nItemId;
1923 pItem->meType = VALUESETITEM_USERDRAW;
1924 mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos );
1925
1906 if ( IsReallyVisible() && IsUpdateMode() )
1907 Invalidate();
1908}
1909
1910// -----------------------------------------------------------------------
1911
1912void ValueSet::InsertItem( sal_uInt16 nItemId, sal_uInt16 nPos )
1913{
1914 DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
1915 DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
1916 "ValueSet::InsertItem(): ItemId already exists" );
1917
1918 ValueSetItem* pItem = new ValueSetItem( *this );
1919 pItem->mnId = nItemId;
1920 pItem->meType = VALUESETITEM_USERDRAW;
1921 mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos );
1922
1926 mbFormat = sal_True;
1923 mbFormat = true;
1927 if ( IsReallyVisible() && IsUpdateMode() )
1928 Invalidate();
1929}
1930
1931// -----------------------------------------------------------------------
1932
1933void ValueSet::InsertSpace( sal_uInt16 nItemId, sal_uInt16 nPos )
1934{
1935 DBG_ASSERT( nItemId, "ValueSet::InsertSpace(): ItemId == 0" );
1936 DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
1937 "ValueSet::InsertSpace(): ItemId already exists" );
1938
1939 ValueSetItem* pItem = new ValueSetItem( *this );
1940 pItem->mnId = nItemId;
1941 pItem->meType = VALUESETITEM_SPACE;
1942 mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos );
1943
1924 if ( IsReallyVisible() && IsUpdateMode() )
1925 Invalidate();
1926}
1927
1928// -----------------------------------------------------------------------
1929
1930void ValueSet::InsertSpace( sal_uInt16 nItemId, sal_uInt16 nPos )
1931{
1932 DBG_ASSERT( nItemId, "ValueSet::InsertSpace(): ItemId == 0" );
1933 DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
1934 "ValueSet::InsertSpace(): ItemId already exists" );
1935
1936 ValueSetItem* pItem = new ValueSetItem( *this );
1937 pItem->mnId = nItemId;
1938 pItem->meType = VALUESETITEM_SPACE;
1939 mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos );
1940
1944 mbFormat = sal_True;
1941 mbFormat = true;
1945 if ( IsReallyVisible() && IsUpdateMode() )
1946 Invalidate();
1947}
1948
1949// -----------------------------------------------------------------------
1950
1951void ValueSet::RemoveItem( sal_uInt16 nItemId )
1952{

--- 6 unchanged lines hidden (view full) ---

1959
1960 // Variablen zuruecksetzen
1961 if ( (mnHighItemId == nItemId) || (mnSelItemId == nItemId) )
1962 {
1963 mnCurCol = 0;
1964 mnOldItemId = 0;
1965 mnHighItemId = 0;
1966 mnSelItemId = 0;
1942 if ( IsReallyVisible() && IsUpdateMode() )
1943 Invalidate();
1944}
1945
1946// -----------------------------------------------------------------------
1947
1948void ValueSet::RemoveItem( sal_uInt16 nItemId )
1949{

--- 6 unchanged lines hidden (view full) ---

1956
1957 // Variablen zuruecksetzen
1958 if ( (mnHighItemId == nItemId) || (mnSelItemId == nItemId) )
1959 {
1960 mnCurCol = 0;
1961 mnOldItemId = 0;
1962 mnHighItemId = 0;
1963 mnSelItemId = 0;
1967 mbNoSelection = sal_True;
1964 mbNoSelection = true;
1968 }
1969
1965 }
1966
1970 mbFormat = sal_True;
1967 mbFormat = true;
1971 if ( IsReallyVisible() && IsUpdateMode() )
1972 Invalidate();
1973}
1974
1975// -----------------------------------------------------------------------
1976
1977void ValueSet::CopyItems( const ValueSet& rValueSet )
1978{

--- 19 unchanged lines hidden (view full) ---

1998 }
1999
2000 // Variablen zuruecksetzen
2001 mnFirstLine = 0;
2002 mnCurCol = 0;
2003 mnOldItemId = 0;
2004 mnHighItemId = 0;
2005 mnSelItemId = 0;
1968 if ( IsReallyVisible() && IsUpdateMode() )
1969 Invalidate();
1970}
1971
1972// -----------------------------------------------------------------------
1973
1974void ValueSet::CopyItems( const ValueSet& rValueSet )
1975{

--- 19 unchanged lines hidden (view full) ---

1995 }
1996
1997 // Variablen zuruecksetzen
1998 mnFirstLine = 0;
1999 mnCurCol = 0;
2000 mnOldItemId = 0;
2001 mnHighItemId = 0;
2002 mnSelItemId = 0;
2006 mbNoSelection = sal_True;
2003 mbNoSelection = true;
2007
2004
2008 mbFormat = sal_True;
2005 mbFormat = true;
2009 if ( IsReallyVisible() && IsUpdateMode() )
2010 Invalidate();
2011}
2012
2013// -----------------------------------------------------------------------
2014
2015void ValueSet::Clear()
2016{
2017 ImplDeleteItems();
2018
2019 // Variablen zuruecksetzen
2020 mnFirstLine = 0;
2021 mnCurCol = 0;
2022 mnOldItemId = 0;
2023 mnHighItemId = 0;
2024 mnSelItemId = 0;
2006 if ( IsReallyVisible() && IsUpdateMode() )
2007 Invalidate();
2008}
2009
2010// -----------------------------------------------------------------------
2011
2012void ValueSet::Clear()
2013{
2014 ImplDeleteItems();
2015
2016 // Variablen zuruecksetzen
2017 mnFirstLine = 0;
2018 mnCurCol = 0;
2019 mnOldItemId = 0;
2020 mnHighItemId = 0;
2021 mnSelItemId = 0;
2025 mbNoSelection = sal_True;
2022 mbNoSelection = true;
2026
2023
2027 mbFormat = sal_True;
2024 mbFormat = true;
2028 if ( IsReallyVisible() && IsUpdateMode() )
2029 Invalidate();
2030}
2031
2032// -----------------------------------------------------------------------
2033
2034sal_uInt16 ValueSet::GetItemCount() const
2035{

--- 47 unchanged lines hidden (view full) ---

2083 if ( nPos != VALUESET_ITEM_NOTFOUND )
2084 return mpImpl->mpItemList->GetObject( nPos )->maRect;
2085 else
2086 return Rectangle();
2087}
2088
2089// -----------------------------------------------------------------------
2090
2025 if ( IsReallyVisible() && IsUpdateMode() )
2026 Invalidate();
2027}
2028
2029// -----------------------------------------------------------------------
2030
2031sal_uInt16 ValueSet::GetItemCount() const
2032{

--- 47 unchanged lines hidden (view full) ---

2080 if ( nPos != VALUESET_ITEM_NOTFOUND )
2081 return mpImpl->mpItemList->GetObject( nPos )->maRect;
2082 else
2083 return Rectangle();
2084}
2085
2086// -----------------------------------------------------------------------
2087
2091void ValueSet::EnableFullItemMode( sal_Bool bFullMode )
2088void ValueSet::EnableFullItemMode( bool bFullMode )
2092{
2093 mbFullMode = bFullMode;
2094}
2095
2096// -----------------------------------------------------------------------
2097
2098void ValueSet::SetColCount( sal_uInt16 nNewCols )
2099{
2100 if ( mnUserCols != nNewCols )
2101 {
2102 mnUserCols = nNewCols;
2089{
2090 mbFullMode = bFullMode;
2091}
2092
2093// -----------------------------------------------------------------------
2094
2095void ValueSet::SetColCount( sal_uInt16 nNewCols )
2096{
2097 if ( mnUserCols != nNewCols )
2098 {
2099 mnUserCols = nNewCols;
2103 mbFormat = sal_True;
2100 mbFormat = true;
2104 if ( IsReallyVisible() && IsUpdateMode() )
2105 Invalidate();
2106 }
2107}
2108
2109// -----------------------------------------------------------------------
2110
2111void ValueSet::SetLineCount( sal_uInt16 nNewLines )
2112{
2113 if ( mnUserVisLines != nNewLines )
2114 {
2115 mnUserVisLines = nNewLines;
2101 if ( IsReallyVisible() && IsUpdateMode() )
2102 Invalidate();
2103 }
2104}
2105
2106// -----------------------------------------------------------------------
2107
2108void ValueSet::SetLineCount( sal_uInt16 nNewLines )
2109{
2110 if ( mnUserVisLines != nNewLines )
2111 {
2112 mnUserVisLines = nNewLines;
2116 mbFormat = sal_True;
2113 mbFormat = true;
2117 if ( IsReallyVisible() && IsUpdateMode() )
2118 Invalidate();
2119 }
2120}
2121
2122// -----------------------------------------------------------------------
2123
2124void ValueSet::SetItemWidth( long nNewItemWidth )
2125{
2126 if ( mnUserItemWidth != nNewItemWidth )
2127 {
2128 mnUserItemWidth = nNewItemWidth;
2114 if ( IsReallyVisible() && IsUpdateMode() )
2115 Invalidate();
2116 }
2117}
2118
2119// -----------------------------------------------------------------------
2120
2121void ValueSet::SetItemWidth( long nNewItemWidth )
2122{
2123 if ( mnUserItemWidth != nNewItemWidth )
2124 {
2125 mnUserItemWidth = nNewItemWidth;
2129 mbFormat = sal_True;
2126 mbFormat = true;
2130 if ( IsReallyVisible() && IsUpdateMode() )
2131 Invalidate();
2132 }
2133}
2134
2135// -----------------------------------------------------------------------
2136
2137void ValueSet::SetItemHeight( long nNewItemHeight )
2138{
2139 if ( mnUserItemHeight != nNewItemHeight )
2140 {
2141 mnUserItemHeight = nNewItemHeight;
2127 if ( IsReallyVisible() && IsUpdateMode() )
2128 Invalidate();
2129 }
2130}
2131
2132// -----------------------------------------------------------------------
2133
2134void ValueSet::SetItemHeight( long nNewItemHeight )
2135{
2136 if ( mnUserItemHeight != nNewItemHeight )
2137 {
2138 mnUserItemHeight = nNewItemHeight;
2142 mbFormat = sal_True;
2139 mbFormat = true;
2143 if ( IsReallyVisible() && IsUpdateMode() )
2144 Invalidate();
2145 }
2146}
2147
2148// -----------------------------------------------------------------------
2149
2150void ValueSet::SetFirstLine( sal_uInt16 nNewLine )
2151{
2152 if ( mnFirstLine != nNewLine )
2153 {
2154 mnFirstLine = nNewLine;
2140 if ( IsReallyVisible() && IsUpdateMode() )
2141 Invalidate();
2142 }
2143}
2144
2145// -----------------------------------------------------------------------
2146
2147void ValueSet::SetFirstLine( sal_uInt16 nNewLine )
2148{
2149 if ( mnFirstLine != nNewLine )
2150 {
2151 mnFirstLine = nNewLine;
2155 mbFormat = sal_True;
2152 mbFormat = true;
2156 if ( IsReallyVisible() && IsUpdateMode() )
2157 Invalidate();
2158 }
2159}
2160
2161// -----------------------------------------------------------------------
2162
2163void ValueSet::SelectItem( sal_uInt16 nItemId )

--- 8 unchanged lines hidden (view full) ---

2172 if ( mpImpl->mpItemList->GetObject( nItemPos )->meType == VALUESETITEM_SPACE )
2173 return;
2174 }
2175
2176 if ( (mnSelItemId != nItemId) || mbNoSelection )
2177 {
2178 sal_uInt16 nOldItem = mnSelItemId ? mnSelItemId : 1;
2179 mnSelItemId = nItemId;
2153 if ( IsReallyVisible() && IsUpdateMode() )
2154 Invalidate();
2155 }
2156}
2157
2158// -----------------------------------------------------------------------
2159
2160void ValueSet::SelectItem( sal_uInt16 nItemId )

--- 8 unchanged lines hidden (view full) ---

2169 if ( mpImpl->mpItemList->GetObject( nItemPos )->meType == VALUESETITEM_SPACE )
2170 return;
2171 }
2172
2173 if ( (mnSelItemId != nItemId) || mbNoSelection )
2174 {
2175 sal_uInt16 nOldItem = mnSelItemId ? mnSelItemId : 1;
2176 mnSelItemId = nItemId;
2180 mbNoSelection = sal_False;
2177 mbNoSelection = false;
2181
2182 sal_Bool bNewOut;
2183 sal_Bool bNewLine;
2184 if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
2185 bNewOut = sal_True;
2186 else
2187 bNewOut = sal_False;
2188 bNewLine = sal_False;

--- 15 unchanged lines hidden (view full) ---

2204 }
2205
2206 if ( bNewOut )
2207 {
2208 if ( bNewLine )
2209 {
2210 // Falls sich der sichtbare Bereich geaendert hat,
2211 // alles neu ausgeben
2178
2179 sal_Bool bNewOut;
2180 sal_Bool bNewLine;
2181 if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
2182 bNewOut = sal_True;
2183 else
2184 bNewOut = sal_False;
2185 bNewLine = sal_False;

--- 15 unchanged lines hidden (view full) ---

2201 }
2202
2203 if ( bNewOut )
2204 {
2205 if ( bNewLine )
2206 {
2207 // Falls sich der sichtbare Bereich geaendert hat,
2208 // alles neu ausgeben
2212 mbFormat = sal_True;
2209 mbFormat = true;
2213 ImplDraw();
2214 }
2215 else
2216 {
2217 // alte Selection wegnehmen und neue ausgeben
2218 ImplHideSelect( nOldItem );
2219 ImplDrawSelect();
2220 }

--- 65 unchanged lines hidden (view full) ---

2286 mpImpl->maHighlightHdl.Call(this);
2287 }
2288}
2289
2290// -----------------------------------------------------------------------
2291
2292void ValueSet::SetNoSelection()
2293{
2210 ImplDraw();
2211 }
2212 else
2213 {
2214 // alte Selection wegnehmen und neue ausgeben
2215 ImplHideSelect( nOldItem );
2216 ImplDrawSelect();
2217 }

--- 65 unchanged lines hidden (view full) ---

2283 mpImpl->maHighlightHdl.Call(this);
2284 }
2285}
2286
2287// -----------------------------------------------------------------------
2288
2289void ValueSet::SetNoSelection()
2290{
2294 mbNoSelection = sal_True;
2295 mbHighlight = sal_False;
2296 mbSelection = sal_False;
2291 mbNoSelection = true;
2292 mbHighlight = false;
2293 mbSelection = false;
2297
2298 if ( IsReallyVisible() && IsUpdateMode() )
2299 ImplDraw();
2300}
2301
2302// -----------------------------------------------------------------------
2303
2304void ValueSet::SetItemBits( sal_uInt16 nItemId, sal_uInt16 nItemBits )

--- 30 unchanged lines hidden (view full) ---

2335 pItem->maImage = rImage;
2336
2337 if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
2338 {
2339 ImplFormatItem( pItem );
2340 Invalidate( pItem->maRect );
2341 }
2342 else
2294
2295 if ( IsReallyVisible() && IsUpdateMode() )
2296 ImplDraw();
2297}
2298
2299// -----------------------------------------------------------------------
2300
2301void ValueSet::SetItemBits( sal_uInt16 nItemId, sal_uInt16 nItemBits )

--- 30 unchanged lines hidden (view full) ---

2332 pItem->maImage = rImage;
2333
2334 if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
2335 {
2336 ImplFormatItem( pItem );
2337 Invalidate( pItem->maRect );
2338 }
2339 else
2343 mbFormat = sal_True;
2340 mbFormat = true;
2344}
2345
2346// -----------------------------------------------------------------------
2347
2348Image ValueSet::GetItemImage( sal_uInt16 nItemId ) const
2349{
2350 sal_uInt16 nPos = GetItemPos( nItemId );
2351

--- 17 unchanged lines hidden (view full) ---

2369 pItem->maColor = rColor;
2370
2371 if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
2372 {
2373 ImplFormatItem( pItem );
2374 Invalidate( pItem->maRect );
2375 }
2376 else
2341}
2342
2343// -----------------------------------------------------------------------
2344
2345Image ValueSet::GetItemImage( sal_uInt16 nItemId ) const
2346{
2347 sal_uInt16 nPos = GetItemPos( nItemId );
2348

--- 17 unchanged lines hidden (view full) ---

2366 pItem->maColor = rColor;
2367
2368 if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
2369 {
2370 ImplFormatItem( pItem );
2371 Invalidate( pItem->maRect );
2372 }
2373 else
2377 mbFormat = sal_True;
2374 mbFormat = true;
2378}
2379
2380// -----------------------------------------------------------------------
2381
2382Color ValueSet::GetItemColor( sal_uInt16 nItemId ) const
2383{
2384 sal_uInt16 nPos = GetItemPos( nItemId );
2385

--- 18 unchanged lines hidden (view full) ---

2404 if ( pItem->meType == VALUESETITEM_USERDRAW )
2405 {
2406 if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
2407 {
2408 ImplFormatItem( pItem );
2409 Invalidate( pItem->maRect );
2410 }
2411 else
2375}
2376
2377// -----------------------------------------------------------------------
2378
2379Color ValueSet::GetItemColor( sal_uInt16 nItemId ) const
2380{
2381 sal_uInt16 nPos = GetItemPos( nItemId );
2382

--- 18 unchanged lines hidden (view full) ---

2401 if ( pItem->meType == VALUESETITEM_USERDRAW )
2402 {
2403 if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
2404 {
2405 ImplFormatItem( pItem );
2406 Invalidate( pItem->maRect );
2407 }
2408 else
2412 mbFormat = sal_True;
2409 mbFormat = true;
2413 }
2414}
2415
2416// -----------------------------------------------------------------------
2417
2418void* ValueSet::GetItemData( sal_uInt16 nItemId ) const
2419{
2420 sal_uInt16 nPos = GetItemPos( nItemId );

--- 59 unchanged lines hidden (view full) ---

2480 return XubString();
2481}
2482
2483// -----------------------------------------------------------------------
2484
2485void ValueSet::SetColor( const Color& rColor )
2486{
2487 maColor = rColor;
2410 }
2411}
2412
2413// -----------------------------------------------------------------------
2414
2415void* ValueSet::GetItemData( sal_uInt16 nItemId ) const
2416{
2417 sal_uInt16 nPos = GetItemPos( nItemId );

--- 59 unchanged lines hidden (view full) ---

2477 return XubString();
2478}
2479
2480// -----------------------------------------------------------------------
2481
2482void ValueSet::SetColor( const Color& rColor )
2483{
2484 maColor = rColor;
2488 mbFormat = sal_True;
2485 mbFormat = true;
2489 if ( IsReallyVisible() && IsUpdateMode() )
2490 ImplDraw();
2491}
2492
2493// -----------------------------------------------------------------------
2494
2495void ValueSet::SetExtraSpacing( sal_uInt16 nNewSpacing )
2496{
2497 if ( GetStyle() & WB_ITEMBORDER )
2498 {
2499 mnSpacing = nNewSpacing;
2500
2486 if ( IsReallyVisible() && IsUpdateMode() )
2487 ImplDraw();
2488}
2489
2490// -----------------------------------------------------------------------
2491
2492void ValueSet::SetExtraSpacing( sal_uInt16 nNewSpacing )
2493{
2494 if ( GetStyle() & WB_ITEMBORDER )
2495 {
2496 mnSpacing = nNewSpacing;
2497
2501 mbFormat = sal_True;
2498 mbFormat = true;
2502 if ( IsReallyVisible() && IsUpdateMode() )
2503 Invalidate();
2504 }
2505}
2506
2507// -----------------------------------------------------------------------
2508
2509void ValueSet::StartSelection()
2510{
2511 mnOldItemId = mnSelItemId;
2499 if ( IsReallyVisible() && IsUpdateMode() )
2500 Invalidate();
2501 }
2502}
2503
2504// -----------------------------------------------------------------------
2505
2506void ValueSet::StartSelection()
2507{
2508 mnOldItemId = mnSelItemId;
2512 mbHighlight = sal_True;
2513 mbSelection = sal_True;
2509 mbHighlight = true;
2510 mbSelection = true;
2514 mnHighItemId = mnSelItemId;
2515}
2516
2517// -----------------------------------------------------------------------
2518
2519void ValueSet::EndSelection()
2520{
2521 if ( mbHighlight )
2522 {
2523 if ( IsTracking() )
2524 EndTracking( ENDTRACK_CANCEL );
2525
2526 ImplHighlightItem( mnSelItemId );
2511 mnHighItemId = mnSelItemId;
2512}
2513
2514// -----------------------------------------------------------------------
2515
2516void ValueSet::EndSelection()
2517{
2518 if ( mbHighlight )
2519 {
2520 if ( IsTracking() )
2521 EndTracking( ENDTRACK_CANCEL );
2522
2523 ImplHighlightItem( mnSelItemId );
2527 mbHighlight = sal_False;
2524 mbHighlight = false;
2528 }
2525 }
2529 mbSelection = sal_False;
2526 mbSelection = false;
2530}
2531
2532// -----------------------------------------------------------------------
2533
2534sal_Bool ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
2535{
2536 if ( rCEvt.GetCommand() != COMMAND_STARTDRAG )
2537 return sal_False;

--- 112 unchanged lines hidden (view full) ---

2650 // Evt. ScrollBar-Breite aufaddieren
2651 aSize.Width() += GetScrollWidth();
2652
2653 return aSize;
2654}
2655
2656// -----------------------------------------------------------------------
2657
2527}
2528
2529// -----------------------------------------------------------------------
2530
2531sal_Bool ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
2532{
2533 if ( rCEvt.GetCommand() != COMMAND_STARTDRAG )
2534 return sal_False;

--- 112 unchanged lines hidden (view full) ---

2647 // Evt. ScrollBar-Breite aufaddieren
2648 aSize.Width() += GetScrollWidth();
2649
2650 return aSize;
2651}
2652
2653// -----------------------------------------------------------------------
2654
2658Size ValueSet::CalcItemSizePixel( const Size& rItemSize, sal_Bool bOut ) const
2655Size ValueSet::CalcItemSizePixel( const Size& rItemSize, bool bOut ) const
2659{
2660 Size aSize = rItemSize;
2661
2662 WinBits nStyle = GetStyle();
2663 if ( nStyle & WB_ITEMBORDER )
2664 {
2665 long n;
2666

--- 29 unchanged lines hidden (view full) ---

2696 else
2697 return 0;
2698}
2699
2700// -----------------------------------------------------------------------
2701
2702sal_uInt16 ValueSet::ShowDropPos( const Point& rPos )
2703{
2656{
2657 Size aSize = rItemSize;
2658
2659 WinBits nStyle = GetStyle();
2660 if ( nStyle & WB_ITEMBORDER )
2661 {
2662 long n;
2663

--- 29 unchanged lines hidden (view full) ---

2693 else
2694 return 0;
2695}
2696
2697// -----------------------------------------------------------------------
2698
2699sal_uInt16 ValueSet::ShowDropPos( const Point& rPos )
2700{
2704 mbDropPos = sal_True;
2701 mbDropPos = true;
2705
2706 // Gegebenenfalls scrollen
2707 ImplScroll( rPos );
2708
2709 // DropPosition ermitteln
2710 sal_uInt16 nPos = ImplGetItem( rPos, sal_True );
2711 if ( nPos == VALUESET_ITEM_NONEITEM )
2712 nPos = 0;

--- 26 unchanged lines hidden (view full) ---

2739
2740// -----------------------------------------------------------------------
2741
2742void ValueSet::HideDropPos()
2743{
2744 if ( mbDropPos )
2745 {
2746 ImplDrawDropPos( sal_False );
2702
2703 // Gegebenenfalls scrollen
2704 ImplScroll( rPos );
2705
2706 // DropPosition ermitteln
2707 sal_uInt16 nPos = ImplGetItem( rPos, sal_True );
2708 if ( nPos == VALUESET_ITEM_NONEITEM )
2709 nPos = 0;

--- 26 unchanged lines hidden (view full) ---

2736
2737// -----------------------------------------------------------------------
2738
2739void ValueSet::HideDropPos()
2740{
2741 if ( mbDropPos )
2742 {
2743 ImplDrawDropPos( sal_False );
2747 mbDropPos = sal_False;
2744 mbDropPos = false;
2748 }
2749}
2750
2751// -----------------------------------------------------------------------
2752
2753bool ValueSet::IsRTLActive (void)
2754{
2755 return Application::GetSettings().GetLayoutRTL() && IsRTLEnabled();

--- 10 unchanged lines hidden (view full) ---

2766
2767const Link& ValueSet::GetHighlightHdl() const
2768{
2769 return mpImpl->maHighlightHdl;
2770}
2771
2772// -----------------------------------------------------------------------
2773
2745 }
2746}
2747
2748// -----------------------------------------------------------------------
2749
2750bool ValueSet::IsRTLActive (void)
2751{
2752 return Application::GetSettings().GetLayoutRTL() && IsRTLEnabled();

--- 10 unchanged lines hidden (view full) ---

2763
2764const Link& ValueSet::GetHighlightHdl() const
2765{
2766 return mpImpl->maHighlightHdl;
2767}
2768
2769// -----------------------------------------------------------------------
2770
2771void ValueSet::SetEdgeBlending(bool bNew)
2772{
2773 if(mbEdgeBlending != bNew)
2774 {
2775 mbEdgeBlending = bNew;
2776 mbFormat = true;
2777
2778 if(IsReallyVisible() && IsUpdateMode())
2779 {
2780 Invalidate();
2781 }
2782 }
2783}
2784
2785// -----------------------------------------------------------------------
2786// eof