diff options
author | Noel Grandin <noel@peralex.com> | 2015-07-23 13:19:40 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-07-24 09:52:08 +0200 |
commit | 9e28cc8ca79b5c42955867a62e89faf8facc5e80 (patch) | |
tree | d882dd9776f44748debac32c65b80194387cffe5 /vcl | |
parent | dc7fc2074dd81f0960e6c112ead1cfe5bfd1bf4c (diff) |
convert WindowAlign to scoped enum
Change-Id: I028d108b3a83bd5541d873c4d03b87339cd3be52
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/dockingarea.cxx | 18 | ||||
-rw-r--r-- | vcl/source/window/menubarwindow.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/splitwin.cxx | 74 | ||||
-rw-r--r-- | vcl/source/window/tabdlg.cxx | 10 | ||||
-rw-r--r-- | vcl/source/window/toolbox.cxx | 80 | ||||
-rw-r--r-- | vcl/source/window/toolbox2.cxx | 10 |
6 files changed, 97 insertions, 97 deletions
diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx index e847685278e3..4cb8b006e245 100644 --- a/vcl/source/window/dockingarea.cxx +++ b/vcl/source/window/dockingarea.cxx @@ -37,7 +37,7 @@ public: DockingAreaWindow::ImplData::ImplData() { - meAlign = WINDOWALIGN_TOP; + meAlign = WindowAlign::Top; } DockingAreaWindow::ImplData::~ImplData() @@ -78,7 +78,7 @@ static void ImplInvalidateMenubar( DockingAreaWindow* pThis ) // due to a possible common gradient covering menubar and top dockingarea // the menubar must be repainted if the top dockingarea changes size or visibility if( ImplGetSVData()->maNWFData.mbMenuBarDockingAreaCommonBG && - (pThis->GetAlign() == WINDOWALIGN_TOP) + (pThis->GetAlign() == WindowAlign::Top) && pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL ) && pThis->IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL ) ) { @@ -102,7 +102,7 @@ void DockingAreaWindow::StateChanged( StateChangedType nType ) bool DockingAreaWindow::IsHorizontal() const { - return ( mpImplData->meAlign == WINDOWALIGN_TOP || mpImplData->meAlign == WINDOWALIGN_BOTTOM ); + return ( mpImplData->meAlign == WindowAlign::Top || mpImplData->meAlign == WindowAlign::Bottom ); } void DockingAreaWindow::SetAlign( WindowAlign eNewAlign ) @@ -122,12 +122,12 @@ WindowAlign DockingAreaWindow::GetAlign() const void DockingAreaWindow::ApplySettings(vcl::RenderContext& rRenderContext) { const StyleSettings rSetting = rRenderContext.GetSettings().GetStyleSettings(); - const BitmapEx& rPersonaBitmap = (GetAlign() == WINDOWALIGN_TOP) ? rSetting.GetPersonaHeader() : rSetting.GetPersonaFooter(); + const BitmapEx& rPersonaBitmap = (GetAlign() == WindowAlign::Top) ? rSetting.GetPersonaHeader() : rSetting.GetPersonaFooter(); - if (!rPersonaBitmap.IsEmpty() && (GetAlign() == WINDOWALIGN_TOP || GetAlign()==WINDOWALIGN_BOTTOM)) + if (!rPersonaBitmap.IsEmpty() && (GetAlign() == WindowAlign::Top || GetAlign()==WindowAlign::Bottom)) { Wallpaper aWallpaper(rPersonaBitmap); - if (GetAlign() == WINDOWALIGN_TOP) + if (GetAlign() == WindowAlign::Top) aWallpaper.SetStyle(WallpaperStyle::TopRight); else aWallpaper.SetStyle(WallpaperStyle::BottomRight); @@ -169,7 +169,7 @@ void DockingAreaWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangl { ToolbarValue aControlValue; - if (GetAlign() == WINDOWALIGN_TOP && ImplGetSVData()->maNWFData.mbMenuBarDockingAreaCommonBG) + if (GetAlign() == WindowAlign::Top && ImplGetSVData()->maNWFData.mbMenuBarDockingAreaCommonBG) { // give NWF a hint that this dockingarea is adjacent to the menubar // useful for special gradient effects that should cover both windows @@ -177,9 +177,9 @@ void DockingAreaWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangl } ControlState nState = ControlState::ENABLED; - const bool isFooter = GetAlign() == WINDOWALIGN_BOTTOM && !rSetting.GetPersonaFooter().IsEmpty(); + const bool isFooter = GetAlign() == WindowAlign::Bottom && !rSetting.GetPersonaFooter().IsEmpty(); - if ((GetAlign() == WINDOWALIGN_TOP && !rSetting.GetPersonaHeader().IsEmpty() ) || isFooter) + if ((GetAlign() == WindowAlign::Top && !rSetting.GetPersonaHeader().IsEmpty() ) || isFooter) Erase(rRenderContext); else if (!ImplGetSVData()->maNWFData.mbDockingAreaSeparateTB) { diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index c6a0783bb2f3..718ffc000e02 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -562,7 +562,7 @@ static int ImplGetTopDockingAreaHeight( vcl::Window *pWindow ) if ( pChildWin->GetType() == WINDOW_DOCKINGAREA ) pDockingArea = static_cast< DockingAreaWindow* >( pChildWin ); - if( pDockingArea && pDockingArea->GetAlign() == WINDOWALIGN_TOP && + if( pDockingArea && pDockingArea->GetAlign() == WindowAlign::Top && pDockingArea->IsVisible() && pDockingArea->GetOutputSizePixel().Height() != 0 ) { return pDockingArea->GetOutputSizePixel().Height(); diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index 69c14f8363a0..fc5cc4730dd3 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -204,19 +204,19 @@ static void ImplCalcBorder( WindowAlign eAlign, bool bNoAlign, { switch ( eAlign ) { - case WINDOWALIGN_TOP: + case WindowAlign::Top: rLeft = 2; rTop = 2; rRight = 2; rBottom = 0; break; - case WINDOWALIGN_LEFT: + case WindowAlign::Left: rLeft = 0; rTop = 2; rRight = 2; rBottom = 2; break; - case WINDOWALIGN_BOTTOM: + case WindowAlign::Bottom: rLeft = 2; rTop = 0; rRight = 2; @@ -249,7 +249,7 @@ void SplitWindow::ImplDrawBorder(vcl::RenderContext& rRenderContext) { switch (meAlign) { - case WINDOWALIGN_BOTTOM: + case WindowAlign::Bottom: rRenderContext.SetLineColor(rStyleSettings.GetShadowColor()); rRenderContext.DrawLine(Point(0, 0), Point(nDX - 1, 0)); rRenderContext.DrawLine(Point(0, nDY - 2), Point(nDX - 1, nDY - 2)); @@ -258,7 +258,7 @@ void SplitWindow::ImplDrawBorder(vcl::RenderContext& rRenderContext) rRenderContext.DrawLine(Point(0, 1), Point(nDX - 1, 1)); rRenderContext.DrawLine(Point(0, nDY - 1), Point(nDX - 1, nDY - 1)); break; - case WINDOWALIGN_TOP: + case WindowAlign::Top: rRenderContext.SetLineColor(rStyleSettings.GetShadowColor()); rRenderContext.DrawLine(Point(0, nDY - 2), Point(nDX - 1, nDY - 2)); rRenderContext.DrawLine(Point(0, 0), Point(nDX - 1, 0)); @@ -267,7 +267,7 @@ void SplitWindow::ImplDrawBorder(vcl::RenderContext& rRenderContext) rRenderContext.DrawLine(Point(0, nDY - 1), Point(nDX - 1, nDY - 1)); rRenderContext.DrawLine(Point(0, 1), Point(nDX - 1, 1)); break; - case WINDOWALIGN_LEFT: + case WindowAlign::Left: rRenderContext.SetLineColor(rStyleSettings.GetShadowColor()); rRenderContext.DrawLine(Point(nDX - 2, 0), Point(nDX - 2, nDY - 2)); rRenderContext.DrawLine(Point(0, 0), Point(nDX - 1, 0)); @@ -302,28 +302,28 @@ void SplitWindow::ImplDrawBorderLine(vcl::RenderContext& rRenderContext) switch (meAlign) { - case WINDOWALIGN_LEFT: + case WindowAlign::Left: rRenderContext.SetLineColor( rStyleSettings.GetShadowColor() ); rRenderContext.DrawLine( Point( nDX-SPLITWIN_SPLITSIZEEXLN-1, 1 ), Point( nDX-SPLITWIN_SPLITSIZEEXLN-1, nDY-2 ) ); rRenderContext.SetLineColor( rStyleSettings.GetLightColor() ); rRenderContext.DrawLine( Point( nDX-SPLITWIN_SPLITSIZEEXLN, 1 ), Point( nDX-SPLITWIN_SPLITSIZEEXLN, nDY-3 ) ); break; - case WINDOWALIGN_RIGHT: + case WindowAlign::Right: rRenderContext.SetLineColor( rStyleSettings.GetShadowColor() ); rRenderContext.DrawLine( Point( SPLITWIN_SPLITSIZEEXLN-1, 0 ), Point( SPLITWIN_SPLITSIZEEXLN-1, nDY-2 ) ); rRenderContext.SetLineColor( rStyleSettings.GetLightColor() ); rRenderContext.DrawLine( Point( SPLITWIN_SPLITSIZEEXLN, 1 ), Point( SPLITWIN_SPLITSIZEEXLN, nDY-3 ) ); break; - case WINDOWALIGN_TOP: + case WindowAlign::Top: rRenderContext.SetLineColor( rStyleSettings.GetShadowColor() ); rRenderContext.DrawLine( Point( 0, nDY-SPLITWIN_SPLITSIZEEXLN-1 ), Point( nDX-1, nDY-SPLITWIN_SPLITSIZEEXLN-1 ) ); rRenderContext.SetLineColor( rStyleSettings.GetLightColor() ); rRenderContext.DrawLine( Point( 0, nDY-SPLITWIN_SPLITSIZEEXLN ), Point( nDX-1, nDY-SPLITWIN_SPLITSIZEEXLN ) ); break; - case WINDOWALIGN_BOTTOM: + case WindowAlign::Bottom: rRenderContext.SetLineColor( rStyleSettings.GetShadowColor() ); rRenderContext.DrawLine( Point( 0, 5 ), Point( nDX-1, 5 ) ); @@ -1321,7 +1321,7 @@ void SplitWindow::ImplInit( vcl::Window* pParent, WinBits nStyle ) mnBottomBorder = 0; mnMaxSize = 0; mnMouseOff = 0; - meAlign = WINDOWALIGN_TOP; + meAlign = WindowAlign::Top; mnWinStyle = nStyle; mnSplitTest = 0; mnSplitPos = 0; @@ -1424,11 +1424,11 @@ void SplitWindow::ImplSetWindowSize( long nDelta ) Size aSize = GetSizePixel(); switch ( meAlign ) { - case WINDOWALIGN_TOP: + case WindowAlign::Top: aSize.Height() += nDelta; SetSizePixel( aSize ); break; - case WINDOWALIGN_BOTTOM: + case WindowAlign::Bottom: { maDragRect.Top() += nDelta; Point aPos = GetPosPixel(); @@ -1437,11 +1437,11 @@ void SplitWindow::ImplSetWindowSize( long nDelta ) SetPosSizePixel( aPos, aSize ); break; } - case WINDOWALIGN_LEFT: + case WindowAlign::Left: aSize.Width() += nDelta; SetSizePixel( aSize ); break; - case WINDOWALIGN_RIGHT: + case WindowAlign::Right: default: { maDragRect.Left() += nDelta; @@ -1498,17 +1498,17 @@ Size SplitWindow::CalcLayoutSizePixel( const Size& aNewSize ) switch ( meAlign ) { - case WINDOWALIGN_TOP: + case WindowAlign::Top: aSize.Height() += nDelta; break; - case WINDOWALIGN_BOTTOM: + case WindowAlign::Bottom: aPos.Y() -= nDelta; aSize.Height() += nDelta; break; - case WINDOWALIGN_LEFT: + case WindowAlign::Left: aSize.Width() += nDelta; break; - case WINDOWALIGN_RIGHT: + case WindowAlign::Right: default: aPos.X() -= nDelta; aSize.Width() += nDelta; @@ -1660,7 +1660,7 @@ void SplitWindow::ImplGetButtonRect( Rectangle& rRect, long nEx, bool bTest ) co switch ( meAlign ) { - case WINDOWALIGN_TOP: + case WindowAlign::Top: rRect.Left() = mnLeftBorder+nEx; rRect.Top() = mnDY-mnBottomBorder-nSplitSize; rRect.Right() = rRect.Left()+SPLITWIN_SPLITSIZEAUTOHIDE; @@ -1671,7 +1671,7 @@ void SplitWindow::ImplGetButtonRect( Rectangle& rRect, long nEx, bool bTest ) co rRect.Bottom() += mnBottomBorder; } break; - case WINDOWALIGN_BOTTOM: + case WindowAlign::Bottom: rRect.Left() = mnLeftBorder+nEx; rRect.Top() = mnTopBorder; rRect.Right() = rRect.Left()+SPLITWIN_SPLITSIZEAUTOHIDE; @@ -1682,7 +1682,7 @@ void SplitWindow::ImplGetButtonRect( Rectangle& rRect, long nEx, bool bTest ) co rRect.Bottom() += mnBottomBorder; } break; - case WINDOWALIGN_LEFT: + case WindowAlign::Left: rRect.Left() = mnDX-mnRightBorder-nSplitSize; rRect.Top() = mnTopBorder+nEx; rRect.Right() = mnDX-mnRightBorder-1; @@ -1693,7 +1693,7 @@ void SplitWindow::ImplGetButtonRect( Rectangle& rRect, long nEx, bool bTest ) co rRect.Right() += mnRightBorder; } break; - case WINDOWALIGN_RIGHT: + case WindowAlign::Right: rRect.Left() = mnLeftBorder; rRect.Top() = mnTopBorder+nEx; rRect.Right() = mnLeftBorder+nSplitSize-1; @@ -1977,12 +1977,12 @@ void SplitWindow::ImplDrawFadeIn(vcl::RenderContext& rRenderContext, bool bInPai bool bLeft = true; switch (meAlign) { - case WINDOWALIGN_TOP: - case WINDOWALIGN_LEFT: + case WindowAlign::Top: + case WindowAlign::Left: bLeft = false; break; - case WINDOWALIGN_BOTTOM: - case WINDOWALIGN_RIGHT: + case WindowAlign::Bottom: + case WindowAlign::Right: default: bLeft = true; break; @@ -1991,7 +1991,7 @@ void SplitWindow::ImplDrawFadeIn(vcl::RenderContext& rRenderContext, bool bInPai if (!bInPaint) rRenderContext.Erase(aTempRect); - ImplDrawGrip(rRenderContext, aTempRect, (meAlign == WINDOWALIGN_TOP) || (meAlign == WINDOWALIGN_BOTTOM), bLeft); + ImplDrawGrip(rRenderContext, aTempRect, (meAlign == WindowAlign::Top) || (meAlign == WindowAlign::Bottom), bLeft); } } @@ -2005,12 +2005,12 @@ void SplitWindow::ImplDrawFadeOut(vcl::RenderContext& rRenderContext, bool bInPa bool bLeft = true; switch (meAlign) { - case WINDOWALIGN_BOTTOM: - case WINDOWALIGN_RIGHT: + case WindowAlign::Bottom: + case WindowAlign::Right: bLeft = false; break; - case WINDOWALIGN_TOP: - case WINDOWALIGN_LEFT: + case WindowAlign::Top: + case WindowAlign::Left: default: bLeft = true; break; @@ -2019,7 +2019,7 @@ void SplitWindow::ImplDrawFadeOut(vcl::RenderContext& rRenderContext, bool bInPa if (!bInPaint) rRenderContext.Erase(aTempRect); - ImplDrawGrip(rRenderContext, aTempRect, (meAlign == WINDOWALIGN_TOP) || (meAlign == WINDOWALIGN_BOTTOM), bLeft); + ImplDrawGrip(rRenderContext, aTempRect, (meAlign == WindowAlign::Top) || (meAlign == WindowAlign::Bottom), bLeft); } } @@ -3200,19 +3200,19 @@ void SplitWindow::ImplNewAlign() { switch ( meAlign ) { - case WINDOWALIGN_TOP: + case WindowAlign::Top: mbHorz = true; mbBottomRight = false; break; - case WINDOWALIGN_BOTTOM: + case WindowAlign::Bottom: mbHorz = true; mbBottomRight = true; break; - case WINDOWALIGN_LEFT: + case WindowAlign::Left: mbHorz = false; mbBottomRight = false; break; - case WINDOWALIGN_RIGHT: + case WindowAlign::Right: mbHorz = false; mbBottomRight = true; break; diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx index 1080cb8eb421..c5bea40f1278 100644 --- a/vcl/source/window/tabdlg.cxx +++ b/vcl/source/window/tabdlg.cxx @@ -27,7 +27,7 @@ void TabDialog::ImplInitTabDialogData() { mpFixedLine = NULL; mpViewWindow = NULL; - meViewAlign = WINDOWALIGN_LEFT; + meViewAlign = WindowAlign::Left; mbPosControls = true; } @@ -97,7 +97,7 @@ void TabDialog::ImplPosControls() long nViewHeight = 0; PosSizeFlags nViewPosFlags = PosSizeFlags::Pos; Size aViewSize = mpViewWindow->GetSizePixel(); - if ( meViewAlign == WINDOWALIGN_TOP ) + if ( meViewAlign == WindowAlign::Top ) { nViewOffX = aTabOffset.X(); nViewOffY = nOffY+IMPL_DIALOG_OFFSET; @@ -106,7 +106,7 @@ void TabDialog::ImplPosControls() aTabOffset.Y() += aViewSize.Height()+IMPL_DIALOG_OFFSET; aDlgSize.Height() += aViewSize.Height()+IMPL_DIALOG_OFFSET; } - else if ( meViewAlign == WINDOWALIGN_BOTTOM ) + else if ( meViewAlign == WindowAlign::Bottom ) { nViewOffX = aTabOffset.X(); nViewOffY = aTabOffset.Y()+aTabSize.Height()+IMPL_DIALOG_OFFSET; @@ -114,7 +114,7 @@ void TabDialog::ImplPosControls() nViewPosFlags |= PosSizeFlags::Width; aDlgSize.Height() += aViewSize.Height()+IMPL_DIALOG_OFFSET; } - else if ( meViewAlign == WINDOWALIGN_RIGHT ) + else if ( meViewAlign == WindowAlign::Right ) { nViewOffX = aTabOffset.X()+aTabSize.Width()+IMPL_DIALOG_OFFSET; nViewOffY = aTabOffset.Y(); @@ -123,7 +123,7 @@ void TabDialog::ImplPosControls() aDlgSize.Width() += aViewSize.Width()+IMPL_DIALOG_OFFSET; nBtnEx = aViewSize.Width()+IMPL_DIALOG_OFFSET; } - else // meViewAlign == WINDOWALIGN_LEFT + else // meViewAlign == WindowAlign::Left { nViewOffX = IMPL_DIALOG_OFFSET; nViewOffY = aTabOffset.Y(); diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 0100068259d2..09847f88a28a 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -189,7 +189,7 @@ void ToolBox::ImplUpdateDragArea( ToolBox *pThis ) pWrapper->SetDragArea( Rectangle() ); else { - if( pThis->meAlign == WINDOWALIGN_TOP || pThis->meAlign == WINDOWALIGN_BOTTOM ) + if( pThis->meAlign == WindowAlign::Top || pThis->meAlign == WindowAlign::Bottom ) pWrapper->SetDragArea( Rectangle( 0, 0, ImplGetDragWidth( pThis ), pThis->GetOutputSizePixel().Height() ) ); else pWrapper->SetDragArea( Rectangle( 0, 0, pThis->GetOutputSizePixel().Width(), ImplGetDragWidth( pThis ) ) ); @@ -215,21 +215,21 @@ void ToolBox::ImplCalcBorder( WindowAlign eAlign, long& rLeft, long& rTop, // no shadow border for dockable toolbars int borderwidth = pWrapper ? 0: 2; - if ( eAlign == WINDOWALIGN_TOP ) + if ( eAlign == WindowAlign::Top ) { rLeft = borderwidth+dragwidth; rTop = borderwidth; rRight = borderwidth; rBottom = 0; } - else if ( eAlign == WINDOWALIGN_LEFT ) + else if ( eAlign == WindowAlign::Left ) { rLeft = borderwidth; rTop = borderwidth+dragwidth; rRight = 0; rBottom = borderwidth; } - else if ( eAlign == WINDOWALIGN_BOTTOM ) + else if ( eAlign == WindowAlign::Bottom ) { rLeft = borderwidth+dragwidth; rTop = 0; @@ -287,7 +287,7 @@ void ToolBox::ImplDrawGrip(vcl::RenderContext& rRenderContext) Size aSz(GetOutputSizePixel()); - if (meAlign == WINDOWALIGN_TOP || meAlign == WINDOWALIGN_BOTTOM) + if (meAlign == WindowAlign::Top || meAlign == WindowAlign::Bottom) { int height = (int) (0.6 * aSz.Height() + 0.5); int i = (aSz.Height() - height) / 2; @@ -533,9 +533,9 @@ void ToolBox::ImplDrawBackground(vcl::RenderContext& rRenderContext, const Recta const StyleSettings rSetting = Application::GetSettings().GetStyleSettings(); if (!bNativeOk) { - const bool isFooter = GetAlign() == WINDOWALIGN_BOTTOM && !rSetting.GetPersonaFooter().IsEmpty(); + const bool isFooter = GetAlign() == WindowAlign::Bottom && !rSetting.GetPersonaFooter().IsEmpty(); if (!IsBackground() || - ((GetAlign() == WINDOWALIGN_TOP && !rSetting.GetPersonaHeader().IsEmpty() ) || isFooter)) + ((GetAlign() == WindowAlign::Top && !rSetting.GetPersonaHeader().IsEmpty() ) || isFooter)) { if (!IsInPaint()) ImplDrawTransparentBackground(rRenderContext, aPaintRegion); @@ -589,7 +589,7 @@ void ToolBox::ImplDrawBorder(vcl::RenderContext& rRenderContext) if( pWrapper ) return; - if (meAlign == WINDOWALIGN_BOTTOM) + if (meAlign == WindowAlign::Bottom) { // draw bottom border rRenderContext.SetLineColor( rStyleSettings.GetShadowColor() ); @@ -605,9 +605,9 @@ void ToolBox::ImplDrawBorder(vcl::RenderContext& rRenderContext) rRenderContext.SetLineColor( rStyleSettings.GetLightColor() ); rRenderContext.DrawLine( Point( 0, 1 ), Point( nDX-1, 1 ) ); - if (meAlign == WINDOWALIGN_LEFT || meAlign == WINDOWALIGN_RIGHT) + if (meAlign == WindowAlign::Left || meAlign == WindowAlign::Right) { - if (meAlign == WINDOWALIGN_LEFT) + if (meAlign == WindowAlign::Left) { // draw left-bottom border rRenderContext.SetLineColor( rStyleSettings.GetShadowColor() ); @@ -630,7 +630,7 @@ void ToolBox::ImplDrawBorder(vcl::RenderContext& rRenderContext) } } - if ( meAlign == WINDOWALIGN_BOTTOM || meAlign == WINDOWALIGN_TOP ) + if ( meAlign == WindowAlign::Bottom || meAlign == WindowAlign::Top ) { // draw right border rRenderContext.SetLineColor( rStyleSettings.GetShadowColor() ); @@ -684,18 +684,18 @@ Size ToolBox::ImplCalcSize( const ToolBox* pThis, sal_uInt16 nCalcLines, sal_uIn if ( nCalcMode == TB_CALCMODE_HORZ ) { pThis->mpData->mbAssumeDocked = true; // force non-floating mode during calculation - ImplCalcBorder( WINDOWALIGN_TOP, nLeft, nTop, nRight, nBottom, pThis ); + ImplCalcBorder( WindowAlign::Top, nLeft, nTop, nRight, nBottom, pThis ); const_cast<ToolBox*>(pThis)->mbHorz = true; if ( pThis->mbHorz != bOldHorz ) - const_cast<ToolBox*>(pThis)->meAlign = WINDOWALIGN_TOP; + const_cast<ToolBox*>(pThis)->meAlign = WindowAlign::Top; } else if ( nCalcMode == TB_CALCMODE_VERT ) { pThis->mpData->mbAssumeDocked = true; // force non-floating mode during calculation - ImplCalcBorder( WINDOWALIGN_LEFT, nLeft, nTop, nRight, nBottom, pThis ); + ImplCalcBorder( WindowAlign::Left, nLeft, nTop, nRight, nBottom, pThis ); const_cast<ToolBox*>(pThis)->mbHorz = false; if ( pThis->mbHorz != bOldHorz ) - const_cast<ToolBox*>(pThis)->meAlign = WINDOWALIGN_LEFT; + const_cast<ToolBox*>(pThis)->meAlign = WindowAlign::Left; } else if ( nCalcMode == TB_CALCMODE_FLOAT ) { @@ -703,7 +703,7 @@ Size ToolBox::ImplCalcSize( const ToolBox* pThis, sal_uInt16 nCalcLines, sal_uIn nLeft = nTop = nRight = nBottom = 0; const_cast<ToolBox*>(pThis)->mbHorz = true; if ( pThis->mbHorz != bOldHorz ) - const_cast<ToolBox*>(pThis)->meAlign = WINDOWALIGN_TOP; + const_cast<ToolBox*>(pThis)->meAlign = WindowAlign::Top; } if ( (pThis->meAlign != eOldAlign) || (pThis->mbHorz != bOldHorz) || @@ -945,22 +945,22 @@ sal_uInt16 ToolBox::ImplTestLineSize( ToolBox* pThis, const Point& rPos ) { WindowAlign eAlign = pThis->GetAlign(); - if ( eAlign == WINDOWALIGN_LEFT ) + if ( eAlign == WindowAlign::Left ) { if ( rPos.X() > pThis->mnDX-DOCK_LINEOFFSET ) return DOCK_LINEHSIZE | DOCK_LINERIGHT; } - else if ( eAlign == WINDOWALIGN_TOP ) + else if ( eAlign == WindowAlign::Top ) { if ( rPos.Y() > pThis->mnDY-DOCK_LINEOFFSET ) return DOCK_LINEVSIZE | DOCK_LINEBOTTOM; } - else if ( eAlign == WINDOWALIGN_RIGHT ) + else if ( eAlign == WindowAlign::Right ) { if ( rPos.X() < DOCK_LINEOFFSET ) return DOCK_LINEHSIZE | DOCK_LINELEFT; } - else if ( eAlign == WINDOWALIGN_BOTTOM ) + else if ( eAlign == WindowAlign::Bottom ) { if ( rPos.Y() < DOCK_LINEOFFSET ) return DOCK_LINEVSIZE | DOCK_LINETOP; @@ -1395,7 +1395,7 @@ void ToolBox::ImplInit( vcl::Window* pParent, WinBits nStyle ) mbIsKeyEvent = false; mbChangingHighlight = false; meButtonType = ButtonType::SYMBOLONLY; - meAlign = WINDOWALIGN_TOP; + meAlign = WindowAlign::Top; meLastStyle = PointerStyle::Arrow; mnWinStyle = nStyle; meLayoutMode = TBX_LAYOUT_NORMAL; @@ -1456,8 +1456,8 @@ void ToolBox::ApplySettings(vcl::RenderContext& rRenderContext) else { if (rRenderContext.IsNativeControlSupported(CTRL_TOOLBAR, PART_ENTIRE_CONTROL) - || (GetAlign() == WINDOWALIGN_TOP && !Application::GetSettings().GetStyleSettings().GetPersonaHeader().IsEmpty()) - || (GetAlign() == WINDOWALIGN_BOTTOM && !Application::GetSettings().GetStyleSettings().GetPersonaFooter().IsEmpty())) + || (GetAlign() == WindowAlign::Top && !Application::GetSettings().GetStyleSettings().GetPersonaHeader().IsEmpty()) + || (GetAlign() == WindowAlign::Bottom && !Application::GetSettings().GetStyleSettings().GetPersonaFooter().IsEmpty())) { rRenderContext.SetBackground(); rRenderContext.SetTextColor(rStyleSettings.GetMenuBarTextColor()); @@ -1519,8 +1519,8 @@ void ToolBox::ImplInitSettings(bool bFont, bool bForeground, bool bBackground) else { if (IsNativeControlSupported(CTRL_TOOLBAR, PART_ENTIRE_CONTROL) - || (GetAlign() == WINDOWALIGN_TOP && !Application::GetSettings().GetStyleSettings().GetPersonaHeader().IsEmpty()) - || (GetAlign() == WINDOWALIGN_BOTTOM && !Application::GetSettings().GetStyleSettings().GetPersonaFooter().IsEmpty())) + || (GetAlign() == WindowAlign::Top && !Application::GetSettings().GetStyleSettings().GetPersonaHeader().IsEmpty()) + || (GetAlign() == WindowAlign::Bottom && !Application::GetSettings().GetStyleSettings().GetPersonaFooter().IsEmpty())) { SetBackground(); SetTextColor(rStyleSettings.GetMenuBarTextColor()); @@ -3213,7 +3213,7 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos, // rotate text when vertically docked vcl::Font aOldFont = rRenderContext.GetFont(); if( pItem->mbVisibleText && !ImplIsFloatingMode() && - ((meAlign == WINDOWALIGN_LEFT) || (meAlign == WINDOWALIGN_RIGHT)) ) + ((meAlign == WindowAlign::Left) || (meAlign == WindowAlign::Right)) ) { bRotate = true; @@ -3679,14 +3679,14 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt ) sal_uInt16 nLinePtr = ImplTestLineSize( this, rMEvt.GetPosPixel() ); if ( nLinePtr & DOCK_LINEHSIZE ) { - if ( meAlign == WINDOWALIGN_LEFT ) + if ( meAlign == WindowAlign::Left ) eStyle = PointerStyle::WindowESize; else eStyle = PointerStyle::WindowWSize; } else if ( nLinePtr & DOCK_LINEVSIZE ) { - if ( meAlign == WINDOWALIGN_TOP ) + if ( meAlign == WindowAlign::Top ) eStyle = PointerStyle::WindowSSize; else eStyle = PointerStyle::WindowNSize; @@ -4573,7 +4573,7 @@ void ToolBox::ToggleFloatingMode() if ( ImplIsFloatingMode() ) { mbHorz = true; - meAlign = WINDOWALIGN_TOP; + meAlign = WindowAlign::Top; mbScroll = true; if( mbOldHorz != mbHorz ) @@ -4585,7 +4585,7 @@ void ToolBox::ToggleFloatingMode() else { mbScroll = (mnWinStyle & WB_SCROLL) != 0; - if ( (meAlign == WINDOWALIGN_TOP) || (meAlign == WINDOWALIGN_BOTTOM) ) + if ( (meAlign == WindowAlign::Top) || (meAlign == WindowAlign::Bottom) ) mbHorz = true; else mbHorz = false; @@ -4677,16 +4677,16 @@ bool ToolBox::Docking( const Point& rPos, Rectangle& rRect ) Size aInSize = aInRect.GetSize(); if ( aInPosTL.X() <= 0 ) - meDockAlign = WINDOWALIGN_LEFT; + meDockAlign = WindowAlign::Left; else if ( aInPosTL.Y() <= 0) - meDockAlign = WINDOWALIGN_TOP; + meDockAlign = WindowAlign::Top; else if ( aInPosBR.X() >= aInSize.Width() ) - meDockAlign = WINDOWALIGN_RIGHT; + meDockAlign = WindowAlign::Right; else if ( aInPosBR.Y() >= aInSize.Height() ) - meDockAlign = WINDOWALIGN_BOTTOM; + meDockAlign = WindowAlign::Bottom; // update the Dock size if Dock-Align was changed - if ( (meDockAlign == WINDOWALIGN_TOP) || (meDockAlign == WINDOWALIGN_BOTTOM) ) + if ( (meDockAlign == WindowAlign::Top) || (meDockAlign == WindowAlign::Bottom) ) aDockSize.Width() = maInDockRect.GetWidth(); else aDockSize.Height() = maInDockRect.GetHeight(); @@ -4696,20 +4696,20 @@ bool ToolBox::Docking( const Point& rPos, Rectangle& rRect ) Point aPosTL( maInDockRect.TopLeft() ); switch ( meDockAlign ) { - case WINDOWALIGN_TOP : + case WindowAlign::Top : aDockingRect.SetPos( aPosTL ); break; - case WINDOWALIGN_LEFT : + case WindowAlign::Left : aDockingRect.SetPos( aPosTL ); break; - case WINDOWALIGN_BOTTOM : + case WindowAlign::Bottom : { Point aPosBL( maInDockRect.BottomLeft() ); aPosBL.Y() -= aDockingRect.GetHeight(); aDockingRect.SetPos( aPosBL ); break; } - case WINDOWALIGN_RIGHT : + case WindowAlign::Right : { Point aPosTR( maInDockRect.TopRight() ); aPosTR.X() -= aDockingRect.GetWidth(); @@ -4829,7 +4829,7 @@ Size ToolBox::CalcWindowSizePixel( sal_uInt16 nCalcLines ) const Size ToolBox::CalcWindowSizePixel( sal_uInt16 nCalcLines, WindowAlign eAlign ) const { return ImplCalcSize( this, nCalcLines, - (eAlign == WINDOWALIGN_TOP || eAlign == WINDOWALIGN_BOTTOM) ? TB_CALCMODE_HORZ : TB_CALCMODE_VERT ); + (eAlign == WindowAlign::Top || eAlign == WindowAlign::Bottom) ? TB_CALCMODE_HORZ : TB_CALCMODE_VERT ); } sal_uInt16 ToolBox::ImplCountLineBreaks( const ToolBox *pThis ) diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 856b807c6782..7bd7610b48bc 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -826,7 +826,7 @@ void ToolBox::SetAlign( WindowAlign eNewAlign ) if ( !ImplIsFloatingMode() ) { // set horizontal/vertical alignment - if ( (eNewAlign == WINDOWALIGN_LEFT) || (eNewAlign == WINDOWALIGN_RIGHT) ) + if ( (eNewAlign == WindowAlign::Left) || (eNewAlign == WindowAlign::Right) ) mbHorz = false; else mbHorz = true; @@ -974,14 +974,14 @@ Point ToolBox::ImplGetPopupPosition( const Rectangle& rRect, const Size& rSize ) Point devPos; // the position in device coordinates for screen comparison switch( meAlign ) { - case WINDOWALIGN_TOP: + case WindowAlign::Top: aPos = rRect.BottomLeft(); aPos.Y()++; devPos = OutputToAbsoluteScreenPixel( aPos ); if( devPos.Y() + rSize.Height() >= aScreen.Bottom() ) aPos.Y() = rRect.Top() - rSize.Height(); break; - case WINDOWALIGN_BOTTOM: + case WindowAlign::Bottom: aPos = rRect.TopLeft(); aPos.Y()--; devPos = OutputToAbsoluteScreenPixel( aPos ); @@ -990,14 +990,14 @@ Point ToolBox::ImplGetPopupPosition( const Rectangle& rRect, const Size& rSize ) else aPos.Y() = rRect.Bottom(); break; - case WINDOWALIGN_LEFT: + case WindowAlign::Left: aPos = rRect.TopRight(); aPos.X()++; devPos = OutputToAbsoluteScreenPixel( aPos ); if( devPos.X() + rSize.Width() >= aScreen.Right() ) aPos.X() = rRect.Left() - rSize.Width(); break; - case WINDOWALIGN_RIGHT: + case WindowAlign::Right: aPos = rRect.TopLeft(); aPos.X()--; devPos = OutputToAbsoluteScreenPixel( aPos ); |