diff options
Diffstat (limited to 'svtools/source/contnr')
-rw-r--r-- | svtools/source/contnr/cont_pch.cxx | 41 | ||||
-rw-r--r-- | svtools/source/contnr/contentenumeration.cxx | 2 | ||||
-rw-r--r-- | svtools/source/contnr/fileview.cxx | 5 | ||||
-rw-r--r-- | svtools/source/contnr/imivctl.hxx | 2 | ||||
-rw-r--r-- | svtools/source/contnr/imivctl1.cxx | 2 | ||||
-rw-r--r-- | svtools/source/contnr/ivctrl.cxx | 5 | ||||
-rw-r--r-- | svtools/source/contnr/makefile.mk | 82 | ||||
-rw-r--r-- | svtools/source/contnr/svicnvw.cxx | 11 | ||||
-rw-r--r-- | svtools/source/contnr/svimpbox.cxx | 126 | ||||
-rw-r--r-- | svtools/source/contnr/svimpicn.cxx | 19 | ||||
-rw-r--r-- | svtools/source/contnr/svlbox.cxx | 73 | ||||
-rw-r--r-- | svtools/source/contnr/svtreebx.cxx | 41 | ||||
-rw-r--r-- | svtools/source/contnr/templwin.cxx | 19 | ||||
-rw-r--r-- | svtools/source/contnr/templwin.hxx | 4 | ||||
-rw-r--r-- | svtools/source/contnr/templwin.src | 2 | ||||
-rw-r--r-- | svtools/source/contnr/tooltiplbox.cxx | 2 |
16 files changed, 172 insertions, 264 deletions
diff --git a/svtools/source/contnr/cont_pch.cxx b/svtools/source/contnr/cont_pch.cxx deleted file mode 100644 index 4661a08162a2..000000000000 --- a/svtools/source/contnr/cont_pch.cxx +++ /dev/null @@ -1,41 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" - -#include <sv.hxx> -#include <svtools/treelist.hxx> -#include <svtools/svtabbx.hxx> -#include <svtools/svtreebx.hxx> -#include <svtools/svicnvw.hxx> -#include "svimpbox.hxx" -#include "svimpicn.hxx" -#include <svtools/svlbox.hxx> -#include <svtools/svlbitm.hxx> - - diff --git a/svtools/source/contnr/contentenumeration.cxx b/svtools/source/contnr/contentenumeration.cxx index 93f328ae2028..e3ba48180e9c 100644 --- a/svtools/source/contnr/contentenumeration.cxx +++ b/svtools/source/contnr/contentenumeration.cxx @@ -30,7 +30,7 @@ #include "contentenumeration.hxx" #include <svl/urlfilter.hxx> #include <svtools/inettbc.hxx> -#include "imagemgr.hxx" +#include <svtools/imagemgr.hxx> /** === begin UNO includes === **/ #include <com/sun/star/beans/XPropertySet.hpp> diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index b40ef436d8ab..accbbc84dcdd 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -28,12 +28,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svtools.hxx" -#include "fileview.hxx" +#include <svtools/fileview.hxx> #include <svtools/svtdata.hxx> -#include "imagemgr.hxx" +#include <svtools/imagemgr.hxx> #include <svtools/headbar.hxx> #include <svtools/svtabbx.hxx> - #include <svtools/svtools.hrc> #include "fileview.hrc" #include "contentenumeration.hxx" diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx index 82cfbe4595d5..81231925154c 100644 --- a/svtools/source/contnr/imivctl.hxx +++ b/svtools/source/contnr/imivctl.hxx @@ -41,7 +41,7 @@ #include <limits.h> -#include "ivctrl.hxx" +#include <svtools/ivctrl.hxx> #include <svl/svarray.hxx> class IcnCursor_Impl; diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index a6686f6013ab..1ba9419d48a3 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -40,7 +40,7 @@ #include <vcl/mnemonic.hxx> #include <vcl/controllayout.hxx> -#include "ivctrl.hxx" +#include <svtools/ivctrl.hxx> #include "imivctl.hxx" #include <svtools/svmedit.hxx> diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx index 5b542b75d0aa..d674712d9d23 100644 --- a/svtools/source/contnr/ivctrl.cxx +++ b/svtools/source/contnr/ivctrl.cxx @@ -28,10 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svtools.hxx" -#ifndef GCC -#endif - -#include "ivctrl.hxx" +#include <svtools/ivctrl.hxx> #include "imivctl.hxx" #include <vcl/bitmapex.hxx> #include <vcl/controllayout.hxx> diff --git a/svtools/source/contnr/makefile.mk b/svtools/source/contnr/makefile.mk deleted file mode 100644 index 232665c88c9c..000000000000 --- a/svtools/source/contnr/makefile.mk +++ /dev/null @@ -1,82 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=svtools -TARGET=svcontnr - -PROJECTPCH4DLL=TRUE -PROJECTPCH=cont_pch -PROJECTPCHSOURCE=cont_pch - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svt.pmk - -# --- Files -------------------------------------------------------- - -EXCEPTIONSFILES=\ - $(SLO)$/contentenumeration.obj \ - $(SLO)$/fileview.obj \ - $(SLO)$/svlbox.obj \ - $(SLO)$/svtabbx.obj \ - $(SLO)$/svimpbox.obj \ - $(SLO)$/templwin.obj - -SLOFILES= $(EXCEPTIONSFILES) \ - $(SLO)$/svicnvw.obj \ - $(SLO)$/svimpicn.obj \ - $(SLO)$/treelist.obj \ - $(SLO)$/svlbitm.obj \ - $(SLO)$/svtreebx.obj \ - $(SLO)$/imivctl1.obj \ - $(SLO)$/imivctl2.obj \ - $(SLO)$/ivctrl.obj \ - $(SLO)$/tooltiplbox.obj - -SRS1NAME=$(TARGET) -SRC1FILES =\ - fileview.src \ - templwin.src \ - svcontnr.src - -HXX1TARGET= svcontnr -HXX1EXT= hxx -HXX1FILES= $(PRJ)$/inc$/svlbox.hxx \ - $(PRJ)$/inc$/svlbitm.hxx \ - $(PRJ)$/inc$/svtreebx.hxx \ - $(PRJ)$/inc$/svicnvw.hxx \ - $(PRJ)$/inc$/svtabbx.hxx \ - $(PRJ)$/inc$/treelist.hxx -HXX1EXCL= -E:*include* - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - diff --git a/svtools/source/contnr/svicnvw.cxx b/svtools/source/contnr/svicnvw.cxx index 6b472465d400..f41c480e3c08 100644 --- a/svtools/source/contnr/svicnvw.cxx +++ b/svtools/source/contnr/svicnvw.cxx @@ -50,7 +50,6 @@ SvIcnVwDataEntry::~SvIcnVwDataEntry() SvIconView::SvIconView( Window* pParent, WinBits nWinStyle ) : SvLBox( pParent, nWinStyle | WB_BORDER ) { - nWinBits = nWinStyle; nIcnVwFlags = 0; pImp = new SvImpIconView( this, GetModel(), nWinStyle | WB_ICON ); pImp->mpViewData = 0; @@ -72,8 +71,6 @@ SvIconView::SvIconView( Window* pParent , const ResId& rResId ) : SetBackground( Wallpaper( rStyleSettings.GetFieldColor() ) ); SetDefaultFont(); pImp->SetSelectionMode( GetSelectionMode() ); - pImp->SetWindowBits( nWindowStyle ); - nWinBits = nWindowStyle; } SvIconView::~SvIconView() @@ -403,10 +400,11 @@ SvLBoxEntry* SvIconView::GetEntryFromLogicPos( const Point& rDocPos ) const } -void SvIconView::SetWindowBits( WinBits nWinStyle ) +void SvIconView::StateChanged( StateChangedType i_nStateChange ) { - nWinBits = nWinStyle; - pImp->SetWindowBits( nWinStyle ); + SvLBox::StateChanged( i_nStateChange ); + if ( i_nStateChange == STATE_CHANGE_STYLE ) + pImp->SetStyle( GetStyle() ); } void SvIconView::PaintEntry( SvLBoxEntry* pEntry ) @@ -469,6 +467,7 @@ void SvIconView::SelectAll( sal_Bool bSelect, sal_Bool ) void SvIconView::SetCurEntry( SvLBoxEntry* _pEntry ) { pImp->SetCursor( _pEntry ); + OnCurrentEntryChanged(); } SvLBoxEntry* SvIconView::GetCurEntry() const diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index 8336e29a8ff6..6a5aadfbbbf0 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -29,15 +29,10 @@ #include "precompiled_svtools.hxx" #include <vcl/svapp.hxx> #include <vcl/salnativewidgets.hxx> - -#ifndef _HELP_HXX #include <vcl/help.hxx> -#endif -#include <tabbar.hxx> +#include <svtools/tabbar.hxx> -#ifndef _STACK_ #include <stack> -#endif #define _SVTREEBX_CXX #include <svtools/svtreebx.hxx> @@ -45,15 +40,9 @@ #include <svimpbox.hxx> #include <rtl/instance.hxx> #include <svtools/svtdata.hxx> - -#ifndef _SVTOOLS_HRC +#include <tools/wintypes.hxx> #include <svtools/svtools.hrc> -#endif - -// #102891# -------------------- -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> -#endif #define NODE_BMP_TABDIST_NOTVALID -2000000 #define FIRST_ENTRY_TAB 1 @@ -83,7 +72,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n pTree = pLBTree; aSelEng.SetFunctionSet( (FunctionSet*)&aFctSet ); aSelEng.ExpandSelectionOnMouseMove( sal_False ); - SetWindowBits( nWinStyle ); + SetStyle( nWinStyle ); SetSelectionMode( SINGLE_SELECTION ); SetDragDropMode( 0 ); @@ -253,10 +242,10 @@ void SvImpLBox::CalcCellFocusRect( SvLBoxEntry* pEntry, Rectangle& rRect ) } } -void SvImpLBox::SetWindowBits( WinBits nWinStyle ) +void SvImpLBox::SetStyle( WinBits i_nWinStyle ) { - nWinBits = nWinStyle; - if((nWinStyle & WB_SIMPLEMODE) && aSelEng.GetSelectionMode()==MULTIPLE_SELECTION) + m_nStyle = i_nWinStyle; + if ( ( m_nStyle & WB_SIMPLEMODE) && ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION ) ) aSelEng.AddAlways( sal_True ); } @@ -683,6 +672,8 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect ) } } nFlags &= (~F_DESEL_ALL); + + pView->OnCurrentEntryChanged(); } void SvImpLBox::ShowCursor( sal_Bool bShow ) @@ -952,7 +943,7 @@ void SvImpLBox::Paint( const Rectangle& rRect ) // erst die Linien Zeichnen, dann clippen! pView->SetClipRegion(); - if( nWinBits & ( WB_HASLINES | WB_HASLINESATROOT ) ) + if( m_nStyle & ( WB_HASLINES | WB_HASLINESATROOT ) ) DrawNet(); pView->SetClipRegion( aClipRegion ); @@ -969,7 +960,7 @@ void SvImpLBox::Paint( const Rectangle& rRect ) { // do not select if multiselection or explicit set sal_Bool bNotSelect = ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION ) - || ( ( nWinBits & WB_NOINITIALSELECTION ) == WB_NOINITIALSELECTION ); + || ( ( m_nStyle & WB_NOINITIALSELECTION ) == WB_NOINITIALSELECTION ); SetCursor( pStartEntry, bNotSelect ); } @@ -994,7 +985,7 @@ void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop ) if( bInView && (!bMoveToTop || pStartEntry == pEntry) ) return; // ist schon sichtbar - if( pStartEntry || (nWinBits & WB_FORCE_MAKEVISIBLE) ) + if( pStartEntry || (m_nStyle & WB_FORCE_MAKEVISIBLE) ) nFlags &= (~F_FILLING); if( !bInView ) { @@ -1132,7 +1123,7 @@ void SvImpLBox::DrawNet() pView->DrawLine( aPos1, aPos2 ); } // Sichtbar im Control ? - if( n>= nOffs && ((nWinBits & WB_HASLINESATROOT) || !pTree->IsAtRootDepth(pEntry))) + if( n>= nOffs && ((m_nStyle & WB_HASLINESATROOT) || !pTree->IsAtRootDepth(pEntry))) { // kann aPos1 recyclet werden ? if( !pView->IsExpanded(pEntry) ) @@ -1154,7 +1145,7 @@ void SvImpLBox::DrawNet() nY += nEntryHeight; pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry )); } - if( nWinBits & WB_HASLINESATROOT ) + if( m_nStyle & WB_HASLINESATROOT ) { pEntry = pView->First(); aPos1.X() = pView->GetTabPos( pEntry, pFirstDynamicTab); @@ -1248,7 +1239,8 @@ sal_uInt16 SvImpLBox::AdjustScrollBars( Size& rSize ) Size aOSize( pView->Control::GetOutputSizePixel() ); - sal_Bool bVerSBar = ( pView->nWindowStyle & WB_VSCROLL ) != 0; + const WinBits nWindowStyle = pView->GetStyle(); + sal_Bool bVerSBar = ( nWindowStyle & WB_VSCROLL ) != 0; sal_Bool bHorBar = sal_False; long nMaxRight = aOSize.Width(); //GetOutputSize().Width(); Point aOrigin( pView->GetMapMode().GetOrigin() ); @@ -1256,7 +1248,7 @@ sal_uInt16 SvImpLBox::AdjustScrollBars( Size& rSize ) nMaxRight += aOrigin.X() - 1; long nVis = nMostRight - aOrigin.X(); if( pTabBar || ( - (pView->nWindowStyle & WB_HSCROLL) && + (nWindowStyle & WB_HSCROLL) && (nVis < nMostRight || nMaxRight < nMostRight) )) bHorBar = sal_True; @@ -1274,7 +1266,7 @@ sal_uInt16 SvImpLBox::AdjustScrollBars( Size& rSize ) nMaxRight -= nVerSBarWidth; if( !bHorBar ) { - if( (pView->nWindowStyle & WB_HSCROLL) && + if( (nWindowStyle & WB_HSCROLL) && (nVis < nMostRight || nMaxRight < nMostRight) ) bHorBar = sal_True; } @@ -1439,7 +1431,7 @@ void SvImpLBox::FillView() void SvImpLBox::ShowVerSBar() { - sal_Bool bVerBar = ( pView->nWindowStyle & WB_VSCROLL ) != 0; + sal_Bool bVerBar = ( pView->GetStyle() & WB_VSCROLL ) != 0; sal_uIntPtr nVis = 0; if( !bVerBar ) nVis = pView->GetVisibleCount(); @@ -1681,7 +1673,7 @@ void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, sal_Bool bSelect ) return; /* - if( (nWinBits & WB_HIDESELECTION) && pEntry && !pView->HasFocus() ) + if( (m_nStyle & WB_HIDESELECTION) && pEntry && !pView->HasFocus() ) { SvViewData* pViewData = pView->GetViewData( pEntry ); pViewData->SetCursored( bSelect ); @@ -1943,7 +1935,7 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry ) // die Linien invalidieren /* if( (bEntryVisible || bPrevEntryVisible) && - (nWinBits & ( WB_HASLINES | WB_HASLINESATROOT )) ) + (m_nStyle & ( WB_HASLINES | WB_HASLINESATROOT )) ) { SvLBoxTab* pTab = pView->GetFirstDynamicTab(); if( pTab ) @@ -2265,6 +2257,7 @@ sal_Bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) SvLBoxEntry* pNewCursor; + const WinBits nWindowStyle = pView->GetStyle(); switch( aCode ) { case KEY_UP: @@ -2348,7 +2341,7 @@ sal_Bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor ); } } - else if( pView->nWindowStyle & WB_HSCROLL ) + else if( nWindowStyle & WB_HSCROLL ) { long nThumb = aHorSBar.GetThumbPos(); nThumb += aHorSBar.GetLineSize(); @@ -2379,7 +2372,7 @@ sal_Bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor ); } } - else if ( pView->nWindowStyle & WB_HSCROLL ) + else if ( nWindowStyle & WB_HSCROLL ) { long nThumb = aHorSBar.GetThumbPos(); nThumb -= aHorSBar.GetLineSize(); @@ -2481,13 +2474,17 @@ sal_Bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) else if ( !bShift /*&& !bMod1*/ ) { if ( aSelEng.IsAddMode() ) + { // toggle selection pView->Select( pCursor, !pView->IsSelected( pCursor ) ); - else + } + else if ( !pView->IsSelected( pCursor ) ) { SelAllDestrAnch( sal_False ); pView->Select( pCursor, sal_True ); } + else + bKeyUsed = sal_False; } else bKeyUsed = sal_False; @@ -2520,7 +2517,7 @@ sal_Bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) case KEY_F8: if( bShift && pView->GetSelectionMode()==MULTIPLE_SELECTION && - !(nWinBits & WB_SIMPLEMODE)) + !(m_nStyle & WB_SIMPLEMODE)) { if( aSelEng.IsAlwaysAdding() ) aSelEng.AddAlways( sal_False ); @@ -2568,8 +2565,8 @@ sal_Bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) case KEY_A: if( bMod1 ) SelAllDestrAnch( sal_True ); -// else -// bKeyUsed = sal_False; #105907# assume user wants to use quicksearch with key "a", so key is handled! + else + bKeyUsed = sal_False; break; case KEY_SUBTRACT: @@ -2680,10 +2677,15 @@ sal_Bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) break; default: - if( bMod1 || rKeyCode.GetGroup() == KEYGROUP_FKEYS ) - // #105907# CTRL or Function key is pressed, assume user don't want to use quicksearch... - // if there are groups of keys which should not be handled, they can be added here - bKeyUsed = sal_False; + // is there any reason why we should eat the events here? The only place where this is called + // is from SvTreeListBox::KeyInput. If we set bKeyUsed to sal_True here, then the key input + // is just silenced. However, we want SvLBox::KeyInput to get a chance, to do the QuickSelection + // handling. + // (The old code here which intentionally set bKeyUsed to TRUE said this was because of "quick search" + // handling, but actually there was no quick search handling anymore. We just re-implemented it.) + // #i31275# / 2009-06-16 / frank.schoenheit@sun.com + bKeyUsed = sal_False; + break; } return bKeyUsed; } @@ -2698,7 +2700,7 @@ void __EXPORT SvImpLBox::GetFocus() // if( bSimpleTravel && !pView->IsSelected(pCursor) ) // pView->Select( pCursor, sal_True ); } - if( nWinBits & WB_HIDESELECTION ) + if( m_nStyle & WB_HIDESELECTION ) { SvLBoxEntry* pEntry = pView->FirstSelected(); while( pEntry ) @@ -2731,7 +2733,7 @@ void __EXPORT SvImpLBox::LoseFocus() pView->SetEntryFocus( pCursor,sal_False ); ShowCursor( sal_False ); - if( nWinBits & WB_HIDESELECTION ) + if( m_nStyle & WB_HIDESELECTION ) { SvLBoxEntry* pEntry = pView->FirstSelected(); while( pEntry ) @@ -3029,7 +3031,7 @@ void SvImpLBox::SetSelectionMode( SelectionMode eSelMode ) bSimpleTravel = sal_True; else bSimpleTravel = sal_False; - if( (nWinBits & WB_SIMPLEMODE) && (eSelMode == MULTIPLE_SELECTION) ) + if( (m_nStyle & WB_SIMPLEMODE) && (eSelMode == MULTIPLE_SELECTION) ) aSelEng.AddAlways( sal_True ); } @@ -3107,7 +3109,7 @@ void lcl_DeleteSubPopups(PopupMenu* pPopup) } } -bool SvImpLBox::Command( const CommandEvent& rCEvt ) +void SvImpLBox::Command( const CommandEvent& rCEvt ) { sal_uInt16 nCommand = rCEvt.GetCommand(); @@ -3115,22 +3117,9 @@ bool SvImpLBox::Command( const CommandEvent& rCEvt ) aEditTimer.Stop(); // Rollmaus-Event? - if ( ( ( nCommand == COMMAND_WHEEL ) - || ( nCommand == COMMAND_STARTAUTOSCROLL ) - || ( nCommand == COMMAND_AUTOSCROLL ) - ) - && pView->HandleScrollCommand( rCEvt, &aHorSBar, &aVerSBar ) - ) - { - return true; - } - - if ( ( nCommand == COMMAND_CONTEXTMENU ) - && !bContextMenuHandling - ) - { - return false; - } + if( ( ( nCommand == COMMAND_WHEEL ) || ( nCommand == COMMAND_STARTAUTOSCROLL ) || ( nCommand == COMMAND_AUTOSCROLL ) ) + && pView->HandleScrollCommand( rCEvt, &aHorSBar, &aVerSBar ) ) + return; if( bContextMenuHandling && nCommand == COMMAND_CONTEXTMENU ) { @@ -3179,6 +3168,8 @@ bool SvImpLBox::Command( const CommandEvent& rCEvt ) { // deselect all pView->SelectAll( sal_False ); } + + } else { // key event (or at least no mouse event) @@ -3238,18 +3229,15 @@ bool SvImpLBox::Command( const CommandEvent& rCEvt ) aSelRestore.pop(); } } - return true; } - - const Point& rPos = rCEvt.GetMousePosPixel(); - if( rPos.X() < aOutputSize.Width() && rPos.Y() < aOutputSize.Height() ) - aSelEng.Command( rCEvt ); - - // strictly, this is not correct. However, it leads to a behavior compatible to the one at the time - // when this method did have a void return value ... - // A proper solution would be to give the EditEngine::Command also a boolean return value, and forward - // this (or false) to our caller - return true; +#ifndef NOCOMMAND + else + { + const Point& rPos = rCEvt.GetMousePosPixel(); + if( rPos.X() < aOutputSize.Width() && rPos.Y() < aOutputSize.Height() ) + aSelEng.Command( rCEvt ); + } +#endif } void SvImpLBox::BeginScroll() diff --git a/svtools/source/contnr/svimpicn.cxx b/svtools/source/contnr/svimpicn.cxx index 89f94bd531d4..4b9d82f59172 100644 --- a/svtools/source/contnr/svimpicn.cxx +++ b/svtools/source/contnr/svimpicn.cxx @@ -708,7 +708,7 @@ public: SvImpIconView::SvImpIconView( SvIconView* pCurView, SvLBoxTreeList* pTree, - WinBits nWinStyle ) : + WinBits i_nWinStyle ) : aVerSBar( pCurView, WB_DRAG | WB_VSCROLL ), aHorSBar( pCurView, WB_DRAG | WB_HSCROLL ) { @@ -716,7 +716,7 @@ SvImpIconView::SvImpIconView( SvIconView* pCurView, SvLBoxTreeList* pTree, pModel = pTree; pCurParent = 0; pZOrderList = new SvPtrarr; - SetWindowBits( nWinStyle ); + SetStyle( i_nWinStyle ); nHorDist = 0; nVerDist = 0; nFlags = 0; @@ -785,13 +785,12 @@ void SvImpIconView::Clear( sal_Bool bInCtor ) AdjustScrollBars(); } -void SvImpIconView::SetWindowBits( WinBits nWinStyle ) +void SvImpIconView::SetStyle( const WinBits i_nWinStyle ) { - nWinBits = nWinStyle; nViewMode = VIEWMODE_TEXT; - if( nWinStyle & WB_NAME ) + if( i_nWinStyle & WB_NAME ) nViewMode = VIEWMODE_NAME; - if( nWinStyle & WB_ICON ) + if( i_nWinStyle & WB_ICON ) nViewMode = VIEWMODE_ICON; } @@ -1754,8 +1753,8 @@ void SvImpIconView::AdjustScrollBars() else nVisibleHeight = nRealHeight; - bool bVerSBar = (pView->nWindowStyle & WB_VSCROLL) ? true : false; - bool bHorSBar = (pView->nWindowStyle & WB_HSCROLL) ? true : false; + bool bVerSBar = (pView->GetStyle() & WB_VSCROLL) ? true : false; + bool bHorSBar = (pView->GetStyle() & WB_HSCROLL) ? true : false; sal_uInt16 nResult = 0; if( nVirtHeight ) @@ -1903,7 +1902,7 @@ sal_Bool SvImpIconView::CheckHorScrollBar() return sal_False; const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); - if(!(pView->nWindowStyle & WB_HSCROLL) && !aOrigin.X() ) + if(!(pView->GetStyle() & WB_HSCROLL) && !aOrigin.X() ) { long nWidth = aOutputSize.Width(); sal_uInt16 nCount = pZOrderList->Count(); @@ -1941,7 +1940,7 @@ sal_Bool SvImpIconView::CheckVerScrollBar() return sal_False; const MapMode& rMapMode = pView->GetMapMode(); Point aOrigin( rMapMode.GetOrigin() ); - if(!(pView->nWindowStyle & WB_VSCROLL) && !aOrigin.Y() ) + if(!(pView->GetStyle() & WB_VSCROLL) && !aOrigin.Y() ) { long nDeepest = 0; long nHeight = aOutputSize.Height(); diff --git a/svtools/source/contnr/svlbox.cxx b/svtools/source/contnr/svlbox.cxx index 494bcfe28ad5..2074d41e248d 100644 --- a/svtools/source/contnr/svlbox.cxx +++ b/svtools/source/contnr/svlbox.cxx @@ -685,6 +685,7 @@ SvLBox_Impl::SvLBox_Impl( SvLBox& _rBox ) ,m_bEntryMnemonicsEnabled( false ) ,m_pLink( NULL ) ,m_aMnemonicEngine( _rBox ) + ,m_aQuickSelectionEngine( _rBox ) { } @@ -699,7 +700,6 @@ SvLBox::SvLBox( Window* pParent, WinBits nWinStyle ) : DropTargetHelper( this ), DragSourceHelper( this ), eSelMode( NO_SELECTION ) { DBG_CTOR(SvLBox,0); - nWindowStyle = nWinStyle; nDragOptions = DND_ACTION_COPYMOVE | DND_ACTION_LINK; nImpFlags = 0; pTargetEntry = 0; @@ -724,7 +724,6 @@ SvLBox::SvLBox( Window* pParent, const ResId& rResId ) : DBG_CTOR(SvLBox,0); pTargetEntry = 0; nImpFlags = 0; - nWindowStyle = 0; pLBoxImpl = new SvLBox_Impl( *this ); nDragOptions = DND_ACTION_COPYMOVE | DND_ACTION_LINK; nDragDropMode = 0; @@ -1251,6 +1250,12 @@ sal_uIntPtr SvLBox::SelectChilds( SvLBoxEntry* , sal_Bool ) return 0; } +void SvLBox::OnCurrentEntryChanged() +{ + if ( !pLBoxImpl->m_bDoingQuickSelection ) + pLBoxImpl->m_aQuickSelectionEngine.Reset(); +} + void SvLBox::SelectAll( sal_Bool /* bSelect */ , sal_Bool /* bPaint */ ) { DBG_CHKTHIS(SvLBox,0); @@ -1535,15 +1540,14 @@ void SvLBox::KeyInput( const KeyEvent& rKEvt ) Control::KeyInput( rKEvt ); } -const void* SvLBox::FirstSearchEntry( String& _rEntryText ) +const void* SvLBox::FirstSearchEntry( String& _rEntryText ) const { SvLBoxEntry* pEntry = GetCurEntry(); if ( pEntry ) pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( NextSearchEntry( pEntry, _rEntryText ) ) ); else { - if ( !pEntry ) - pEntry = FirstSelected(); + pEntry = FirstSelected(); if ( !pEntry ) pEntry = First(); } @@ -1554,11 +1558,23 @@ const void* SvLBox::FirstSearchEntry( String& _rEntryText ) return pEntry; } -const void* SvLBox::NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) +const void* SvLBox::NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const { SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pCurrentSearchEntry ) ); - pEntry = Next( pEntry ); + if ( ( ( GetChildCount( pEntry ) > 0 ) + || ( pEntry->HasChildsOnDemand() ) + ) + && !IsExpanded( pEntry ) + ) + { + pEntry = NextSibling( pEntry ); + } + else + { + pEntry = Next( pEntry ); + } + if ( !pEntry ) pEntry = First(); @@ -1572,7 +1588,7 @@ void SvLBox::SelectSearchEntry( const void* _pEntry ) { SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pEntry ) ); DBG_ASSERT( pEntry, "SvLBox::SelectSearchEntry: invalid entry!" ); - if ( pEntry ) + if ( !pEntry ) return; SelectAll( sal_False ); @@ -1580,17 +1596,50 @@ void SvLBox::SelectSearchEntry( const void* _pEntry ) Select( pEntry ); } -void SvLBox::ExecuteSearchEntry( const void* /*_pEntry*/ ) +void SvLBox::ExecuteSearchEntry( const void* /*_pEntry*/ ) const { // nothing to do here, we have no "execution" } +::vcl::StringEntryIdentifier SvLBox::CurrentEntry( String& _out_entryText ) const +{ + // always accept the current entry if there is one + SvLBoxEntry* pCurrentEntry( GetCurEntry() ); + if ( pCurrentEntry ) + { + _out_entryText = GetEntryText( pCurrentEntry ); + return pCurrentEntry; + } + return FirstSearchEntry( _out_entryText ); +} + +::vcl::StringEntryIdentifier SvLBox::NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const +{ + return NextSearchEntry( _currentEntry, _out_entryText ); +} + +void SvLBox::SelectEntry( ::vcl::StringEntryIdentifier _entry ) +{ + SelectSearchEntry( _entry ); +} + bool SvLBox::HandleKeyInput( const KeyEvent& _rKEvt ) { - if ( !IsEntryMnemonicsEnabled() ) - return false; + if ( IsEntryMnemonicsEnabled() + && pLBoxImpl->m_aMnemonicEngine.HandleKeyEvent( _rKEvt ) + ) + return true; + + if ( ( GetStyle() & WB_QUICK_SEARCH ) != 0 ) + { + pLBoxImpl->m_bDoingQuickSelection = true; + const bool bHandled = pLBoxImpl->m_aQuickSelectionEngine.HandleKeyEvent( _rKEvt ); + pLBoxImpl->m_bDoingQuickSelection = false; + if ( bHandled ) + return true; + } - return pLBoxImpl->m_aMnemonicEngine.HandleKeyEvent( _rKEvt ); + return false; } SvLBoxEntry* SvLBox::GetEntry( const Point&, sal_Bool ) const diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index ac4ca35a67ac..0e66c425825e 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -65,10 +65,10 @@ DBG_NAME(SvTreeListBox) #define SV_LBOX_DEFAULT_INDENT_PIXEL 20 SvTreeListBox::SvTreeListBox( Window* pParent, WinBits nWinStyle ) - : SvLBox(pParent,nWinStyle ) + : SvLBox( pParent, nWinStyle ) { DBG_CTOR(SvTreeListBox,0); - InitTreeView( nWinStyle ); + InitTreeView(); SetSublistOpenWithLeftRight(); } @@ -78,13 +78,13 @@ SvTreeListBox::SvTreeListBox( Window* pParent , const ResId& rResId ) { DBG_CTOR(SvTreeListBox,0); - InitTreeView( 0 ); + InitTreeView(); Resize(); SetSublistOpenWithLeftRight(); } -void SvTreeListBox::InitTreeView( WinBits nWinStyle ) +void SvTreeListBox::InitTreeView() { DBG_CHKTHIS(SvTreeListBox,0); pCheckButtonData = NULL; @@ -102,7 +102,7 @@ void SvTreeListBox::InitTreeView( WinBits nWinStyle ) nTreeFlags = TREEFLAG_RECALCTABS; nIndent = SV_LBOX_DEFAULT_INDENT_PIXEL; nEntryHeightOffs = SV_ENTRYHEIGHTOFFS_PIXEL; - pImp = new SvImpLBox( this, GetModel(), nWinStyle ); + pImp = new SvImpLBox( this, GetModel(), GetStyle() ); aContextBmpMode = SVLISTENTRYFLAG_EXPANDED; nContextBmpWidthMax = 0; @@ -110,7 +110,7 @@ void SvTreeListBox::InitTreeView( WinBits nWinStyle ) SetSpaceBetweenEntries( 0 ); SetLineColor(); InitSettings( sal_True, sal_True, sal_True ); - SetWindowBits( nWinStyle ); + ImplInitStyle(); SetTabs(); } @@ -227,8 +227,9 @@ void SvTreeListBox::SetTabs() EndEditing( sal_True ); nTreeFlags &= (~TREEFLAG_RECALCTABS); nFocusWidth = -1; - sal_Bool bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0; - sal_Bool bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT | + const WinBits nStyle( GetStyle() ); + sal_Bool bHasButtons = (nStyle & WB_HASBUTTONS)!=0; + sal_Bool bHasButtonsAtRoot = (nStyle & (WB_HASLINESATROOT | WB_HASBUTTONSATROOT))!=0; long nStartPos = TAB_STARTPOS; long nNodeWidthPixel = GetExpandedNodeBmp().GetSizePixel().Width(); @@ -1492,12 +1493,14 @@ SvLBoxEntry* SvTreeListBox::GetCurEntry() const return pImp->GetCurEntry(); } -void SvTreeListBox::SetWindowBits( WinBits nWinStyle ) +void SvTreeListBox::ImplInitStyle() { DBG_CHKTHIS(SvTreeListBox,0); - nWindowStyle = nWinStyle; + + const WinBits nWindowStyle = GetStyle(); + nTreeFlags |= TREEFLAG_RECALCTABS; - if( nWinStyle & WB_SORT ) + if( nWindowStyle & WB_SORT ) { GetModel()->SetSortMode( SortAscending ); GetModel()->SetCompareHdl( LINK(this,SvTreeListBox,DefaultCompare)); @@ -1508,9 +1511,9 @@ void SvTreeListBox::SetWindowBits( WinBits nWinStyle ) GetModel()->SetCompareHdl( Link() ); } #ifdef OS2 - nWinStyle |= WB_VSCROLL; + nWindowStyle |= WB_VSCROLL; #endif - pImp->SetWindowBits( nWinStyle ); + pImp->SetStyle( nWindowStyle ); pImp->Resize(); Invalidate(); } @@ -1578,8 +1581,9 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFl sal_Bool bInUse = pEntry->HasInUseEmphasis(); // wenn eine ClipRegion von aussen gesetzt wird, dann // diese nicht zuruecksetzen - sal_Bool bResetClipRegion = !bHasClipRegion; - sal_Bool bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0; + const WinBits nWindowStyle = GetStyle(); + const sal_Bool bResetClipRegion = !bHasClipRegion; + const sal_Bool bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0; const StyleSettings& rSettings = GetSettings().GetStyleSettings(); Font aHighlightFont( GetFont() ); @@ -2229,8 +2233,8 @@ Region SvTreeListBox::GetDragRegion() const void SvTreeListBox::Command( const CommandEvent& rCEvt ) { DBG_CHKTHIS(SvTreeListBox,0); - if ( !pImp->Command( rCEvt ) ) - SvLBox::Command( rCEvt ); + // FIXME gnumake2 resync to DEV300_m84 + pImp->Command( rCEvt ); } @@ -2367,6 +2371,7 @@ void SvTreeListBox::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry long SvTreeListBox::GetTextOffset() const { DBG_CHKTHIS(SvTreeListBox,0); + const WinBits nWindowStyle = GetStyle(); sal_Bool bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0; sal_Bool bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT | WB_HASBUTTONSATROOT))!=0; @@ -2519,6 +2524,8 @@ void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt ) void SvTreeListBox::StateChanged( StateChangedType i_nStateChange ) { SvLBox::StateChanged( i_nStateChange ); + if ( i_nStateChange == STATE_CHANGE_STYLE ) + ImplInitStyle(); } void SvTreeListBox::InitSettings(sal_Bool bFont,sal_Bool bForeground,sal_Bool bBackground) diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx index fc39b771bf92..82514405cbdd 100644 --- a/svtools/source/contnr/templwin.cxx +++ b/svtools/source/contnr/templwin.cxx @@ -28,31 +28,24 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svtools.hxx" #include "templwin.hxx" -#include "templdlg.hxx" +#include <svtools/templdlg.hxx> #include <svtools/svtdata.hxx> #include <unotools/pathoptions.hxx> #include <unotools/dynamicmenuoptions.hxx> #include <unotools/extendedsecurityoptions.hxx> #include <svtools/xtextedt.hxx> #include <svl/inettype.hxx> -#include "imagemgr.hxx" +#include <svtools/imagemgr.hxx> #include <svtools/miscopt.hxx> -#include "templatefoldercache.hxx" -#include "imgdef.hxx" -#include "txtattr.hxx" -#ifndef _SVTOOLS_HRC +#include <svtools/templatefoldercache.hxx> +#include <svtools/imgdef.hxx> +#include <svtools/txtattr.hxx> #include <svtools/svtools.hrc> -#endif -#ifndef _SVTOOLS_TEMPLWIN_HRC #include "templwin.hrc" -#endif -#ifndef _SVT_HELPID_HRC #include <svtools/helpid.hrc> -#endif #include <unotools/pathoptions.hxx> #include <unotools/viewoptions.hxx> #include <unotools/ucbhelper.hxx> - #include "unotools/configmgr.hxx" #include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -87,7 +80,7 @@ #include <vcl/svapp.hxx> #include <vcl/split.hxx> #include <vcl/msgbox.hxx> -#include "DocumentInfoPreview.hxx" +#include <svtools/DocumentInfoPreview.hxx> #include <vcl/mnemonic.hxx> #include <ucbhelper/content.hxx> diff --git a/svtools/source/contnr/templwin.hxx b/svtools/source/contnr/templwin.hxx index 42969f3ad99f..0bab9d2a6546 100644 --- a/svtools/source/contnr/templwin.hxx +++ b/svtools/source/contnr/templwin.hxx @@ -32,8 +32,8 @@ #include <vcl/toolbox.hxx> #include <vcl/window.hxx> #include <svtools/headbar.hxx> -#include "fileview.hxx" -#include "ivctrl.hxx" +#include <svtools/fileview.hxx> +#include <svtools/ivctrl.hxx> #include <svtools/svmedit2.hxx> #include <svl/restrictedpaths.hxx> #include <com/sun/star/frame/XDispatch.hpp> diff --git a/svtools/source/contnr/templwin.src b/svtools/source/contnr/templwin.src index 45f9803539a1..113e20c34f28 100644 --- a/svtools/source/contnr/templwin.src +++ b/svtools/source/contnr/templwin.src @@ -28,7 +28,7 @@ // includes ------------------------------------------------------------------ #include "templwin.hrc" -#include "controldims.hrc" +#include <svtools/controldims.hrc> #include <svtools/helpid.hrc> #include <svtools/svtools.hrc> diff --git a/svtools/source/contnr/tooltiplbox.cxx b/svtools/source/contnr/tooltiplbox.cxx index 6aae495bd504..69073a0793c5 100644 --- a/svtools/source/contnr/tooltiplbox.cxx +++ b/svtools/source/contnr/tooltiplbox.cxx @@ -27,7 +27,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svtools.hxx" -#include "tooltiplbox.hxx" +#include <svtools/tooltiplbox.hxx> #include <vcl/help.hxx> // ============================================================================ |