ilstbox.cxx (ad3a95a3) | ilstbox.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 --- 517 unchanged lines hidden (view full) --- 526{ 527 mpEntryList = new ImplEntryList( this ); 528 529 mnTop = 0; 530 mnLeft = 0; 531 mnBorder = 1; 532 mnSelectModifier = 0; 533 mnUserDrawEntry = LISTBOX_ENTRY_NOTFOUND; | 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 --- 517 unchanged lines hidden (view full) --- 526{ 527 mpEntryList = new ImplEntryList( this ); 528 529 mnTop = 0; 530 mnLeft = 0; 531 mnBorder = 1; 532 mnSelectModifier = 0; 533 mnUserDrawEntry = LISTBOX_ENTRY_NOTFOUND; |
534 mbTrack = sal_False; 535 mbImgsDiffSz = sal_False; 536 mbTravelSelect = sal_False; 537 mbTrackingSelect = sal_False; 538 mbSelectionChanged = sal_False; 539 mbMouseMoveSelect = sal_False; 540 mbMulti = sal_False; 541 mbStackMode = sal_False; 542 mbGrabFocus = sal_False; 543 mbUserDrawEnabled = sal_False; 544 mbInUserDraw = sal_False; 545 mbReadOnly = sal_False; 546 mbHasFocusRect = sal_False; 547 mbRight = ( nWinStyle & WB_RIGHT ) ? sal_True : sal_False; 548 mbCenter = ( nWinStyle & WB_CENTER ) ? sal_True : sal_False; 549 mbSimpleMode = ( nWinStyle & WB_SIMPLEMODE ) ? sal_True : sal_False; 550 mbSort = ( nWinStyle & WB_SORT ) ? sal_True : sal_False; | 534 mbTrack = false; 535 mbImgsDiffSz = false; 536 mbTravelSelect = false; 537 mbTrackingSelect = false; 538 mbSelectionChanged = false; 539 mbMouseMoveSelect = false; 540 mbMulti = false; 541 mbStackMode = false; 542 mbGrabFocus = false; 543 mbUserDrawEnabled = false; 544 mbInUserDraw = false; 545 mbReadOnly = false; 546 mbHasFocusRect = false; 547 mbRight = ( nWinStyle & WB_RIGHT ); 548 mbCenter = ( nWinStyle & WB_CENTER ); 549 mbSimpleMode = ( nWinStyle & WB_SIMPLEMODE ); 550 mbSort = ( nWinStyle & WB_SORT ); 551 mbEdgeBlending = false; |
551 552 // pb: #106948# explicit mirroring for calc | 552 553 // pb: #106948# explicit mirroring for calc |
553 mbMirroring = sal_False; | 554 mbMirroring = false; |
554 555 mnCurrentPos = LISTBOX_ENTRY_NOTFOUND; 556 mnTrackingSaveSelection = LISTBOX_ENTRY_NOTFOUND; 557 mnSeparatorPos = LISTBOX_ENTRY_NOTFOUND; 558 meProminentType = PROMINENT_TOP; 559 560 SetLineColor(); 561 SetTextFillColor(); --- 58 unchanged lines hidden (view full) --- 620 mnMaxHeight = mnMaxTxtHeight; 621 mnMaxWidth = 0; 622 mnMaxTxtWidth = 0; 623 mnMaxImgTxtWidth= 0; 624 mnMaxImgWidth = 0; 625 mnMaxImgHeight = 0; 626 mnTop = 0; 627 mnLeft = 0; | 555 556 mnCurrentPos = LISTBOX_ENTRY_NOTFOUND; 557 mnTrackingSaveSelection = LISTBOX_ENTRY_NOTFOUND; 558 mnSeparatorPos = LISTBOX_ENTRY_NOTFOUND; 559 meProminentType = PROMINENT_TOP; 560 561 SetLineColor(); 562 SetTextFillColor(); --- 58 unchanged lines hidden (view full) --- 621 mnMaxHeight = mnMaxTxtHeight; 622 mnMaxWidth = 0; 623 mnMaxTxtWidth = 0; 624 mnMaxImgTxtWidth= 0; 625 mnMaxImgWidth = 0; 626 mnMaxImgHeight = 0; 627 mnTop = 0; 628 mnLeft = 0; |
628 mbImgsDiffSz = sal_False; | 629 mbImgsDiffSz = false; |
629 ImplClearLayoutData(); 630 631 mnCurrentPos = LISTBOX_ENTRY_NOTFOUND; 632 maQuickSelectionEngine.Reset(); 633 634 Invalidate(); 635} 636 --- 59 unchanged lines hidden (view full) --- 696 } 697 if ( aMetrics.bImage ) 698 { 699 Size aImgSz = rEntry.maImage.GetSizePixel(); 700 aMetrics.nImgWidth = (sal_uInt16) CalcZoom( aImgSz.Width() ); 701 aMetrics.nImgHeight = (sal_uInt16) CalcZoom( aImgSz.Height() ); 702 703 if( mnMaxImgWidth && ( aMetrics.nImgWidth != mnMaxImgWidth ) ) | 630 ImplClearLayoutData(); 631 632 mnCurrentPos = LISTBOX_ENTRY_NOTFOUND; 633 maQuickSelectionEngine.Reset(); 634 635 Invalidate(); 636} 637 --- 59 unchanged lines hidden (view full) --- 697 } 698 if ( aMetrics.bImage ) 699 { 700 Size aImgSz = rEntry.maImage.GetSizePixel(); 701 aMetrics.nImgWidth = (sal_uInt16) CalcZoom( aImgSz.Width() ); 702 aMetrics.nImgHeight = (sal_uInt16) CalcZoom( aImgSz.Height() ); 703 704 if( mnMaxImgWidth && ( aMetrics.nImgWidth != mnMaxImgWidth ) ) |
704 mbImgsDiffSz = sal_True; | 705 mbImgsDiffSz = true; |
705 else if ( mnMaxImgHeight && ( aMetrics.nImgHeight != mnMaxImgHeight ) ) | 706 else if ( mnMaxImgHeight && ( aMetrics.nImgHeight != mnMaxImgHeight ) ) |
706 mbImgsDiffSz = sal_True; | 707 mbImgsDiffSz = true; |
707 708 if( aMetrics.nImgWidth > mnMaxImgWidth ) 709 mnMaxImgWidth = aMetrics.nImgWidth; 710 if( aMetrics.nImgHeight > mnMaxImgHeight ) 711 mnMaxImgHeight = aMetrics.nImgHeight; 712 713 mnMaxImgTxtWidth = Max( mnMaxImgTxtWidth, aMetrics.nTextWidth ); 714 aMetrics.nEntryHeight = Max( aMetrics.nImgHeight, aMetrics.nEntryHeight ); --- 58 unchanged lines hidden (view full) --- 773 ImplUpdateEntryMetrics( *pNewEntry ); 774 GetEntryList()->SetMRUCount( ++nMRUCount ); 775 SetSeparatorPos( nMRUCount ? nMRUCount-1 : 0 ); 776 maMRUChangedHdl.Call( NULL ); 777 } 778 } 779 780 maSelectHdl.Call( NULL ); | 708 709 if( aMetrics.nImgWidth > mnMaxImgWidth ) 710 mnMaxImgWidth = aMetrics.nImgWidth; 711 if( aMetrics.nImgHeight > mnMaxImgHeight ) 712 mnMaxImgHeight = aMetrics.nImgHeight; 713 714 mnMaxImgTxtWidth = Max( mnMaxImgTxtWidth, aMetrics.nTextWidth ); 715 aMetrics.nEntryHeight = Max( aMetrics.nImgHeight, aMetrics.nEntryHeight ); --- 58 unchanged lines hidden (view full) --- 774 ImplUpdateEntryMetrics( *pNewEntry ); 775 GetEntryList()->SetMRUCount( ++nMRUCount ); 776 SetSeparatorPos( nMRUCount ? nMRUCount-1 : 0 ); 777 maMRUChangedHdl.Call( NULL ); 778 } 779 } 780 781 maSelectHdl.Call( NULL ); |
781 mbSelectionChanged = sal_False; | 782 mbSelectionChanged = false; |
782} 783 784// ----------------------------------------------------------------------- 785 786sal_uInt16 ImplListBoxWindow::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry ) 787{ 788 ImplClearLayoutData(); 789 sal_uInt16 nNewPos = mpEntryList->InsertEntry( nPos, pNewEntry, mbSort ); --- 28 unchanged lines hidden (view full) --- 818 819// ----------------------------------------------------------------------- 820 821void ImplListBoxWindow::ImplShowFocusRect() 822{ 823 if ( mbHasFocusRect ) 824 HideFocus(); 825 ShowFocus( maFocusRect ); | 783} 784 785// ----------------------------------------------------------------------- 786 787sal_uInt16 ImplListBoxWindow::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry ) 788{ 789 ImplClearLayoutData(); 790 sal_uInt16 nNewPos = mpEntryList->InsertEntry( nPos, pNewEntry, mbSort ); --- 28 unchanged lines hidden (view full) --- 819 820// ----------------------------------------------------------------------- 821 822void ImplListBoxWindow::ImplShowFocusRect() 823{ 824 if ( mbHasFocusRect ) 825 HideFocus(); 826 ShowFocus( maFocusRect ); |
826 mbHasFocusRect = sal_True; | 827 mbHasFocusRect = true; |
827} 828 829// ----------------------------------------------------------------------- 830 831void ImplListBoxWindow::ImplHideFocusRect() 832{ 833 if ( mbHasFocusRect ) 834 { 835 HideFocus(); | 828} 829 830// ----------------------------------------------------------------------- 831 832void ImplListBoxWindow::ImplHideFocusRect() 833{ 834 if ( mbHasFocusRect ) 835 { 836 HideFocus(); |
836 mbHasFocusRect = sal_False; | 837 mbHasFocusRect = false; |
837 } 838} 839 840 841// ----------------------------------------------------------------------- 842 843sal_uInt16 ImplListBoxWindow::GetEntryPosForPoint( const Point& rPoint ) const 844{ --- 49 unchanged lines hidden (view full) --- 894 895 return nPos; 896} 897 898// ----------------------------------------------------------------------- 899 900void ImplListBoxWindow::MouseButtonDown( const MouseEvent& rMEvt ) 901{ | 838 } 839} 840 841 842// ----------------------------------------------------------------------- 843 844sal_uInt16 ImplListBoxWindow::GetEntryPosForPoint( const Point& rPoint ) const 845{ --- 49 unchanged lines hidden (view full) --- 895 896 return nPos; 897} 898 899// ----------------------------------------------------------------------- 900 901void ImplListBoxWindow::MouseButtonDown( const MouseEvent& rMEvt ) 902{ |
902 mbMouseMoveSelect = sal_False; // Nur bis zum ersten MouseButtonDown | 903 mbMouseMoveSelect = false; // Nur bis zum ersten MouseButtonDown |
903 maQuickSelectionEngine.Reset(); 904 905 if ( !IsReadOnly() ) 906 { 907 if( rMEvt.GetClicks() == 1 ) 908 { 909 sal_uInt16 nSelect = GetEntryPosForPoint( rMEvt.GetPosPixel() ); 910 if( nSelect != LISTBOX_ENTRY_NOTFOUND ) 911 { 912 if ( !mbMulti && GetEntryList()->GetSelectEntryCount() ) 913 mnTrackingSaveSelection = GetEntryList()->GetSelectEntryPos( 0 ); 914 else 915 mnTrackingSaveSelection = LISTBOX_ENTRY_NOTFOUND; 916 917 mnCurrentPos = nSelect; | 904 maQuickSelectionEngine.Reset(); 905 906 if ( !IsReadOnly() ) 907 { 908 if( rMEvt.GetClicks() == 1 ) 909 { 910 sal_uInt16 nSelect = GetEntryPosForPoint( rMEvt.GetPosPixel() ); 911 if( nSelect != LISTBOX_ENTRY_NOTFOUND ) 912 { 913 if ( !mbMulti && GetEntryList()->GetSelectEntryCount() ) 914 mnTrackingSaveSelection = GetEntryList()->GetSelectEntryPos( 0 ); 915 else 916 mnTrackingSaveSelection = LISTBOX_ENTRY_NOTFOUND; 917 918 mnCurrentPos = nSelect; |
918 mbTrackingSelect = sal_True; 919 //IAccessibility2 Impplementaton 2009----- 920 sal_Bool bCurPosChange = (mnCurrentPos != nSelect); 921 //SelectEntries( nSelect, LET_MBDOWN, rMEvt.IsShift(), rMEvt.IsMod1() ); 922 SelectEntries( nSelect, LET_MBDOWN, rMEvt.IsShift(), rMEvt.IsMod1() ,bCurPosChange); 923 //-----IAccessibility2 Impplementaton 2009 924 mbTrackingSelect = sal_False; | 919 mbTrackingSelect = true; 920 SelectEntries( nSelect, LET_MBDOWN, rMEvt.IsShift(), rMEvt.IsMod1() ); 921 mbTrackingSelect = false; |
925 if ( mbGrabFocus ) 926 GrabFocus(); 927 928 StartTracking( STARTTRACK_SCROLLREPEAT ); 929 } 930 } 931 if( rMEvt.GetClicks() == 2 ) 932 { --- 16 unchanged lines hidden (view full) --- 949 { 950 if ( rMEvt.GetPosPixel().Y() < 0 ) 951 { 952 DeselectAll(); 953 mnCurrentPos = LISTBOX_ENTRY_NOTFOUND; 954 SetTopEntry( 0 ); 955 if ( mbStackMode ) // #87072#, #92323# 956 { | 922 if ( mbGrabFocus ) 923 GrabFocus(); 924 925 StartTracking( STARTTRACK_SCROLLREPEAT ); 926 } 927 } 928 if( rMEvt.GetClicks() == 2 ) 929 { --- 16 unchanged lines hidden (view full) --- 946 { 947 if ( rMEvt.GetPosPixel().Y() < 0 ) 948 { 949 DeselectAll(); 950 mnCurrentPos = LISTBOX_ENTRY_NOTFOUND; 951 SetTopEntry( 0 ); 952 if ( mbStackMode ) // #87072#, #92323# 953 { |
957 mbTravelSelect = sal_True; | 954 mbTravelSelect = true; |
958 mnSelectModifier = rMEvt.GetModifier(); 959 ImplCallSelect(); | 955 mnSelectModifier = rMEvt.GetModifier(); 956 ImplCallSelect(); |
960 mbTravelSelect = sal_False; | 957 mbTravelSelect = false; |
961 } 962 963 } 964 } 965 } 966 else if ( ( ( !mbMulti && IsMouseMoveSelect() ) || mbStackMode ) && mpEntryList->GetEntryCount() ) 967 { 968 Point aPoint; --- 7 unchanged lines hidden (view full) --- 976 nSelect = mpEntryList->GetEntryCount() - 1; 977 nSelect = Min( nSelect, GetLastVisibleEntry() ); 978 nSelect = Min( nSelect, (sal_uInt16) ( mpEntryList->GetEntryCount() - 1 ) ); 979 // Select only visible Entries with MouseMove, otherwise Tracking... 980 if ( IsVisible( nSelect ) && 981 mpEntryList->IsEntrySelectable( nSelect ) && 982 ( ( nSelect != mnCurrentPos ) || !GetEntryList()->GetSelectEntryCount() || ( nSelect != GetEntryList()->GetSelectEntryPos( 0 ) ) ) ) 983 { | 958 } 959 960 } 961 } 962 } 963 else if ( ( ( !mbMulti && IsMouseMoveSelect() ) || mbStackMode ) && mpEntryList->GetEntryCount() ) 964 { 965 Point aPoint; --- 7 unchanged lines hidden (view full) --- 973 nSelect = mpEntryList->GetEntryCount() - 1; 974 nSelect = Min( nSelect, GetLastVisibleEntry() ); 975 nSelect = Min( nSelect, (sal_uInt16) ( mpEntryList->GetEntryCount() - 1 ) ); 976 // Select only visible Entries with MouseMove, otherwise Tracking... 977 if ( IsVisible( nSelect ) && 978 mpEntryList->IsEntrySelectable( nSelect ) && 979 ( ( nSelect != mnCurrentPos ) || !GetEntryList()->GetSelectEntryCount() || ( nSelect != GetEntryList()->GetSelectEntryPos( 0 ) ) ) ) 980 { |
984 mbTrackingSelect = sal_True; | 981 mbTrackingSelect = true; |
985 if ( SelectEntries( nSelect, LET_TRACKING, sal_False, sal_False ) ) 986 { 987 if ( mbStackMode ) // #87072# 988 { | 982 if ( SelectEntries( nSelect, LET_TRACKING, sal_False, sal_False ) ) 983 { 984 if ( mbStackMode ) // #87072# 985 { |
989 mbTravelSelect = sal_True; | 986 mbTravelSelect = true; |
990 mnSelectModifier = rMEvt.GetModifier(); 991 ImplCallSelect(); | 987 mnSelectModifier = rMEvt.GetModifier(); 988 ImplCallSelect(); |
992 mbTravelSelect = sal_False; | 989 mbTravelSelect = false; |
993 } | 990 } |
994//IAccessibility2 Implementation 2009---- 995 // When list box selection change by mouse move, notity 996 // VCLEVENT_LISTBOX_SELECT vcl event. 997 else 998 { 999 maListItemSelectHdl.Call(NULL); 1000 } 1001//----IAccessibility2 Implementation 2009 | |
1002 } | 991 } |
1003 mbTrackingSelect = sal_False; | 992 mbTrackingSelect = false; |
1004 } 1005 } 1006 1007 // Falls der DD-Button gedrueckt wurde und jemand mit gedrueckter 1008 // Maustaste in die ListBox faehrt... 1009 if ( rMEvt.IsLeft() && !rMEvt.IsSynthetic() ) 1010 { 1011 if ( !mbMulti && GetEntryList()->GetSelectEntryCount() ) --- 63 unchanged lines hidden (view full) --- 1075 } 1076 } 1077 } 1078 else 1079 { 1080 mpEntryList->SelectEntry( nPos, sal_False ); 1081 ImplPaint( nPos, sal_True ); 1082 } | 993 } 994 } 995 996 // Falls der DD-Button gedrueckt wurde und jemand mit gedrueckter 997 // Maustaste in die ListBox faehrt... 998 if ( rMEvt.IsLeft() && !rMEvt.IsSynthetic() ) 999 { 1000 if ( !mbMulti && GetEntryList()->GetSelectEntryCount() ) --- 63 unchanged lines hidden (view full) --- 1064 } 1065 } 1066 } 1067 else 1068 { 1069 mpEntryList->SelectEntry( nPos, sal_False ); 1070 ImplPaint( nPos, sal_True ); 1071 } |
1083 mbSelectionChanged = sal_True; | 1072 mbSelectionChanged = true; |
1084 } 1085} 1086 1087// ----------------------------------------------------------------------- 1088 | 1073 } 1074} 1075 1076// ----------------------------------------------------------------------- 1077 |
1089sal_Bool ImplListBoxWindow::SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLET, sal_Bool bShift, sal_Bool bCtrl, sal_Bool bSelectPosChange /*=FALSE*/ ) | 1078sal_Bool ImplListBoxWindow::SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLET, sal_Bool bShift, sal_Bool bCtrl ) |
1090{ 1091 sal_Bool bFocusChanged = sal_False; 1092 sal_Bool bSelectionChanged = sal_False; 1093 1094 if( IsEnabled() && mpEntryList->IsEntrySelectable( nSelect ) ) 1095 { 1096 // Hier (Single-ListBox) kann nur ein Eintrag deselektiert werden 1097 if( !mbMulti ) --- 117 unchanged lines hidden (view full) --- 1215 } 1216 } 1217 else if( bShift ) 1218 { 1219 bFocusChanged = sal_True; 1220 } 1221 1222 if( bSelectionChanged ) | 1079{ 1080 sal_Bool bFocusChanged = sal_False; 1081 sal_Bool bSelectionChanged = sal_False; 1082 1083 if( IsEnabled() && mpEntryList->IsEntrySelectable( nSelect ) ) 1084 { 1085 // Hier (Single-ListBox) kann nur ein Eintrag deselektiert werden 1086 if( !mbMulti ) --- 117 unchanged lines hidden (view full) --- 1204 } 1205 } 1206 else if( bShift ) 1207 { 1208 bFocusChanged = sal_True; 1209 } 1210 1211 if( bSelectionChanged ) |
1223 mbSelectionChanged = sal_True; | 1212 mbSelectionChanged = true; |
1224 1225 if( bFocusChanged ) 1226 { 1227 long nHeightDiff = mpEntryList->GetAddedHeight( nSelect, mnTop, 0 ); 1228 maFocusRect.SetPos( Point( 0, nHeightDiff ) ); 1229 Size aSz( maFocusRect.GetWidth(), 1230 mpEntryList->GetEntryHeight( nSelect ) ); 1231 maFocusRect.SetSize( aSz ); 1232 if( HasFocus() ) 1233 ImplShowFocusRect(); | 1213 1214 if( bFocusChanged ) 1215 { 1216 long nHeightDiff = mpEntryList->GetAddedHeight( nSelect, mnTop, 0 ); 1217 maFocusRect.SetPos( Point( 0, nHeightDiff ) ); 1218 Size aSz( maFocusRect.GetWidth(), 1219 mpEntryList->GetEntryHeight( nSelect ) ); 1220 maFocusRect.SetSize( aSz ); 1221 if( HasFocus() ) 1222 ImplShowFocusRect(); |
1234//IAccessibility2 Implementation 2009---- 1235 if (bSelectPosChange) 1236 { 1237 maFocusHdl.Call(reinterpret_cast<void*>(nSelect)); 1238 } 1239//----IAccessibility2 Implementation 2009 | |
1240 } 1241 ImplClearLayoutData(); 1242 } 1243 return bSelectionChanged; 1244} 1245 1246// ----------------------------------------------------------------------- 1247 --- 10 unchanged lines hidden (view full) --- 1258 mnSelectModifier = rTEvt.GetMouseEvent().GetModifier(); 1259 ImplCallSelect(); 1260 } 1261 else 1262 { 1263 maCancelHdl.Call( NULL ); 1264 if ( !mbMulti ) 1265 { | 1223 } 1224 ImplClearLayoutData(); 1225 } 1226 return bSelectionChanged; 1227} 1228 1229// ----------------------------------------------------------------------- 1230 --- 10 unchanged lines hidden (view full) --- 1241 mnSelectModifier = rTEvt.GetMouseEvent().GetModifier(); 1242 ImplCallSelect(); 1243 } 1244 else 1245 { 1246 maCancelHdl.Call( NULL ); 1247 if ( !mbMulti ) 1248 { |
1266 mbTrackingSelect = sal_True; | 1249 mbTrackingSelect = true; |
1267 SelectEntry( mnTrackingSaveSelection, sal_True ); | 1250 SelectEntry( mnTrackingSaveSelection, sal_True ); |
1268 mbTrackingSelect = sal_False; | 1251 mbTrackingSelect = false; |
1269 if ( mnTrackingSaveSelection != LISTBOX_ENTRY_NOTFOUND ) 1270 { 1271 long nHeightDiff = mpEntryList->GetAddedHeight( mnCurrentPos, mnTop, 0 ); 1272 maFocusRect.SetPos( Point( 0, nHeightDiff ) ); 1273 Size aSz( maFocusRect.GetWidth(), 1274 mpEntryList->GetEntryHeight( mnCurrentPos ) ); 1275 maFocusRect.SetSize( aSz ); 1276 ImplShowFocusRect(); 1277 } 1278 } 1279 } 1280 | 1252 if ( mnTrackingSaveSelection != LISTBOX_ENTRY_NOTFOUND ) 1253 { 1254 long nHeightDiff = mpEntryList->GetAddedHeight( mnCurrentPos, mnTop, 0 ); 1255 maFocusRect.SetPos( Point( 0, nHeightDiff ) ); 1256 Size aSz( maFocusRect.GetWidth(), 1257 mpEntryList->GetEntryHeight( mnCurrentPos ) ); 1258 maFocusRect.SetSize( aSz ); 1259 ImplShowFocusRect(); 1260 } 1261 } 1262 } 1263 |
1281 mbTrack = sal_False; | 1264 mbTrack = false; |
1282 } 1283 else 1284 { 1285 sal_Bool bTrackOrQuickClick = mbTrack; 1286 if( !mbTrack ) 1287 { 1288 if ( bInside ) 1289 { | 1265 } 1266 else 1267 { 1268 sal_Bool bTrackOrQuickClick = mbTrack; 1269 if( !mbTrack ) 1270 { 1271 if ( bInside ) 1272 { |
1290 mbTrack = sal_True; | 1273 mbTrack = true; |
1291 } 1292 1293 // Folgender Fall tritt nur auf, wenn man ganz kurz die Maustaste drueckt 1294 if( rTEvt.IsTrackingEnded() && mbTrack ) 1295 { 1296 bTrackOrQuickClick = sal_True; | 1274 } 1275 1276 // Folgender Fall tritt nur auf, wenn man ganz kurz die Maustaste drueckt 1277 if( rTEvt.IsTrackingEnded() && mbTrack ) 1278 { 1279 bTrackOrQuickClick = sal_True; |
1297 mbTrack = sal_False; | 1280 mbTrack = false; |
1298 } 1299 } 1300 1301 if( bTrackOrQuickClick ) 1302 { 1303 MouseEvent aMEvt = rTEvt.GetMouseEvent(); 1304 Point aPt( aMEvt.GetPosPixel() ); 1305 sal_Bool bShift = aMEvt.IsShift(); --- 24 unchanged lines hidden (view full) --- 1330 nSelect = Min( nSelect, GetLastVisibleEntry() ); 1331 nSelect = Min( nSelect, (sal_uInt16) ( mpEntryList->GetEntryCount() - 1 ) ); 1332 } 1333 1334 if ( bInside ) 1335 { 1336 if ( ( nSelect != mnCurrentPos ) || !GetEntryList()->GetSelectEntryCount() ) 1337 { | 1281 } 1282 } 1283 1284 if( bTrackOrQuickClick ) 1285 { 1286 MouseEvent aMEvt = rTEvt.GetMouseEvent(); 1287 Point aPt( aMEvt.GetPosPixel() ); 1288 sal_Bool bShift = aMEvt.IsShift(); --- 24 unchanged lines hidden (view full) --- 1313 nSelect = Min( nSelect, GetLastVisibleEntry() ); 1314 nSelect = Min( nSelect, (sal_uInt16) ( mpEntryList->GetEntryCount() - 1 ) ); 1315 } 1316 1317 if ( bInside ) 1318 { 1319 if ( ( nSelect != mnCurrentPos ) || !GetEntryList()->GetSelectEntryCount() ) 1320 { |
1338 mbTrackingSelect = sal_True; | 1321 mbTrackingSelect = true; |
1339 if ( SelectEntries( nSelect, LET_TRACKING, bShift, bCtrl ) ) 1340 { 1341 if ( mbStackMode ) // #87734# (#87072#) 1342 { | 1322 if ( SelectEntries( nSelect, LET_TRACKING, bShift, bCtrl ) ) 1323 { 1324 if ( mbStackMode ) // #87734# (#87072#) 1325 { |
1343 mbTravelSelect = sal_True; | 1326 mbTravelSelect = true; |
1344 mnSelectModifier = rTEvt.GetMouseEvent().GetModifier(); 1345 ImplCallSelect(); | 1327 mnSelectModifier = rTEvt.GetMouseEvent().GetModifier(); 1328 ImplCallSelect(); |
1346 mbTravelSelect = sal_False; | 1329 mbTravelSelect = false; |
1347 } 1348 } | 1330 } 1331 } |
1349 mbTrackingSelect = sal_False; | 1332 mbTrackingSelect = false; |
1350 } 1351 } 1352 else 1353 { 1354 if ( !mbMulti && GetEntryList()->GetSelectEntryCount() ) 1355 { | 1333 } 1334 } 1335 else 1336 { 1337 if ( !mbMulti && GetEntryList()->GetSelectEntryCount() ) 1338 { |
1356 mbTrackingSelect = sal_True; | 1339 mbTrackingSelect = true; |
1357 SelectEntry( GetEntryList()->GetSelectEntryPos( 0 ), sal_False ); | 1340 SelectEntry( GetEntryList()->GetSelectEntryPos( 0 ), sal_False ); |
1358 mbTrackingSelect = sal_False; | 1341 mbTrackingSelect = false; |
1359 } 1360 else if ( mbStackMode ) 1361 { 1362 if ( ( rTEvt.GetMouseEvent().GetPosPixel().X() > 0 ) && ( rTEvt.GetMouseEvent().GetPosPixel().X() < aRect.Right() ) ) 1363 { 1364 if ( ( rTEvt.GetMouseEvent().GetPosPixel().Y() < 0 ) || ( rTEvt.GetMouseEvent().GetPosPixel().Y() > GetOutputSizePixel().Height() ) ) 1365 { 1366 sal_Bool bSelectionChanged = sal_False; --- 5 unchanged lines hidden (view full) --- 1372 SelectEntry( 0, sal_False ); 1373 bSelectionChanged = sal_True; 1374 nSelect = LISTBOX_ENTRY_NOTFOUND; 1375 1376 } 1377 } 1378 else 1379 { | 1342 } 1343 else if ( mbStackMode ) 1344 { 1345 if ( ( rTEvt.GetMouseEvent().GetPosPixel().X() > 0 ) && ( rTEvt.GetMouseEvent().GetPosPixel().X() < aRect.Right() ) ) 1346 { 1347 if ( ( rTEvt.GetMouseEvent().GetPosPixel().Y() < 0 ) || ( rTEvt.GetMouseEvent().GetPosPixel().Y() > GetOutputSizePixel().Height() ) ) 1348 { 1349 sal_Bool bSelectionChanged = sal_False; --- 5 unchanged lines hidden (view full) --- 1355 SelectEntry( 0, sal_False ); 1356 bSelectionChanged = sal_True; 1357 nSelect = LISTBOX_ENTRY_NOTFOUND; 1358 1359 } 1360 } 1361 else 1362 { |
1380 mbTrackingSelect = sal_True; | 1363 mbTrackingSelect = true; |
1381 bSelectionChanged = SelectEntries( nSelect, LET_TRACKING, bShift, bCtrl ); | 1364 bSelectionChanged = SelectEntries( nSelect, LET_TRACKING, bShift, bCtrl ); |
1382 mbTrackingSelect = sal_False; | 1365 mbTrackingSelect = false; |
1383 } 1384 1385 if ( bSelectionChanged ) 1386 { | 1366 } 1367 1368 if ( bSelectionChanged ) 1369 { |
1387 mbSelectionChanged = sal_True; 1388 mbTravelSelect = sal_True; | 1370 mbSelectionChanged = true; 1371 mbTravelSelect = true; |
1389 mnSelectModifier = rTEvt.GetMouseEvent().GetModifier(); 1390 ImplCallSelect(); | 1372 mnSelectModifier = rTEvt.GetMouseEvent().GetModifier(); 1373 ImplCallSelect(); |
1391 mbTravelSelect = sal_False; | 1374 mbTravelSelect = false; |
1392 } 1393 } 1394 } 1395 } 1396 } 1397 mnCurrentPos = nSelect; 1398 if ( mnCurrentPos == LISTBOX_ENTRY_NOTFOUND ) 1399 { --- 294 unchanged lines hidden (view full) --- 1694 && ( ( !mpEntryList->IsEntryPosSelected( nSelect ) ) 1695 || ( eLET == LET_KEYSPACE ) 1696 ) 1697 ) 1698 { 1699 DBG_ASSERT( !mpEntryList->IsEntryPosSelected( nSelect ) || mbMulti, "ImplListBox: Selecting same Entry" ); 1700 if( nSelect >= mpEntryList->GetEntryCount() ) 1701 nSelect = mpEntryList->GetEntryCount()-1; | 1375 } 1376 } 1377 } 1378 } 1379 } 1380 mnCurrentPos = nSelect; 1381 if ( mnCurrentPos == LISTBOX_ENTRY_NOTFOUND ) 1382 { --- 294 unchanged lines hidden (view full) --- 1677 && ( ( !mpEntryList->IsEntryPosSelected( nSelect ) ) 1678 || ( eLET == LET_KEYSPACE ) 1679 ) 1680 ) 1681 { 1682 DBG_ASSERT( !mpEntryList->IsEntryPosSelected( nSelect ) || mbMulti, "ImplListBox: Selecting same Entry" ); 1683 if( nSelect >= mpEntryList->GetEntryCount() ) 1684 nSelect = mpEntryList->GetEntryCount()-1; |
1702//IAccessibility2 Implementation 2009----- 1703 sal_Bool bCurPosChange = (mnCurrentPos != nSelect); | |
1704 mnCurrentPos = nSelect; | 1685 mnCurrentPos = nSelect; |
1705 //if ( SelectEntries( nSelect, eLET, bShift, bCtrl ) ) 1706 if(SelectEntries( nSelect, eLET, bShift, bCtrl ,bCurPosChange)) 1707//-----IAccessibility2 Implementation 2009 | 1686 if ( SelectEntries( nSelect, eLET, bShift, bCtrl ) ) |
1708 { | 1687 { |
1709 mbTravelSelect = sal_True; | 1688 mbTravelSelect = true; |
1710 mnSelectModifier = rKEvt.GetKeyCode().GetModifier(); 1711 ImplCallSelect(); | 1689 mnSelectModifier = rKEvt.GetKeyCode().GetModifier(); 1690 ImplCallSelect(); |
1712 mbTravelSelect = sal_False; | 1691 mbTravelSelect = false; |
1713 } 1714 } 1715 1716 return bDone; 1717} 1718 1719// ----------------------------------------------------------------------- 1720namespace --- 49 unchanged lines hidden (view full) --- 1770 1771 // make visible 1772 ShowProminentEntry( nSelect ); 1773 1774 // actually select 1775 mnCurrentPos = nSelect; 1776 if ( SelectEntries( nSelect, LET_KEYMOVE, sal_False, sal_False ) ) 1777 { | 1692 } 1693 } 1694 1695 return bDone; 1696} 1697 1698// ----------------------------------------------------------------------- 1699namespace --- 49 unchanged lines hidden (view full) --- 1749 1750 // make visible 1751 ShowProminentEntry( nSelect ); 1752 1753 // actually select 1754 mnCurrentPos = nSelect; 1755 if ( SelectEntries( nSelect, LET_KEYMOVE, sal_False, sal_False ) ) 1756 { |
1778 mbTravelSelect = sal_True; | 1757 mbTravelSelect = true; |
1779 mnSelectModifier = 0; 1780 ImplCallSelect(); | 1758 mnSelectModifier = 0; 1759 ImplCallSelect(); |
1781 mbTravelSelect = sal_False; | 1760 mbTravelSelect = false; |
1782 } 1783} 1784 1785// ----------------------------------------------------------------------- 1786 1787void ImplListBoxWindow::ImplPaint( sal_uInt16 nPos, sal_Bool bErase, bool bLayout ) 1788{ 1789 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); --- 23 unchanged lines hidden (view full) --- 1813 SetTextFillColor(); 1814 if( bErase ) 1815 Erase( aRect ); 1816 } 1817 } 1818 1819 if ( IsUserDrawEnabled() ) 1820 { | 1761 } 1762} 1763 1764// ----------------------------------------------------------------------- 1765 1766void ImplListBoxWindow::ImplPaint( sal_uInt16 nPos, sal_Bool bErase, bool bLayout ) 1767{ 1768 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); --- 23 unchanged lines hidden (view full) --- 1792 SetTextFillColor(); 1793 if( bErase ) 1794 Erase( aRect ); 1795 } 1796 } 1797 1798 if ( IsUserDrawEnabled() ) 1799 { |
1821 mbInUserDraw = sal_True; | 1800 mbInUserDraw = true; |
1822 mnUserDrawEntry = nPos; 1823 aRect.Left() -= mnLeft; 1824 if ( nPos < GetEntryList()->GetMRUCount() ) 1825 nPos = GetEntryList()->FindEntry( GetEntryList()->GetEntryText( nPos ) ); 1826 nPos = sal::static_int_cast<sal_uInt16>(nPos - GetEntryList()->GetMRUCount()); 1827 UserDrawEvent aUDEvt( this, aRect, nPos, 0 ); 1828 maUserDrawHdl.Call( &aUDEvt ); | 1801 mnUserDrawEntry = nPos; 1802 aRect.Left() -= mnLeft; 1803 if ( nPos < GetEntryList()->GetMRUCount() ) 1804 nPos = GetEntryList()->FindEntry( GetEntryList()->GetEntryText( nPos ) ); 1805 nPos = sal::static_int_cast<sal_uInt16>(nPos - GetEntryList()->GetMRUCount()); 1806 UserDrawEvent aUDEvt( this, aRect, nPos, 0 ); 1807 maUserDrawHdl.Call( &aUDEvt ); |
1829 mbInUserDraw = sal_False; | 1808 mbInUserDraw = false; |
1830 } 1831 else 1832 { 1833 DrawEntry( nPos, sal_True, sal_True, sal_False, bLayout ); 1834 } 1835} 1836 1837// ----------------------------------------------------------------------- --- 30 unchanged lines hidden (view full) --- 1868 DrawImage( aPtImg, aImage ); 1869 } 1870 else 1871 { 1872 aImgSz.Width() = CalcZoom( aImgSz.Width() ); 1873 aImgSz.Height() = CalcZoom( aImgSz.Height() ); 1874 DrawImage( aPtImg, aImgSz, aImage ); 1875 } | 1809 } 1810 else 1811 { 1812 DrawEntry( nPos, sal_True, sal_True, sal_False, bLayout ); 1813 } 1814} 1815 1816// ----------------------------------------------------------------------- --- 30 unchanged lines hidden (view full) --- 1847 DrawImage( aPtImg, aImage ); 1848 } 1849 else 1850 { 1851 aImgSz.Width() = CalcZoom( aImgSz.Width() ); 1852 aImgSz.Height() = CalcZoom( aImgSz.Height() ); 1853 DrawImage( aPtImg, aImgSz, aImage ); 1854 } |
1855 1856 const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); 1857 const sal_uInt16 nEdgeBlendingPercent(GetEdgeBlending() ? rStyleSettings.GetEdgeBlending() : 0); 1858 1859 if(nEdgeBlendingPercent) 1860 { 1861 const Rectangle aRect(aPtImg, aImgSz); 1862 Bitmap aBitmap(GetBitmap(aRect.TopLeft(), aRect.GetSize())); 1863 1864 if(!aBitmap.IsEmpty()) 1865 { 1866 const Color& rTopLeft(rStyleSettings.GetEdgeBlendingTopLeftColor()); 1867 const Color& rBottomRight(rStyleSettings.GetEdgeBlendingBottomRightColor()); 1868 const sal_uInt8 nAlpha((nEdgeBlendingPercent * 255) / 100); 1869 1870 aBitmap.DrawBlendFrame(nAlpha, rTopLeft, rBottomRight); 1871 DrawBitmap(aRect.TopLeft(), aBitmap); 1872 } 1873 } |
|
1876 } 1877 } 1878 1879 if( bDrawText ) 1880 { 1881 MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL; 1882 String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL; 1883 XubString aStr( mpEntryList->GetEntryText( nPos ) ); --- 274 unchanged lines hidden (view full) --- 2158} 2159 2160// ----------------------------------------------------------------------- 2161 2162Rectangle ImplListBoxWindow::GetBoundingRectangle( sal_uInt16 nItem ) const 2163{ 2164 const ImplEntryType* pEntry = mpEntryList->GetEntryPtr( nItem ); 2165 Size aSz( GetSizePixel().Width(), pEntry ? pEntry->mnHeight : GetEntryHeight() ); | 1874 } 1875 } 1876 1877 if( bDrawText ) 1878 { 1879 MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL; 1880 String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL; 1881 XubString aStr( mpEntryList->GetEntryText( nPos ) ); --- 274 unchanged lines hidden (view full) --- 2156} 2157 2158// ----------------------------------------------------------------------- 2159 2160Rectangle ImplListBoxWindow::GetBoundingRectangle( sal_uInt16 nItem ) const 2161{ 2162 const ImplEntryType* pEntry = mpEntryList->GetEntryPtr( nItem ); 2163 Size aSz( GetSizePixel().Width(), pEntry ? pEntry->mnHeight : GetEntryHeight() ); |
2166 //long nY = mpEntryList->GetAddedHeight( nItem, GetTopEntry() ) - mpEntryList->GetAddedHeight( GetTopEntry() ); 2167 //IAccessibility2 Impplementaton 2009----- 2168 long nY = mpEntryList->GetAddedHeight( nItem, GetTopEntry() ) + GetEntryList()->GetMRUCount()*GetEntryHeight(); 2169 //-----IAccessibility2 Impplementaton 2009 | 2164 long nY = mpEntryList->GetAddedHeight( nItem, GetTopEntry() ) - mpEntryList->GetAddedHeight( GetTopEntry() ); |
2170 Rectangle aRect( Point( 0, nY ), aSz ); 2171 return aRect; 2172} 2173 2174 2175// ----------------------------------------------------------------------- 2176 2177void ImplListBoxWindow::StateChanged( StateChangedType nType ) --- 78 unchanged lines hidden (view full) --- 2256 mpVScrollBar = new ScrollBar( this, WB_VSCROLL | WB_DRAG ); 2257 mpHScrollBar = new ScrollBar( this, WB_HSCROLL | WB_DRAG ); 2258 mpScrollBarBox = new ScrollBarBox( this ); 2259 2260 Link aLink( LINK( this, ImplListBox, ScrollBarHdl ) ); 2261 mpVScrollBar->SetScrollHdl( aLink ); 2262 mpHScrollBar->SetScrollHdl( aLink ); 2263 | 2165 Rectangle aRect( Point( 0, nY ), aSz ); 2166 return aRect; 2167} 2168 2169 2170// ----------------------------------------------------------------------- 2171 2172void ImplListBoxWindow::StateChanged( StateChangedType nType ) --- 78 unchanged lines hidden (view full) --- 2251 mpVScrollBar = new ScrollBar( this, WB_VSCROLL | WB_DRAG ); 2252 mpHScrollBar = new ScrollBar( this, WB_HSCROLL | WB_DRAG ); 2253 mpScrollBarBox = new ScrollBarBox( this ); 2254 2255 Link aLink( LINK( this, ImplListBox, ScrollBarHdl ) ); 2256 mpVScrollBar->SetScrollHdl( aLink ); 2257 mpHScrollBar->SetScrollHdl( aLink ); 2258 |
2264 mbVScroll = sal_False; 2265 mbHScroll = sal_False; 2266 mbAutoHScroll = ( nWinStyle & WB_AUTOHSCROLL ) ? sal_True : sal_False; | 2259 mbVScroll = false; 2260 mbHScroll = false; 2261 mbAutoHScroll = ( nWinStyle & WB_AUTOHSCROLL ); 2262 mbEdgeBlending = false; |
2267 2268 maLBWindow.SetScrollHdl( LINK( this, ImplListBox, LBWindowScrolled ) ); 2269 maLBWindow.SetMRUChangedHdl( LINK( this, ImplListBox, MRUChanged ) ); | 2263 2264 maLBWindow.SetScrollHdl( LINK( this, ImplListBox, LBWindowScrolled ) ); 2265 maLBWindow.SetMRUChangedHdl( LINK( this, ImplListBox, MRUChanged ) ); |
2266 maLBWindow.SetEdgeBlending(GetEdgeBlending()); |
|
2270 maLBWindow.Show(); 2271} 2272 2273// ----------------------------------------------------------------------- 2274 2275ImplListBox::~ImplListBox() 2276{ 2277 delete mpHScrollBar; --- 153 unchanged lines hidden (view full) --- 2431 sal_uInt16 nEntries = GetEntryList()->GetEntryCount(); 2432 sal_uInt16 nMaxVisEntries = (sal_uInt16) (aOutSz.Height() / GetEntryHeight()); 2433 2434 // vert. ScrollBar 2435 if( nEntries > nMaxVisEntries ) 2436 { 2437 if( !mbVScroll ) 2438 bArrange = sal_True; | 2267 maLBWindow.Show(); 2268} 2269 2270// ----------------------------------------------------------------------- 2271 2272ImplListBox::~ImplListBox() 2273{ 2274 delete mpHScrollBar; --- 153 unchanged lines hidden (view full) --- 2428 sal_uInt16 nEntries = GetEntryList()->GetEntryCount(); 2429 sal_uInt16 nMaxVisEntries = (sal_uInt16) (aOutSz.Height() / GetEntryHeight()); 2430 2431 // vert. ScrollBar 2432 if( nEntries > nMaxVisEntries ) 2433 { 2434 if( !mbVScroll ) 2435 bArrange = sal_True; |
2439 mbVScroll = sal_True; | 2436 mbVScroll = true; |
2440 2441 // Ueberpruefung des rausgescrollten Bereichs 2442 if( GetEntryList()->GetSelectEntryCount() == 1 && 2443 GetEntryList()->GetSelectEntryPos( 0 ) != LISTBOX_ENTRY_NOTFOUND ) 2444 ShowProminentEntry( GetEntryList()->GetSelectEntryPos( 0 ) ); 2445 else 2446 SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft... 2447 } 2448 else 2449 { 2450 if( mbVScroll ) 2451 bArrange = sal_True; | 2437 2438 // Ueberpruefung des rausgescrollten Bereichs 2439 if( GetEntryList()->GetSelectEntryCount() == 1 && 2440 GetEntryList()->GetSelectEntryPos( 0 ) != LISTBOX_ENTRY_NOTFOUND ) 2441 ShowProminentEntry( GetEntryList()->GetSelectEntryPos( 0 ) ); 2442 else 2443 SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft... 2444 } 2445 else 2446 { 2447 if( mbVScroll ) 2448 bArrange = sal_True; |
2452 mbVScroll = sal_False; | 2449 mbVScroll = false; |
2453 SetTopEntry( 0 ); 2454 } 2455 2456 // horz. ScrollBar 2457 if( mbAutoHScroll ) 2458 { 2459 long nWidth = (sal_uInt16) aOutSz.Width(); 2460 if ( mbVScroll ) 2461 nWidth -= mpVScrollBar->GetSizePixel().Width(); 2462 2463 long nMaxWidth = GetMaxEntryWidth(); 2464 if( nWidth < nMaxWidth ) 2465 { 2466 if( !mbHScroll ) 2467 bArrange = sal_True; | 2450 SetTopEntry( 0 ); 2451 } 2452 2453 // horz. ScrollBar 2454 if( mbAutoHScroll ) 2455 { 2456 long nWidth = (sal_uInt16) aOutSz.Width(); 2457 if ( mbVScroll ) 2458 nWidth -= mpVScrollBar->GetSizePixel().Width(); 2459 2460 long nMaxWidth = GetMaxEntryWidth(); 2461 if( nWidth < nMaxWidth ) 2462 { 2463 if( !mbHScroll ) 2464 bArrange = sal_True; |
2468 mbHScroll = sal_True; | 2465 mbHScroll = true; |
2469 2470 if ( !mbVScroll ) // ggf. brauchen wir jetzt doch einen 2471 { 2472 nMaxVisEntries = (sal_uInt16) ( ( aOutSz.Height() - mpHScrollBar->GetSizePixel().Height() ) / GetEntryHeight() ); 2473 if( nEntries > nMaxVisEntries ) 2474 { 2475 bArrange = sal_True; | 2466 2467 if ( !mbVScroll ) // ggf. brauchen wir jetzt doch einen 2468 { 2469 nMaxVisEntries = (sal_uInt16) ( ( aOutSz.Height() - mpHScrollBar->GetSizePixel().Height() ) / GetEntryHeight() ); 2470 if( nEntries > nMaxVisEntries ) 2471 { 2472 bArrange = sal_True; |
2476 mbVScroll = sal_True; | 2473 mbVScroll = true; |
2477 2478 // Ueberpruefung des rausgescrollten Bereichs 2479 if( GetEntryList()->GetSelectEntryCount() == 1 && 2480 GetEntryList()->GetSelectEntryPos( 0 ) != LISTBOX_ENTRY_NOTFOUND ) 2481 ShowProminentEntry( GetEntryList()->GetSelectEntryPos( 0 ) ); 2482 else 2483 SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft... 2484 } 2485 } 2486 2487 // Ueberpruefung des rausgescrollten Bereichs 2488 sal_uInt16 nMaxLI = (sal_uInt16) (nMaxWidth - nWidth); 2489 if ( nMaxLI < GetLeftIndent() ) 2490 SetLeftIndent( nMaxLI ); 2491 } 2492 else 2493 { 2494 if( mbHScroll ) 2495 bArrange = sal_True; | 2474 2475 // Ueberpruefung des rausgescrollten Bereichs 2476 if( GetEntryList()->GetSelectEntryCount() == 1 && 2477 GetEntryList()->GetSelectEntryPos( 0 ) != LISTBOX_ENTRY_NOTFOUND ) 2478 ShowProminentEntry( GetEntryList()->GetSelectEntryPos( 0 ) ); 2479 else 2480 SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft... 2481 } 2482 } 2483 2484 // Ueberpruefung des rausgescrollten Bereichs 2485 sal_uInt16 nMaxLI = (sal_uInt16) (nMaxWidth - nWidth); 2486 if ( nMaxLI < GetLeftIndent() ) 2487 SetLeftIndent( nMaxLI ); 2488 } 2489 else 2490 { 2491 if( mbHScroll ) 2492 bArrange = sal_True; |
2496 mbHScroll = sal_False; | 2493 mbHScroll = false; |
2497 SetLeftIndent( 0 ); 2498 } 2499 } 2500 2501 if( bArrange ) 2502 ImplResizeControls(); 2503 2504 ImplInitScrollBars(); --- 240 unchanged lines hidden (view full) --- 2745 { 2746 aEntries += GetEntryList()->GetEntryText( n ); 2747 if( n < ( GetEntryList()->GetMRUCount() - 1 ) ) 2748 aEntries += cSep; 2749 } 2750 return aEntries; 2751} 2752 | 2494 SetLeftIndent( 0 ); 2495 } 2496 } 2497 2498 if( bArrange ) 2499 ImplResizeControls(); 2500 2501 ImplInitScrollBars(); --- 240 unchanged lines hidden (view full) --- 2742 { 2743 aEntries += GetEntryList()->GetEntryText( n ); 2744 if( n < ( GetEntryList()->GetMRUCount() - 1 ) ) 2745 aEntries += cSep; 2746 } 2747 return aEntries; 2748} 2749 |
2750// ----------------------------------------------------------------------- 2751 2752void ImplListBox::SetEdgeBlending(bool bNew) 2753{ 2754 if(mbEdgeBlending != bNew) 2755 { 2756 mbEdgeBlending = bNew; 2757 maLBWindow.SetEdgeBlending(GetEdgeBlending()); 2758 } 2759} 2760 |
|
2753// ======================================================================= 2754 2755ImplWin::ImplWin( Window* pParent, WinBits nWinStyle ) : 2756 Control ( pParent, nWinStyle ) 2757{ 2758 if ( IsNativeControlSupported(CTRL_LISTBOX, PART_ENTIRE_CONTROL) 2759 && ! IsNativeControlSupported(CTRL_LISTBOX, PART_BUTTON_DOWN) ) 2760 SetBackground(); 2761 else 2762 SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFieldColor() ) ); 2763 | 2761// ======================================================================= 2762 2763ImplWin::ImplWin( Window* pParent, WinBits nWinStyle ) : 2764 Control ( pParent, nWinStyle ) 2765{ 2766 if ( IsNativeControlSupported(CTRL_LISTBOX, PART_ENTIRE_CONTROL) 2767 && ! IsNativeControlSupported(CTRL_LISTBOX, PART_BUTTON_DOWN) ) 2768 SetBackground(); 2769 else 2770 SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFieldColor() ) ); 2771 |
2764 mbInUserDraw = sal_False; 2765 mbUserDrawEnabled = sal_False; | 2772 mbInUserDraw = false; 2773 mbUserDrawEnabled = false; 2774 mbEdgeBlending = false; |
2766 mnItemPos = LISTBOX_ENTRY_NOTFOUND; 2767} 2768 2769// ----------------------------------------------------------------------- 2770 2771sal_Bool ImplWin::SetModeImage( const Image& rImage, BmpColorMode eMode ) 2772{ 2773 if( eMode == BMP_COLOR_NORMAL ) --- 151 unchanged lines hidden (view full) --- 2925 SetTextColor( rStyleSettings.GetDisableColor() ); 2926 if ( !bNativeOK ) 2927 Erase( maFocusRect ); 2928 } 2929 } 2930 2931 if ( IsUserDrawEnabled() ) 2932 { | 2775 mnItemPos = LISTBOX_ENTRY_NOTFOUND; 2776} 2777 2778// ----------------------------------------------------------------------- 2779 2780sal_Bool ImplWin::SetModeImage( const Image& rImage, BmpColorMode eMode ) 2781{ 2782 if( eMode == BMP_COLOR_NORMAL ) --- 151 unchanged lines hidden (view full) --- 2934 SetTextColor( rStyleSettings.GetDisableColor() ); 2935 if ( !bNativeOK ) 2936 Erase( maFocusRect ); 2937 } 2938 } 2939 2940 if ( IsUserDrawEnabled() ) 2941 { |
2933 mbInUserDraw = sal_True; | 2942 mbInUserDraw = true; |
2934 UserDrawEvent aUDEvt( this, maFocusRect, mnItemPos, 0 ); 2935 maUserDrawHdl.Call( &aUDEvt ); | 2943 UserDrawEvent aUDEvt( this, maFocusRect, mnItemPos, 0 ); 2944 maUserDrawHdl.Call( &aUDEvt ); |
2936 mbInUserDraw = sal_False; | 2945 mbInUserDraw = false; |
2937 } 2938 else 2939 { 2940 DrawEntry( sal_True, sal_True, sal_False, bLayout ); 2941 } 2942} 2943 2944// ----------------------------------------------------------------------- --- 11 unchanged lines hidden (view full) --- 2956 Size aOutSz = GetOutputSizePixel(); 2957 2958 sal_Bool bImage = !!maImage; 2959 if( bDrawImage && bImage && !bLayout ) 2960 { 2961 sal_uInt16 nStyle = 0; 2962 Size aImgSz = maImage.GetSizePixel(); 2963 Point aPtImg( nBorder, ( ( aOutSz.Height() - aImgSz.Height() ) / 2 ) ); | 2946 } 2947 else 2948 { 2949 DrawEntry( sal_True, sal_True, sal_False, bLayout ); 2950 } 2951} 2952 2953// ----------------------------------------------------------------------- --- 11 unchanged lines hidden (view full) --- 2965 Size aOutSz = GetOutputSizePixel(); 2966 2967 sal_Bool bImage = !!maImage; 2968 if( bDrawImage && bImage && !bLayout ) 2969 { 2970 sal_uInt16 nStyle = 0; 2971 Size aImgSz = maImage.GetSizePixel(); 2972 Point aPtImg( nBorder, ( ( aOutSz.Height() - aImgSz.Height() ) / 2 ) ); |
2973 const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); |
|
2964 2965 // check for HC mode 2966 Image *pImage = &maImage; 2967 2968 if( !!maImageHC ) 2969 { | 2974 2975 // check for HC mode 2976 Image *pImage = &maImage; 2977 2978 if( !!maImageHC ) 2979 { |
2970 if( GetSettings().GetStyleSettings().GetHighContrastMode() ) | 2980 if( rStyleSettings.GetHighContrastMode() ) |
2971 pImage = &maImageHC; 2972 } 2973 2974 if ( !IsZoom() ) 2975 { 2976 DrawImage( aPtImg, *pImage, nStyle ); 2977 } 2978 else 2979 { 2980 aImgSz.Width() = CalcZoom( aImgSz.Width() ); 2981 aImgSz.Height() = CalcZoom( aImgSz.Height() ); 2982 DrawImage( aPtImg, aImgSz, *pImage, nStyle ); 2983 } | 2981 pImage = &maImageHC; 2982 } 2983 2984 if ( !IsZoom() ) 2985 { 2986 DrawImage( aPtImg, *pImage, nStyle ); 2987 } 2988 else 2989 { 2990 aImgSz.Width() = CalcZoom( aImgSz.Width() ); 2991 aImgSz.Height() = CalcZoom( aImgSz.Height() ); 2992 DrawImage( aPtImg, aImgSz, *pImage, nStyle ); 2993 } |
2994 2995 const sal_uInt16 nEdgeBlendingPercent(GetEdgeBlending() ? rStyleSettings.GetEdgeBlending() : 0); 2996 2997 if(nEdgeBlendingPercent) 2998 { 2999 const Rectangle aRect(aPtImg, aImgSz); 3000 Bitmap aBitmap(GetBitmap(aRect.TopLeft(), aRect.GetSize())); 3001 3002 if(!aBitmap.IsEmpty()) 3003 { 3004 const Color& rTopLeft(rStyleSettings.GetEdgeBlendingTopLeftColor()); 3005 const Color& rBottomRight(rStyleSettings.GetEdgeBlendingBottomRightColor()); 3006 const sal_uInt8 nAlpha((nEdgeBlendingPercent * 255) / 100); 3007 3008 aBitmap.DrawBlendFrame(nAlpha, rTopLeft, rBottomRight); 3009 DrawBitmap(aRect.TopLeft(), aBitmap); 3010 } 3011 } |
|
2984 } 2985 2986 if( bDrawText && maString.Len() ) 2987 { 2988 sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER; 2989 2990 if ( bDrawImage && bImage && !bLayout ) 2991 nTextStyle |= TEXT_DRAW_LEFT; --- 294 unchanged lines hidden --- | 3012 } 3013 3014 if( bDrawText && maString.Len() ) 3015 { 3016 sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER; 3017 3018 if ( bDrawImage && bImage && !bLayout ) 3019 nTextStyle |= TEXT_DRAW_LEFT; --- 294 unchanged lines hidden --- |