summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2012-07-06 11:19:57 +0100
committerPetr Mladek <pmladek@suse.cz>2012-08-08 10:08:51 +0200
commit99cad9fd7f413adecffc527d334eff616799cc4b (patch)
treeb76f54f004ef089a86e548a30baeb9b27e94f999 /svtools
parent73a465ed443e820974600ee291e21ed6413ecb9d (diff)
fdo#51336 - change vcl checkbox no-label behaviour
Change-Id: I352c6041cc520dc76c302190dcf3a6945f5ac85f Signed-off-by: Petr Mladek <pmladek@suse.cz>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/brwbox/ebbcontrols.cxx24
1 files changed, 23 insertions, 1 deletions
diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx
index 1d7b0253fa29..b0ab8018ac62 100644
--- a/svtools/source/brwbox/ebbcontrols.cxx
+++ b/svtools/source/brwbox/ebbcontrols.cxx
@@ -253,6 +253,28 @@ namespace svt
//= CheckBoxControl
//==================================================================
//------------------------------------------------------------------
+
+ class CBCntrlTriState : public TriStateBox
+ {
+ CBCntrlTriState( const CBCntrlTriState & );
+ CBCntrlTriState& operator= ( const CBCntrlTriState & );
+ protected:
+ virtual void ImplHandleHoriAlign( const Point& rPos, const Size& rSize,
+ const Size& rImageSize, Rectangle& rStateRect )
+ {
+ WinBits nWinStyle = GetStyle();
+ if ( nWinStyle & WB_CENTER )
+ rStateRect.Left() = rPos.X()+((rSize.Width()-rImageSize.Width())/2);
+ else if ( nWinStyle & WB_RIGHT )
+ rStateRect.Left() = rPos.X()+rSize.Width()-rImageSize.Width();
+ else
+ rStateRect.Left() = rPos.X();
+ }
+ public:
+ CBCntrlTriState( Window* pParent, WinBits nStyle = 0 ) : TriStateBox( pParent, nStyle ) {}
+ CBCntrlTriState( Window* pParent, const ResId& rResId ) : TriStateBox( pParent, rResId ) {}
+ };
+
CheckBoxControl::CheckBoxControl(Window* pParent, WinBits nWinStyle)
:Control(pParent, nWinStyle)
{
@@ -267,7 +289,7 @@ namespace svt
EnableChildTransparentMode();
- pBox = new TriStateBox(this,WB_CENTER|WB_VCENTER);
+ pBox = new CBCntrlTriState(this,WB_CENTER|WB_VCENTER);
pBox->EnableChildTransparentMode();
pBox->SetPaintTransparent( sal_True );
pBox->SetClickHdl( LINK( this, CheckBoxControl, OnClick ) );