diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-01-15 08:55:00 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-01-15 14:58:05 +0000 |
commit | 356f6c5d89dd4dd92b2351898e07f99b96cb34cc (patch) | |
tree | 9f9e61103b46614434fd3d8da970b91ba3e0e683 /svx/source/dialog/frmsel.cxx | |
parent | 8a324a3ba599bee03311e5f6ba6e1c83edc1e343 (diff) |
teach FrameSelector to be resizable
Change-Id: I0fd91d707b89197d57dc6eaf7dcebfdb055d73c6
Diffstat (limited to 'svx/source/dialog/frmsel.cxx')
-rw-r--r-- | svx/source/dialog/frmsel.cxx | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx index be955c3311c3..5772e134b33e 100644 --- a/svx/source/dialog/frmsel.cxx +++ b/svx/source/dialog/frmsel.cxx @@ -18,6 +18,7 @@ */ #include <svx/frmsel.hxx> +#include <vcl/builder.hxx> #include <algorithm> #include <math.h> @@ -374,6 +375,13 @@ void FrameSelectorImpl::InitBorderGeometry() /* Width for focus rectangles from center of frame borders. */ mnFocusOffs = FRAMESEL_GEOM_WIDTH / 2 + 1; + maLeft.ClearFocusArea(); + maVer.ClearFocusArea(); + maRight.ClearFocusArea(); + maTop.ClearFocusArea(); + maHor.ClearFocusArea(); + maBottom.ClearFocusArea(); + maLeft.AddFocusPolygon( Rectangle( mnLine1 - mnFocusOffs, mnLine1 - mnFocusOffs, mnLine1 + mnFocusOffs, mnLine3 + mnFocusOffs ) ); maVer.AddFocusPolygon( Rectangle( mnLine2 - mnFocusOffs, mnLine1 - mnFocusOffs, mnLine2 + mnFocusOffs, mnLine3 + mnFocusOffs ) ); maRight.AddFocusPolygon( Rectangle( mnLine3 - mnFocusOffs, mnLine1 - mnFocusOffs, mnLine3 + mnFocusOffs, mnLine3 + mnFocusOffs ) ); @@ -477,6 +485,11 @@ void FrameSelectorImpl::InitVirtualDevice() InitColors(); InitArrowImageList(); + sizeChanged(); +} + +void FrameSelectorImpl::sizeChanged() +{ // initialize geometry InitGlobalGeometry(); InitBorderGeometry(); @@ -773,6 +786,19 @@ FrameSelector::FrameSelector( Window* pParent, const ResId& rResId ) : EnableRTL( false ); // #107808# don't mirror the mouse handling } +FrameSelector::FrameSelector(Window* pParent) + : Control(pParent, WB_BORDER|WB_TABSTOP) +{ + // not in c'tor init list (avoid warning about usage of *this) + mxImpl.reset( new FrameSelectorImpl( *this ) ); + EnableRTL( false ); // #107808# don't mirror the mouse handling +} + +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxFrameSelector(Window *pParent, VclBuilder::stringmap &) +{ + return new FrameSelector(pParent); +} + FrameSelector::~FrameSelector() { } @@ -1181,6 +1207,17 @@ void FrameSelector::DataChanged( const DataChangedEvent& rDCEvt ) mxImpl->InitVirtualDevice(); } +void FrameSelector::Resize() +{ + Control::Resize(); + mxImpl->sizeChanged(); +} + +Size FrameSelector::GetOptimalSize() const +{ + return LogicToPixel(Size(61, 65), MAP_APPFONT); +} + // ============================================================================ template< typename Cont, typename Iter, typename Pred > |