diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-13 19:08:14 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-14 10:44:08 +0000 |
commit | 8c00536d87010b14a95e9c81f2f5f1d683e5fa70 (patch) | |
tree | 92ac779cef9c4f5adb1421f8eee51a301dc8ef61 /vcl/source | |
parent | 5815ca4ef1126140e08f3a1d106bcadc41044505 (diff) |
Convert WindowType to scoped enum
Change-Id: I85cfe02f28729e13f2c0dd3d91cd89e6f3e3b6a9
Reviewed-on: https://gerrit.libreoffice.org/34219
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source')
53 files changed, 425 insertions, 425 deletions
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 2b185790314a..e6f3c8a4f215 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -254,7 +254,7 @@ HelpTextWindow::HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal FloatingWindow( pParent, WB_SYSTEMWINDOW|WB_TOOLTIPWIN ), // #105827# if we change the parent, mirroring will not work correctly when positioning this window maHelpText( rText ) { - SetType( WINDOW_HELPTEXTWINDOW ); + SetType( WindowType::HELPTEXTWINDOW ); ImplSetMouseTransparent( true ); mnHelpWinStyle = nHelpWinStyle; mnStyle = nStyle; diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 7acb1d6f5470..e565639c7763 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -674,10 +674,10 @@ WinBits PushButton::ImplInitStyle( const vcl::Window* pPrevWindow, WinBits nStyl if ( !(nStyle & WB_NOGROUP) && (!pPrevWindow || - ((pPrevWindow->GetType() != WINDOW_PUSHBUTTON ) && - (pPrevWindow->GetType() != WINDOW_OKBUTTON ) && - (pPrevWindow->GetType() != WINDOW_CANCELBUTTON) && - (pPrevWindow->GetType() != WINDOW_HELPBUTTON )) ) ) + ((pPrevWindow->GetType() != WindowType::PUSHBUTTON ) && + (pPrevWindow->GetType() != WindowType::OKBUTTON ) && + (pPrevWindow->GetType() != WindowType::CANCELBUTTON) && + (pPrevWindow->GetType() != WindowType::HELPBUTTON )) ) ) nStyle |= WB_GROUP; return nStyle; } @@ -955,20 +955,20 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext) ControlType aCtrlType = ControlType::Generic; switch(GetParent()->GetType()) { - case WINDOW_LISTBOX: - case WINDOW_MULTILISTBOX: - case WINDOW_TREELISTBOX: + case WindowType::LISTBOX: + case WindowType::MULTILISTBOX: + case WindowType::TREELISTBOX: aCtrlType = ControlType::Listbox; break; - case WINDOW_COMBOBOX: - case WINDOW_PATTERNBOX: - case WINDOW_NUMERICBOX: - case WINDOW_METRICBOX: - case WINDOW_CURRENCYBOX: - case WINDOW_DATEBOX: - case WINDOW_TIMEBOX: - case WINDOW_LONGCURRENCYBOX: + case WindowType::COMBOBOX: + case WindowType::PATTERNBOX: + case WindowType::NUMERICBOX: + case WindowType::METRICBOX: + case WindowType::CURRENCYBOX: + case WindowType::DATEBOX: + case WindowType::TIMEBOX: + case WindowType::LONGCURRENCYBOX: aCtrlType = ControlType::Combobox; break; default: @@ -1199,7 +1199,7 @@ PushButton::PushButton( WindowType nType ) : } PushButton::PushButton( vcl::Window* pParent, WinBits nStyle ) : - Button( WINDOW_PUSHBUTTON ) + Button( WindowType::PUSHBUTTON ) { ImplInitPushButtonData(); ImplInit( pParent, nStyle ); @@ -1496,20 +1496,20 @@ bool PushButton::PreNotify( NotifyEvent& rNEvt ) ControlType aCtrlType = ControlType::Generic; switch( GetParent()->GetType() ) { - case WINDOW_LISTBOX: - case WINDOW_MULTILISTBOX: - case WINDOW_TREELISTBOX: + case WindowType::LISTBOX: + case WindowType::MULTILISTBOX: + case WindowType::TREELISTBOX: aCtrlType = ControlType::Listbox; break; - case WINDOW_COMBOBOX: - case WINDOW_PATTERNBOX: - case WINDOW_NUMERICBOX: - case WINDOW_METRICBOX: - case WINDOW_CURRENCYBOX: - case WINDOW_DATEBOX: - case WINDOW_TIMEBOX: - case WINDOW_LONGCURRENCYBOX: + case WindowType::COMBOBOX: + case WindowType::PATTERNBOX: + case WindowType::NUMERICBOX: + case WindowType::METRICBOX: + case WindowType::CURRENCYBOX: + case WindowType::DATEBOX: + case WindowType::TIMEBOX: + case WindowType::LONGCURRENCYBOX: aCtrlType = ControlType::Combobox; break; default: @@ -1704,7 +1704,7 @@ void OKButton::ImplInit( vcl::Window* pParent, WinBits nStyle ) } OKButton::OKButton( vcl::Window* pParent, WinBits nStyle ) : - PushButton( WINDOW_OKBUTTON ) + PushButton( WindowType::OKBUTTON ) { ImplInit( pParent, nStyle ); } @@ -1750,7 +1750,7 @@ void CancelButton::ImplInit( vcl::Window* pParent, WinBits nStyle ) } CancelButton::CancelButton( vcl::Window* pParent, WinBits nStyle ) : - PushButton( WINDOW_CANCELBUTTON ) + PushButton( WindowType::CANCELBUTTON ) { ImplInit( pParent, nStyle ); } @@ -1802,7 +1802,7 @@ void HelpButton::ImplInit( vcl::Window* pParent, WinBits nStyle ) } HelpButton::HelpButton( vcl::Window* pParent, WinBits nStyle ) : - PushButton( WINDOW_HELPBUTTON ) + PushButton( WindowType::HELPBUTTON ) { ImplInit( pParent, nStyle ); } @@ -1841,7 +1841,7 @@ void RadioButton::ImplInit( vcl::Window* pParent, WinBits nStyle ) WinBits RadioButton::ImplInitStyle( const vcl::Window* pPrevWindow, WinBits nStyle ) { if ( !(nStyle & WB_NOGROUP) && - (!pPrevWindow || (pPrevWindow->GetType() != WINDOW_RADIOBUTTON)) ) + (!pPrevWindow || (pPrevWindow->GetType() != WindowType::RADIOBUTTON)) ) nStyle |= WB_GROUP; if ( !(nStyle & WB_NOTABSTOP) ) { @@ -2240,7 +2240,7 @@ std::vector< VclPtr<RadioButton> > RadioButton::GetRadioButtonGroup(bool bInclud // insert radiobuttons up to next group do { - if( pFirst->GetType() == WINDOW_RADIOBUTTON ) + if( pFirst->GetType() == WindowType::RADIOBUTTON ) { if( pFirst != this || bIncludeThis ) aGroup.push_back( static_cast<RadioButton*>(pFirst) ); @@ -2299,7 +2299,7 @@ void RadioButton::ImplCallClick( bool bGrabFocus, GetFocusFlags nFocusFlags ) } RadioButton::RadioButton( vcl::Window* pParent, WinBits nStyle ) : - Button( WINDOW_RADIOBUTTON ), mbLegacyNoTextAlign( false ) + Button( WindowType::RADIOBUTTON ), mbLegacyNoTextAlign( false ) { ImplInitRadioButtonData(); ImplInit( pParent, nStyle ); @@ -2947,7 +2947,7 @@ WinBits CheckBox::ImplInitStyle( const vcl::Window* pPrevWindow, WinBits nStyle if ( !(nStyle & WB_NOTABSTOP) ) nStyle |= WB_TABSTOP; if ( !(nStyle & WB_NOGROUP) && - (!pPrevWindow || (pPrevWindow->GetType() != WINDOW_CHECKBOX)) ) + (!pPrevWindow || (pPrevWindow->GetType() != WindowType::CHECKBOX)) ) nStyle |= WB_GROUP; return nStyle; } @@ -3185,7 +3185,7 @@ void CheckBox::ImplCheck() } CheckBox::CheckBox( vcl::Window* pParent, WinBits nStyle ) : - Button( WINDOW_CHECKBOX ), mbLegacyNoTextAlign( false ) + Button( WindowType::CHECKBOX ), mbLegacyNoTextAlign( false ) { ImplInitCheckBoxData(); ImplInit( pParent, nStyle ); diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 118bad1d8530..84d1edcf9e5c 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -102,7 +102,7 @@ static void lcl_GetSelectedEntries( ::std::set< sal_Int32 >& rSelectedPos, const } ComboBox::ComboBox(vcl::Window *const pParent, WinBits const nStyle) - : Edit( WINDOW_COMBOBOX ) + : Edit( WindowType::COMBOBOX ) , m_pImpl(new Impl(*this)) { m_pImpl->ImplInitComboBoxData(); diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index 15a9215c756d..ff90996359d8 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -47,7 +47,7 @@ Control::Control( WindowType nType ) : } Control::Control( vcl::Window* pParent, WinBits nStyle ) : - Window( WINDOW_CONTROL ) + Window( WindowType::CONTROL ) { ImplInitControlData(); ImplInit( pParent, nStyle, nullptr ); diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index a81ec9527ad4..95dc4d916c10 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -156,7 +156,7 @@ Edit::Edit( WindowType nType ) } Edit::Edit( vcl::Window* pParent, WinBits nStyle ) - : Control( WINDOW_EDIT ) + : Control( WindowType::EDIT ) { ImplInitEditData(); ImplInit( pParent, nStyle ); @@ -262,7 +262,7 @@ void Edit::dispose() mxDnDListener.clear(); } - SetType(WINDOW_WINDOW); + SetType(WindowType::WINDOW); mpSubEdit.disposeAndClear(); Control::dispose(); @@ -939,33 +939,33 @@ ControlType Edit::ImplGetNativeControlType() const switch (pControl->GetType()) { - case WINDOW_COMBOBOX: - case WINDOW_PATTERNBOX: - case WINDOW_NUMERICBOX: - case WINDOW_METRICBOX: - case WINDOW_CURRENCYBOX: - case WINDOW_DATEBOX: - case WINDOW_TIMEBOX: - case WINDOW_LONGCURRENCYBOX: + case WindowType::COMBOBOX: + case WindowType::PATTERNBOX: + case WindowType::NUMERICBOX: + case WindowType::METRICBOX: + case WindowType::CURRENCYBOX: + case WindowType::DATEBOX: + case WindowType::TIMEBOX: + case WindowType::LONGCURRENCYBOX: nCtrl = ControlType::Combobox; break; - case WINDOW_MULTILINEEDIT: + case WindowType::MULTILINEEDIT: if ( GetWindow( GetWindowType::Border ) != this ) nCtrl = ControlType::MultilineEditbox; else nCtrl = ControlType::EditboxNoBorder; break; - case WINDOW_EDIT: - case WINDOW_PATTERNFIELD: - case WINDOW_METRICFIELD: - case WINDOW_CURRENCYFIELD: - case WINDOW_DATEFIELD: - case WINDOW_TIMEFIELD: - case WINDOW_LONGCURRENCYFIELD: - case WINDOW_NUMERICFIELD: - case WINDOW_SPINFIELD: + case WindowType::EDIT: + case WindowType::PATTERNFIELD: + case WindowType::METRICFIELD: + case WindowType::CURRENCYFIELD: + case WindowType::DATEFIELD: + case WindowType::TIMEFIELD: + case WindowType::LONGCURRENCYFIELD: + case WindowType::NUMERICFIELD: + case WindowType::SPINFIELD: if (pControl->GetStyle() & WB_SPIN) nCtrl = ControlType::Spinbox; else @@ -2520,7 +2520,7 @@ void Edit::ImplSetSelection( const Selection& rSelection, bool bPaint ) } // #103511# notify combobox listeners of deselection - if( !maSelection && GetParent() && GetParent()->GetType() == WINDOW_COMBOBOX ) + if( !maSelection && GetParent() && GetParent()->GetType() == WindowType::COMBOBOX ) static_cast<Edit*>(GetParent())->CallEventListeners( VclEventId::ComboboxDeselect ); } } diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx index 46d1299d93a8..da3202945acf 100644 --- a/vcl/source/control/fixed.cxx +++ b/vcl/source/control/fixed.cxx @@ -105,7 +105,7 @@ const Color& FixedText::GetCanonicalTextColor( const StyleSettings& _rStyle ) co } FixedText::FixedText( vcl::Window* pParent, WinBits nStyle ) - : Control(WINDOW_FIXEDTEXT) + : Control(WindowType::FIXEDTEXT) , m_nMaxWidthChars(-1) , m_nMinWidthChars(-1) , m_pMnemonicWindow(nullptr) @@ -567,7 +567,7 @@ void FixedLine::ImplDraw(vcl::RenderContext& rRenderContext) } FixedLine::FixedLine( vcl::Window* pParent, WinBits nStyle ) : - Control( WINDOW_FIXEDLINE ) + Control( WindowType::FIXEDLINE ) { ImplInit( pParent, nStyle ); SetSizePixel( Size( 2, 2 ) ); @@ -690,7 +690,7 @@ WinBits FixedBitmap::ImplInitStyle( WinBits nStyle ) } FixedBitmap::FixedBitmap( vcl::Window* pParent, WinBits nStyle ) : - Control( WINDOW_FIXEDBITMAP ) + Control( WindowType::FIXEDBITMAP ) { ImplInit( pParent, nStyle ); } @@ -827,7 +827,7 @@ WinBits FixedImage::ImplInitStyle( WinBits nStyle ) } FixedImage::FixedImage( vcl::Window* pParent, WinBits nStyle ) : - Control( WINDOW_FIXEDIMAGE ) + Control( WindowType::FIXEDIMAGE ) { ImplInit( pParent, nStyle ); } diff --git a/vcl/source/control/group.cxx b/vcl/source/control/group.cxx index 68cd7030463c..48d3ffdbdfc6 100644 --- a/vcl/source/control/group.cxx +++ b/vcl/source/control/group.cxx @@ -87,7 +87,7 @@ void GroupBox::ImplInitSettings( bool bFont, } GroupBox::GroupBox( vcl::Window* pParent, WinBits nStyle ) : - Control( WINDOW_GROUPBOX ) + Control( WindowType::GROUPBOX ) { ImplInit( pParent, nStyle ); } diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index 806c26f2c034..c56845b85352 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -2115,7 +2115,7 @@ ImplListBox::ImplListBox( vcl::Window* pParent, WinBits nWinStyle ) : maLBWindow(VclPtr<ImplListBoxWindow>::Create( this, nWinStyle&(~WB_BORDER) )) { // for native widget rendering we must be able to detect this window type - SetType( WINDOW_LISTBOXWINDOW ); + SetType( WindowType::LISTBOXWINDOW ); mpVScrollBar = VclPtr<ScrollBar>::Create( this, WB_VSCROLL | WB_DRAG ); mpHScrollBar = VclPtr<ScrollBar>::Create( this, WB_HSCROLL | WB_DRAG ); diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx index 225efd5436e5..eedb2cbe4110 100644 --- a/vcl/source/control/listbox.cxx +++ b/vcl/source/control/listbox.cxx @@ -50,7 +50,7 @@ ListBox::ListBox(WindowType nType) ImplInitListBoxData(); } -ListBox::ListBox( vcl::Window* pParent, WinBits nStyle ) : Control( WINDOW_LISTBOX ) +ListBox::ListBox( vcl::Window* pParent, WinBits nStyle ) : Control( WindowType::LISTBOX ) { ImplInitListBoxData(); ImplInit( pParent, nStyle ); @@ -1456,7 +1456,7 @@ FactoryFunction ListBox::GetUITestFactory() const } MultiListBox::MultiListBox( vcl::Window* pParent, WinBits nStyle ) : - ListBox( WINDOW_MULTILISTBOX ) + ListBox( WindowType::MULTILISTBOX ) { ImplInit( pParent, nStyle ); EnableMultiSelection( true ); diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx index a6ae684ed545..cc30eb548cc5 100644 --- a/vcl/source/control/menubtn.cxx +++ b/vcl/source/control/menubtn.cxx @@ -73,7 +73,7 @@ OString MenuButton::GetCurItemIdent() const } MenuButton::MenuButton( vcl::Window* pParent, WinBits nWinBits ) - : PushButton(WINDOW_MENUBUTTON) + : PushButton(WindowType::MENUBUTTON) , mpMenuTimer(nullptr) , mnCurItemId(0) , mbDelayMenu(false) diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx index 90f968321342..9509e152e21f 100644 --- a/vcl/source/control/morebtn.cxx +++ b/vcl/source/control/morebtn.cxx @@ -69,7 +69,7 @@ void MoreButton::ShowState() } MoreButton::MoreButton( vcl::Window* pParent, WinBits nStyle ) : - PushButton( WINDOW_MOREBUTTON ) + PushButton( WindowType::MOREBUTTON ) { ImplInit( pParent, nStyle ); } diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx index 770cf1ee41d1..6f4108d1e9e4 100644 --- a/vcl/source/control/notebookbar.cxx +++ b/vcl/source/control/notebookbar.cxx @@ -84,7 +84,7 @@ void NotebookBar::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, P bool bIsLayoutEnabled = isLayoutEnabled(this); Window *pChild = GetWindow(GetWindowType::FirstChild); - if (bIsLayoutEnabled && pChild->GetType() == WINDOW_SCROLLWINDOW) + if (bIsLayoutEnabled && pChild->GetType() == WindowType::SCROLLWINDOW) { WinBits nStyle = pChild->GetStyle(); if (nStyle & (WB_AUTOHSCROLL | WB_HSCROLL)) diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 1237615b9de1..672cf6aeb30c 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -114,7 +114,7 @@ void ScrollBar::ImplInitStyle( WinBits nStyle ) } ScrollBar::ScrollBar( vcl::Window* pParent, WinBits nStyle ) : - Control( WINDOW_SCROLLBAR ) + Control( WindowType::SCROLLBAR ) { ImplInit( pParent, nStyle ); } @@ -1450,7 +1450,7 @@ void ScrollBarBox::ImplInit(vcl::Window* pParent, WinBits nStyle) } ScrollBarBox::ScrollBarBox( vcl::Window* pParent, WinBits nStyle ) : - Window( WINDOW_SCROLLBARBOX ) + Window( WindowType::SCROLLBARBOX ) { ImplInit( pParent, nStyle ); } diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx index 5a4947caa3d7..5c16e5a96dba 100644 --- a/vcl/source/control/slider.cxx +++ b/vcl/source/control/slider.cxx @@ -69,7 +69,7 @@ void Slider::ImplInit( vcl::Window* pParent, WinBits nStyle ) } Slider::Slider( vcl::Window* pParent, WinBits nStyle ) : - Control(WINDOW_SLIDER) + Control(WindowType::SLIDER) { ImplInit( pParent, nStyle ); } diff --git a/vcl/source/control/spinbtn.cxx b/vcl/source/control/spinbtn.cxx index 1cea3469f31a..6294549bc917 100644 --- a/vcl/source/control/spinbtn.cxx +++ b/vcl/source/control/spinbtn.cxx @@ -50,7 +50,7 @@ void SpinButton::ImplInit( vcl::Window* pParent, WinBits nStyle ) } SpinButton::SpinButton( vcl::Window* pParent, WinBits nStyle ) - : Control(WINDOW_SPINBUTTON) + : Control(WindowType::SPINBUTTON) , mbUpperIsFocused(false) { ImplInit(pParent, nStyle); diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index c561cbbd26aa..c006140571a3 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -167,16 +167,16 @@ void ImplDrawSpinButton(vcl::RenderContext& rRenderContext, vcl::Window* pWindow ControlType aControl = ControlType::SpinButtons; switch (pWindow->GetType()) { - case WINDOW_EDIT: - case WINDOW_MULTILINEEDIT: - case WINDOW_PATTERNFIELD: - case WINDOW_METRICFIELD: - case WINDOW_CURRENCYFIELD: - case WINDOW_DATEFIELD: - case WINDOW_TIMEFIELD: - case WINDOW_LONGCURRENCYFIELD: - case WINDOW_NUMERICFIELD: - case WINDOW_SPINFIELD: + case WindowType::EDIT: + case WindowType::MULTILINEEDIT: + case WindowType::PATTERNFIELD: + case WindowType::METRICFIELD: + case WindowType::CURRENCYFIELD: + case WindowType::DATEFIELD: + case WindowType::TIMEFIELD: + case WindowType::LONGCURRENCYFIELD: + case WindowType::NUMERICFIELD: + case WindowType::SPINFIELD: aControl = ControlType::Spinbox; break; default: @@ -339,7 +339,7 @@ void SpinField::ImplInit(vcl::Window* pParent, WinBits nWinStyle) } SpinField::SpinField(vcl::Window* pParent, WinBits nWinStyle) : - Edit(WINDOW_SPINFIELD) + Edit(WindowType::SPINFIELD) { ImplInitSpinFieldData(); ImplInit(pParent, nWinStyle); diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index f0369b5b6681..3540ab11dc65 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -175,7 +175,7 @@ void TabControl::ImplFreeLayoutData() } TabControl::TabControl( vcl::Window* pParent, WinBits nStyle ) : - Control( WINDOW_TABCONTROL ) + Control( WindowType::TABCONTROL ) { ImplInit( pParent, nStyle ); SAL_INFO( "vcl", "*** TABCONTROL no notabs? " << (( GetStyle() & WB_NOBORDER ) ? "true" : "false") ); diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx index 40046b4f030c..0a3daac5794f 100644 --- a/vcl/source/edit/vclmedit.cxx +++ b/vcl/source/edit/vclmedit.cxx @@ -946,7 +946,7 @@ void TextWindow::LoseFocus() VclMultiLineEdit::VclMultiLineEdit( vcl::Window* pParent, WinBits nWinStyle ) : Edit( pParent, nWinStyle ) { - SetType( WINDOW_MULTILINEEDIT ); + SetType( WindowType::MULTILINEEDIT ); pImpVclMEdit = new ImpVclMEdit( this, nWinStyle ); ImplInitSettings( true, true, true ); pUpdateDataTimer = nullptr; diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index 10c67b0ff071..407289dfd8d2 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -75,14 +75,14 @@ bool isDialogWindow(vcl::Window* pWindow) { WindowType nType = pWindow->GetType(); // DIALOG to FONTDIALOG - if (nType >= 0x13a && nType <= 0x143) + if (nType >= WindowType::DIALOG && nType <= WindowType::FONTDIALOG) return true; - // MESSBOX, INFOBOX, QUERYBOX, WARNINGBOX, ERRORBOX - if (nType >= 0x130 && nType <= 0x134) + // MESSBOX, INFOBOX, WARNINGBOX, ERRORBOX, QUERYBOX + if (nType >= WindowType::MESSBOX && nType <= WindowType::QUERYBOX) return true; - if (nType == WINDOW_TABDIALOG) + if (nType == WindowType::TABDIALOG) return true; return false; @@ -261,7 +261,7 @@ StringMap WindowUIObject::get_state() aMap["Visible"] = OUString::boolean(mxWindow->IsVisible()); aMap["ReallyVisible"] = OUString::boolean(mxWindow->IsReallyVisible()); aMap["Enabled"] = OUString::boolean(mxWindow->IsEnabled()); - aMap["WindowType"] = OUString::number(mxWindow->GetType(), 16); + aMap["WindowType"] = OUString::number((sal_uInt16)mxWindow->GetType(), 16); Point aPos = mxWindow->GetPosPixel(); aMap["RelPosition"] = to_string(aPos); diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx index 0d0b21b60d8e..2e683209e8c8 100644 --- a/vcl/source/window/accessibility.cxx +++ b/vcl/source/window/accessibility.cxx @@ -119,7 +119,7 @@ css::uno::Reference< css::accessibility::XAccessible > Window::GetAccessible( bo { // do not optimize hierarchy for the top level border win (ie, when there is no parent) /* // do not optimize accessible hierarchy at all to better reflect real VCL hierarchy - if ( GetParent() && ( GetType() == WINDOW_BORDERWINDOW ) && ( GetChildCount() == 1 ) ) + if ( GetParent() && ( GetType() == WindowType::BORDERWINDOW ) && ( GetChildCount() == 1 ) ) //if( !ImplIsAccessibleCandidate() ) { vcl::Window* pChild = GetAccessibleChildWindow( 0 ); @@ -178,7 +178,7 @@ vcl::Window* Window::GetAccessibleParentWindow() const return nullptr; vcl::Window* pParent = mpWindowImpl->mpParent; - if( GetType() == WINDOW_MENUBARWINDOW ) + if( GetType() == WindowType::MENUBARWINDOW ) { // report the menubar as a child of THE workwindow vcl::Window *pWorkWin = GetParent()->mpWindowImpl->mpFirstChild; @@ -192,7 +192,7 @@ vcl::Window* Window::GetAccessibleParentWindow() const // The logic here has to match that of AccessibleFactory::createAccessibleContext in // accessibility/source/helper/acc_factory.cxx to avoid PopupMenuFloatingWindow // becoming a11y parents of themselves - else if( GetType() == WINDOW_FLOATINGWINDOW && + else if( GetType() == WindowType::FLOATINGWINDOW && mpWindowImpl->mpBorderWindow && mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame && !PopupMenuFloatingWindow::isPopupMenu(this)) { @@ -217,7 +217,7 @@ sal_uInt16 Window::GetAccessibleChildWindowCount() } // report the menubarwindow as a child of THE workwindow - if( GetType() == WINDOW_BORDERWINDOW ) + if( GetType() == WindowType::BORDERWINDOW ) { ImplBorderWindow *pBorderWindow = static_cast<ImplBorderWindow*>(this); if( pBorderWindow->mpMenuBarWindow && @@ -225,7 +225,7 @@ sal_uInt16 Window::GetAccessibleChildWindowCount() ) --nChildren; } - else if( GetType() == WINDOW_WORKWINDOW ) + else if( GetType() == WindowType::WORKWINDOW ) { WorkWindow *pWorkWindow = static_cast<WorkWindow*>(this); if( pWorkWindow->GetMenuBar() && @@ -241,7 +241,7 @@ sal_uInt16 Window::GetAccessibleChildWindowCount() vcl::Window* Window::GetAccessibleChildWindow( sal_uInt16 n ) { // report the menubarwindow as a the first child of THE workwindow - if( GetType() == WINDOW_WORKWINDOW && static_cast<WorkWindow *>(this)->GetMenuBar() ) + if( GetType() == WindowType::WORKWINDOW && static_cast<WorkWindow *>(this)->GetMenuBar() ) { if( n == 0 ) { @@ -267,13 +267,13 @@ vcl::Window* Window::GetAccessibleChildWindow( sal_uInt16 n ) pChild = pChild->mpWindowImpl->mpNext; } - if( GetType() == WINDOW_BORDERWINDOW && pChild && pChild->GetType() == WINDOW_MENUBARWINDOW ) + if( GetType() == WindowType::BORDERWINDOW && pChild && pChild->GetType() == WindowType::MENUBARWINDOW ) { do pChild = pChild->mpWindowImpl->mpNext; while( pChild && ! pChild->IsVisible() ); SAL_WARN_IF( !pChild, "vcl", "GetAccessibleChildWindow(): wrong index in border window"); } - if ( pChild && ( pChild->GetType() == WINDOW_BORDERWINDOW ) && ( pChild->GetChildCount() == 1 ) ) + if ( pChild && ( pChild->GetType() == WindowType::BORDERWINDOW ) && ( pChild->GetChildCount() == 1 ) ) { pChild = pChild->GetChild( 0 ); } @@ -294,115 +294,115 @@ sal_uInt16 Window::getDefaultAccessibleRole() const sal_uInt16 nRole = 0xFFFF; switch ( GetType() ) { - case WINDOW_MESSBOX: // MT: Would be nice to have special roles! - case WINDOW_INFOBOX: - case WINDOW_WARNINGBOX: - case WINDOW_ERRORBOX: - case WINDOW_QUERYBOX: nRole = accessibility::AccessibleRole::ALERT; break; - - case WINDOW_MODELESSDIALOG: - case WINDOW_MODALDIALOG: - case WINDOW_SYSTEMDIALOG: - case WINDOW_PRINTERSETUPDIALOG: - case WINDOW_PRINTDIALOG: - case WINDOW_TABDIALOG: - case WINDOW_BUTTONDIALOG: - case WINDOW_DIALOG: nRole = accessibility::AccessibleRole::DIALOG; break; - - case WINDOW_PUSHBUTTON: - case WINDOW_OKBUTTON: - case WINDOW_CANCELBUTTON: - case WINDOW_HELPBUTTON: - case WINDOW_IMAGEBUTTON: - case WINDOW_MOREBUTTON: - case WINDOW_SPINBUTTON: - case WINDOW_BUTTON: nRole = accessibility::AccessibleRole::PUSH_BUTTON; break; - case WINDOW_MENUBUTTON: nRole = accessibility::AccessibleRole::BUTTON_MENU; break; - - case WINDOW_PATHDIALOG: nRole = accessibility::AccessibleRole::DIRECTORY_PANE; break; - case WINDOW_FILEDIALOG: nRole = accessibility::AccessibleRole::FILE_CHOOSER; break; - case WINDOW_COLORDIALOG: nRole = accessibility::AccessibleRole::COLOR_CHOOSER; break; - case WINDOW_FONTDIALOG: nRole = accessibility::AccessibleRole::FONT_CHOOSER; break; - - case WINDOW_RADIOBUTTON: nRole = accessibility::AccessibleRole::RADIO_BUTTON; break; - case WINDOW_TRISTATEBOX: - case WINDOW_CHECKBOX: nRole = accessibility::AccessibleRole::CHECK_BOX; break; - - case WINDOW_MULTILINEEDIT: nRole = accessibility::AccessibleRole::SCROLL_PANE; break; - - case WINDOW_PATTERNFIELD: - case WINDOW_CALCINPUTLINE: - case WINDOW_EDIT: nRole = ( GetStyle() & WB_PASSWORD ) ? (accessibility::AccessibleRole::PASSWORD_TEXT) : (accessibility::AccessibleRole::TEXT); break; - - case WINDOW_PATTERNBOX: - case WINDOW_NUMERICBOX: - case WINDOW_METRICBOX: - case WINDOW_CURRENCYBOX: - case WINDOW_LONGCURRENCYBOX: - case WINDOW_COMBOBOX: nRole = accessibility::AccessibleRole::COMBO_BOX; break; - - case WINDOW_LISTBOX: - case WINDOW_MULTILISTBOX: nRole = accessibility::AccessibleRole::LIST; break; - - case WINDOW_TREELISTBOX: nRole = accessibility::AccessibleRole::TREE; break; - - case WINDOW_FIXEDTEXT: nRole = accessibility::AccessibleRole::LABEL; break; - case WINDOW_FIXEDLINE: + case WindowType::MESSBOX: // MT: Would be nice to have special roles! + case WindowType::INFOBOX: + case WindowType::WARNINGBOX: + case WindowType::ERRORBOX: + case WindowType::QUERYBOX: nRole = accessibility::AccessibleRole::ALERT; break; + + case WindowType::MODELESSDIALOG: + case WindowType::MODALDIALOG: + case WindowType::SYSTEMDIALOG: + case WindowType::PRINTERSETUPDIALOG: + case WindowType::PRINTDIALOG: + case WindowType::TABDIALOG: + case WindowType::BUTTONDIALOG: + case WindowType::DIALOG: nRole = accessibility::AccessibleRole::DIALOG; break; + + case WindowType::PUSHBUTTON: + case WindowType::OKBUTTON: + case WindowType::CANCELBUTTON: + case WindowType::HELPBUTTON: + case WindowType::IMAGEBUTTON: + case WindowType::MOREBUTTON: + case WindowType::SPINBUTTON: + case WindowType::BUTTON: nRole = accessibility::AccessibleRole::PUSH_BUTTON; break; + case WindowType::MENUBUTTON: nRole = accessibility::AccessibleRole::BUTTON_MENU; break; + + case WindowType::PATHDIALOG: nRole = accessibility::AccessibleRole::DIRECTORY_PANE; break; + case WindowType::FILEDIALOG: nRole = accessibility::AccessibleRole::FILE_CHOOSER; break; + case WindowType::COLORDIALOG: nRole = accessibility::AccessibleRole::COLOR_CHOOSER; break; + case WindowType::FONTDIALOG: nRole = accessibility::AccessibleRole::FONT_CHOOSER; break; + + case WindowType::RADIOBUTTON: nRole = accessibility::AccessibleRole::RADIO_BUTTON; break; + case WindowType::TRISTATEBOX: + case WindowType::CHECKBOX: nRole = accessibility::AccessibleRole::CHECK_BOX; break; + + case WindowType::MULTILINEEDIT: nRole = accessibility::AccessibleRole::SCROLL_PANE; break; + + case WindowType::PATTERNFIELD: + case WindowType::CALCINPUTLINE: + case WindowType::EDIT: nRole = ( GetStyle() & WB_PASSWORD ) ? (accessibility::AccessibleRole::PASSWORD_TEXT) : (accessibility::AccessibleRole::TEXT); break; + + case WindowType::PATTERNBOX: + case WindowType::NUMERICBOX: + case WindowType::METRICBOX: + case WindowType::CURRENCYBOX: + case WindowType::LONGCURRENCYBOX: + case WindowType::COMBOBOX: nRole = accessibility::AccessibleRole::COMBO_BOX; break; + + case WindowType::LISTBOX: + case WindowType::MULTILISTBOX: nRole = accessibility::AccessibleRole::LIST; break; + + case WindowType::TREELISTBOX: nRole = accessibility::AccessibleRole::TREE; break; + + case WindowType::FIXEDTEXT: nRole = accessibility::AccessibleRole::LABEL; break; + case WindowType::FIXEDLINE: if( !GetText().isEmpty() ) nRole = accessibility::AccessibleRole::LABEL; else nRole = accessibility::AccessibleRole::SEPARATOR; break; - case WINDOW_FIXEDBITMAP: - case WINDOW_FIXEDIMAGE: nRole = accessibility::AccessibleRole::ICON; break; - case WINDOW_GROUPBOX: nRole = accessibility::AccessibleRole::GROUP_BOX; break; - case WINDOW_SCROLLBAR: nRole = accessibility::AccessibleRole::SCROLL_BAR; break; + case WindowType::FIXEDBITMAP: + case WindowType::FIXEDIMAGE: nRole = accessibility::AccessibleRole::ICON; break; + case WindowType::GROUPBOX: nRole = accessibility::AccessibleRole::GROUP_BOX; break; + case WindowType::SCROLLBAR: nRole = accessibility::AccessibleRole::SCROLL_BAR; break; - case WINDOW_SLIDER: - case WINDOW_SPLITTER: - case WINDOW_SPLITWINDOW: nRole = accessibility::AccessibleRole::SPLIT_PANE; break; + case WindowType::SLIDER: + case WindowType::SPLITTER: + case WindowType::SPLITWINDOW: nRole = accessibility::AccessibleRole::SPLIT_PANE; break; - case WINDOW_DATEBOX: - case WINDOW_TIMEBOX: - case WINDOW_DATEFIELD: - case WINDOW_TIMEFIELD: nRole = accessibility::AccessibleRole::DATE_EDITOR; break; + case WindowType::DATEBOX: + case WindowType::TIMEBOX: + case WindowType::DATEFIELD: + case WindowType::TIMEFIELD: nRole = accessibility::AccessibleRole::DATE_EDITOR; break; - case WINDOW_NUMERICFIELD: - case WINDOW_METRICFIELD: - case WINDOW_CURRENCYFIELD: - case WINDOW_LONGCURRENCYFIELD: - case WINDOW_SPINFIELD: nRole = accessibility::AccessibleRole::SPIN_BOX; break; + case WindowType::NUMERICFIELD: + case WindowType::METRICFIELD: + case WindowType::CURRENCYFIELD: + case WindowType::LONGCURRENCYFIELD: + case WindowType::SPINFIELD: nRole = accessibility::AccessibleRole::SPIN_BOX; break; - case WINDOW_TOOLBOX: nRole = accessibility::AccessibleRole::TOOL_BAR; break; - case WINDOW_STATUSBAR: nRole = accessibility::AccessibleRole::STATUS_BAR; break; + case WindowType::TOOLBOX: nRole = accessibility::AccessibleRole::TOOL_BAR; break; + case WindowType::STATUSBAR: nRole = accessibility::AccessibleRole::STATUS_BAR; break; - case WINDOW_TABPAGE: nRole = accessibility::AccessibleRole::PANEL; break; - case WINDOW_TABCONTROL: nRole = accessibility::AccessibleRole::PAGE_TAB_LIST; break; + case WindowType::TABPAGE: nRole = accessibility::AccessibleRole::PANEL; break; + case WindowType::TABCONTROL: nRole = accessibility::AccessibleRole::PAGE_TAB_LIST; break; - case WINDOW_DOCKINGWINDOW: - case WINDOW_SYSWINDOW: nRole = (mpWindowImpl->mbFrame) ? accessibility::AccessibleRole::FRAME : + case WindowType::DOCKINGWINDOW: + case WindowType::SYSWINDOW: nRole = (mpWindowImpl->mbFrame) ? accessibility::AccessibleRole::FRAME : accessibility::AccessibleRole::PANEL; break; - case WINDOW_FLOATINGWINDOW: nRole = ( mpWindowImpl->mbFrame || + case WindowType::FLOATINGWINDOW: nRole = ( mpWindowImpl->mbFrame || (mpWindowImpl->mpBorderWindow && mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame) || (GetStyle() & WB_OWNERDRAWDECORATION) ) ? accessibility::AccessibleRole::FRAME : accessibility::AccessibleRole::WINDOW; break; - case WINDOW_WORKWINDOW: nRole = accessibility::AccessibleRole::ROOT_PANE; break; + case WindowType::WORKWINDOW: nRole = accessibility::AccessibleRole::ROOT_PANE; break; - case WINDOW_SCROLLBARBOX: nRole = accessibility::AccessibleRole::FILLER; break; + case WindowType::SCROLLBARBOX: nRole = accessibility::AccessibleRole::FILLER; break; - case WINDOW_HELPTEXTWINDOW: nRole = accessibility::AccessibleRole::TOOL_TIP; break; + case WindowType::HELPTEXTWINDOW: nRole = accessibility::AccessibleRole::TOOL_TIP; break; - case WINDOW_RULER: nRole = accessibility::AccessibleRole::RULER; break; + case WindowType::RULER: nRole = accessibility::AccessibleRole::RULER; break; - case WINDOW_SCROLLWINDOW: nRole = accessibility::AccessibleRole::SCROLL_PANE; break; + case WindowType::SCROLLWINDOW: nRole = accessibility::AccessibleRole::SCROLL_PANE; break; - case WINDOW_WINDOW: - case WINDOW_CONTROL: - case WINDOW_BORDERWINDOW: - case WINDOW_SYSTEMCHILDWINDOW: + case WindowType::WINDOW: + case WindowType::CONTROL: + case WindowType::BORDERWINDOW: + case WindowType::SYSTEMCHILDWINDOW: default: if (ImplIsAccessibleNativeFrame() ) nRole = accessibility::AccessibleRole::FRAME; @@ -454,28 +454,28 @@ OUString Window::getDefaultAccessibleName() const OUString aAccessibleName; switch ( GetType() ) { - case WINDOW_MULTILINEEDIT: - case WINDOW_PATTERNFIELD: - case WINDOW_NUMERICFIELD: - case WINDOW_METRICFIELD: - case WINDOW_CURRENCYFIELD: - case WINDOW_LONGCURRENCYFIELD: - case WINDOW_CALCINPUTLINE: - case WINDOW_EDIT: - - case WINDOW_DATEBOX: - case WINDOW_TIMEBOX: - case WINDOW_CURRENCYBOX: - case WINDOW_LONGCURRENCYBOX: - case WINDOW_DATEFIELD: - case WINDOW_TIMEFIELD: - case WINDOW_SPINFIELD: - - case WINDOW_COMBOBOX: - case WINDOW_LISTBOX: - case WINDOW_MULTILISTBOX: - case WINDOW_TREELISTBOX: - case WINDOW_METRICBOX: + case WindowType::MULTILINEEDIT: + case WindowType::PATTERNFIELD: + case WindowType::NUMERICFIELD: + case WindowType::METRICFIELD: + case WindowType::CURRENCYFIELD: + case WindowType::LONGCURRENCYFIELD: + case WindowType::CALCINPUTLINE: + case WindowType::EDIT: + + case WindowType::DATEBOX: + case WindowType::TIMEBOX: + case WindowType::CURRENCYBOX: + case WindowType::LONGCURRENCYBOX: + case WindowType::DATEFIELD: + case WindowType::TIMEFIELD: + case WindowType::SPINFIELD: + + case WindowType::COMBOBOX: + case WindowType::LISTBOX: + case WindowType::MULTILISTBOX: + case WindowType::TREELISTBOX: + case WindowType::METRICBOX: { vcl::Window *pLabel = GetAccessibleRelationLabeledBy(); if ( pLabel && pLabel != this ) @@ -485,8 +485,8 @@ OUString Window::getDefaultAccessibleName() const } break; - case WINDOW_IMAGEBUTTON: - case WINDOW_PUSHBUTTON: + case WindowType::IMAGEBUTTON: + case WindowType::PUSHBUTTON: aAccessibleName = GetText(); if (aAccessibleName.isEmpty()) { @@ -496,11 +496,11 @@ OUString Window::getDefaultAccessibleName() const } break; - case WINDOW_TOOLBOX: + case WindowType::TOOLBOX: aAccessibleName = GetText(); break; - case WINDOW_MOREBUTTON: + case WindowType::MOREBUTTON: aAccessibleName = mpWindowImpl->maText; break; @@ -534,7 +534,7 @@ OUString Window::GetAccessibleDescription() const // Special code for help text windows. ZT asks the border window for the // description so we have to forward this request to our inner window. const vcl::Window* pWin = const_cast<vcl::Window *>(this)->ImplGetWindow(); - if ( pWin->GetType() == WINDOW_HELPTEXTWINDOW ) + if ( pWin->GetType() == WindowType::HELPTEXTWINDOW ) aAccessibleDescription = pWin->GetHelpText(); else aAccessibleDescription = GetHelpText(); diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index a3c90647b34e..6a174b89521f 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -445,34 +445,34 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei { switch( pCtrl->GetType() ) { - case WINDOW_LISTBOX: + case WindowType::LISTBOX: if( pCtrl->GetStyle() & WB_DROPDOWN ) { aCtrlType = ControlType::Listbox; mbNWFBorder = true; } break; - case WINDOW_COMBOBOX: + case WindowType::COMBOBOX: if( pCtrl->GetStyle() & WB_DROPDOWN ) { aCtrlType = ControlType::Combobox; mbNWFBorder = true; } break; - case WINDOW_MULTILINEEDIT: + case WindowType::MULTILINEEDIT: aCtrlType = ControlType::MultilineEditbox; mbNWFBorder = true; break; - case WINDOW_EDIT: - case WINDOW_PATTERNFIELD: - case WINDOW_METRICFIELD: - case WINDOW_CURRENCYFIELD: - case WINDOW_DATEFIELD: - case WINDOW_TIMEFIELD: - case WINDOW_LONGCURRENCYFIELD: - case WINDOW_NUMERICFIELD: - case WINDOW_SPINFIELD: - case WINDOW_CALCINPUTLINE: + case WindowType::EDIT: + case WindowType::PATTERNFIELD: + case WindowType::METRICFIELD: + case WindowType::CURRENCYFIELD: + case WindowType::DATEFIELD: + case WindowType::TIMEFIELD: + case WindowType::LONGCURRENCYFIELD: + case WindowType::NUMERICFIELD: + case WindowType::SPINFIELD: + case WindowType::CALCINPUTLINE: mbNWFBorder = true; if (pCtrl->GetStyle() & WB_SPIN) aCtrlType = ControlType::Spinbox; @@ -601,28 +601,28 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, c { switch (pCtrl->GetType()) { - case WINDOW_MULTILINEEDIT: + case WindowType::MULTILINEEDIT: aCtrlType = ControlType::MultilineEditbox; break; - case WINDOW_EDIT: - case WINDOW_PATTERNFIELD: - case WINDOW_METRICFIELD: - case WINDOW_CURRENCYFIELD: - case WINDOW_DATEFIELD: - case WINDOW_TIMEFIELD: - case WINDOW_LONGCURRENCYFIELD: - case WINDOW_NUMERICFIELD: - case WINDOW_SPINFIELD: - case WINDOW_CALCINPUTLINE: + case WindowType::EDIT: + case WindowType::PATTERNFIELD: + case WindowType::METRICFIELD: + case WindowType::CURRENCYFIELD: + case WindowType::DATEFIELD: + case WindowType::TIMEFIELD: + case WindowType::LONGCURRENCYFIELD: + case WindowType::NUMERICFIELD: + case WindowType::SPINFIELD: + case WindowType::CALCINPUTLINE: if (pCtrl->GetStyle() & WB_SPIN) aCtrlType = ControlType::Spinbox; else aCtrlType = ControlType::Editbox; break; - case WINDOW_LISTBOX: - case WINDOW_MULTILISTBOX: - case WINDOW_TREELISTBOX: + case WindowType::LISTBOX: + case WindowType::MULTILISTBOX: + case WindowType::TREELISTBOX: aCtrlType = ControlType::Listbox; if (pCtrl->GetStyle() & WB_DROPDOWN) aCtrlPart = ControlPart::Entire; @@ -630,19 +630,19 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, c aCtrlPart = ControlPart::ListboxWindow; break; - case WINDOW_LISTBOXWINDOW: + case WindowType::LISTBOXWINDOW: aCtrlType = ControlType::Listbox; aCtrlPart = ControlPart::ListboxWindow; break; - case WINDOW_COMBOBOX: - case WINDOW_PATTERNBOX: - case WINDOW_NUMERICBOX: - case WINDOW_METRICBOX: - case WINDOW_CURRENCYBOX: - case WINDOW_DATEBOX: - case WINDOW_TIMEBOX: - case WINDOW_LONGCURRENCYBOX: + case WindowType::COMBOBOX: + case WindowType::PATTERNBOX: + case WindowType::NUMERICBOX: + case WindowType::METRICBOX: + case WindowType::CURRENCYBOX: + case WindowType::DATEBOX: + case WindowType::TIMEBOX: + case WindowType::LONGCURRENCYBOX: if (pCtrl->GetStyle() & WB_DROPDOWN) { aCtrlType = ControlType::Combobox; @@ -1648,14 +1648,14 @@ void ImplBorderWindow::ImplInit( vcl::Window* pParent, ImplBorderWindow::ImplBorderWindow( vcl::Window* pParent, SystemParentData* pSystemParentData, WinBits nStyle, BorderWindowStyle nTypeStyle - ) : Window( WINDOW_BORDERWINDOW ) + ) : Window( WindowType::BORDERWINDOW ) { ImplInit( pParent, nStyle, nTypeStyle, pSystemParentData ); } ImplBorderWindow::ImplBorderWindow( vcl::Window* pParent, WinBits nStyle , BorderWindowStyle nTypeStyle ) : - Window( WINDOW_BORDERWINDOW ) + Window( WindowType::BORDERWINDOW ) { ImplInit( pParent, nStyle, nTypeStyle, nullptr ); } diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx index aafb1c828e1e..5ff1f358baa1 100644 --- a/vcl/source/window/btndlg.cxx +++ b/vcl/source/window/btndlg.cxx @@ -50,7 +50,7 @@ ButtonDialog::ButtonDialog( WindowType nType ) : } ButtonDialog::ButtonDialog( vcl::Window* pParent, WinBits nStyle ) : - Dialog( WINDOW_BUTTONDIALOG ) + Dialog( WindowType::BUTTONDIALOG ) { ImplInitButtonDialogData(); ImplInit( pParent, nStyle ); @@ -300,9 +300,9 @@ void ButtonDialog::AddButton( StandardButtonType eType, sal_uInt16 nId, pItem->mpPushButton = ImplCreatePushButton( nBtnFlags ); // Standard-Buttons have the right text already - if ( !((eType == StandardButtonType::OK && pItem->mpPushButton->GetType() == WINDOW_OKBUTTON) || - (eType == StandardButtonType::Cancel && pItem->mpPushButton->GetType() == WINDOW_CANCELBUTTON) || - (eType == StandardButtonType::Help && pItem->mpPushButton->GetType() == WINDOW_HELPBUTTON)) ) + if ( !((eType == StandardButtonType::OK && pItem->mpPushButton->GetType() == WindowType::OKBUTTON) || + (eType == StandardButtonType::Cancel && pItem->mpPushButton->GetType() == WindowType::CANCELBUTTON) || + (eType == StandardButtonType::Help && pItem->mpPushButton->GetType() == WindowType::HELPBUTTON)) ) { pItem->mpPushButton->SetText( Button::GetStandardText( eType ) ); } diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index c627cf1a9726..ac2d86947345 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -161,14 +161,14 @@ namespace { bool isButtonType(WindowType nType) { - return nType == WINDOW_PUSHBUTTON || - nType == WINDOW_OKBUTTON || - nType == WINDOW_CANCELBUTTON || - nType == WINDOW_HELPBUTTON || - nType == WINDOW_IMAGEBUTTON || - nType == WINDOW_MENUBUTTON || - nType == WINDOW_MOREBUTTON || - nType == WINDOW_SPINBUTTON; + return nType == WindowType::PUSHBUTTON || + nType == WindowType::OKBUTTON || + nType == WindowType::CANCELBUTTON || + nType == WindowType::HELPBUTTON || + nType == WindowType::IMAGEBUTTON || + nType == WindowType::MENUBUTTON || + nType == WindowType::MOREBUTTON || + nType == WindowType::SPINBUTTON; } } #endif @@ -476,7 +476,7 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr { vcl::Window *pChild = pOne->get_child(); vcl::Window* pLabel = pOne->GetWindow(GetWindowType::LastChild); - if (pLabel && pLabel != pChild && pLabel->GetType() == WINDOW_FIXEDTEXT) + if (pLabel && pLabel != pChild && pLabel->GetType() == WindowType::FIXEDTEXT) { FixedText *pLabelWidget = static_cast<FixedText*>(pLabel); pOne->set_label(pLabelWidget->GetText()); @@ -1248,7 +1248,7 @@ vcl::Window* VclBuilder::prepareWidgetOwnScrolling(vcl::Window *pParent, WinBits //For Widgets that manage their own scrolling, if one appears as a child of //a scrolling window shoehorn that scrolling settings to this widget and //return the real parent to use - if (pParent && pParent->GetType() == WINDOW_SCROLLWINDOW) + if (pParent && pParent->GetType() == WindowType::SCROLLWINDOW) { WinBits nScrollBits = pParent->GetStyle(); nScrollBits &= (WB_AUTOHSCROLL|WB_HSCROLL|WB_AUTOVSCROLL|WB_VSCROLL); @@ -1280,7 +1280,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & bool bIsPlaceHolder = name.isEmpty(); bool bVertical = false; - if (pParent && pParent->GetType() == WINDOW_TABCONTROL) + if (pParent && pParent->GetType() == WindowType::TABCONTROL) { //We have to add a page @@ -1788,9 +1788,9 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & { VclPtr<vcl::Window> xParent(pParent); pFunction(xWindow, xParent, rMap); - if (xWindow->GetType() == WINDOW_PUSHBUTTON) + if (xWindow->GetType() == WindowType::PUSHBUTTON) setupFromActionName(static_cast<Button*>(xWindow.get()), rMap, m_xFrame); - else if (xWindow->GetType() == WINDOW_MENUBUTTON) + else if (xWindow->GetType() == WindowType::MENUBUTTON) { OString sMenu = extractCustomProperty(rMap); if (!sMenu.isEmpty()) @@ -1821,7 +1821,7 @@ namespace //represented in the .ui format, i.e. only their children exist. bool isConsideredGtkPseudo(vcl::Window *pWindow) { - return pWindow->GetType() == WINDOW_TABPAGE; + return pWindow->GetType() == WindowType::TABPAGE; } } @@ -2127,7 +2127,7 @@ void VclBuilder::handleChild(vcl::Window *pParent, xmlreader::XmlReader &reader) pCurrentChild->Show(); //Select the first page if it's a notebook - if (pCurrentChild->GetType() == WINDOW_TABCONTROL) + if (pCurrentChild->GetType() == WindowType::TABCONTROL) { TabControl *pTabControl = static_cast<TabControl*>(pCurrentChild); pTabControl->SetCurPageId(pTabControl->GetPageId(0)); @@ -2994,7 +2994,7 @@ void VclBuilder::applyPackingProperty(vcl::Window *pCurrent, xmlreader::Span name; int nsId; - if (pCurrent->GetType() == WINDOW_SCROLLWINDOW) + if (pCurrent->GetType() == WindowType::SCROLLWINDOW) { auto aFind = m_pParserState->m_aRedundantParentWidgets.find(VclPtr<vcl::Window>(pCurrent)); if (aFind != m_pParserState->m_aRedundantParentWidgets.end()) diff --git a/vcl/source/window/debug.cxx b/vcl/source/window/debug.cxx index baa370027022..960fe82400de 100644 --- a/vcl/source/window/debug.cxx +++ b/vcl/source/window/debug.cxx @@ -29,7 +29,7 @@ const char* ImplDbgCheckWindow( const void* pObj ) const vcl::Window* pWindow = static_cast<vcl::Window const *>(pObj); - if ( (pWindow->GetType() < WINDOW_FIRST) || (pWindow->GetType() > WINDOW_LAST) ) + if ( (pWindow->GetType() < WindowType::FIRST) || (pWindow->GetType() > WindowType::LAST) ) return "Window data overwrite"; // check window-chain diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx index e40d3b56cbae..46b8d78adbb6 100644 --- a/vcl/source/window/decoview.cxx +++ b/vcl/source/window/decoview.cxx @@ -635,7 +635,7 @@ void ImplDrawFrame( OutputDevice *const pDev, Rectangle& rRect, // no flat borders for standard VCL controls (ie formcontrols that keep their classic look) // will not affect frame windows (like dropdowns) - if( bFlatBorders && pWin && pWin->GetType() == WINDOW_BORDERWINDOW && (pWin != pWin->ImplGetFrameWindow()) ) + if( bFlatBorders && pWin && pWin->GetType() == WindowType::BORDERWINDOW && (pWin != pWin->ImplGetFrameWindow()) ) { // check for formcontrol, i.e., a control without NWF enabled Control *const pControl = dynamic_cast< Control* >( pWin->GetWindow( GetWindowType::Client ) ); @@ -655,7 +655,7 @@ void ImplDrawFrame( OutputDevice *const pDev, Rectangle& rRect, { long nControlFlags = static_cast<long>(nStyle); nControlFlags |= static_cast<long>(nFlags); - nControlFlags |= static_cast<long>(pWin->GetType()==WINDOW_BORDERWINDOW ? + nControlFlags |= static_cast<long>(pWin->GetType() == WindowType::BORDERWINDOW ? DrawFrameFlags::BorderWindowBorder : DrawFrameFlags::NONE); ImplControlValue aControlValue( nControlFlags ); diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 4e0fd974d161..15a31bc1c40d 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -83,13 +83,13 @@ static bool ImplIsMnemonicCtrl( vcl::Window* pWindow ) if( ! pWindow->GetSettings().GetStyleSettings().GetAutoMnemonic() ) return false; - if ( (pWindow->GetType() == WINDOW_RADIOBUTTON) || - (pWindow->GetType() == WINDOW_CHECKBOX) || - (pWindow->GetType() == WINDOW_TRISTATEBOX) || - (pWindow->GetType() == WINDOW_PUSHBUTTON) ) + if ( (pWindow->GetType() == WindowType::RADIOBUTTON) || + (pWindow->GetType() == WindowType::CHECKBOX) || + (pWindow->GetType() == WindowType::TRISTATEBOX) || + (pWindow->GetType() == WindowType::PUSHBUTTON) ) return true; - if ( pWindow->GetType() == WINDOW_FIXEDTEXT ) + if ( pWindow->GetType() == WindowType::FIXEDTEXT ) { FixedText *pText = static_cast<FixedText*>(pWindow); if (pText->get_mnemonic_widget()) @@ -103,12 +103,12 @@ static bool ImplIsMnemonicCtrl( vcl::Window* pWindow ) return false; pNextWindow = pNextWindow->GetWindow( GetWindowType::Client ); if ( !(pNextWindow->GetStyle() & WB_TABSTOP) || - (pNextWindow->GetType() == WINDOW_FIXEDTEXT) || - (pNextWindow->GetType() == WINDOW_GROUPBOX) || - (pNextWindow->GetType() == WINDOW_RADIOBUTTON) || - (pNextWindow->GetType() == WINDOW_CHECKBOX) || - (pNextWindow->GetType() == WINDOW_TRISTATEBOX) || - (pNextWindow->GetType() == WINDOW_PUSHBUTTON) ) + (pNextWindow->GetType() == WindowType::FIXEDTEXT) || + (pNextWindow->GetType() == WindowType::GROUPBOX) || + (pNextWindow->GetType() == WindowType::RADIOBUTTON) || + (pNextWindow->GetType() == WindowType::CHECKBOX) || + (pNextWindow->GetType() == WindowType::TRISTATEBOX) || + (pNextWindow->GetType() == WindowType::PUSHBUTTON) ) return false; return true; @@ -205,10 +205,10 @@ void Accelerator::GenerateAutoMnemonicsOnHierarchy(vcl::Window* pWindow) } // take the Controls of the dialog into account for TabPages - if ( pWindow->GetType() == WINDOW_TABPAGE ) + if ( pWindow->GetType() == WindowType::TABPAGE ) { vcl::Window* pParent = pWindow->GetParent(); - if ( pParent->GetType() == WINDOW_TABCONTROL ) + if ( pParent->GetType() == WindowType::TABCONTROL ) pParent = pParent->GetParent(); if ( (pParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) == WB_DIALOGCONTROL ) @@ -289,7 +289,7 @@ static PushButton* ImplGetOKButton( Dialog* pDialog ) vcl::Window* pChild = getActionAreaButtonList(pDialog); while ( pChild ) { - if ( pChild->GetType() == WINDOW_OKBUTTON ) + if ( pChild->GetType() == WindowType::OKBUTTON ) return static_cast<PushButton*>(pChild); pChild = pChild->GetWindow( GetWindowType::Next ); @@ -304,7 +304,7 @@ static PushButton* ImplGetCancelButton( Dialog* pDialog ) while ( pChild ) { - if ( pChild->GetType() == WINDOW_CANCELBUTTON ) + if ( pChild->GetType() == WindowType::CANCELBUTTON ) return static_cast<PushButton*>(pChild); pChild = pChild->GetWindow( GetWindowType::Next ); @@ -519,7 +519,7 @@ void Dialog::doDeferredInit(WinBits nBits) } Dialog::Dialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription) - : SystemWindow(WINDOW_DIALOG) + : SystemWindow(WindowType::DIALOG) , mnInitFlag(InitFlag::Default) { ImplInitDialogData(); @@ -535,7 +535,7 @@ Dialog::Dialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXML } Dialog::Dialog(vcl::Window* pParent, WinBits nStyle, InitFlag eFlag) - : SystemWindow(WINDOW_DIALOG) + : SystemWindow(WindowType::DIALOG) , mnInitFlag(eFlag) { ImplInitDialogData(); @@ -1205,18 +1205,18 @@ VclBuilderContainer::~VclBuilderContainer() } ModelessDialog::ModelessDialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription, InitFlag eFlag) - : Dialog(pParent, rID, rUIXMLDescription, WINDOW_MODELESSDIALOG, eFlag) + : Dialog(pParent, rID, rUIXMLDescription, WindowType::MODELESSDIALOG, eFlag) { } ModalDialog::ModalDialog( vcl::Window* pParent, WinBits nStyle ) : - Dialog( WINDOW_MODALDIALOG ) + Dialog( WindowType::MODALDIALOG ) { ImplInit( pParent, nStyle ); } ModalDialog::ModalDialog( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription ) : - Dialog(pParent, rID, rUIXMLDescription, WINDOW_MODALDIALOG) + Dialog(pParent, rID, rUIXMLDescription, WindowType::MODALDIALOG) { } diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index 3cb40abf84db..e1e4495ca60c 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -93,7 +93,7 @@ static vcl::Window* ImplGetSubChildWindow( vcl::Window* pParent, sal_uInt16 n, s pFoundWindow = pWindow; // for a TabControl, remember the current TabPage for later use - if ( pWindow->GetType() == WINDOW_TABCONTROL ) + if ( pWindow->GetType() == WindowType::TABCONTROL ) { TabControl* pTabControl = static_cast<TabControl*>(pWindow); // Check if the TabPage is a Child of the TabControl and still exists (by @@ -264,7 +264,7 @@ vcl::Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, GetDlgWindowType nType { if ( pWindow ) { - if ( pWindow->GetType() == WINDOW_TABCONTROL ) + if ( pWindow->GetType() == WindowType::TABCONTROL ) { vcl::Window* pNextWindow = ImplGetDlgWindow( i, GetDlgWindowType::Next ); if ( pNextWindow ) @@ -413,7 +413,7 @@ vcl::Window* ImplFindAccelWindow( vcl::Window* pParent, sal_uInt16& rIndex, sal_ cCompareChar = xCharClass->toUpper( OUString(cCompareChar), 0, 1, rLocale )[0]; if ( cCompareChar == cCharCode ) { - if (pWindow->GetType() == WINDOW_FIXEDTEXT) + if (pWindow->GetType() == WindowType::FIXEDTEXT) { FixedText *pFixedText = static_cast<FixedText*>(pWindow); vcl::Window *pMnemonicWidget = pFixedText->get_mnemonic_widget(); @@ -424,9 +424,9 @@ vcl::Window* ImplFindAccelWindow( vcl::Window* pParent, sal_uInt16& rIndex, sal_ } // skip Static-Controls - if ( (pWindow->GetType() == WINDOW_FIXEDTEXT) || - (pWindow->GetType() == WINDOW_FIXEDLINE) || - (pWindow->GetType() == WINDOW_GROUPBOX) ) + if ( (pWindow->GetType() == WindowType::FIXEDTEXT) || + (pWindow->GetType() == WindowType::FIXEDLINE) || + (pWindow->GetType() == WindowType::GROUPBOX) ) pWindow = pParent->ImplGetDlgWindow( i, GetDlgWindowType::Next ); rIndex = i; return pWindow; @@ -476,7 +476,7 @@ void Window::ImplControlFocus( GetFocusFlags nFlags ) { if ( nFlags & GetFocusFlags::Mnemonic ) { - if ( GetType() == WINDOW_RADIOBUTTON ) + if ( GetType() == WindowType::RADIOBUTTON ) { if ( !static_cast<RadioButton*>(this)->IsChecked() ) static_cast<RadioButton*>(this)->ImplCallClick( true, nFlags ); @@ -488,7 +488,7 @@ void Window::ImplControlFocus( GetFocusFlags nFlags ) ImplGrabFocus( nFlags ); if ( nFlags & GetFocusFlags::UniqueMnemonic ) { - if ( GetType() == WINDOW_CHECKBOX ) + if ( GetType() == WindowType::CHECKBOX ) static_cast<CheckBox*>(this)->ImplCheck(); else if ( mpWindowImpl->mbPushButton ) { @@ -501,7 +501,7 @@ void Window::ImplControlFocus( GetFocusFlags nFlags ) } else { - if ( GetType() == WINDOW_RADIOBUTTON ) + if ( GetType() == WindowType::RADIOBUTTON ) { if ( !static_cast<RadioButton*>(this)->IsChecked() ) static_cast<RadioButton*>(this)->ImplCallClick( true, nFlags ); @@ -523,8 +523,8 @@ namespace isEnabledInLayout(pWindow) && pWindow->IsInputEnabled() && //Pure window shouldn't get window after controls such as //buttons. - (pWindow->GetType() != WINDOW_WINDOW && pWindow->GetType() != WINDOW_SYSWINDOW && - pWindow->GetType() != WINDOW_WORKWINDOW && pWindow->GetType() != WINDOW_CONTROL) + (pWindow->GetType() != WindowType::WINDOW && pWindow->GetType() != WindowType::SYSWINDOW && + pWindow->GetType() != WindowType::WORKWINDOW && pWindow->GetType() != WindowType::CONTROL) ); } @@ -704,7 +704,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) iButtonStart = iButton; while ( pButtonWindow ) { - if ( pButtonWindow->GetType() == WINDOW_CANCELBUTTON ) + if ( pButtonWindow->GetType() == WindowType::CANCELBUTTON ) break; pButtonWindow = ImplGetNextWindow( this, iButton, iButton, true ); @@ -848,7 +848,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) } else if ( (nKeyCode == KEY_LEFT) || (nKeyCode == KEY_UP) ) { - if (pSWindow->GetType() == WINDOW_RADIOBUTTON) + if (pSWindow->GetType() == WindowType::RADIOBUTTON) return nextInGroup(static_cast<RadioButton*>(pSWindow), true); else { @@ -879,7 +879,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) } else if ( (nKeyCode == KEY_RIGHT) || (nKeyCode == KEY_DOWN) ) { - if (pSWindow->GetType() == WINDOW_RADIOBUTTON) + if (pSWindow->GetType() == WindowType::RADIOBUTTON) return nextInGroup(static_cast<RadioButton*>(pSWindow), false); else { diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx index f735949ecab8..f23fc4da10b6 100644 --- a/vcl/source/window/dockingarea.cxx +++ b/vcl/source/window/dockingarea.cxx @@ -40,7 +40,7 @@ DockingAreaWindow::ImplData::ImplData() } DockingAreaWindow::DockingAreaWindow( vcl::Window* pParent ) : - Window( WINDOW_DOCKINGAREA ) + Window( WindowType::DOCKINGAREA ) { ImplInit( pParent, WB_CLIPCHILDREN|WB_3DLOOK, nullptr ); diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index ba168bd75ca1..7871b539e207 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -970,7 +970,7 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin mpOldBorderWin = nullptr; // no border window found bool bAllowTearOff = bool( nFlags & FloatWinPopupFlags::AllowTearOff ); - bool bUseStdPopup = bAllowTearOff && GetWindow()->GetType() != WINDOW_TOOLBOX; + bool bUseStdPopup = bAllowTearOff && GetWindow()->GetType() != WindowType::TOOLBOX; // the new parent for popup mode VclPtr<FloatingWindow> pWin; diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index a74d659aa68f..ced4ec955b36 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -351,7 +351,7 @@ DockingWindow::DockingWindow( WindowType nType ) : } DockingWindow::DockingWindow( vcl::Window* pParent, WinBits nStyle ) : - Window( WINDOW_DOCKINGWINDOW ) + Window( WindowType::DOCKINGWINDOW ) { ImplInitDockingWindowData(); ImplInit( pParent, nStyle ); @@ -376,7 +376,7 @@ void DockingWindow::loadUI(vcl::Window* pParent, const OString& rID, const OUStr DockingWindow::DockingWindow(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame) - : Window(WINDOW_DOCKINGWINDOW) + : Window(WindowType::DOCKINGWINDOW) { ImplInitDockingWindowData(); diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx index e8bb662355ed..da6fc79a7c28 100644 --- a/vcl/source/window/event.cxx +++ b/vcl/source/window/event.cxx @@ -580,17 +580,17 @@ void Window::ImplCallFocusChangeActivate( vcl::Window* pNewOverlapWindow, pOldRealWindow = pOldOverlapWindow->ImplGetWindow(); pNewRealWindow = pNewOverlapWindow->ImplGetWindow(); - if ( (pOldRealWindow->GetType() != WINDOW_FLOATINGWINDOW) || + if ( (pOldRealWindow->GetType() != WindowType::FLOATINGWINDOW) || pOldRealWindow->GetActivateMode() != ActivateModeFlags::NONE ) { - if ( (pNewRealWindow->GetType() == WINDOW_FLOATINGWINDOW) && + if ( (pNewRealWindow->GetType() == WindowType::FLOATINGWINDOW) && pNewRealWindow->GetActivateMode() == ActivateModeFlags::NONE) { pSVData->maWinData.mpLastDeacWin = pOldOverlapWindow; bCallDeactivate = false; } } - else if ( (pNewRealWindow->GetType() != WINDOW_FLOATINGWINDOW) || + else if ( (pNewRealWindow->GetType() != WindowType::FLOATINGWINDOW) || pNewRealWindow->GetActivateMode() != ActivateModeFlags::NONE ) { if ( pSVData->maWinData.mpLastDeacWin ) diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 41e12ea67aea..4337969fc07f 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -146,13 +146,13 @@ void FloatingWindow::ImplInitSettings() } FloatingWindow::FloatingWindow(vcl::Window* pParent, WinBits nStyle) : - SystemWindow(WINDOW_FLOATINGWINDOW) + SystemWindow(WindowType::FLOATINGWINDOW) { ImplInit(pParent, nStyle); } FloatingWindow::FloatingWindow(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame) - : SystemWindow(WINDOW_FLOATINGWINDOW) + : SystemWindow(WindowType::FLOATINGWINDOW) , mpNextFloat(nullptr) , mpFirstPopupModeWin(nullptr) , mpImplData(nullptr) diff --git a/vcl/source/window/introwin.cxx b/vcl/source/window/introwin.cxx index 50c871203e90..d33a36c5bb14 100644 --- a/vcl/source/window/introwin.cxx +++ b/vcl/source/window/introwin.cxx @@ -32,7 +32,7 @@ void IntroWindow::ImplInitIntroWindowData() } IntroWindow::IntroWindow( ) : - WorkWindow( WINDOW_INTROWINDOW ) + WorkWindow( WindowType::INTROWINDOW ) { ImplInitIntroWindowData(); WorkWindow::ImplInit( nullptr, WB_INTROWIN ); diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 77dbf1990dc4..785ec06f13bb 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -25,7 +25,7 @@ #include <svids.hrc> VclContainer::VclContainer(vcl::Window *pParent, WinBits nStyle) - : Window(WINDOW_CONTAINER) + : Window(WindowType::CONTAINER) , IPrioritable() , m_bLayoutDirty(true) { @@ -1825,7 +1825,7 @@ VclScrolledWindow::VclScrolledWindow(vcl::Window *pParent) , m_pHScroll(VclPtr<ScrollBar>::Create(this, WB_HIDE | WB_HORZ)) , m_aScrollBarBox(VclPtr<ScrollBarBox>::Create(this, WB_HIDE)) { - SetType(WINDOW_SCROLLWINDOW); + SetType(WindowType::SCROLLWINDOW); Link<ScrollBar*,void> aLink( LINK( this, VclScrolledWindow, ScrollBarHdl ) ); m_pVScroll->SetScrollHdl(aLink); @@ -2185,7 +2185,7 @@ MessageDialog::MessageDialog(vcl::Window* pParent, WinBits nStyle) , m_pPrimaryMessage(nullptr) , m_pSecondaryMessage(nullptr) { - SetType(WINDOW_MESSBOX); + SetType(WindowType::MESSBOX); } MessageDialog::MessageDialog(vcl::Window* pParent, @@ -2201,12 +2201,12 @@ MessageDialog::MessageDialog(vcl::Window* pParent, , m_pSecondaryMessage(nullptr) , m_sPrimaryString(rMessage) { - SetType(WINDOW_MESSBOX); + SetType(WindowType::MESSBOX); create_owned_areas(); } MessageDialog::MessageDialog(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription) - : Dialog(pParent, OStringToOUString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription, WINDOW_MESSBOX) + : Dialog(pParent, OStringToOUString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription, WindowType::MESSBOX) , m_eButtonsType(VclButtonsType::NONE) , m_eMessageType(VclMessageType::Info) , m_pOwnedContentArea(nullptr) @@ -2267,7 +2267,7 @@ void MessageDialog::setButtonHandlers(VclButtonBox *pButtonBox) { switch (pChild->GetType()) { - case WINDOW_PUSHBUTTON: + case WindowType::PUSHBUTTON: { PushButton* pButton = static_cast<PushButton*>(pChild); pButton->SetClickHdl(LINK(this, MessageDialog, ButtonHdl)); @@ -2275,13 +2275,13 @@ void MessageDialog::setButtonHandlers(VclButtonBox *pButtonBox) } //insist that the response ids match the default actions for those //widgets, and leave their default handlers in place - case WINDOW_OKBUTTON: + case WindowType::OKBUTTON: assert(get_response(pChild) == RET_OK); break; - case WINDOW_CANCELBUTTON: + case WindowType::CANCELBUTTON: assert(get_response(pChild) == RET_CANCEL); break; - case WINDOW_HELPBUTTON: + case WindowType::HELPBUTTON: assert(get_response(pChild) == RET_HELP); break; default: diff --git a/vcl/source/window/legacyaccessibility.cxx b/vcl/source/window/legacyaccessibility.cxx index 1cddcab06201..f476712e1833 100644 --- a/vcl/source/window/legacyaccessibility.cxx +++ b/vcl/source/window/legacyaccessibility.cxx @@ -42,13 +42,13 @@ static vcl::Window* ImplGetLabelFor( vcl::Window* pFrameWindow, WindowType nMyTy { vcl::Window* pWindow = nullptr; - if( nMyType == WINDOW_FIXEDTEXT || - nMyType == WINDOW_FIXEDLINE || - nMyType == WINDOW_GROUPBOX ) + if( nMyType == WindowType::FIXEDTEXT || + nMyType == WindowType::FIXEDLINE || + nMyType == WindowType::GROUPBOX ) { // #i100833# MT 2010/02: Group box and fixed lines can also label a fixed text. // See tools/options/print for example. - bool bThisIsAGroupControl = (nMyType == WINDOW_GROUPBOX) || (nMyType == WINDOW_FIXEDLINE); + bool bThisIsAGroupControl = (nMyType == WindowType::GROUPBOX) || (nMyType == WindowType::FIXEDLINE); // get index, form start and form end sal_uInt16 nIndex=0, nFormStart=0, nFormEnd=0; ::ImplFindDlgCtrlWindow( pFrameWindow, @@ -80,13 +80,13 @@ static vcl::Window* ImplGetLabelFor( vcl::Window* pFrameWindow, WindowType nMyTy if( pSWindow && isVisibleInLayout(pSWindow) && ! (pSWindow->GetStyle() & WB_NOLABEL) ) { WindowType nType = pSWindow->GetType(); - if( nType != WINDOW_FIXEDTEXT && - nType != WINDOW_FIXEDLINE && - nType != WINDOW_GROUPBOX ) + if( nType != WindowType::FIXEDTEXT && + nType != WindowType::FIXEDLINE && + nType != WindowType::GROUPBOX ) { pWindow = pSWindow; } - else if( bThisIsAGroupControl && ( nType == WINDOW_FIXEDTEXT ) ) + else if( bThisIsAGroupControl && ( nType == WindowType::FIXEDTEXT ) ) { pWindow = pSWindow; } @@ -129,7 +129,7 @@ Window* Window::getLegacyNonLayoutAccessibleRelationLabelFor() const static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Window* pLabeled ) { Window* pWindow = nullptr; - if ( (nMyType != WINDOW_GROUPBOX) && (nMyType != WINDOW_FIXEDLINE) ) + if ( (nMyType != WindowType::GROUPBOX) && (nMyType != WindowType::FIXEDLINE) ) { // search for a control that labels this window // a label is considered the last fixed text, fixed line or group box @@ -146,10 +146,10 @@ static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Windo nFormEnd ); if( pSWindow && nIndex != nFormStart ) { - if( nMyType == WINDOW_PUSHBUTTON || - nMyType == WINDOW_HELPBUTTON || - nMyType == WINDOW_OKBUTTON || - nMyType == WINDOW_CANCELBUTTON ) + if( nMyType == WindowType::PUSHBUTTON || + nMyType == WindowType::HELPBUTTON || + nMyType == WindowType::OKBUTTON || + nMyType == WindowType::CANCELBUTTON ) { nFormStart = nIndex-1; } @@ -163,12 +163,12 @@ static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Windo if( pSWindow && isVisibleInLayout(pSWindow) && !(pSWindow->GetStyle() & WB_NOLABEL) ) { WindowType nType = pSWindow->GetType(); - if ( ( nType == WINDOW_FIXEDTEXT || - nType == WINDOW_FIXEDLINE || - nType == WINDOW_GROUPBOX ) ) + if ( ( nType == WindowType::FIXEDTEXT || + nType == WindowType::FIXEDLINE || + nType == WindowType::GROUPBOX ) ) { // a fixed text can't be labeld by a fixed text. - if ( ( nMyType != WINDOW_FIXEDTEXT ) || ( nType != WINDOW_FIXEDTEXT ) ) + if ( ( nMyType != WindowType::FIXEDTEXT ) || ( nType != WindowType::FIXEDTEXT ) ) pWindow = pSWindow; break; } @@ -195,12 +195,12 @@ Window* Window::getLegacyNonLayoutAccessibleRelationLabeledBy() const } // #i62723#, #104191# checkboxes and radiobuttons are not supposed to have labels - if( GetType() == WINDOW_CHECKBOX || GetType() == WINDOW_RADIOBUTTON ) + if( GetType() == WindowType::CHECKBOX || GetType() == WindowType::RADIOBUTTON ) return nullptr; -// if( ! ( GetType() == WINDOW_FIXEDTEXT || -// GetType() == WINDOW_FIXEDLINE || -// GetType() == WINDOW_GROUPBOX ) ) +// if( ! ( GetType() == WindowType::FIXEDTEXT || +// GetType() == WindowType::FIXEDLINE || +// GetType() == WindowType::GROUPBOX ) ) // #i100833# MT 2010/02: Group box and fixed lines can also label a fixed text. // See tools/options/print for example. @@ -219,9 +219,9 @@ Window* Window::getLegacyNonLayoutAccessibleRelationMemberOf() const { pFrameWindow = ImplGetFrameWindow(); } - // if( ! ( GetType() == WINDOW_FIXEDTEXT || - if( !( GetType() == WINDOW_FIXEDLINE || - GetType() == WINDOW_GROUPBOX ) ) + // if( ! ( GetType() == WindowType::FIXEDTEXT || + if( !( GetType() == WindowType::FIXEDLINE || + GetType() == WindowType::GROUPBOX ) ) { // search for a control that makes member of this window // it is considered the last fixed line or group box @@ -237,10 +237,10 @@ Window* Window::getLegacyNonLayoutAccessibleRelationMemberOf() const nFormEnd ); if( pSWindow && nIndex != nFormStart ) { - if( GetType() == WINDOW_PUSHBUTTON || - GetType() == WINDOW_HELPBUTTON || - GetType() == WINDOW_OKBUTTON || - GetType() == WINDOW_CANCELBUTTON ) + if( GetType() == WindowType::PUSHBUTTON || + GetType() == WindowType::HELPBUTTON || + GetType() == WindowType::OKBUTTON || + GetType() == WindowType::CANCELBUTTON ) { nFormStart = nIndex-1; } @@ -252,8 +252,8 @@ Window* Window::getLegacyNonLayoutAccessibleRelationMemberOf() const nFoundIndex, false ); if( pSWindow && pSWindow->IsVisible() && - ( pSWindow->GetType() == WINDOW_FIXEDLINE || - pSWindow->GetType() == WINDOW_GROUPBOX ) ) + ( pSWindow->GetType() == WindowType::FIXEDLINE || + pSWindow->GetType() == WindowType::GROUPBOX ) ) { pWindow = pSWindow; break; diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index be3ab27845aa..a2ad3a96172f 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -118,7 +118,7 @@ MenuBarWindow::MenuBarWindow( vcl::Window* pParent ) : aFloatBtn(VclPtr<PushButton>::Create(this, WB_NOPOINTERFOCUS | WB_SMALLSTYLE | WB_RECTSTYLE)), aHideBtn(VclPtr<PushButton>::Create(this, WB_NOPOINTERFOCUS | WB_SMALLSTYLE | WB_RECTSTYLE)) { - SetType(WINDOW_MENUBARWINDOW); + SetType(WindowType::MENUBARWINDOW); pMenu = nullptr; pActivePopup = nullptr; nHighlightedItem = ITEMPOS_INVALID; @@ -536,7 +536,7 @@ static int ImplGetTopDockingAreaHeight( vcl::Window *pWindow ) while( pChildWin ) { DockingAreaWindow *pDockingArea = nullptr; - if ( pChildWin->GetType() == WINDOW_DOCKINGAREA ) + if ( pChildWin->GetType() == WindowType::DOCKINGAREA ) pDockingArea = static_cast< DockingAreaWindow* >( pChildWin ); if( pDockingArea && pDockingArea->GetAlign() == WindowAlign::Top && diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx index 240fb2698330..81862e62aa4f 100644 --- a/vcl/source/window/msgbox.cxx +++ b/vcl/source/window/msgbox.cxx @@ -130,7 +130,7 @@ void MessBox::ImplInitButtons() MessBox::MessBox( vcl::Window* pParent, WinBits nStyle, const OUString& rTitle, const OUString& rMessage ) : - ButtonDialog( WINDOW_MESSBOX ), + ButtonDialog( WindowType::MESSBOX ), mbHelpBtn( false ), mbCheck( false ), maMessText( rMessage ) diff --git a/vcl/source/window/settings.cxx b/vcl/source/window/settings.cxx index 6bb516eb956e..759f1ff12da1 100644 --- a/vcl/source/window/settings.cxx +++ b/vcl/source/window/settings.cxx @@ -50,7 +50,7 @@ void Window::SetSettings( const AllSettings& rSettings, bool bChild ) if ( mpWindowImpl->mpBorderWindow ) { mpWindowImpl->mpBorderWindow->SetSettings( rSettings, false ); - if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) && + if ( (mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW) && static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->mpMenuBarWindow ) static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->mpMenuBarWindow->SetSettings( rSettings, true ); } @@ -85,7 +85,7 @@ void Window::UpdateSettings( const AllSettings& rSettings, bool bChild ) if ( mpWindowImpl->mpBorderWindow ) { mpWindowImpl->mpBorderWindow->UpdateSettings( rSettings ); - if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) && + if ( (mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW) && static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->mpMenuBarWindow ) static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->mpMenuBarWindow->UpdateSettings( rSettings, true ); } diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx index eb6da6e758fa..8d607d6f9858 100644 --- a/vcl/source/window/split.cxx +++ b/vcl/source/window/split.cxx @@ -127,7 +127,7 @@ void Splitter::ImplDrawSplitter() } Splitter::Splitter( vcl::Window* pParent, WinBits nStyle ) : - Window( WINDOW_SPLITTER ), + Window( WindowType::SPLITTER ), mpRefWin( nullptr ), mnSplitPos( 0 ), mnLastSplitPos( 0 ), diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index 64b0ffe08e69..b53386344832 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -1375,7 +1375,7 @@ void SplitWindow::ImplInitSettings() } SplitWindow::SplitWindow( vcl::Window* pParent, WinBits nStyle ) : - DockingWindow( WINDOW_SPLITWINDOW ) + DockingWindow( WindowType::SPLITWINDOW ) { ImplInit( pParent, nStyle ); DockingWindow::SetIdleDebugName( "vcl::SplitWindow maLayoutIdle" ); diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx index 2c5bebc62ce2..ce70ebaf2428 100644 --- a/vcl/source/window/stacking.cxx +++ b/vcl/source/window/stacking.cxx @@ -973,8 +973,8 @@ void Window::SetParent( vcl::Window* pNewParent ) // also convert Activate-Status if ( bNewFrame ) { - if ( (GetType() == WINDOW_BORDERWINDOW) && - (ImplGetWindow()->GetType() == WINDOW_FLOATINGWINDOW) ) + if ( (GetType() == WindowType::BORDERWINDOW) && + (ImplGetWindow()->GetType() == WindowType::FLOATINGWINDOW) ) static_cast<ImplBorderWindow*>(this)->SetDisplayActive( mpWindowImpl->mpFrameData->mbHasFocus ); } diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index c4f541572cfa..3960437063cb 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -140,7 +140,7 @@ void StatusBar::ImplInit( vcl::Window* pParent, WinBits nStyle ) } StatusBar::StatusBar( vcl::Window* pParent, WinBits nStyle ) : - Window( WINDOW_STATUSBAR ) + Window( WindowType::STATUSBAR ) { ImplInit( pParent, nStyle ); } diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx index d6595038991b..3b8c90a390b4 100644 --- a/vcl/source/window/syschild.cxx +++ b/vcl/source/window/syschild.cxx @@ -121,13 +121,13 @@ void SystemChildWindow::ImplInitSysChild( vcl::Window* pParent, WinBits nStyle, } SystemChildWindow::SystemChildWindow( vcl::Window* pParent, WinBits nStyle ) : - Window( WINDOW_SYSTEMCHILDWINDOW ) + Window( WindowType::SYSTEMCHILDWINDOW ) { ImplInitSysChild( pParent, nStyle, nullptr ); } SystemChildWindow::SystemChildWindow( vcl::Window* pParent, WinBits nStyle, SystemWindowData *pData, bool bShow ) : - Window( WINDOW_SYSTEMCHILDWINDOW ) + Window( WindowType::SYSTEMCHILDWINDOW ) { ImplInitSysChild( pParent, nStyle, pData, bShow ); } diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index a8ed067a5b4e..192b85e4c8a8 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -131,14 +131,14 @@ namespace vcl::Window* pChild = firstLogicalChildOfParent(pParent); while (pChild) { - if (pChild->GetType() == WINDOW_TABCONTROL) + if (pChild->GetType() == WindowType::TABCONTROL) { // find currently shown tab page TabControl* pTabControl = static_cast<TabControl*>(pChild); TabPage* pTabPage = pTabControl->GetTabPage( pTabControl->GetCurPageId() ); processChildren(pTabPage, bShowAccel); } - else if (pChild->GetType() == WINDOW_TABPAGE) + else if (pChild->GetType() == WindowType::TABPAGE) { // bare tabpage without tabcontrol parent (options dialog) processChildren(pChild, bShowAccel); @@ -179,7 +179,7 @@ bool SystemWindow::EventNotify( NotifyEvent& rNEvt ) rNEvt.GetType() == MouseNotifyEvent::COMMAND) { MenuBar* pMBar = mpMenuBar; - if ( !pMBar && ( GetType() == WINDOW_FLOATINGWINDOW ) ) + if ( !pMBar && ( GetType() == WindowType::FLOATINGWINDOW ) ) { vcl::Window* pWin = ImplGetFrameWindow()->ImplGetWindow(); if( pWin && pWin->IsSystemWindow() ) @@ -216,7 +216,7 @@ bool SystemWindow::PreNotify( NotifyEvent& rNEvt ) else { TaskPaneList *pTList = mpImplData->mpTaskPaneList.get(); - if( !pTList && ( GetType() == WINDOW_FLOATINGWINDOW ) ) + if( !pTList && ( GetType() == WindowType::FLOATINGWINDOW ) ) { vcl::Window* pWin = ImplGetFrameWindow()->ImplGetWindow(); if( pWin && pWin->IsSystemWindow() ) @@ -252,7 +252,7 @@ TaskPaneList* SystemWindow::GetTaskPaneList() { mpImplData->mpTaskPaneList.reset( new TaskPaneList ); MenuBar* pMBar = mpMenuBar; - if ( !pMBar && ( GetType() == WINDOW_FLOATINGWINDOW ) ) + if ( !pMBar && ( GetType() == WindowType::FLOATINGWINDOW ) ) { vcl::Window* pWin = ImplGetFrameWindow()->ImplGetWindow(); if ( pWin && pWin->IsSystemWindow() ) @@ -913,7 +913,7 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar) VclPtr<vcl::Window> pNewWindow; mpMenuBar = pMenuBar; - if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) ) + if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW) ) { if ( pOldMenuBar ) pOldWindow = pOldMenuBar->ImplGetWindow(); @@ -996,7 +996,7 @@ void SystemWindow::SetMenuBarMode( MenuBarMode nMode ) if ( mnMenuBarMode != nMode ) { mnMenuBarMode = nMode; - if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) ) + if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW) ) { if ( nMode == MenuBarMode::Hide ) static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarMode( true ); diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx index 6c97b1f29c1e..4b4cb46b9f57 100644 --- a/vcl/source/window/tabdlg.cxx +++ b/vcl/source/window/tabdlg.cxx @@ -47,7 +47,7 @@ void TabDialog::ImplPosControls() { if ( pChild->IsVisible() && (pChild != mpViewWindow) ) { - if (pChild->GetType() == WINDOW_TABCONTROL || isContainerWindow(*pChild)) + if (pChild->GetType() == WindowType::TABCONTROL || isContainerWindow(*pChild)) pTabControl = pChild; else if ( pTabControl ) { @@ -208,14 +208,14 @@ void TabDialog::ImplPosControls() } TabDialog::TabDialog( vcl::Window* pParent, WinBits nStyle ) : - Dialog( WINDOW_TABDIALOG ) + Dialog( WindowType::TABDIALOG ) { ImplInitTabDialogData(); ImplInit( pParent, nStyle ); } TabDialog::TabDialog( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription ) : - Dialog(pParent, rID, rUIXMLDescription, WINDOW_TABDIALOG) + Dialog(pParent, rID, rUIXMLDescription, WindowType::TABDIALOG) { ImplInitTabDialogData(); } @@ -250,7 +250,7 @@ vcl::Window* findTabControl(vcl::Window* pCurrent) return nullptr; } - if (pCurrent->GetType() == WINDOW_TABCONTROL) + if (pCurrent->GetType() == WindowType::TABCONTROL) { return pCurrent; } diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx index cda47e0ad401..a929a333830d 100644 --- a/vcl/source/window/tabpage.cxx +++ b/vcl/source/window/tabpage.cxx @@ -42,7 +42,7 @@ void TabPage::ImplInit( vcl::Window* pParent, WinBits nStyle ) // if the tabpage is drawn (ie filled) by a native widget, make sure all controls will have transparent background // otherwise they will paint with a wrong background - if( IsNativeControlSupported(ControlType::TabBody, ControlPart::Entire) && GetParent() && (GetParent()->GetType() == WINDOW_TABCONTROL) ) + if( IsNativeControlSupported(ControlType::TabBody, ControlPart::Entire) && GetParent() && (GetParent()->GetType() == WindowType::TABCONTROL) ) EnableChildTransparentMode(); } @@ -70,14 +70,14 @@ void TabPage::ImplInitSettings() } TabPage::TabPage( vcl::Window* pParent, WinBits nStyle ) : - Window( WINDOW_TABPAGE ) + Window( WindowType::TABPAGE ) , IContext() { ImplInit( pParent, nStyle ); } TabPage::TabPage(vcl::Window *pParent, const OString& rID, const OUString& rUIXMLDescription) - : Window(WINDOW_TABPAGE) + : Window(WindowType::TABPAGE) , IContext() { ImplInit(pParent, 0); @@ -131,7 +131,7 @@ void TabPage::DataChanged( const DataChangedEvent& rDCEvt ) void TabPage::Paint( vcl::RenderContext& rRenderContext, const Rectangle& ) { // draw native tabpage only inside tabcontrols, standalone tabpages look ugly (due to bad dialog design) - if( IsNativeControlSupported(ControlType::TabBody, ControlPart::Entire) && GetParent() && (GetParent()->GetType() == WINDOW_TABCONTROL) ) + if( IsNativeControlSupported(ControlType::TabBody, ControlPart::Entire) && GetParent() && (GetParent()->GetType() == WindowType::TABCONTROL) ) { const ImplControlValue aControlValue; diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx index 0cd840779a5a..7b6f67a41f17 100644 --- a/vcl/source/window/taskpanelist.cxx +++ b/vcl/source/window/taskpanelist.cxx @@ -289,7 +289,7 @@ vcl::Window* TaskPaneList::FindNextFloat( vcl::Window *pWindow, bool bForward ) /* #i83908# do not use the menubar if it is native and invisible */ if( (*p)->IsReallyVisible() && !(*p)->ImplIsSplitter() && - ( (*p)->GetType() != WINDOW_MENUBARWINDOW || static_cast<MenuBarWindow*>(p->get())->CanGetFocus() ) ) + ( (*p)->GetType() != WindowType::MENUBARWINDOW || static_cast<MenuBarWindow*>(p->get())->CanGetFocus() ) ) { pWindow = (*p).get(); break; diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index a6e3d5640e6f..9d8a1ba7cccd 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -646,9 +646,9 @@ void ToolBox::ImplDrawBorder(vcl::RenderContext& rRenderContext) static bool ImplIsFixedControl( const ImplToolItem *pItem ) { return ( pItem->mpWindow && - (pItem->mpWindow->GetType() == WINDOW_FIXEDTEXT || - pItem->mpWindow->GetType() == WINDOW_FIXEDLINE || - pItem->mpWindow->GetType() == WINDOW_GROUPBOX) ); + (pItem->mpWindow->GetType() == WindowType::FIXEDTEXT || + pItem->mpWindow->GetType() == WindowType::FIXEDLINE || + pItem->mpWindow->GetType() == WindowType::GROUPBOX) ); } const ImplToolItem *ToolBox::ImplGetFirstClippedItem( const ToolBox* pThis ) @@ -1556,7 +1556,7 @@ void ToolBox::doDeferredInit(WinBits nBits) } ToolBox::ToolBox( vcl::Window* pParent, WinBits nStyle ) : - DockingWindow( WINDOW_TOOLBOX ) + DockingWindow( WindowType::TOOLBOX ) { ImplInitToolBoxData(); ImplInit( pParent, nStyle ); @@ -1564,7 +1564,7 @@ ToolBox::ToolBox( vcl::Window* pParent, WinBits nStyle ) : ToolBox::ToolBox(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame) - : DockingWindow(WINDOW_TOOLBOX) + : DockingWindow(WindowType::TOOLBOX) { ImplInitToolBoxData(); @@ -2543,7 +2543,7 @@ void ToolBox::ImplFormat( bool bResize ) // equal to the LineSize when multibar has a single // line size ) if ( it->maRect.Top() || - (it->mpWindow && it->mpWindow->GetType() == WINDOW_CALCINPUTLINE) ) // tdf#83099 + (it->mpWindow && it->mpWindow->GetType() == WindowType::CALCINPUTLINE) ) // tdf#83099 { it->maCalcRect.Top() = it->maRect.Top(); } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 39df6c7aa496..14d0e935c60d 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -93,7 +93,7 @@ Window::Window( WindowType nType ) : } Window::Window( vcl::Window* pParent, WinBits nStyle ) : - mpWindowImpl(new WindowImpl( WINDOW_WINDOW )) + mpWindowImpl(new WindowImpl( WindowType::WINDOW )) { meOutDevType = OUTDEV_WINDOW; @@ -111,7 +111,7 @@ namespace // skip border windows, they do not carry information that // would help with diagnosing the problem const vcl::Window* pTempWin( pWindow ); - while ( pTempWin && pTempWin->GetType() == WINDOW_BORDERWINDOW ) { + while ( pTempWin && pTempWin->GetType() == WindowType::BORDERWINDOW ) { pTempWin = pTempWin->GetWindow( GetWindowType::FirstChild ); } // check if pTempWin is not null, otherwise use the @@ -952,7 +952,7 @@ static sal_Int32 CountDPIScaleFactor(sal_Int32 nDPI) void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData ) { - SAL_WARN_IF( !mpWindowImpl->mbFrame && !pParent && GetType() != WINDOW_FIXEDIMAGE, "vcl.window", + SAL_WARN_IF( !mpWindowImpl->mbFrame && !pParent && GetType() != WindowType::FIXEDIMAGE, "vcl.window", "Window::Window(): pParent == NULL" ); ImplSVData* pSVData = ImplGetSVData(); @@ -1012,9 +1012,9 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p // check for undecorated floating window if( // 1. floating windows that are not moveable/sizeable (only closeable allowed) ( !(nFrameStyle & ~SalFrameStyleFlags::CLOSEABLE) && - ( mpWindowImpl->mbFloatWin || ((GetType() == WINDOW_BORDERWINDOW) && static_cast<ImplBorderWindow*>(this)->mbFloatWindow) || (nStyle & WB_SYSTEMFLOATWIN) ) ) || + ( mpWindowImpl->mbFloatWin || ((GetType() == WindowType::BORDERWINDOW) && static_cast<ImplBorderWindow*>(this)->mbFloatWindow) || (nStyle & WB_SYSTEMFLOATWIN) ) ) || // 2. borderwindows of floaters with ownerdraw decoration - ( ((GetType() == WINDOW_BORDERWINDOW) && static_cast<ImplBorderWindow*>(this)->mbFloatWindow && (nStyle & WB_OWNERDRAWDECORATION) ) ) ) + ( ((GetType() == WindowType::BORDERWINDOW) && static_cast<ImplBorderWindow*>(this)->mbFloatWindow && (nStyle & WB_OWNERDRAWDECORATION) ) ) ) { nFrameStyle = SalFrameStyleFlags::FLOAT; if( nStyle & WB_OWNERDRAWDECORATION ) @@ -1036,15 +1036,15 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p switch (mpWindowImpl->mnType) { - case WINDOW_DIALOG: - case WINDOW_TABDIALOG: - case WINDOW_MODALDIALOG: - case WINDOW_MODELESSDIALOG: - case WINDOW_MESSBOX: - case WINDOW_INFOBOX: - case WINDOW_WARNINGBOX: - case WINDOW_ERRORBOX: - case WINDOW_QUERYBOX: + case WindowType::DIALOG: + case WindowType::TABDIALOG: + case WindowType::MODALDIALOG: + case WindowType::MODELESSDIALOG: + case WindowType::MESSBOX: + case WindowType::INFOBOX: + case WindowType::WARNINGBOX: + case WindowType::ERRORBOX: + case WindowType::QUERYBOX: nFrameStyle |= SalFrameStyleFlags::DIALOG; break; default: @@ -2038,7 +2038,7 @@ void Window::SetBorderStyle( WindowBorderStyle nBorderStyle ) } else { - if ( mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW ) + if ( mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW ) static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetBorderStyle( nBorderStyle ); else mpWindowImpl->mpBorderWindow->SetBorderStyle( nBorderStyle ); @@ -2051,7 +2051,7 @@ WindowBorderStyle Window::GetBorderStyle() const if ( mpWindowImpl->mpBorderWindow ) { - if ( mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW ) + if ( mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW ) return static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->GetBorderStyle(); else return mpWindowImpl->mpBorderWindow->GetBorderStyle(); @@ -2065,7 +2065,7 @@ long Window::CalcTitleWidth() const if ( mpWindowImpl->mpBorderWindow ) { - if ( mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW ) + if ( mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW ) return static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->CalcTitleWidth(); else return mpWindowImpl->mpBorderWindow->CalcTitleWidth(); @@ -2448,7 +2448,7 @@ void Window::Enable( bool bEnable, bool bChild ) if ( mpWindowImpl->mpBorderWindow ) { mpWindowImpl->mpBorderWindow->Enable( bEnable, false ); - if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) && + if ( (mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW) && static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->mpMenuBarWindow ) static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->mpMenuBarWindow->Enable( bEnable ); } @@ -2510,7 +2510,7 @@ void Window::EnableInput( bool bEnable, bool bChild ) if ( mpWindowImpl->mpBorderWindow ) { mpWindowImpl->mpBorderWindow->EnableInput( bEnable, false ); - if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) && + if ( (mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW) && static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->mpMenuBarWindow ) static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->mpMenuBarWindow->EnableInput( bEnable ); } @@ -2697,7 +2697,7 @@ void Window::SetActivateMode( ActivateModeFlags nMode ) // possibly trigger Decativate/Activate if ( mpWindowImpl->mnActivateMode != ActivateModeFlags::NONE ) { - if ( (mpWindowImpl->mbActive || (GetType() == WINDOW_BORDERWINDOW)) && + if ( (mpWindowImpl->mbActive || (GetType() == WindowType::BORDERWINDOW)) && !HasChildPathFocus( true ) ) { mpWindowImpl->mbActive = false; @@ -2706,7 +2706,7 @@ void Window::SetActivateMode( ActivateModeFlags nMode ) } else { - if ( !mpWindowImpl->mbActive || (GetType() == WINDOW_BORDERWINDOW) ) + if ( !mpWindowImpl->mbActive || (GetType() == WindowType::BORDERWINDOW) ) { mpWindowImpl->mbActive = true; Activate(); @@ -2962,7 +2962,7 @@ Rectangle Window::ImplGetWindowExtentsRelative( vcl::Window *pRelativeWindow, bo aPos.Y() += g.nY; Size aSize ( pWin->GetSizePixel() ); // #104088# do not add decoration to the workwindow to be compatible to java accessibility api - if( !bClientOnly && (mpWindowImpl->mbFrame || (mpWindowImpl->mpBorderWindow && mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame && GetType() != WINDOW_WORKWINDOW)) ) + if( !bClientOnly && (mpWindowImpl->mbFrame || (mpWindowImpl->mpBorderWindow && mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame && GetType() != WindowType::WORKWINDOW)) ) { aPos.X() -= g.nLeftDecoration; aPos.Y() -= g.nTopDecoration; @@ -3125,7 +3125,7 @@ const OUString& Window::GetHelpText() const if ( !mpWindowImpl->maHelpText.getLength() && bStrHelpId ) { - if ( !IsDialog() && (mpWindowImpl->mnType != WINDOW_TABPAGE) && (mpWindowImpl->mnType != WINDOW_FLOATINGWINDOW) ) + if ( !IsDialog() && (mpWindowImpl->mnType != WindowType::TABPAGE) && (mpWindowImpl->mnType != WindowType::FLOATINGWINDOW) ) { Help* pHelp = Application::GetHelp(); if ( pHelp ) @@ -3422,7 +3422,7 @@ bool Window::IsScrollable() const VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild; while( pChild ) { - if( pChild->GetType() == WINDOW_SCROLLBAR ) + if( pChild->GetType() == WindowType::SCROLLBAR ) return true; else pChild = pChild->mpWindowImpl->mpNext; diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index ed43771a8c0d..9882ce3e3e77 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1029,7 +1029,7 @@ WindowType Window::GetType() const if (mpWindowImpl) return mpWindowImpl->mnType; else - return 0; + return WindowType::NONE; } Dialog* Window::GetParentDialog() const @@ -1341,7 +1341,7 @@ namespace { bSomeoneCares = true; } - else if (pWindow->GetType() == WINDOW_TABCONTROL) + else if (pWindow->GetType() == WindowType::TABCONTROL) { bSomeoneCares = true; } diff --git a/vcl/source/window/window3.cxx b/vcl/source/window/window3.cxx index aa5c1f9d3ab9..283aee05918e 100644 --- a/vcl/source/window/window3.cxx +++ b/vcl/source/window/window3.cxx @@ -38,10 +38,10 @@ void Window::ImplAdjustNWFSizes() { switch( GetType() ) { - case WINDOW_CHECKBOX: + case WindowType::CHECKBOX: static_cast<CheckBox*>(this)->ImplSetMinimumNWFSize(); break; - case WINDOW_RADIOBUTTON: + case WindowType::RADIOBUTTON: static_cast<RadioButton*>(this)->ImplSetMinimumNWFSize(); break; default: diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index 8faf66faba0b..55efefd60e63 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -1713,8 +1713,8 @@ static void ImplActivateFloatingWindows( vcl::Window* pWindow, bool bActive ) { if ( pTempWindow->GetActivateMode() == ActivateModeFlags::NONE ) { - if ( (pTempWindow->GetType() == WINDOW_BORDERWINDOW) && - (pTempWindow->ImplGetWindow()->GetType() == WINDOW_FLOATINGWINDOW) ) + if ( (pTempWindow->GetType() == WindowType::BORDERWINDOW) && + (pTempWindow->ImplGetWindow()->GetType() == WindowType::FLOATINGWINDOW) ) static_cast<ImplBorderWindow*>(pTempWindow)->SetDisplayActive( bActive ); } @@ -2178,7 +2178,7 @@ static bool ImplHandleShowDialog( vcl::Window* pWindow, ShowDialogId nDialogId ) if( ! pWindow ) return false; - if( pWindow->GetType() == WINDOW_BORDERWINDOW ) + if( pWindow->GetType() == WindowType::BORDERWINDOW ) { vcl::Window* pWrkWin = pWindow->GetWindow( GetWindowType::Client ); if( pWrkWin ) diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx index 9c51ba1a913b..ff7bd64cce91 100644 --- a/vcl/source/window/wrkwin.cxx +++ b/vcl/source/window/wrkwin.cxx @@ -91,14 +91,14 @@ WorkWindow::WorkWindow( WindowType nType ) : } WorkWindow::WorkWindow( vcl::Window* pParent, WinBits nStyle ) : - SystemWindow( WINDOW_WORKWINDOW ) + SystemWindow( WindowType::WORKWINDOW ) { ImplInitWorkWindowData(); ImplInit( pParent, nStyle ); } WorkWindow::WorkWindow( vcl::Window* pParent, const css::uno::Any& aSystemWorkWindowToken, WinBits nStyle ) : - SystemWindow( WINDOW_WORKWINDOW ) + SystemWindow( WindowType::WORKWINDOW ) { ImplInitWorkWindowData(); mbSysChild = true; @@ -106,7 +106,7 @@ WorkWindow::WorkWindow( vcl::Window* pParent, const css::uno::Any& aSystemWorkWi } WorkWindow::WorkWindow( SystemParentData* pParent ) : - SystemWindow( WINDOW_WORKWINDOW ) + SystemWindow( WindowType::WORKWINDOW ) { ImplInitWorkWindowData(); mbSysChild = true; |