From 82da03eb8f6b300e0c4dd1e32a2da02271e39902 Mon Sep 17 00:00:00 2001 From: Thomas Benisch Date: Fri, 4 May 2001 14:20:34 +0000 Subject: [PATCH] #86076# selection of controls within groupbox --- basctl/source/dlged/dlgedobj.cxx | 38 ++++++++++++++++++++++++++++++-- basctl/source/inc/dlgedobj.hxx | 6 +++-- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx index ea77abbe6185..625bfdf289b6 100644 --- a/basctl/source/dlged/dlgedobj.cxx +++ b/basctl/source/dlged/dlgedobj.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dlgedobj.cxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: tbe $ $Date: 2001-05-04 11:09:19 $ + * last change: $Author: tbe $ $Date: 2001-05-04 15:20:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1258,6 +1258,40 @@ void SAL_CALL DlgEdObj::_elementRemoved(const ::com::sun::star::container::Conta } } +//---------------------------------------------------------------------------- + +SdrObject* DlgEdObj::CheckHit( const Point& rPnt, USHORT nTol,const SetOfByte* pSet ) const +{ + ::rtl::OUString aServiceName = GetServiceName(); + + if (aServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.awt.UnoControlGroupBoxModel") )) + { + Rectangle aROuter = aOutRect; + aROuter.Left() -= nTol; + aROuter.Right() += nTol; + aROuter.Top() -= nTol; + aROuter.Bottom() += nTol; + + Rectangle aRInner = aOutRect; + if( (aRInner.GetSize().Height() > (long)nTol*2) && + (aRInner.GetSize().Width() > (long)nTol*2) ) + { + aRInner.Left() += nTol; + aRInner.Right() -= nTol; + aRInner.Top() += nTol; + aRInner.Bottom() -= nTol; + } + + if( aROuter.IsInside( rPnt ) && !aRInner.IsInside( rPnt ) ) + return (SdrObject*)this; + else + return 0; + } + else + return SdrObject::CheckHit( rPnt, nTol, pSet ); +} + + //---------------------------------------------------------------------------- TYPEINIT1(DlgEdForm, DlgEdObj); diff --git a/basctl/source/inc/dlgedobj.hxx b/basctl/source/inc/dlgedobj.hxx index a959ea8cd38e..9219e1bba7cf 100644 --- a/basctl/source/inc/dlgedobj.hxx +++ b/basctl/source/inc/dlgedobj.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dlgedobj.hxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: tbe $ $Date: 2001-03-23 16:12:35 $ + * last change: $Author: tbe $ $Date: 2001-05-04 15:20:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -156,6 +156,8 @@ public: virtual void SAL_CALL _elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL _elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL _elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException); + + virtual SdrObject* CheckHit(const Point& rPnt,USHORT nTol,const SetOfByte*) const; };