diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-09-12 06:32:46 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-09-12 08:41:29 +0200 |
commit | d22edd44b59df11df94dc10f9678973b0f04557c (patch) | |
tree | 87e139c8f21c5618dd67045bf0b664cc1bf21c67 /vcl | |
parent | 540078ad31390c0fc7800c6c7581b0fd2332c339 (diff) |
vcl: It's a close button, there is no such a thing as a 'closer'.
Clean up at least vcl + what depends on that, but unfortunately there are
still some "Closer"'s left elsewhere...
Change-Id: I019c863d07ee62d701ff01c8d871334012c105f1
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/brdwin.hxx | 2 | ||||
-rw-r--r-- | vcl/source/window/brdwin.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/menu.cxx | 24 | ||||
-rw-r--r-- | vcl/source/window/menubarwindow.cxx | 84 | ||||
-rw-r--r-- | vcl/source/window/menubarwindow.hxx | 4 | ||||
-rw-r--r-- | vcl/source/window/msgbox.cxx | 2 |
7 files changed, 59 insertions, 61 deletions
diff --git a/vcl/inc/brdwin.hxx b/vcl/inc/brdwin.hxx index 4b33db5f933f..8f1d5f3dd02e 100644 --- a/vcl/inc/brdwin.hxx +++ b/vcl/inc/brdwin.hxx @@ -149,7 +149,7 @@ public: sal_uInt16 GetBorderStyle() const { return mnBorderStyle; } void SetPin( bool bPin ); void SetRollUp( bool bRollUp, const Size& rSize ); - void SetCloser(); + void SetCloseButton(); void SetDockButton( bool bDockButton ); void SetHideButton( bool bHideButton ); void SetMenuButton( bool bMenuButton ); diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index a1a016577db3..b1edf9493422 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -2122,7 +2122,7 @@ void ImplBorderWindow::SetRollUp( bool bRollUp, const Size& rSize ) UpdateView( false, rSize ); } -void ImplBorderWindow::SetCloser() +void ImplBorderWindow::SetCloseButton() { SetStyle( GetStyle() | WB_CLOSEABLE ); Size aSize = GetOutputSizePixel(); diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 9ec2a2f7f582..918247f9bb05 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -627,7 +627,7 @@ void Dialog::StateChanged( StateChangedType nType ) if ( ImplGetCancelButton( this ) || ImplGetOKButton( this ) ) { if ( ImplGetBorderWindow() ) - ((ImplBorderWindow*)ImplGetBorderWindow())->SetCloser(); + ((ImplBorderWindow*)ImplGetBorderWindow())->SetCloseButton(); } } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 9e818105120c..7923acde7b33 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -1733,9 +1733,9 @@ Size Menu::ImplCalcSize( const Window* pWin ) // account for the size of the close button, which actually is a toolbox // due to NWF this is variable - long nCloserHeight = ((MenuBarWindow*) pWindow)->MinCloseButtonSize().Height(); - if( aSz.Height() < nCloserHeight ) - aSz.Height() = nCloserHeight; + long nCloseButtonHeight = ((MenuBarWindow*) pWindow)->MinCloseButtonSize().Height(); + if (aSz.Height() < nCloseButtonHeight) + aSz.Height() = nCloseButtonHeight; } if ( pLogo ) @@ -2467,7 +2467,7 @@ void Menu::HighlightItem( sal_uInt16 nItemPos ) MenuBar::MenuBar() : Menu(), - mbCloserVisible(false), + mbCloseBtnVisible(false), mbFloatBtnVisible(false), mbHideBtnVisible(false), mbDisplayable(true) @@ -2477,7 +2477,7 @@ MenuBar::MenuBar() MenuBar::MenuBar( const MenuBar& rMenu ) : Menu(), - mbCloserVisible(false), + mbCloseBtnVisible(false), mbFloatBtnVisible(false), mbHideBtnVisible(false), mbDisplayable(true) @@ -2491,20 +2491,20 @@ MenuBar::~MenuBar() ImplDestroy( this, true ); } -void MenuBar::ShowCloser( bool bShow ) +void MenuBar::ShowCloseButton(bool bShow) { ShowButtons( bShow, mbFloatBtnVisible, mbHideBtnVisible ); } void MenuBar::ShowButtons( bool bClose, bool bFloat, bool bHide ) { - if ( (bClose != mbCloserVisible) || - (bFloat != mbFloatBtnVisible) || - (bHide != mbHideBtnVisible) ) + if ((bClose != mbCloseBtnVisible) || + (bFloat != mbFloatBtnVisible) || + (bHide != mbHideBtnVisible)) { - mbCloserVisible = bClose; - mbFloatBtnVisible = bFloat; - mbHideBtnVisible = bHide; + mbCloseBtnVisible = bClose; + mbFloatBtnVisible = bFloat; + mbHideBtnVisible = bHide; if ( ImplGetWindow() ) ((MenuBarWindow*)ImplGetWindow())->ShowButtons( bClose, bFloat, bHide ); } diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index b265517067d4..af254ee3e8d4 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -117,7 +117,7 @@ void DecoToolBox::SetImages( long nMaxHeight, bool bForce ) MenuBarWindow::MenuBarWindow( Window* pParent ) : Window( pParent, 0 ), - aCloser( this ), + aCloseBtn(this), aFloatBtn( this, WB_NOPOINTERFOCUS | WB_SMALLSTYLE | WB_RECTSTYLE ), aHideBtn( this, WB_NOPOINTERFOCUS | WB_SMALLSTYLE | WB_RECTSTYLE ) { @@ -137,17 +137,17 @@ MenuBarWindow::MenuBarWindow( Window* pParent ) : if( pResMgr ) { BitmapEx aBitmap( ResId( SV_RESID_BITMAP_CLOSEDOC, *pResMgr ) ); - aCloser.maImage = Image( aBitmap ); + aCloseBtn.maImage = Image(aBitmap); - aCloser.SetOutStyle( TOOLBOX_STYLE_FLAT ); - aCloser.SetBackground(); - aCloser.SetPaintTransparent( true ); - aCloser.SetParentClipMode( PARENTCLIPMODE_NOCLIP ); + aCloseBtn.SetOutStyle(TOOLBOX_STYLE_FLAT); + aCloseBtn.SetBackground(); + aCloseBtn.SetPaintTransparent(true); + aCloseBtn.SetParentClipMode(PARENTCLIPMODE_NOCLIP); - aCloser.InsertItem( IID_DOCUMENTCLOSE, aCloser.maImage, 0 ); - aCloser.SetSelectHdl( LINK( this, MenuBarWindow, CloserHdl ) ); - aCloser.AddEventListener( LINK( this, MenuBarWindow, ToolboxEventHdl ) ); - aCloser.SetQuickHelpText( IID_DOCUMENTCLOSE, ResId(SV_HELPTEXT_CLOSEDOCUMENT, *pResMgr).toString() ); + aCloseBtn.InsertItem(IID_DOCUMENTCLOSE, aCloseBtn.maImage, 0); + aCloseBtn.SetSelectHdl(LINK(this, MenuBarWindow, CloseHdl)); + aCloseBtn.AddEventListener(LINK(this, MenuBarWindow, ToolboxEventHdl)); + aCloseBtn.SetQuickHelpText(IID_DOCUMENTCLOSE, ResId(SV_HELPTEXT_CLOSEDOCUMENT, *pResMgr).toString()); aFloatBtn.SetClickHdl( LINK( this, MenuBarWindow, FloatHdl ) ); aFloatBtn.SetSymbol( SYMBOL_FLOAT ); @@ -165,8 +165,8 @@ MenuBarWindow::MenuBarWindow( Window* pParent ) : MenuBarWindow::~MenuBarWindow() { - aCloser.RemoveEventListener( LINK( this, MenuBarWindow, ToolboxEventHdl ) ); - RemoveEventListener( LINK( this, MenuBarWindow, ShowHideListener ) ); + aCloseBtn.RemoveEventListener(LINK(this, MenuBarWindow, ToolboxEventHdl)); + RemoveEventListener(LINK(this, MenuBarWindow, ShowHideListener)); } void MenuBarWindow::SetMenu( MenuBar* pMen ) @@ -177,10 +177,10 @@ void MenuBarWindow::SetMenu( MenuBar* pMen ) ImplInitMenuWindow( this, true, true ); if ( pMen ) { - aCloser.ShowItem( IID_DOCUMENTCLOSE, pMen->HasCloser() ); - aCloser.Show( pMen->HasCloser() || !m_aAddButtons.empty() ); - aFloatBtn.Show( pMen->HasFloatButton() ); - aHideBtn.Show( pMen->HasHideButton() ); + aCloseBtn.ShowItem(IID_DOCUMENTCLOSE, pMen->HasCloseButton()); + aCloseBtn.Show(pMen->HasCloseButton() || !m_aAddButtons.empty()); + aFloatBtn.Show(pMen->HasFloatButton()); + aHideBtn.Show(pMen->HasHideButton()); } Invalidate(); @@ -196,8 +196,8 @@ void MenuBarWindow::SetMenu( MenuBar* pMen ) void MenuBarWindow::ShowButtons( bool bClose, bool bFloat, bool bHide ) { - aCloser.ShowItem( IID_DOCUMENTCLOSE, bClose ); - aCloser.Show( bClose || ! m_aAddButtons.empty() ); + aCloseBtn.ShowItem(IID_DOCUMENTCLOSE, bClose); + aCloseBtn.Show(bClose || !m_aAddButtons.empty()); aFloatBtn.Show( bFloat ); aHideBtn.Show( bHide ); Resize(); @@ -205,29 +205,29 @@ void MenuBarWindow::ShowButtons( bool bClose, bool bFloat, bool bHide ) Size MenuBarWindow::MinCloseButtonSize() { - return aCloser.getMinSize(); + return aCloseBtn.getMinSize(); } -IMPL_LINK_NOARG(MenuBarWindow, CloserHdl) +IMPL_LINK_NOARG(MenuBarWindow, CloseHdl) { if( ! pMenu ) return 0; - if( aCloser.GetCurItemId() == IID_DOCUMENTCLOSE ) + if( aCloseBtn.GetCurItemId() == IID_DOCUMENTCLOSE ) { // #i106052# call close hdl asynchronously to ease handler implementation // this avoids still being in the handler while the DecoToolBox already // gets destroyed - Application::PostUserEvent( ((MenuBar*)pMenu)->GetCloserHdl(), pMenu ); + Application::PostUserEvent(((MenuBar*)pMenu)->GetCloseButtonClickHdl(), pMenu); } else { - std::map<sal_uInt16,AddButtonEntry>::iterator it = m_aAddButtons.find( aCloser.GetCurItemId() ); + std::map<sal_uInt16,AddButtonEntry>::iterator it = m_aAddButtons.find(aCloseBtn.GetCurItemId()); if( it != m_aAddButtons.end() ) { MenuBar::MenuBarButtonCallbackArg aArg; aArg.nId = it->first; - aArg.bHighlight = (aCloser.GetHighlightItemId() == it->first); + aArg.bHighlight = (aCloseBtn.GetHighlightItemId() == it->first); aArg.pMenuBar = dynamic_cast<MenuBar*>(pMenu); return it->second.m_aSelectLink.Call( &aArg ); } @@ -245,11 +245,11 @@ IMPL_LINK( MenuBarWindow, ToolboxEventHdl, VclWindowEvent*, pEvent ) aArg.bHighlight = (pEvent->GetId() == VCLEVENT_TOOLBOX_HIGHLIGHT); aArg.pMenuBar = dynamic_cast<MenuBar*>(pMenu); if( pEvent->GetId() == VCLEVENT_TOOLBOX_HIGHLIGHT ) - aArg.nId = aCloser.GetHighlightItemId(); + aArg.nId = aCloseBtn.GetHighlightItemId(); else if( pEvent->GetId() == VCLEVENT_TOOLBOX_HIGHLIGHTOFF ) { sal_uInt16 nPos = static_cast< sal_uInt16 >(reinterpret_cast<sal_IntPtr>(pEvent->GetData())); - aArg.nId = aCloser.GetItemId( nPos ); + aArg.nId = aCloseBtn.GetItemId(nPos); } std::map< sal_uInt16, AddButtonEntry >::iterator it = m_aAddButtons.find( aArg.nId ); if( it != m_aAddButtons.end() ) @@ -911,16 +911,16 @@ void MenuBarWindow::Resize() long nX = aOutSz.Width()-3; long nY = 2; - if ( aCloser.IsVisible() ) + if ( aCloseBtn.IsVisible() ) { - aCloser.Hide(); - aCloser.SetImages( n ); - Size aTbxSize( aCloser.CalcWindowSizePixel() ); + aCloseBtn.Hide(); + aCloseBtn.SetImages(n); + Size aTbxSize( aCloseBtn.CalcWindowSizePixel() ); nX -= aTbxSize.Width(); long nTbxY = (aOutSz.Height() - aTbxSize.Height())/2; - aCloser.setPosSizePixel( nX, nTbxY, aTbxSize.Width(), aTbxSize.Height() ); + aCloseBtn.setPosSizePixel(nX, nTbxY, aTbxSize.Width(), aTbxSize.Height()); nX -= 3; - aCloser.Show(); + aCloseBtn.Show(); } if ( aFloatBtn.IsVisible() ) { @@ -935,7 +935,7 @@ void MenuBarWindow::Resize() aFloatBtn.SetSymbol( SYMBOL_FLOAT ); aHideBtn.SetSymbol( SYMBOL_HIDE ); - //aCloser.SetSymbol( SYMBOL_CLOSE ); //is a toolbox now + //aCloseBtn.SetSymbol( SYMBOL_CLOSE ); //is a toolbox now Invalidate(); } @@ -1082,11 +1082,9 @@ sal_uInt16 MenuBarWindow::AddMenuBarButton( const Image& i_rImage, const Link& i AddButtonEntry& rNewEntry = m_aAddButtons[nId]; rNewEntry.m_nId = nId; rNewEntry.m_aSelectLink = i_rLink; - aCloser.InsertItem( nId, i_rImage, 0, 0 ); - aCloser.calcMinSize(); - ShowButtons( aCloser.IsItemVisible( IID_DOCUMENTCLOSE ), - aFloatBtn.IsVisible(), - aHideBtn.IsVisible() ); + aCloseBtn.InsertItem(nId, i_rImage, 0, 0); + aCloseBtn.calcMinSize(); + ShowButtons(aCloseBtn.IsItemVisible(IID_DOCUMENTCLOSE), aFloatBtn.IsVisible(), aHideBtn.IsVisible()); ImplLayoutChanged(); if( pMenu->mpSalMenu ) @@ -1119,8 +1117,8 @@ Rectangle MenuBarWindow::GetMenuBarButtonRectPixel( sal_uInt16 nId ) if( aRect.IsEmpty() ) { - aRect = aCloser.GetItemRect( nId ); - Point aOffset = aCloser.OutputToScreenPixel( Point() ); + aRect = aCloseBtn.GetItemRect(nId); + Point aOffset = aCloseBtn.OutputToScreenPixel(Point()); aRect.Move( aOffset.X(), aOffset.Y() ); } } @@ -1129,10 +1127,10 @@ Rectangle MenuBarWindow::GetMenuBarButtonRectPixel( sal_uInt16 nId ) void MenuBarWindow::RemoveMenuBarButton( sal_uInt16 nId ) { - sal_uInt16 nPos = aCloser.GetItemPos( nId ); - aCloser.RemoveItem( nPos ); + sal_uInt16 nPos = aCloseBtn.GetItemPos(nId); + aCloseBtn.RemoveItem(nPos); m_aAddButtons.erase( nId ); - aCloser.calcMinSize(); + aCloseBtn.calcMinSize(); ImplLayoutChanged(); if( pMenu->mpSalMenu ) diff --git a/vcl/source/window/menubarwindow.hxx b/vcl/source/window/menubarwindow.hxx index 9eb7a58bea22..9a2f21a7fc9a 100644 --- a/vcl/source/window/menubarwindow.hxx +++ b/vcl/source/window/menubarwindow.hxx @@ -81,7 +81,7 @@ private: bool bIgnoreFirstMove; bool bStayActive; - DecoToolBox aCloser; + DecoToolBox aCloseBtn; PushButton aFloatBtn; PushButton aHideBtn; @@ -97,7 +97,7 @@ private: void ImplInitStyleSettings(); - DECL_LINK(CloserHdl, void *); + DECL_LINK(CloseHdl, void *); DECL_LINK(FloatHdl, void *); DECL_LINK(HideHdl, void *); DECL_LINK( ToolboxEventHdl, VclWindowEvent* ); diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx index 446df62daa13..0eee716d65dc 100644 --- a/vcl/source/window/msgbox.cxx +++ b/vcl/source/window/msgbox.cxx @@ -217,7 +217,7 @@ void MessBox::ImplPosControls() nMaxWidth -= mpWindowImpl->mnLeftBorder+mpWindowImpl->mnRightBorder+4; // MessagBox should be at least as wide as to see the title - // Extra-Width for Closer, because Closer is set after this call + // Extra-Width for Close button, because Close button is set after this call nTitleWidth = CalcTitleWidth(); nTitleWidth += mpWindowImpl->mnTopBorder; |