svimpbox.cxx (4d7c9de0) svimpbox.cxx (00bcbf85)
1/**************************************************************
1/**************************************************************
2 *
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
9 * with the License. You may obtain a copy of the License at
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
9 * with the License. You may obtain a copy of the License at
10 *
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
19 *
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_svtools.hxx"
26#include <vcl/svapp.hxx>
27#include <vcl/salnativewidgets.hxx>

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

54
55 pTabBar( NULL ),
56 aVerSBar( pLBView, WB_DRAG | WB_VSCROLL ),
57 aHorSBar( pLBView, WB_DRAG | WB_HSCROLL ),
58 aScrBarBox( pLBView ),
59 aOutputSize( 0, 0 ),
60 aSelEng( pLBView, (FunctionSet*)0 ),
61 aFctSet( this, &aSelEng, pLBView ),
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_svtools.hxx"
26#include <vcl/svapp.hxx>
27#include <vcl/salnativewidgets.hxx>

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

54
55 pTabBar( NULL ),
56 aVerSBar( pLBView, WB_DRAG | WB_VSCROLL ),
57 aHorSBar( pLBView, WB_DRAG | WB_HSCROLL ),
58 aScrBarBox( pLBView ),
59 aOutputSize( 0, 0 ),
60 aSelEng( pLBView, (FunctionSet*)0 ),
61 aFctSet( this, &aSelEng, pLBView ),
62 nExtendedWinBits( 0 ),
63 bAreChildrenTransient( sal_True ),
62 nExtendedWinBits( 0 ),
63 bAreChildrenTransient( sal_True ),
64 pIntlWrapper( NULL ) // #102891# -----------------------
65{
66 osl_incrementInterlockedCount(&s_nImageRefCount);
67 pView = pLBView;
68 pTree = pLBTree;
69 aSelEng.SetFunctionSet( (FunctionSet*)&aFctSet );
70 aSelEng.ExpandSelectionOnMouseMove( sal_False );
71 SetStyle( nWinStyle );

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

83 aHorSBar.SetLineSize( 8 ); // Pixel
84
85 nHorSBarHeight = (short)aHorSBar.GetSizePixel().Height();
86 nVerSBarWidth = (short)aVerSBar.GetSizePixel().Width();
87
88 pStartEntry = 0;
89 pCursor = 0;
90 pAnchor = 0;
64 pIntlWrapper( NULL ) // #102891# -----------------------
65{
66 osl_incrementInterlockedCount(&s_nImageRefCount);
67 pView = pLBView;
68 pTree = pLBTree;
69 aSelEng.SetFunctionSet( (FunctionSet*)&aFctSet );
70 aSelEng.ExpandSelectionOnMouseMove( sal_False );
71 SetStyle( nWinStyle );

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

83 aHorSBar.SetLineSize( 8 ); // Pixel
84
85 nHorSBarHeight = (short)aHorSBar.GetSizePixel().Height();
86 nVerSBarWidth = (short)aVerSBar.GetSizePixel().Width();
87
88 pStartEntry = 0;
89 pCursor = 0;
90 pAnchor = 0;
91 nVisibleCount = 0; // Anzahl Daten-Zeilen im Control
91 nVisibleCount = 0; // Anzahl Daten-Zeilen im Control
92 nNodeBmpTabDistance = NODE_BMP_TABDIST_NOTVALID;
93 nYoffsNodeBmp = 0;
94 nNodeBmpWidth = 0;
95
96 bAsyncBeginDrag = sal_False;
97 aAsyncBeginDragTimer.SetTimeout( 0 );
98 aAsyncBeginDragTimer.SetTimeoutHdl( LINK(this,SvImpLBox,BeginDragHdl));
99 // Button-Animation in Listbox

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

223{
224 if ( pEntry && bIsCellFocusEnabled )
225 {
226 if ( nCurTabPos > FIRST_ENTRY_TAB )
227 {
228 SvLBoxItem* pItem = pCursor->GetItem( nCurTabPos );
229 rRect.Left() = pView->GetTab( pCursor, pItem )->GetPos();
230 }
92 nNodeBmpTabDistance = NODE_BMP_TABDIST_NOTVALID;
93 nYoffsNodeBmp = 0;
94 nNodeBmpWidth = 0;
95
96 bAsyncBeginDrag = sal_False;
97 aAsyncBeginDragTimer.SetTimeout( 0 );
98 aAsyncBeginDragTimer.SetTimeoutHdl( LINK(this,SvImpLBox,BeginDragHdl));
99 // Button-Animation in Listbox

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

223{
224 if ( pEntry && bIsCellFocusEnabled )
225 {
226 if ( nCurTabPos > FIRST_ENTRY_TAB )
227 {
228 SvLBoxItem* pItem = pCursor->GetItem( nCurTabPos );
229 rRect.Left() = pView->GetTab( pCursor, pItem )->GetPos();
230 }
231 if ( pCursor->ItemCount() > ( nCurTabPos + 1 ) )
232 {
233 SvLBoxItem* pNextItem = pCursor->GetItem( nCurTabPos + 1 );
234 long nRight = pView->GetTab( pCursor, pNextItem )->GetPos() - 1;
235 if ( nRight < rRect.Right() )
236 rRect.Right() = nRight;
237 }
231 if ( pCursor->ItemCount() > ( nCurTabPos + 1 ) )
232 {
233 SvLBoxItem* pNextItem = pCursor->GetItem( nCurTabPos + 1 );
234 long nRight = pView->GetTab( pCursor, pNextItem )->GetPos() - 1;
235 if ( nRight < rRect.Right() )
236 rRect.Right() = nRight;
237 }
238 }
239}
240
241void SvImpLBox::SetStyle( WinBits i_nWinStyle )
242{
243 m_nStyle = i_nWinStyle;
244 if ( ( m_nStyle & WB_SIMPLEMODE) && ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION ) )
245 aSelEng.AddAlways( sal_True );

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

605 Region aClipRegion( GetClipRegionRect() );
606 pView->SetClipRegion( aClipRegion );
607 pView->ShowFocus( aRect );
608 pView->SetClipRegion( aOldClip );
609 }
610}
611
612//
238 }
239}
240
241void SvImpLBox::SetStyle( WinBits i_nWinStyle )
242{
243 m_nStyle = i_nWinStyle;
244 if ( ( m_nStyle & WB_SIMPLEMODE) && ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION ) )
245 aSelEng.AddAlways( sal_True );

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

605 Region aClipRegion( GetClipRegionRect() );
606 pView->SetClipRegion( aClipRegion );
607 pView->ShowFocus( aRect );
608 pView->SetClipRegion( aOldClip );
609 }
610}
611
612//
613// Setzt Cursor. Passt bei SingleSelection die Selektion an
613// Setzt Cursor. Passt bei SingleSelection die Selektion an
614//
615
616void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect )
617{
618 SvViewDataEntry* pViewDataNewCur = 0;
619 if( pEntry )
620 pViewDataNewCur= pView->GetViewDataEntry(pEntry);
621 if( pEntry &&

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

672 if( pAnchor )
673 {
674 DBG_ASSERT(aSelEng.GetSelectionMode() != SINGLE_SELECTION,"Mode?");
675 SetAnchorSelection( pOldCursor, pCursor );
676 }
677 }
678 nFlags &= (~F_DESEL_ALL);
679
614//
615
616void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect )
617{
618 SvViewDataEntry* pViewDataNewCur = 0;
619 if( pEntry )
620 pViewDataNewCur= pView->GetViewDataEntry(pEntry);
621 if( pEntry &&

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

672 if( pAnchor )
673 {
674 DBG_ASSERT(aSelEng.GetSelectionMode() != SINGLE_SELECTION,"Mode?");
675 SetAnchorSelection( pOldCursor, pCursor );
676 }
677 }
678 nFlags &= (~F_DESEL_ALL);
679
680 pView->OnCurrentEntryChanged();
680 pView->OnCurrentEntryChanged();
681}
682
683void SvImpLBox::ShowCursor( sal_Bool bShow )
684{
685 if( !bShow || !pCursor || !pView->HasFocus() )
686 {
687 Region aOldClip( pView->GetClipRegion());
688 Region aClipRegion( GetClipRegionRect() );

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

769 pView->NotifyScrolled();
770}
771
772
773// gibt letzten Eintrag zurueck, wenn Position unter
774// dem letzten Eintrag ist
775SvLBoxEntry* SvImpLBox::GetClickedEntry( const Point& rPoint ) const
776{
681}
682
683void SvImpLBox::ShowCursor( sal_Bool bShow )
684{
685 if( !bShow || !pCursor || !pView->HasFocus() )
686 {
687 Region aOldClip( pView->GetClipRegion());
688 Region aClipRegion( GetClipRegionRect() );

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

769 pView->NotifyScrolled();
770}
771
772
773// gibt letzten Eintrag zurueck, wenn Position unter
774// dem letzten Eintrag ist
775SvLBoxEntry* SvImpLBox::GetClickedEntry( const Point& rPoint ) const
776{
777 DBG_ASSERT( pView->GetModel(), "SvImpLBox::GetClickedEntry: how can this ever happen? Please tell me (frank.schoenheit@sun.com) how to reproduce!" );
778 if ( !pView->GetModel() )
779 // this is quite impossible. Nevertheless, stack traces from the crash reporter
780 // suggest it isn't. Okay, make it safe, and wait for somebody to reproduce it
781 // reliably :-\ ....
782 // #122359# / 2005-05-23 / frank.schoenheit@sun.com
783 return NULL;
784 if( pView->GetEntryCount() == 0 || !pStartEntry || !pView->GetEntryHeight())
777 DBG_ASSERT( pView->GetModel(), "SvImpLBox::GetClickedEntry: how can this ever happen? Please tell me (frank.schoenheit@sun.com) how to reproduce!" );
778 if ( !pView->GetModel() )
779 // this is quite impossible. Nevertheless, stack traces from the crash reporter
780 // suggest it isn't. Okay, make it safe, and wait for somebody to reproduce it
781 // reliably :-\ ....
782 // #122359# / 2005-05-23 / frank.schoenheit@sun.com
783 return NULL;
784 if( pView->GetEntryCount() == 0 || !pStartEntry || !pView->GetEntryHeight())
785 return 0;
786
787 sal_uInt16 nClickedEntry = (sal_uInt16)(rPoint.Y() / pView->GetEntryHeight() );
788 sal_uInt16 nTemp = nClickedEntry;
789 SvLBoxEntry* pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nTemp ));
790 return pEntry;
791}
792
793//
785 return 0;
786
787 sal_uInt16 nClickedEntry = (sal_uInt16)(rPoint.Y() / pView->GetEntryHeight() );
788 sal_uInt16 nTemp = nClickedEntry;
789 SvLBoxEntry* pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nTemp ));
790 return pEntry;
791}
792
793//
794// prueft, ob der Eintrag "richtig" getroffen wurde
795// (Focusrect+ ContextBitmap bei TreeListBox)
794// prueft, ob der Eintrag "richtig" getroffen wurde
795// (Focusrect+ ContextBitmap bei TreeListBox)
796//
797sal_Bool SvImpLBox::EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPosPixel,long nLine)
798{
799 sal_Bool bRet;
800 // bei "besonderen" Entries (mit CheckButtons usw.) sind wir
801 // nicht so pingelig
802 if( pEntry->ItemCount() >= 3 )
803 return sal_True;

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

819 return bRet;
820}
821
822
823// gibt 0 zurueck, wenn Position unter dem letzten Eintrag ist
824SvLBoxEntry* SvImpLBox::GetEntry( const Point& rPoint ) const
825{
826 if( (pView->GetEntryCount() == 0) || !pStartEntry ||
796//
797sal_Bool SvImpLBox::EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPosPixel,long nLine)
798{
799 sal_Bool bRet;
800 // bei "besonderen" Entries (mit CheckButtons usw.) sind wir
801 // nicht so pingelig
802 if( pEntry->ItemCount() >= 3 )
803 return sal_True;

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

819 return bRet;
820}
821
822
823// gibt 0 zurueck, wenn Position unter dem letzten Eintrag ist
824SvLBoxEntry* SvImpLBox::GetEntry( const Point& rPoint ) const
825{
826 if( (pView->GetEntryCount() == 0) || !pStartEntry ||
827 (rPoint.Y() > aOutputSize.Height())
828 || !pView->GetEntryHeight())
827 (rPoint.Y() > aOutputSize.Height())
828 || !pView->GetEntryHeight())
829 return 0;
830
831 sal_uInt16 nClickedEntry = (sal_uInt16)(rPoint.Y() / pView->GetEntryHeight() );
832 sal_uInt16 nTemp = nClickedEntry;
833 SvLBoxEntry* pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nTemp ));
834 if( nTemp != nClickedEntry )
835 pEntry = 0;
836 return pEntry;

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

955 for( sal_uInt16 n=0; n< nCount && pEntry; n++ )
956 {
957 /*long nMaxRight=*/
958 pView->PaintEntry1( pEntry, nY, 0xffff, sal_True );
959 nY += nEntryHeight;
960 pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
961 }
962
829 return 0;
830
831 sal_uInt16 nClickedEntry = (sal_uInt16)(rPoint.Y() / pView->GetEntryHeight() );
832 sal_uInt16 nTemp = nClickedEntry;
833 SvLBoxEntry* pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nTemp ));
834 if( nTemp != nClickedEntry )
835 pEntry = 0;
836 return pEntry;

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

955 for( sal_uInt16 n=0; n< nCount && pEntry; n++ )
956 {
957 /*long nMaxRight=*/
958 pView->PaintEntry1( pEntry, nY, 0xffff, sal_True );
959 nY += nEntryHeight;
960 pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
961 }
962
963 if ( !pCursor && ( ( nExtendedWinBits & EWB_NO_AUTO_CURENTRY ) == 0 ) )
963 if ( !pCursor && ( ( nExtendedWinBits & EWB_NO_AUTO_CURENTRY ) == 0 ) )
964 {
964 {
965 // do not select if multiselection or explicit set
966 sal_Bool bNotSelect = ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION )
967 || ( ( m_nStyle & WB_NOINITIALSELECTION ) == WB_NOINITIALSELECTION );
968 SetCursor( pStartEntry, bNotSelect );
965 // do not select if multiselection or explicit set
966 sal_Bool bNotSelect = ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION )
967 || ( ( m_nStyle & WB_NOINITIALSELECTION ) == WB_NOINITIALSELECTION );
968 SetCursor( pStartEntry, bNotSelect );
969 }
970
969 }
970
971 nFlags &= (~F_DESEL_ALL);
971 nFlags &= (~F_DESEL_ALL);
972 pView->SetClipRegion();
973 Rectangle aRect;
974 if( !(nFlags & F_PAINTED) )
975 {
976 nFlags |= F_PAINTED;
977 RepaintScrollBars();
978 }
979 nFlags &= (~F_IN_PAINT);
980}
981
982void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop )
983{
984 if( !pEntry )
985 return;
986
987 sal_Bool bInView = IsEntryInView( pEntry );
988
989 if( bInView && (!bMoveToTop || pStartEntry == pEntry) )
972 pView->SetClipRegion();
973 Rectangle aRect;
974 if( !(nFlags & F_PAINTED) )
975 {
976 nFlags |= F_PAINTED;
977 RepaintScrollBars();
978 }
979 nFlags &= (~F_IN_PAINT);
980}
981
982void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop )
983{
984 if( !pEntry )
985 return;
986
987 sal_Bool bInView = IsEntryInView( pEntry );
988
989 if( bInView && (!bMoveToTop || pStartEntry == pEntry) )
990 return; // ist schon sichtbar
990 return; // ist schon sichtbar
991
992 if( pStartEntry || (m_nStyle & WB_FORCE_MAKEVISIBLE) )
993 nFlags &= (~F_FILLING);
994 if( !bInView )
995 {
991
992 if( pStartEntry || (m_nStyle & WB_FORCE_MAKEVISIBLE) )
993 nFlags &= (~F_FILLING);
994 if( !bInView )
995 {
996 if( !pView->IsEntryVisible(pEntry) ) // Parent(s) zugeklappt ?
996 if( !pView->IsEntryVisible(pEntry) ) // Parent(s) zugeklappt ?
997 {
998 SvLBoxEntry* pParent = pView->GetParent( pEntry );
999 while( pParent )
1000 {
1001 if( !pView->IsExpanded( pParent ) )
1002 {
997 {
998 SvLBoxEntry* pParent = pView->GetParent( pEntry );
999 while( pParent )
1000 {
1001 if( !pView->IsExpanded( pParent ) )
1002 {
1003 #ifdef DBG_UTIL
1004 sal_Bool bRet =
1005 #endif
1006 pView->Expand( pParent );
1003 #ifdef DBG_UTIL
1004 sal_Bool bRet =
1005 #endif
1006 pView->Expand( pParent );
1007 DBG_ASSERT(bRet,"Not expanded!");
1008 }
1009 pParent = pView->GetParent( pParent );
1010 }
1011 // Passen Childs der Parents in View oder muessen wir scrollen ?
1012 if( IsEntryInView( pEntry ) && !bMoveToTop )
1007 DBG_ASSERT(bRet,"Not expanded!");
1008 }
1009 pParent = pView->GetParent( pParent );
1010 }
1011 // Passen Childs der Parents in View oder muessen wir scrollen ?
1012 if( IsEntryInView( pEntry ) && !bMoveToTop )
1013 return; // Scrollen nicht noetig -> tschuess
1013 return; // Scrollen nicht noetig -> tschuess
1014 }
1015 }
1016
1017 pStartEntry = pEntry;
1018 ShowCursor( sal_False );
1019 FillView();
1020 aVerSBar.SetThumbPos( (long)(pView->GetVisiblePos( pStartEntry )) );
1021 ShowCursor( sal_True );

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

1053
1054
1055void SvImpLBox::DrawNet()
1056{
1057 if( pView->GetVisibleCount() < 2 && !pStartEntry->HasChildsOnDemand() &&
1058 !pStartEntry->HasChilds() )
1059 return;
1060
1014 }
1015 }
1016
1017 pStartEntry = pEntry;
1018 ShowCursor( sal_False );
1019 FillView();
1020 aVerSBar.SetThumbPos( (long)(pView->GetVisiblePos( pStartEntry )) );
1021 ShowCursor( sal_True );

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

1053
1054
1055void SvImpLBox::DrawNet()
1056{
1057 if( pView->GetVisibleCount() < 2 && !pStartEntry->HasChildsOnDemand() &&
1058 !pStartEntry->HasChilds() )
1059 return;
1060
1061 //for platforms who don't have nets, DrawNativeControl does nothing and return true
1062 //so that SvImpLBox::DrawNet() doesn't draw anything too
1061 //for platforms who don't have nets, DrawNativeControl does nothing and return true
1062 //so that SvImpLBox::DrawNet() doesn't draw anything too
1063 if(pView->IsNativeControlSupported( CTRL_LISTNET, PART_ENTIRE_CONTROL)) {
1063 if(pView->IsNativeControlSupported( CTRL_LISTNET, PART_ENTIRE_CONTROL)) {
1064 ImplControlValue aControlValue;
1065 Point aTemp(0,0); // temporary needed for g++ 3.3.5
1066 Rectangle aCtrlRegion( aTemp, Size( 0, 0 ) );
1067 ControlState nState = CTRL_STATE_ENABLED;
1068 if( pView->DrawNativeControl( CTRL_LISTNET, PART_ENTIRE_CONTROL,
1069 aCtrlRegion, nState, aControlValue, rtl::OUString() ) )
1070 {
1071 return;
1072 }
1064 ImplControlValue aControlValue;
1065 Point aTemp(0,0); // temporary needed for g++ 3.3.5
1066 Rectangle aCtrlRegion( aTemp, Size( 0, 0 ) );
1067 ControlState nState = CTRL_STATE_ENABLED;
1068 if( pView->DrawNativeControl( CTRL_LISTNET, PART_ENTIRE_CONTROL,
1069 aCtrlRegion, nState, aControlValue, rtl::OUString() ) )
1070 {
1071 return;
1072 }
1073
1073
1074 }
1074 }
1075
1076 long nEntryHeight = pView->GetEntryHeight();
1077 long nEntryHeightDIV2 = nEntryHeight / 2;
1078 if( nEntryHeightDIV2 && !(nEntryHeight & 0x0001))
1079 nEntryHeightDIV2--;
1080
1081 SvLBoxEntry* pChild;
1082 SvLBoxEntry* pEntry = pStartEntry;

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

1152 if( m_nStyle & WB_HASLINESATROOT )
1153 {
1154 pEntry = pView->First();
1155 aPos1.X() = pView->GetTabPos( pEntry, pFirstDynamicTab);
1156 // wenn keine ContextBitmap, dann etwas nach rechts
1157 // unter den ersten Text (Node.Bmp ebenfalls
1158 if( !pView->nContextBmpWidthMax )
1159 aPos1.X() += rExpandedNodeBitmap.GetSizePixel().Width() / 2;
1075
1076 long nEntryHeight = pView->GetEntryHeight();
1077 long nEntryHeightDIV2 = nEntryHeight / 2;
1078 if( nEntryHeightDIV2 && !(nEntryHeight & 0x0001))
1079 nEntryHeightDIV2--;
1080
1081 SvLBoxEntry* pChild;
1082 SvLBoxEntry* pEntry = pStartEntry;

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

1152 if( m_nStyle & WB_HASLINESATROOT )
1153 {
1154 pEntry = pView->First();
1155 aPos1.X() = pView->GetTabPos( pEntry, pFirstDynamicTab);
1156 // wenn keine ContextBitmap, dann etwas nach rechts
1157 // unter den ersten Text (Node.Bmp ebenfalls
1158 if( !pView->nContextBmpWidthMax )
1159 aPos1.X() += rExpandedNodeBitmap.GetSizePixel().Width() / 2;
1160 aPos1.X() -= pView->GetIndent();
1160 aPos1.X() -= pView->GetIndent();
1161 aPos1.Y() = GetEntryLine( pEntry );
1162 aPos1.Y() += nEntryHeightDIV2;
1163 pChild = pTree->LastSibling( pEntry );
1164 aPos2.X() = aPos1.X();
1165 aPos2.Y() = GetEntryLine( pChild );
1166 aPos2.Y() += nEntryHeightDIV2;
1167 pView->DrawLine( aPos1, aPos2 );
1168 }

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

1238 long nEntryHeight = pView->GetEntryHeight();
1239 if( !nEntryHeight )
1240 return 0;
1241
1242 sal_uInt16 nResult = 0;
1243
1244 Size aOSize( pView->Control::GetOutputSizePixel() );
1245
1161 aPos1.Y() = GetEntryLine( pEntry );
1162 aPos1.Y() += nEntryHeightDIV2;
1163 pChild = pTree->LastSibling( pEntry );
1164 aPos2.X() = aPos1.X();
1165 aPos2.Y() = GetEntryLine( pChild );
1166 aPos2.Y() += nEntryHeightDIV2;
1167 pView->DrawLine( aPos1, aPos2 );
1168 }

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

1238 long nEntryHeight = pView->GetEntryHeight();
1239 if( !nEntryHeight )
1240 return 0;
1241
1242 sal_uInt16 nResult = 0;
1243
1244 Size aOSize( pView->Control::GetOutputSizePixel() );
1245
1246 const WinBits nWindowStyle = pView->GetStyle();
1246 const WinBits nWindowStyle = pView->GetStyle();
1247 sal_Bool bVerSBar = ( nWindowStyle & WB_VSCROLL ) != 0;
1248 sal_Bool bHorBar = sal_False;
1249 long nMaxRight = aOSize.Width(); //GetOutputSize().Width();
1250 Point aOrigin( pView->GetMapMode().GetOrigin() );
1251 aOrigin.X() *= -1;
1252 nMaxRight += aOrigin.X() - 1;
1253 long nVis = nMostRight - aOrigin.X();
1254 if( pTabBar || (
1255 (nWindowStyle & WB_HSCROLL) &&
1256 (nVis < nMostRight || nMaxRight < nMostRight) ))
1257 bHorBar = sal_True;
1258
1259 // Anzahl aller nicht eingeklappten Eintraege
1260 sal_uLong nTotalCount = pView->GetVisibleCount();
1261
1262 // Anzahl in der View sichtbarer Eintraege
1263 nVisibleCount = aOSize.Height() / nEntryHeight;
1264
1265 // muessen wir eine vertikale Scrollbar einblenden?
1247 sal_Bool bVerSBar = ( nWindowStyle & WB_VSCROLL ) != 0;
1248 sal_Bool bHorBar = sal_False;
1249 long nMaxRight = aOSize.Width(); //GetOutputSize().Width();
1250 Point aOrigin( pView->GetMapMode().GetOrigin() );
1251 aOrigin.X() *= -1;
1252 nMaxRight += aOrigin.X() - 1;
1253 long nVis = nMostRight - aOrigin.X();
1254 if( pTabBar || (
1255 (nWindowStyle & WB_HSCROLL) &&
1256 (nVis < nMostRight || nMaxRight < nMostRight) ))
1257 bHorBar = sal_True;
1258
1259 // Anzahl aller nicht eingeklappten Eintraege
1260 sal_uLong nTotalCount = pView->GetVisibleCount();
1261
1262 // Anzahl in der View sichtbarer Eintraege
1263 nVisibleCount = aOSize.Height() / nEntryHeight;
1264
1265 // muessen wir eine vertikale Scrollbar einblenden?
1266 if( bVerSBar || nTotalCount > nVisibleCount )
1266 if( bVerSBar || nTotalCount > nVisibleCount )
1267 {
1268 nResult = 1;
1269 nFlags |= F_HOR_SBARSIZE_WITH_VBAR;
1270 nMaxRight -= nVerSBarWidth;
1271 if( !bHorBar )
1272 {
1273 if( (nWindowStyle & WB_HSCROLL) &&
1274 (nVis < nMostRight || nMaxRight < nMostRight) )
1275 bHorBar = sal_True;
1276 }
1277 }
1278
1279 // muessen wir eine horizontale Scrollbar einblenden?
1280 if( bHorBar )
1281 {
1282 nResult |= 0x0002;
1283 // die Anzahl der in der View sichtbaren Eintraege
1284 // muss neu berechnet werden, da die horizontale
1285 // ScrollBar eingeblendet wird
1267 {
1268 nResult = 1;
1269 nFlags |= F_HOR_SBARSIZE_WITH_VBAR;
1270 nMaxRight -= nVerSBarWidth;
1271 if( !bHorBar )
1272 {
1273 if( (nWindowStyle & WB_HSCROLL) &&
1274 (nVis < nMostRight || nMaxRight < nMostRight) )
1275 bHorBar = sal_True;
1276 }
1277 }
1278
1279 // muessen wir eine horizontale Scrollbar einblenden?
1280 if( bHorBar )
1281 {
1282 nResult |= 0x0002;
1283 // die Anzahl der in der View sichtbaren Eintraege
1284 // muss neu berechnet werden, da die horizontale
1285 // ScrollBar eingeblendet wird
1286 nVisibleCount = (aOSize.Height() - nHorSBarHeight) / nEntryHeight;
1286 nVisibleCount = (aOSize.Height() - nHorSBarHeight) / nEntryHeight;
1287 // eventuell brauchen wir jetzt doch eine vertikale ScrollBar
1288 if( !(nResult & 0x0001) &&
1287 // eventuell brauchen wir jetzt doch eine vertikale ScrollBar
1288 if( !(nResult & 0x0001) &&
1289 ((nTotalCount > nVisibleCount) || bVerSBar) )
1289 ((nTotalCount > nVisibleCount) || bVerSBar) )
1290 {
1291 nResult = 3;
1292 nFlags |= F_VER_SBARSIZE_WITH_HBAR;
1293 }
1294 }
1295
1296 PositionScrollBars( aOSize, nResult );
1297

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

1397 nTempThumb = nVisibleViewCount - 1;
1398 pStartEntry = (SvLBoxEntry*)(pView->GetEntryAtVisPos(nTempThumb));
1399 }
1400 if( pStartEntry )
1401 {
1402 sal_uInt16 nLast = (sal_uInt16)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible())));
1403 sal_uInt16 nThumb = (sal_uInt16)(pView->GetVisiblePos( pStartEntry ));
1404 sal_uInt16 nCurDispEntries = nLast-nThumb+1;
1290 {
1291 nResult = 3;
1292 nFlags |= F_VER_SBARSIZE_WITH_HBAR;
1293 }
1294 }
1295
1296 PositionScrollBars( aOSize, nResult );
1297

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

1397 nTempThumb = nVisibleViewCount - 1;
1398 pStartEntry = (SvLBoxEntry*)(pView->GetEntryAtVisPos(nTempThumb));
1399 }
1400 if( pStartEntry )
1401 {
1402 sal_uInt16 nLast = (sal_uInt16)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible())));
1403 sal_uInt16 nThumb = (sal_uInt16)(pView->GetVisiblePos( pStartEntry ));
1404 sal_uInt16 nCurDispEntries = nLast-nThumb+1;
1405 if( nCurDispEntries < nVisibleCount )
1405 if( nCurDispEntries < nVisibleCount )
1406 {
1407 ShowCursor( sal_False );
1408 // Fenster fuellen, indem der Thumb schrittweise
1409 // nach oben bewegt wird
1410 sal_Bool bFound = sal_False;
1411 SvLBoxEntry* pTemp = pStartEntry;
1412 while( nCurDispEntries < nVisibleCount && pTemp )
1413 {

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

1457 AdjustScrollBars( aOutputSize );
1458 }
1459 }
1460
1461 long nMaxRight = GetOutputSize().Width();
1462 Point aPos( pView->GetMapMode().GetOrigin() );
1463 aPos.X() *= -1; // Umrechnung Dokumentkoord.
1464 nMaxRight = nMaxRight + aPos.X() - 1;
1406 {
1407 ShowCursor( sal_False );
1408 // Fenster fuellen, indem der Thumb schrittweise
1409 // nach oben bewegt wird
1410 sal_Bool bFound = sal_False;
1411 SvLBoxEntry* pTemp = pStartEntry;
1412 while( nCurDispEntries < nVisibleCount && pTemp )
1413 {

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

1457 AdjustScrollBars( aOutputSize );
1458 }
1459 }
1460
1461 long nMaxRight = GetOutputSize().Width();
1462 Point aPos( pView->GetMapMode().GetOrigin() );
1463 aPos.X() *= -1; // Umrechnung Dokumentkoord.
1464 nMaxRight = nMaxRight + aPos.X() - 1;
1465 if( nMaxRight < nMostRight )
1465 if( nMaxRight < nMostRight )
1466 {
1467 if( !aHorSBar.IsVisible() )
1468 {
1469 pView->nFocusWidth = -1;
1470 AdjustScrollBars( aOutputSize );
1471 if( GetUpdateMode() )
1472 aHorSBar.Update();
1473 }

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

1590
1591 if( !pMostRightEntry || pTree->IsChild( pEntry,pMostRightEntry ) )
1592 {
1593 FindMostRight(0);
1594 }
1595
1596 if( pStartEntry )
1597 {
1466 {
1467 if( !aHorSBar.IsVisible() )
1468 {
1469 pView->nFocusWidth = -1;
1470 AdjustScrollBars( aOutputSize );
1471 if( GetUpdateMode() )
1472 aHorSBar.Update();
1473 }

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

1590
1591 if( !pMostRightEntry || pTree->IsChild( pEntry,pMostRightEntry ) )
1592 {
1593 FindMostRight(0);
1594 }
1595
1596 if( pStartEntry )
1597 {
1598 long nOldThumbPos = aVerSBar.GetThumbPos();
1599 sal_uLong nVisList = pView->GetVisibleCount();
1598 long nOldThumbPos = aVerSBar.GetThumbPos();
1599 sal_uLong nVisList = pView->GetVisibleCount();
1600 aVerSBar.SetRange( Range(0, nVisList-1) );
1600 aVerSBar.SetRange( Range(0, nVisList-1) );
1601 long nNewThumbPos = aVerSBar.GetThumbPos();
1602 if( nNewThumbPos != nOldThumbPos )
1601 long nNewThumbPos = aVerSBar.GetThumbPos();
1602 if( nNewThumbPos != nOldThumbPos )
1603 {
1604 pStartEntry = pView->First();
1605 sal_uInt16 nDistance = (sal_uInt16)nNewThumbPos;
1606 if( nDistance )
1607 pStartEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry,
1608 nDistance));
1609 if( GetUpdateMode() )
1610 pView->Invalidate();

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

1823 }
1824 nFlags &= (~F_REMOVED_RECALC_MOST_RIGHT);
1825}
1826
1827
1828void SvImpLBox::MovingEntry( SvLBoxEntry* pEntry )
1829{
1830 int bDeselAll = nFlags & F_DESEL_ALL;
1603 {
1604 pStartEntry = pView->First();
1605 sal_uInt16 nDistance = (sal_uInt16)nNewThumbPos;
1606 if( nDistance )
1607 pStartEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry,
1608 nDistance));
1609 if( GetUpdateMode() )
1610 pView->Invalidate();

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

1823 }
1824 nFlags &= (~F_REMOVED_RECALC_MOST_RIGHT);
1825}
1826
1827
1828void SvImpLBox::MovingEntry( SvLBoxEntry* pEntry )
1829{
1830 int bDeselAll = nFlags & F_DESEL_ALL;
1831 SelAllDestrAnch( sal_False, sal_True ); // DeselectAll();
1831 SelAllDestrAnch( sal_False, sal_True ); // DeselectAll();
1832 if( !bDeselAll )
1833 nFlags &= (~F_DESEL_ALL);
1834
1835 if( pEntry == pCursor )
1836 ShowCursor( sal_False );
1837 if( IsEntryInView( pEntry ) )
1838 pView->Invalidate();
1839 if( pEntry == pStartEntry )

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

1855 }
1856}
1857
1858void SvImpLBox::EntryMoved( SvLBoxEntry* pEntry )
1859{
1860 // #97680# --------------
1861 UpdateContextBmpWidthVectorFromMovedEntry( pEntry );
1862
1832 if( !bDeselAll )
1833 nFlags &= (~F_DESEL_ALL);
1834
1835 if( pEntry == pCursor )
1836 ShowCursor( sal_False );
1837 if( IsEntryInView( pEntry ) )
1838 pView->Invalidate();
1839 if( pEntry == pStartEntry )

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

1855 }
1856}
1857
1858void SvImpLBox::EntryMoved( SvLBoxEntry* pEntry )
1859{
1860 // #97680# --------------
1861 UpdateContextBmpWidthVectorFromMovedEntry( pEntry );
1862
1863 if ( !pStartEntry )
1864 // this might happen if the only entry in the view is moved to its very same position
1865 // #i97346#
1866 pStartEntry = pView->First();
1863 if ( !pStartEntry )
1864 // this might happen if the only entry in the view is moved to its very same position
1865 // #i97346#
1866 pStartEntry = pView->First();
1867
1868 aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1));
1869 sal_uInt16 nFirstPos = (sal_uInt16)pTree->GetAbsPos( pStartEntry );
1870 sal_uInt16 nNewPos = (sal_uInt16)pTree->GetAbsPos( pEntry );
1871 FindMostRight(0);
1872 if( nNewPos < nFirstPos ) //!!!Notloesung
1873 pStartEntry = pEntry;
1874 // #97702# ---------------

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

2124
2125 SvLBoxEntry* pEntry = GetEntry( aPos );
2126 if ( pEntry != pCursor )
2127 // new entry selected -> reset current tab position to first tab
2128 nCurTabPos = FIRST_ENTRY_TAB;
2129 nFlags &= (~F_FILLING);
2130 pView->GrabFocus();
2131 // #120417# the entry can still be invalid!
1867
1868 aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1));
1869 sal_uInt16 nFirstPos = (sal_uInt16)pTree->GetAbsPos( pStartEntry );
1870 sal_uInt16 nNewPos = (sal_uInt16)pTree->GetAbsPos( pEntry );
1871 FindMostRight(0);
1872 if( nNewPos < nFirstPos ) //!!!Notloesung
1873 pStartEntry = pEntry;
1874 // #97702# ---------------

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

2124
2125 SvLBoxEntry* pEntry = GetEntry( aPos );
2126 if ( pEntry != pCursor )
2127 // new entry selected -> reset current tab position to first tab
2128 nCurTabPos = FIRST_ENTRY_TAB;
2129 nFlags &= (~F_FILLING);
2130 pView->GrabFocus();
2131 // #120417# the entry can still be invalid!
2132 if( !pEntry || !pView->GetViewData( pEntry ))
2132 if( !pEntry || !pView->GetViewData( pEntry ))
2133 return;
2134
2135 long nY = GetEntryLine( pEntry );
2136 // Node-Button?
2137 if( ButtonDownCheckExpand( rMEvt, pEntry, nY ) )
2138 return;
2139
2140 if( !EntryReallyHit(pEntry,aPos,nY))

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

2173 return;
2174 }
2175 if( pEntry->HasChilds() || pEntry->HasChildsOnDemand() )
2176 {
2177 if( pView->IsExpanded(pEntry) )
2178 pView->Collapse( pEntry );
2179 else
2180 pView->Expand( pEntry );
2133 return;
2134
2135 long nY = GetEntryLine( pEntry );
2136 // Node-Button?
2137 if( ButtonDownCheckExpand( rMEvt, pEntry, nY ) )
2138 return;
2139
2140 if( !EntryReallyHit(pEntry,aPos,nY))

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

2173 return;
2174 }
2175 if( pEntry->HasChilds() || pEntry->HasChildsOnDemand() )
2176 {
2177 if( pView->IsExpanded(pEntry) )
2178 pView->Collapse( pEntry );
2179 else
2180 pView->Expand( pEntry );
2181 if( pEntry == pCursor ) // nur wenn Entryitem angeklickt wurde
2182 // (Nodebutton ist kein Entryitem!)
2181 if( pEntry == pCursor ) // nur wenn Entryitem angeklickt wurde
2182 // (Nodebutton ist kein Entryitem!)
2183 pView->Select( pCursor, sal_True );
2184 return;
2185 }
2186 }
2187 }
2188 else
2189 {
2190 // CheckButton? (TreeListBox: Check + Info)

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

2196 {
2197 SvLBoxItem* pItem = pView->GetItem( pEntry, aPos.X() );
2198 if( pItem )
2199 pView->EditingRequest( pEntry, pItem, aPos );
2200 return;
2201 }
2202#endif
2203 }
2183 pView->Select( pCursor, sal_True );
2184 return;
2185 }
2186 }
2187 }
2188 else
2189 {
2190 // CheckButton? (TreeListBox: Check + Info)

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

2196 {
2197 SvLBoxItem* pItem = pView->GetItem( pEntry, aPos.X() );
2198 if( pItem )
2199 pView->EditingRequest( pEntry, pItem, aPos );
2200 return;
2201 }
2202#endif
2203 }
2204 if ( aSelEng.GetSelectionMode() != NO_SELECTION )
2205 aSelEng.SelMouseButtonDown( rMEvt );
2204 if ( aSelEng.GetSelectionMode() != NO_SELECTION )
2205 aSelEng.SelMouseButtonDown( rMEvt );
2206}
2207
2208void SvImpLBox::MouseButtonUp( const MouseEvent& rMEvt)
2209{
2210#ifdef OS2
2211 nFlags &= (~F_IGNORE_NEXT_MOUSEMOVE);
2212#endif
2213 if ( !ButtonUpCheckCtrl( rMEvt ) && ( aSelEng.GetSelectionMode() != NO_SELECTION ) )

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

2250
2251 if( !pCursor )
2252 pCursor = pStartEntry;
2253 if( !pCursor )
2254 return sal_False;
2255
2256 sal_Bool bKeyUsed = sal_True;
2257
2206}
2207
2208void SvImpLBox::MouseButtonUp( const MouseEvent& rMEvt)
2209{
2210#ifdef OS2
2211 nFlags &= (~F_IGNORE_NEXT_MOUSEMOVE);
2212#endif
2213 if ( !ButtonUpCheckCtrl( rMEvt ) && ( aSelEng.GetSelectionMode() != NO_SELECTION ) )

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

2250
2251 if( !pCursor )
2252 pCursor = pStartEntry;
2253 if( !pCursor )
2254 return sal_False;
2255
2256 sal_Bool bKeyUsed = sal_True;
2257
2258 sal_uInt16 nDelta = (sal_uInt16)aVerSBar.GetPageSize();
2259 sal_uInt16 aCode = rKeyCode.GetCode();
2258 sal_uInt16 nDelta = (sal_uInt16)aVerSBar.GetPageSize();
2259 sal_uInt16 aCode = rKeyCode.GetCode();
2260
2260
2261 sal_Bool bShift = rKeyCode.IsShift();
2262 sal_Bool bMod1 = rKeyCode.IsMod1();
2261 sal_Bool bShift = rKeyCode.IsShift();
2262 sal_Bool bMod1 = rKeyCode.IsMod1();
2263
2264 SvLBoxEntry* pNewCursor;
2265
2263
2264 SvLBoxEntry* pNewCursor;
2265
2266 const WinBits nWindowStyle = pView->GetStyle();
2266 const WinBits nWindowStyle = pView->GetStyle();
2267 switch( aCode )
2268 {
2269 case KEY_UP:
2270 if( !IsEntryInView( pCursor ) )
2271 MakeVisible( pCursor );
2272
2273 pNewCursor = pCursor;
2274 do

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

2326 if( pCursor )
2327 pView->Select( pCursor, sal_False );
2328 KeyDown( sal_False );
2329 SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on
2330 }
2331 }
2332 else
2333 KeyDown( sal_False ); // weil ScrollBar-Range evtl. noch
2267 switch( aCode )
2268 {
2269 case KEY_UP:
2270 if( !IsEntryInView( pCursor ) )
2271 MakeVisible( pCursor );
2272
2273 pNewCursor = pCursor;
2274 do

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

2326 if( pCursor )
2327 pView->Select( pCursor, sal_False );
2328 KeyDown( sal_False );
2329 SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on
2330 }
2331 }
2332 else
2333 KeyDown( sal_False ); // weil ScrollBar-Range evtl. noch
2334 // scrollen erlaubt
2334 // scrollen erlaubt
2335 break;
2336
2337 case KEY_RIGHT:
2338 {
2339 if( bSubLstOpLR && IsNowExpandable() )
2340 pView->Expand( pCursor );
2335 break;
2336
2337 case KEY_RIGHT:
2338 {
2339 if( bSubLstOpLR && IsNowExpandable() )
2340 pView->Expand( pCursor );
2341 else if ( bIsCellFocusEnabled && pCursor )
2342 {
2343 if ( nCurTabPos < ( pView->TabCount() - 1 /*!2*/ ) )
2344 {
2345 ++nCurTabPos;
2346 ShowCursor( sal_True );
2347 CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor );
2348 }
2349 }
2341 else if ( bIsCellFocusEnabled && pCursor )
2342 {
2343 if ( nCurTabPos < ( pView->TabCount() - 1 /*!2*/ ) )
2344 {
2345 ++nCurTabPos;
2346 ShowCursor( sal_True );
2347 CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor );
2348 }
2349 }
2350 else if( nWindowStyle & WB_HSCROLL )
2351 {
2352 long nThumb = aHorSBar.GetThumbPos();
2353 nThumb += aHorSBar.GetLineSize();
2354 long nOldThumb = aHorSBar.GetThumbPos();
2355 aHorSBar.SetThumbPos( nThumb );
2356 nThumb = nOldThumb;
2357 nThumb -= aHorSBar.GetThumbPos();

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

2364 }
2365 else
2366 bKeyUsed = sal_False;
2367 break;
2368 }
2369
2370 case KEY_LEFT:
2371 {
2350 else if( nWindowStyle & WB_HSCROLL )
2351 {
2352 long nThumb = aHorSBar.GetThumbPos();
2353 nThumb += aHorSBar.GetLineSize();
2354 long nOldThumb = aHorSBar.GetThumbPos();
2355 aHorSBar.SetThumbPos( nThumb );
2356 nThumb = nOldThumb;
2357 nThumb -= aHorSBar.GetThumbPos();

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

2364 }
2365 else
2366 bKeyUsed = sal_False;
2367 break;
2368 }
2369
2370 case KEY_LEFT:
2371 {
2372 // if ( bIsCellFocusEnabled )
2373 if ( bIsCellFocusEnabled && pCursor )
2374 {
2375 if ( nCurTabPos > FIRST_ENTRY_TAB )
2376 {
2377 --nCurTabPos;
2378 ShowCursor( sal_True );
2379 CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor );
2380 }
2381 }
2382 else if ( nWindowStyle & WB_HSCROLL )
2372 // if ( bIsCellFocusEnabled )
2373 if ( bIsCellFocusEnabled && pCursor )
2383 {
2374 {
2375 if ( nCurTabPos > FIRST_ENTRY_TAB )
2376 {
2377 --nCurTabPos;
2378 ShowCursor( sal_True );
2379 CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor );
2380 }
2381 }
2382 else if ( nWindowStyle & WB_HSCROLL )
2383 {
2384 long nThumb = aHorSBar.GetThumbPos();
2385 nThumb -= aHorSBar.GetLineSize();
2386 long nOldThumb = aHorSBar.GetThumbPos();
2387 aHorSBar.SetThumbPos( nThumb );
2388 nThumb = nOldThumb;
2389 nThumb -= aHorSBar.GetThumbPos();
2390 if( nThumb )
2391 {

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

2465 else
2466 KeyDown( sal_False ); // siehe KEY_DOWN
2467 }
2468 else
2469 bKeyUsed = sal_False;
2470 break;
2471
2472 case KEY_SPACE:
2384 long nThumb = aHorSBar.GetThumbPos();
2385 nThumb -= aHorSBar.GetLineSize();
2386 long nOldThumb = aHorSBar.GetThumbPos();
2387 aHorSBar.SetThumbPos( nThumb );
2388 nThumb = nOldThumb;
2389 nThumb -= aHorSBar.GetThumbPos();
2390 if( nThumb )
2391 {

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

2465 else
2466 KeyDown( sal_False ); // siehe KEY_DOWN
2467 }
2468 else
2469 bKeyUsed = sal_False;
2470 break;
2471
2472 case KEY_SPACE:
2473 if ( pView->GetSelectionMode() != NO_SELECTION )
2474 {
2475 if ( bMod1 )
2476 {
2477 if ( pView->GetSelectionMode() == MULTIPLE_SELECTION && !bShift )
2478 // toggle selection
2479 pView->Select( pCursor, !pView->IsSelected( pCursor ) );
2480 }
2481 else if ( !bShift /*&& !bMod1*/ )
2482 {
2483 if ( aSelEng.IsAddMode() )
2484 {
2485 // toggle selection
2486 pView->Select( pCursor, !pView->IsSelected( pCursor ) );
2487 }
2488 else if ( !pView->IsSelected( pCursor ) )
2489 {
2490 SelAllDestrAnch( sal_False );
2491 pView->Select( pCursor, sal_True );
2492 }
2493 else
2494 bKeyUsed = sal_False;
2495 }
2496 else
2497 bKeyUsed = sal_False;
2498 }
2473 if ( pView->GetSelectionMode() != NO_SELECTION )
2474 {
2475 if ( bMod1 )
2476 {
2477 if ( pView->GetSelectionMode() == MULTIPLE_SELECTION && !bShift )
2478 // toggle selection
2479 pView->Select( pCursor, !pView->IsSelected( pCursor ) );
2480 }
2481 else if ( !bShift /*&& !bMod1*/ )
2482 {
2483 if ( aSelEng.IsAddMode() )
2484 {
2485 // toggle selection
2486 pView->Select( pCursor, !pView->IsSelected( pCursor ) );
2487 }
2488 else if ( !pView->IsSelected( pCursor ) )
2489 {
2490 SelAllDestrAnch( sal_False );
2491 pView->Select( pCursor, sal_True );
2492 }
2493 else
2494 bKeyUsed = sal_False;
2495 }
2496 else
2497 bKeyUsed = sal_False;
2498 }
2499 else
2500 bKeyUsed = sal_False;
2501 break;
2502
2503 case KEY_RETURN:
2504 if( bSubLstOpRet && IsExpandable() )
2505 {
2506 if( pView->IsExpanded( pCursor ) )

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

2679 case KEY_DELETE:
2680 case KEY_BACKSPACE:
2681 // #105907# must not be handled because this quits dialogs and does other magic things...
2682 // if there are other single keys which should not be handled, they can be added here
2683 bKeyUsed = sal_False;
2684 break;
2685
2686 default:
2499 else
2500 bKeyUsed = sal_False;
2501 break;
2502
2503 case KEY_RETURN:
2504 if( bSubLstOpRet && IsExpandable() )
2505 {
2506 if( pView->IsExpanded( pCursor ) )

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

2679 case KEY_DELETE:
2680 case KEY_BACKSPACE:
2681 // #105907# must not be handled because this quits dialogs and does other magic things...
2682 // if there are other single keys which should not be handled, they can be added here
2683 bKeyUsed = sal_False;
2684 break;
2685
2686 default:
2687 // is there any reason why we should eat the events here? The only place where this is called
2688 // is from SvTreeListBox::KeyInput. If we set bKeyUsed to sal_True here, then the key input
2689 // is just silenced. However, we want SvLBox::KeyInput to get a chance, to do the QuickSelection
2690 // handling.
2691 // (The old code here which intentionally set bKeyUsed to sal_True said this was because of "quick search"
2692 // handling, but actually there was no quick search handling anymore. We just re-implemented it.)
2693 // #i31275# / 2009-06-16 / frank.schoenheit@sun.com
2687 // is there any reason why we should eat the events here? The only place where this is called
2688 // is from SvTreeListBox::KeyInput. If we set bKeyUsed to sal_True here, then the key input
2689 // is just silenced. However, we want SvLBox::KeyInput to get a chance, to do the QuickSelection
2690 // handling.
2691 // (The old code here which intentionally set bKeyUsed to sal_True said this was because of "quick search"
2692 // handling, but actually there was no quick search handling anymore. We just re-implemented it.)
2693 // #i31275# / 2009-06-16 / frank.schoenheit@sun.com
2694 bKeyUsed = sal_False;
2694 bKeyUsed = sal_False;
2695 break;
2695 break;
2696 }
2697 return bKeyUsed;
2698}
2699
2700void __EXPORT SvImpLBox::GetFocus()
2701{
2702 if( pCursor )
2703 {

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

2802 pImp->pAnchor = 0;
2803}
2804*/
2805
2806
2807sal_Bool __EXPORT ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, sal_Bool bDontSelectAtCursor)
2808{
2809 SvLBoxEntry* pNewCursor = pImp->MakePointVisible( rPoint );
2696 }
2697 return bKeyUsed;
2698}
2699
2700void __EXPORT SvImpLBox::GetFocus()
2701{
2702 if( pCursor )
2703 {

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

2802 pImp->pAnchor = 0;
2803}
2804*/
2805
2806
2807sal_Bool __EXPORT ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, sal_Bool bDontSelectAtCursor)
2808{
2809 SvLBoxEntry* pNewCursor = pImp->MakePointVisible( rPoint );
2810 if( pNewCursor != pImp->pCursor )
2810 if( pNewCursor != pImp->pCursor )
2811 pImp->BeginScroll();
2812
2813 if( pNewCursor )
2814 {
2815 // bei SimpleTravel wird in SetCursor selektiert und
2816 // der Select-Handler gerufen
2817 //if( !bDontSelectAtCursor && !pImp->bSimpleTravel )
2818 // pImp->SelectEntry( pNewCursor, sal_True );

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

2914 }
2915 if( pEntry )
2916 pView->Select( pEntry, sal_False );
2917 return;
2918 }
2919 }
2920 else
2921 {
2811 pImp->BeginScroll();
2812
2813 if( pNewCursor )
2814 {
2815 // bei SimpleTravel wird in SetCursor selektiert und
2816 // der Select-Handler gerufen
2817 //if( !bDontSelectAtCursor && !pImp->bSimpleTravel )
2818 // pImp->SelectEntry( pNewCursor, sal_True );

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

2914 }
2915 if( pEntry )
2916 pView->Select( pEntry, sal_False );
2917 return;
2918 }
2919 }
2920 else
2921 {
2922 if( nNewVisPos < nOldVisPos ) // Vergroessern der Selektion
2922 if( nNewVisPos < nOldVisPos ) // Vergroessern der Selektion
2923 {
2924 pEntry = pNewCursor;
2925 while( pEntry && pEntry != pOldCursor )
2926 {
2927 pView->Select( pEntry, sal_True );
2928 pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
2929 }
2930 if( pEntry )

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

3026
3027 if( bDestroyAnchor )
3028 DestroyAnchor(); // Anker loeschen & SelectionEngine zuruecksetzen
3029 else
3030 pAnchor = 0; // internen Anker immer loeschen
3031 ShowCursor( sal_True );
3032}
3033
2923 {
2924 pEntry = pNewCursor;
2925 while( pEntry && pEntry != pOldCursor )
2926 {
2927 pView->Select( pEntry, sal_True );
2928 pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
2929 }
2930 if( pEntry )

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

3026
3027 if( bDestroyAnchor )
3028 DestroyAnchor(); // Anker loeschen & SelectionEngine zuruecksetzen
3029 else
3030 pAnchor = 0; // internen Anker immer loeschen
3031 ShowCursor( sal_True );
3032}
3033
3034void SvImpLBox::SetSelectionMode( SelectionMode eSelMode )
3034void SvImpLBox::SetSelectionMode( SelectionMode eSelMode )
3035{
3036 aSelEng.SetSelectionMode( eSelMode);
3037 if( eSelMode == SINGLE_SELECTION )
3038 bSimpleTravel = sal_True;
3039 else
3040 bSimpleTravel = sal_False;
3041 if( (m_nStyle & WB_SIMPLEMODE) && (eSelMode == MULTIPLE_SELECTION) )
3042 aSelEng.AddAlways( sal_True );

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

3096 pView->SetRasterOp( ROP_INVERT );
3097 Color aOldLineColor = pView->GetLineColor();
3098 pView->SetLineColor( Color( COL_BLACK ) );
3099 pView->DrawLine( Point( 0, nY ), Point( aOutputSize.Width(), nY ) );
3100 pView->SetLineColor( aOldLineColor );
3101 pView->SetRasterOp( eOldOp );
3102}
3103/* -----------------26.08.2003 12:52-----------------
3035{
3036 aSelEng.SetSelectionMode( eSelMode);
3037 if( eSelMode == SINGLE_SELECTION )
3038 bSimpleTravel = sal_True;
3039 else
3040 bSimpleTravel = sal_False;
3041 if( (m_nStyle & WB_SIMPLEMODE) && (eSelMode == MULTIPLE_SELECTION) )
3042 aSelEng.AddAlways( sal_True );

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

3096 pView->SetRasterOp( ROP_INVERT );
3097 Color aOldLineColor = pView->GetLineColor();
3098 pView->SetLineColor( Color( COL_BLACK ) );
3099 pView->DrawLine( Point( 0, nY ), Point( aOutputSize.Width(), nY ) );
3100 pView->SetLineColor( aOldLineColor );
3101 pView->SetRasterOp( eOldOp );
3102}
3103/* -----------------26.08.2003 12:52-----------------
3104 Delete all sub menues of a PopupMenu, recursively
3104 Delete all sub menus of a PopupMenu, recursively
3105 --------------------------------------------------*/
3106void lcl_DeleteSubPopups(PopupMenu* pPopup)
3107{
3105 --------------------------------------------------*/
3106void lcl_DeleteSubPopups(PopupMenu* pPopup)
3107{
3108 for(sal_uInt16 i = 0; i < pPopup->GetItemCount(); i++)
3109 {
3110 PopupMenu* pSubPopup = pPopup->GetPopupMenu( pPopup->GetItemId( i ));
3111 if(pSubPopup)
3108 for(sal_uInt16 i = 0; i < pPopup->GetItemCount(); i++)
3109 {
3110 PopupMenu* pSubPopup = pPopup->GetPopupMenu( pPopup->GetItemId( i ));
3111 if(pSubPopup)
3112 {
3112 {
3113 lcl_DeleteSubPopups(pSubPopup);
3113 lcl_DeleteSubPopups(pSubPopup);
3114 delete pSubPopup;
3115 }
3114 delete pSubPopup;
3115 }
3116 }
3116 }
3117}
3118
3119void SvImpLBox::Command( const CommandEvent& rCEvt )
3120{
3121 sal_uInt16 nCommand = rCEvt.GetCommand();
3122
3117}
3118
3119void SvImpLBox::Command( const CommandEvent& rCEvt )
3120{
3121 sal_uInt16 nCommand = rCEvt.GetCommand();
3122
3123 if( nCommand == COMMAND_CONTEXTMENU )
3124 aEditTimer.Stop();
3123 if( nCommand == COMMAND_CONTEXTMENU )
3124 aEditTimer.Stop();
3125
3126 // Rollmaus-Event?
3127 if( ( ( nCommand == COMMAND_WHEEL ) || ( nCommand == COMMAND_STARTAUTOSCROLL ) || ( nCommand == COMMAND_AUTOSCROLL ) )
3128 && pView->HandleScrollCommand( rCEvt, &aHorSBar, &aVerSBar ) )
3129 return;
3130
3131 if( bContextMenuHandling && nCommand == COMMAND_CONTEXTMENU )
3132 {

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

3206 aPopupPos = Point( 0, 0 );
3207 }
3208
3209 PopupMenu* pPopup = pView->CreateContextMenu();
3210
3211 if( pPopup )
3212 {
3213 // do action for selected entry in popup menu
3125
3126 // Rollmaus-Event?
3127 if( ( ( nCommand == COMMAND_WHEEL ) || ( nCommand == COMMAND_STARTAUTOSCROLL ) || ( nCommand == COMMAND_AUTOSCROLL ) )
3128 && pView->HandleScrollCommand( rCEvt, &aHorSBar, &aVerSBar ) )
3129 return;
3130
3131 if( bContextMenuHandling && nCommand == COMMAND_CONTEXTMENU )
3132 {

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

3206 aPopupPos = Point( 0, 0 );
3207 }
3208
3209 PopupMenu* pPopup = pView->CreateContextMenu();
3210
3211 if( pPopup )
3212 {
3213 // do action for selected entry in popup menu
3214 sal_uInt16 nMenuAction = pPopup->Execute( pView, aPopupPos );
3215 if ( nMenuAction )
3216 pView->ExcecuteContextMenuAction( nMenuAction );
3217 lcl_DeleteSubPopups(pPopup);
3218 delete pPopup;
3214 sal_uInt16 nMenuAction = pPopup->Execute( pView, aPopupPos );
3215 if ( nMenuAction )
3216 pView->ExcecuteContextMenuAction( nMenuAction );
3217 lcl_DeleteSubPopups(pPopup);
3218 delete pPopup;
3219 }
3220 //added by BerryJia for fixing Bug102739 2002-9-9 17:00(Beijing Time)
3221 if( bClickedIsFreePlace )
3222 {
3223 while(!aSelRestore.empty())
3224 {
3225 SvLBoxEntry* pEntry = aSelRestore.top();
3226 //#i19717# the entry is maybe already deleted

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

3277void SvImpLBox::Invalidate()
3278{
3279 pView->SetClipRegion();
3280}
3281
3282void SvImpLBox::SetCurEntry( SvLBoxEntry* pEntry )
3283{
3284 if ( ( aSelEng.GetSelectionMode() != SINGLE_SELECTION )
3219 }
3220 //added by BerryJia for fixing Bug102739 2002-9-9 17:00(Beijing Time)
3221 if( bClickedIsFreePlace )
3222 {
3223 while(!aSelRestore.empty())
3224 {
3225 SvLBoxEntry* pEntry = aSelRestore.top();
3226 //#i19717# the entry is maybe already deleted

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

3277void SvImpLBox::Invalidate()
3278{
3279 pView->SetClipRegion();
3280}
3281
3282void SvImpLBox::SetCurEntry( SvLBoxEntry* pEntry )
3283{
3284 if ( ( aSelEng.GetSelectionMode() != SINGLE_SELECTION )
3285 && ( aSelEng.GetSelectionMode() != NO_SELECTION )
3286 )
3285 && ( aSelEng.GetSelectionMode() != NO_SELECTION )
3286 )
3287 SelAllDestrAnch( sal_False, sal_True, sal_False );
3287 SelAllDestrAnch( sal_False, sal_True, sal_False );
3288 if ( pEntry )
3289 MakeVisible( pEntry );
3288 if ( pEntry )
3289 MakeVisible( pEntry );
3290 SetCursor( pEntry );
3290 SetCursor( pEntry );
3291 if ( pEntry && ( aSelEng.GetSelectionMode() != NO_SELECTION ) )
3291 if ( pEntry && ( aSelEng.GetSelectionMode() != NO_SELECTION ) )
3292 pView->Select( pEntry, sal_True );
3293}
3294
3295IMPL_LINK( SvImpLBox, EditTimerCall, Timer *, EMPTYARG )
3296{
3297 if( pView->IsInplaceEditingEnabled() )
3298 {
3299 sal_Bool bIsMouseTriggered = aEditClickPos.X() >= 0;

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

3475 }
3476}
3477
3478void SvImpLBox::FindMostRight( SvLBoxEntry* pParent, SvLBoxEntry* pEntryToIgnore )
3479{
3480 if( !pParent )
3481 FindMostRight( pEntryToIgnore );
3482 else
3292 pView->Select( pEntry, sal_True );
3293}
3294
3295IMPL_LINK( SvImpLBox, EditTimerCall, Timer *, EMPTYARG )
3296{
3297 if( pView->IsInplaceEditingEnabled() )
3298 {
3299 sal_Bool bIsMouseTriggered = aEditClickPos.X() >= 0;

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

3475 }
3476}
3477
3478void SvImpLBox::FindMostRight( SvLBoxEntry* pParent, SvLBoxEntry* pEntryToIgnore )
3479{
3480 if( !pParent )
3481 FindMostRight( pEntryToIgnore );
3482 else
3483 FindMostRight_Impl( pParent, pEntryToIgnore );
3483 FindMostRight_Impl( pParent, pEntryToIgnore );
3484}
3485
3486void SvImpLBox::FindMostRight_Impl( SvLBoxEntry* pParent, SvLBoxEntry* pEntryToIgnore )
3487{
3488 SvTreeEntryList* pList = pTree->GetChildList( pParent );
3489
3490 if( !pList )
3491 return;

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

3630 return (pViewDataNewCur == 0) || pViewDataNewCur->IsSelectable();
3631 }
3632 else
3633 {
3634 return false;
3635 }
3636}
3637
3484}
3485
3486void SvImpLBox::FindMostRight_Impl( SvLBoxEntry* pParent, SvLBoxEntry* pEntryToIgnore )
3487{
3488 SvTreeEntryList* pList = pTree->GetChildList( pParent );
3489
3490 if( !pList )
3491 return;

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

3630 return (pViewDataNewCur == 0) || pViewDataNewCur->IsSelectable();
3631 }
3632 else
3633 {
3634 return false;
3635 }
3636}
3637
3638/* vim: set noet sw=4 ts=4: */