diff options
-rw-r--r-- | vcl/source/window/floatwin.cxx | 9 | ||||
-rw-r--r-- | vcl/source/window/toolbox.cxx | 14 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 10 |
3 files changed, 26 insertions, 7 deletions
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 885e12d6b411..564db67cdd93 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -2,9 +2,9 @@ * * $RCSfile: floatwin.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: pl $ $Date: 2002-01-15 18:51:12 $ + * last change: $Author: ssa $ $Date: 2002-03-04 17:07:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -227,6 +227,11 @@ void FloatingWindow::ImplLoadRes( const ResId& rResId ) FloatingWindow::~FloatingWindow() { + if( mbPopupModeCanceled ) + // indicates that ESC key was pressed + // will be handled in Window::ImplGrabFocus() + SetDialogControlFlags( GetDialogControlFlags() | WINDOW_DLGCTRL_FLOATWIN_POPUPMODEEND_CANCEL ); + if ( IsInPopupMode() ) EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL | FLOATWIN_POPUPMODEEND_DONTCALLHDL ); diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index e4219e251754..b3f4f423ae79 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -2,9 +2,9 @@ * * $RCSfile: toolbox.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: ssa $ $Date: 2002-02-28 18:40:42 $ + * last change: $Author: ssa $ $Date: 2002-03-04 17:07:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1372,6 +1372,7 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle ) meAlign = WINDOWALIGN_TOP; meLastStyle = POINTER_ARROW; mnWinStyle = nStyle; + mnLastFocusItemId = 0; maTimer.SetTimeoutHdl( LINK( this, ToolBox, ImplUpdateHdl ) ); @@ -3836,11 +3837,17 @@ long ToolBox::Notify( NotifyEvent& rNEvt ) if( rNEvt.GetWindow() == this ) { // the toolbar itself got the focus - if( (GetGetFocusFlags() & (GETFOCUS_BACKWARD|GETFOCUS_TAB) ) == (GETFOCUS_BACKWARD|GETFOCUS_TAB)) + if( (GetGetFocusFlags() & GETFOCUS_FLOATWIN_POPUPMODEEND_CANCEL) && mnLastFocusItemId != 0 ) + // restore last item + ImplChangeHighlight( ImplGetItem( mnLastFocusItemId ) ); + else if( (GetGetFocusFlags() & (GETFOCUS_BACKWARD|GETFOCUS_TAB) ) == (GETFOCUS_BACKWARD|GETFOCUS_TAB)) // Shift-TAB was pressed in the parent ImplChangeHighlightUpDn( FALSE ); else ImplChangeHighlightUpDn( TRUE ); + + mnLastFocusItemId = 0; + return true; } else @@ -4406,6 +4413,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt ) } mnDownItemId = mnCurItemId = mnHighItemId; + mnLastFocusItemId = mnCurItemId; // save item id for possible later focus restore ImplToolItem* pItem = ImplGetItem( mnHighItemId ); mbDummy1_Shift = TRUE; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 4b7486ad57c9..2233f17e62ae 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -2,9 +2,9 @@ * * $RCSfile: window.cxx,v $ * - * $Revision: 1.61 $ + * $Revision: 1.62 $ * - * last change: $Author: mt $ $Date: 2002-02-25 16:30:39 $ + * last change: $Author: ssa $ $Date: 2002-03-04 17:09:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -3866,6 +3866,12 @@ void Window::ImplGrabFocus( USHORT nFlags ) mpCursor->ImplShow(); mbInFocusHdl = TRUE; mnGetFocusFlags = nFlags; + // if we're changing focus due to closing a popup floating window + // notify the new focus window so it can restore the inner focus + // eg, toolboxes can select their recent active item + if( pOldFocusWindow && + ( pOldFocusWindow->GetDialogControlFlags() & WINDOW_DLGCTRL_FLOATWIN_POPUPMODEEND_CANCEL ) ) + mnGetFocusFlags |= GETFOCUS_FLOATWIN_POPUPMODEEND_CANCEL; NotifyEvent aNEvt( EVENT_GETFOCUS, this ); if ( !ImplCallPreNotify( aNEvt ) ) GetFocus(); |