From 1f0784d2b877910b4a8ba3ed599333b5000ef7d0 Mon Sep 17 00:00:00 2001 From: Tomcsik Bence Date: Mon, 13 Feb 2012 16:06:03 +0100 Subject: Wrong size of 'Remove watch' button at Basic IDE. fdo#44237 This patch resize the nVirtToolBoxHeight in WatchWindow::WatchWindow if the aRemoveWatchButton plus some space is higher than nVirtToolBoxHeight. So the aRemoveWatchButton doesn't go into aHeaderBar. --- basctl/source/basicide/baside2b.cxx | 38 ++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'basctl') diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index f74e134d56eb..d42a407a405f 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -1200,7 +1200,28 @@ WatchWindow::WatchWindow( Window* pParent ) : aXEdit.SetAccessibleName(String(IDEResId( RID_STR_WATCHNAME))); aTreeListBox.SetAccessibleName(String(IDEResId(RID_STR_WATCHNAME))); + long nTextLen = GetTextWidth( aWatchStr ) + DWBORDER + 3; + aXEdit.SetPosPixel( Point( nTextLen, 3 ) ); + aXEdit.SetAccHdl( LINK( this, WatchWindow, EditAccHdl ) ); + aXEdit.GetAccelerator().InsertItem( 1, KeyCode( KEY_RETURN ) ); + aXEdit.GetAccelerator().InsertItem( 2, KeyCode( KEY_ESCAPE ) ); + aXEdit.Show(); + + aRemoveWatchButton.Disable(); + aRemoveWatchButton.SetClickHdl( LINK( this, WatchWindow, ButtonHdl ) ); + aRemoveWatchButton.SetPosPixel( Point( nTextLen + aXEdit.GetSizePixel().Width() + 4, 2 ) ); + Size aSz( aRemoveWatchButton.GetModeImage().GetSizePixel() ); + aSz.Width() += 6; + aSz.Height() += 6; + aRemoveWatchButton.SetSizePixel( aSz ); + aRemoveWatchButton.Show(); + + long nRWBtnSize = aRemoveWatchButton.GetModeImage().GetSizePixel().Height() + 10; nVirtToolBoxHeight = aXEdit.GetSizePixel().Height() + 7; + + if ( nRWBtnSize > nVirtToolBoxHeight ) + nVirtToolBoxHeight = nRWBtnSize; + nHeaderBarHeight = 16; aTreeListBox.SetHelpId(HID_BASICIDE_WATCHWINDOW_LIST); @@ -1232,25 +1253,8 @@ WatchWindow::WatchWindow( Window* pParent ) : aHeaderBar.Show(); - aRemoveWatchButton.Disable(); - aTreeListBox.Show(); - long nTextLen = GetTextWidth( aWatchStr ) + DWBORDER; - aXEdit.SetPosPixel( Point( nTextLen, 3 ) ); - aXEdit.SetAccHdl( LINK( this, WatchWindow, EditAccHdl ) ); - aXEdit.GetAccelerator().InsertItem( 1, KeyCode( KEY_RETURN ) ); - aXEdit.GetAccelerator().InsertItem( 2, KeyCode( KEY_ESCAPE ) ); - aXEdit.Show(); - - aRemoveWatchButton.SetClickHdl( LINK( this, WatchWindow, ButtonHdl ) ); - aRemoveWatchButton.SetPosPixel( Point( nTextLen + aXEdit.GetSizePixel().Width() + 4, 2 ) ); - Size aSz( aRemoveWatchButton.GetModeImage().GetSizePixel() ); - aSz.Width() += 6; - aSz.Height() += 6; - aRemoveWatchButton.SetSizePixel( aSz ); - aRemoveWatchButton.Show(); - SetText( String( IDEResId( RID_STR_WATCHNAME ) ) ); SetHelpId( HID_BASICIDE_WATCHWINDOW ); -- cgit