summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2012-08-20 21:15:27 -0500
committerMiklos Vajna <vmiklos@suse.cz>2012-09-14 07:03:28 +0000
commit9684b9b6e5cb1354522af51e7ea75a49c44e638f (patch)
tree63c3ea008d5db3127a193bf6138ecf0373d2d5ae /vcl
parentd4e79eb8f8f633ce59ee172bcae44e06fdb723bd (diff)
gridfixes: #i117265# implement less-predicate for Date/Time structs
Change-Id: Idf0e5bed399fbf288534779665198e214631c0a0 Reviewed-on: https://gerrit.libreoffice.org/536 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/vcl/ctrl.hxx6
-rw-r--r--vcl/inc/vcl/window.hxx1
-rw-r--r--vcl/source/control/ctrl.cxx10
3 files changed, 12 insertions, 5 deletions
diff --git a/vcl/inc/vcl/ctrl.hxx b/vcl/inc/vcl/ctrl.hxx
index 43f168dfe198..98dd33bea000 100644
--- a/vcl/inc/vcl/ctrl.hxx
+++ b/vcl/inc/vcl/ctrl.hxx
@@ -48,7 +48,7 @@ protected:
::vcl::ImplControlData* mpControlData;
private:
- sal_Bool mbHasFocus;
+ bool mbHasControlFocus;
Link maGetFocusHdl;
Link maLoseFocusHdl;
@@ -176,6 +176,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/window.hxx b/vcl/inc/vcl/window.hxx
index 63b50257a62f..67349eed3742 100644
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -262,6 +262,7 @@ typedef sal_uInt16 StateChangedType;
#define STATE_CHANGE_READONLY ((StateChangedType)16)
#define STATE_CHANGE_EXTENDEDSTYLE ((StateChangedType)17)
#define STATE_CHANGE_MIRRORING ((StateChangedType)18)
+#define STATE_CHANGE_CONTROL_FOCUS ((StateChangedType)20)
#define STATE_CHANGE_USER ((StateChangedType)10000)
// GetFocusFlags
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index 5039c2b83e15..b0e796d3ba37 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -47,7 +47,7 @@ using namespace vcl;
void Control::ImplInitControlData()
{
- mbHasFocus = sal_False;
+ mbHasControlFocus = sal_False;
mpControlData = new ImplControlData;
}
@@ -295,9 +295,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;
@@ -310,7 +311,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;