diff options
author | Kurt Zenker <kz@openoffice.org> | 2011-04-13 17:46:26 +0200 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2011-04-13 17:46:26 +0200 |
commit | adb0b56e22c794b7f63ee19f4503cb38032e82d7 (patch) | |
tree | 6c0d371fad6b1ecbf287716401724f2e2ea09841 /vcl | |
parent | 9e84958536c737f8fdcff4d28664d0c13b9cdc8c (diff) | |
parent | 89ee82b47aa1bce8cf23c16049e990588172a820 (diff) |
CWS-TOOLING: integrate CWS gridfixes_OOO340
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/vcl/ctrl.hxx | 6 | ||||
-rw-r--r-- | vcl/inc/vcl/help.hxx | 24 | ||||
-rw-r--r--[-rwxr-xr-x] | vcl/inc/vcl/window.hxx | 1 | ||||
-rw-r--r-- | vcl/source/app/help.cxx | 10 | ||||
-rw-r--r-- | vcl/source/control/ctrl.cxx | 10 |
5 files changed, 35 insertions, 16 deletions
diff --git a/vcl/inc/vcl/ctrl.hxx b/vcl/inc/vcl/ctrl.hxx index 3bf529ada48b..88a4e1f08362 100644 --- a/vcl/inc/vcl/ctrl.hxx +++ b/vcl/inc/vcl/ctrl.hxx @@ -47,7 +47,7 @@ protected: ::vcl::ImplControlData* mpControlData; private: - sal_Bool mbHasFocus; + bool mbHasControlFocus; Link maGetFocusHdl; Link maLoseFocusHdl; @@ -179,6 +179,10 @@ public: void SetLoseFocusHdl( const Link& rLink ) { maLoseFocusHdl = rLink; } const Link& GetLoseFocusHdl() const { return maLoseFocusHdl; } + /** determines whether the control currently has the focus + */ + bool HasControlFocus() const { return mbHasControlFocus; } + void SetLayoutDataParent( const Control* pParent ) const; virtual Size GetOptimalSize(WindowSizeType eType) const; diff --git a/vcl/inc/vcl/help.hxx b/vcl/inc/vcl/help.hxx index b80b9a86627a..b1e7f05d53a1 100644 --- a/vcl/inc/vcl/help.hxx +++ b/vcl/inc/vcl/help.hxx @@ -77,30 +77,30 @@ public: void SetHelpFile( const String& rFileName ) { maHelpFile = rFileName; } const String& GetHelpFile() const { return maHelpFile; } - virtual sal_Bool Start( const XubString& rHelpId, const Window* pWindow ); - virtual sal_Bool SearchKeyword( const XubString& rKeyWord ); + virtual sal_Bool Start( const XubString& rHelpId, const Window* pWindow ); + virtual sal_Bool SearchKeyword( const XubString& rKeyWord ); virtual void OpenHelpAgent( const rtl::OString& rHelpId ); virtual XubString GetHelpText( const String& aHelpURL, const Window* pWindow ); static void EnableContextHelp(); static void DisableContextHelp(); - static sal_Bool IsContextHelpEnabled(); - static sal_Bool StartContextHelp(); + static sal_Bool IsContextHelpEnabled(); + static sal_Bool StartContextHelp(); static void EnableExtHelp(); static void DisableExtHelp(); - static sal_Bool IsExtHelpEnabled(); - static sal_Bool StartExtHelp(); - static sal_Bool EndExtHelp(); - static sal_Bool IsExtHelpActive(); + static sal_Bool IsExtHelpEnabled(); + static sal_Bool StartExtHelp(); + static sal_Bool EndExtHelp(); + static sal_Bool IsExtHelpActive(); static void EnableBalloonHelp(); static void DisableBalloonHelp(); - static sal_Bool IsBalloonHelpEnabled(); - static sal_Bool ShowBalloon( Window* pParent, + static sal_Bool IsBalloonHelpEnabled(); + static sal_Bool ShowBalloon( Window* pParent, const Point& rScreenPos, const XubString& rHelpText ); - static sal_Bool ShowBalloon( Window* pParent, + static sal_Bool ShowBalloon( Window* pParent, const Point& rScreenPos, const Rectangle&, const XubString& rHelpText ); @@ -119,6 +119,8 @@ public: sal_uInt16 nStyle = 0 ) { return Help::ShowQuickHelp( pParent, rScreenRect, rHelpText, XubString(), nStyle ); } + static void HideBalloonAndQuickHelp(); + static sal_uLong ShowTip( Window* pParent, const Rectangle& rScreenRect, const XubString& rText, sal_uInt16 nStyle = 0 ); diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx index f367be85051d..219bd4328b1b 100755..100644 --- a/vcl/inc/vcl/window.hxx +++ b/vcl/inc/vcl/window.hxx @@ -270,6 +270,7 @@ typedef sal_uInt16 StateChangedType; #define STATE_CHANGE_FORMAT ((StateChangedType)17) #define STATE_CHANGE_EXTENDEDSTYLE ((StateChangedType)18) #define STATE_CHANGE_MIRRORING ((StateChangedType)19) +#define STATE_CHANGE_CONTROL_FOCUS ((StateChangedType)20) #define STATE_CHANGE_USER ((StateChangedType)10000) // GetFocusFlags diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index ce582916ea62..231b1df8e36c 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -277,6 +277,15 @@ sal_Bool Help::ShowQuickHelp( Window* pParent, // ----------------------------------------------------------------------- +void Help::HideBalloonAndQuickHelp() +{ + HelpTextWindow const * pHelpWin = ImplGetSVData()->maHelpData.mpHelpWin; + bool const bIsVisible = ( pHelpWin != NULL ) && pHelpWin->IsVisible(); + ImplDestroyHelpWindow( bIsVisible ); +} + +// ----------------------------------------------------------------------- + sal_uIntPtr Help::ShowTip( Window* pParent, const Rectangle& rScreenRect, const XubString& rText, sal_uInt16 nStyle ) { @@ -303,6 +312,7 @@ void Help::UpdateTip( sal_uIntPtr nId, Window* pParent, const Rectangle& rScreen pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), &rScreenRect ); pHelpWin->SetHelpText( rText ); + pHelpWin->Invalidate(); } // ----------------------------------------------------------------------- diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index 26ef9b076d8c..dd887276ca5b 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -50,7 +50,7 @@ using namespace vcl; void Control::ImplInitControlData() { - mbHasFocus = sal_False; + mbHasControlFocus = sal_False; mpControlData = new ImplControlData; } @@ -304,9 +304,10 @@ long Control::Notify( NotifyEvent& rNEvt ) { if ( rNEvt.GetType() == EVENT_GETFOCUS ) { - if ( !mbHasFocus ) + if ( !mbHasControlFocus ) { - mbHasFocus = sal_True; + mbHasControlFocus = sal_True; + StateChanged( STATE_CHANGE_CONTROL_FOCUS ); if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_GETFOCUS, maGetFocusHdl, this ) ) // been destroyed within the handler return sal_True; @@ -319,7 +320,8 @@ long Control::Notify( NotifyEvent& rNEvt ) Window* pFocusWin = Application::GetFocusWindow(); if ( !pFocusWin || !ImplIsWindowOrChild( pFocusWin ) ) { - mbHasFocus = sal_False; + mbHasControlFocus = sal_False; + StateChanged( STATE_CHANGE_CONTROL_FOCUS ); if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_LOSEFOCUS, maLoseFocusHdl, this ) ) // been destroyed within the handler return sal_True; |