summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-05-06 14:21:26 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-05-07 13:27:55 +0000
commit2c8dc0373377a6e801c9a9246ffdc3641f3be4ec (patch)
tree12389cf068030129f4d9b9fc51e12bad45957888 /vcl
parent90d8bf72d9ea8fa678707326a3cc4b84fae154a1 (diff)
convert BUTTONDIALOG constants to scoped enum
Change-Id: Icbf73fe55ad604f762dd2b98fd39189bab82f061 Reviewed-on: https://gerrit.libreoffice.org/15648 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/btndlg.cxx26
-rw-r--r--vcl/source/window/msgbox.cxx44
-rw-r--r--vcl/unx/x11/x11sys.cxx2
3 files changed, 36 insertions, 36 deletions
diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx
index 7846e41828e8..bb0f0a35f600 100644
--- a/vcl/source/window/btndlg.cxx
+++ b/vcl/source/window/btndlg.cxx
@@ -73,23 +73,23 @@ void ButtonDialog::dispose()
Dialog::dispose();
}
-PushButton* ButtonDialog::ImplCreatePushButton( sal_uInt16 nBtnFlags )
+PushButton* ButtonDialog::ImplCreatePushButton( ButtonDialogFlags nBtnFlags )
{
PushButton* pBtn;
WinBits nStyle = 0;
- if ( nBtnFlags & BUTTONDIALOG_DEFBUTTON )
+ if ( nBtnFlags & ButtonDialogFlags::Default )
nStyle |= WB_DEFBUTTON;
- if ( nBtnFlags & BUTTONDIALOG_CANCELBUTTON )
+ if ( nBtnFlags & ButtonDialogFlags::Cancel )
pBtn = VclPtr<CancelButton>::Create( this, nStyle );
- else if ( nBtnFlags & BUTTONDIALOG_OKBUTTON )
+ else if ( nBtnFlags & ButtonDialogFlags::OK )
pBtn = VclPtr<OKButton>::Create( this, nStyle );
- else if ( nBtnFlags & BUTTONDIALOG_HELPBUTTON )
+ else if ( nBtnFlags & ButtonDialogFlags::Help )
pBtn = VclPtr<HelpButton>::Create( this, nStyle );
else
pBtn = VclPtr<PushButton>::Create( this, nStyle );
- if ( !(nBtnFlags & BUTTONDIALOG_HELPBUTTON) )
+ if ( !(nBtnFlags & ButtonDialogFlags::Help) )
pBtn->SetClickHdl( LINK( this, ButtonDialog, ImplClickHdl ) );
return pBtn;
@@ -274,7 +274,7 @@ void ButtonDialog::Click()
}
void ButtonDialog::AddButton( const OUString& rText, sal_uInt16 nId,
- sal_uInt16 nBtnFlags, long nSepPixel )
+ ButtonDialogFlags nBtnFlags, long nSepPixel )
{
// PageItem anlegen
ImplBtnDlgItem* pItem = new ImplBtnDlgItem;
@@ -288,14 +288,14 @@ void ButtonDialog::AddButton( const OUString& rText, sal_uInt16 nId,
maItemList.push_back(pItem);
- if ( nBtnFlags & BUTTONDIALOG_FOCUSBUTTON )
+ if ( nBtnFlags & ButtonDialogFlags::Focus )
mnFocusButtonId = nId;
mbFormat = true;
}
void ButtonDialog::AddButton( StandardButtonType eType, sal_uInt16 nId,
- sal_uInt16 nBtnFlags, long nSepPixel )
+ ButtonDialogFlags nBtnFlags, long nSepPixel )
{
// PageItem anlegen
ImplBtnDlgItem* pItem = new ImplBtnDlgItem;
@@ -304,11 +304,11 @@ void ButtonDialog::AddButton( StandardButtonType eType, sal_uInt16 nId,
pItem->mnSepSize = nSepPixel;
if ( eType == StandardButtonType::OK )
- nBtnFlags |= BUTTONDIALOG_OKBUTTON;
+ nBtnFlags |= ButtonDialogFlags::OK;
else if ( eType == StandardButtonType::Help )
- nBtnFlags |= BUTTONDIALOG_HELPBUTTON;
+ nBtnFlags |= ButtonDialogFlags::Help;
else if ( (eType == StandardButtonType::Cancel) || (eType == StandardButtonType::Close) )
- nBtnFlags |= BUTTONDIALOG_CANCELBUTTON;
+ nBtnFlags |= ButtonDialogFlags::Cancel;
pItem->mpPushButton = ImplCreatePushButton( nBtnFlags );
// Standard-Buttons have the right text already
@@ -319,7 +319,7 @@ void ButtonDialog::AddButton( StandardButtonType eType, sal_uInt16 nId,
pItem->mpPushButton->SetText( Button::GetStandardText( eType ) );
}
- if ( nBtnFlags & BUTTONDIALOG_FOCUSBUTTON )
+ if ( nBtnFlags & ButtonDialogFlags::Focus )
mnFocusButtonId = nId;
maItemList.push_back(pItem);
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 8ddba996b1a3..0e7e08878184 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -62,18 +62,18 @@ void MessBox::ImplInitMessBoxData()
void MessBox::ImplInitButtons()
{
WinBits nStyle = GetStyle();
- sal_uInt16 nOKFlags = BUTTONDIALOG_OKBUTTON;
- sal_uInt16 nCancelFlags = BUTTONDIALOG_CANCELBUTTON;
- sal_uInt16 nRetryFlags = 0;
- sal_uInt16 nYesFlags = 0;
- sal_uInt16 nNoFlags = 0;
+ ButtonDialogFlags nOKFlags = ButtonDialogFlags::OK;
+ ButtonDialogFlags nCancelFlags = ButtonDialogFlags::Cancel;
+ ButtonDialogFlags nRetryFlags = ButtonDialogFlags::NONE;
+ ButtonDialogFlags nYesFlags = ButtonDialogFlags::NONE;
+ ButtonDialogFlags nNoFlags = ButtonDialogFlags::NONE;
if ( nStyle & WB_OK_CANCEL )
{
if ( nStyle & WB_DEF_CANCEL )
- nCancelFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nCancelFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
else // WB_DEF_OK
- nOKFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nOKFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
AddButton( StandardButtonType::OK, RET_OK, nOKFlags );
AddButton( StandardButtonType::Cancel, RET_CANCEL, nCancelFlags );
@@ -81,10 +81,10 @@ void MessBox::ImplInitButtons()
else if ( nStyle & WB_YES_NO )
{
if ( nStyle & WB_DEF_YES )
- nYesFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nYesFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
else // WB_DEF_NO
- nNoFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
- nNoFlags |= BUTTONDIALOG_CANCELBUTTON;
+ nNoFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
+ nNoFlags |= ButtonDialogFlags::Cancel;
AddButton( StandardButtonType::Yes, RET_YES, nYesFlags );
AddButton( StandardButtonType::No, RET_NO, nNoFlags );
@@ -92,11 +92,11 @@ void MessBox::ImplInitButtons()
else if ( nStyle & WB_YES_NO_CANCEL )
{
if ( nStyle & WB_DEF_YES )
- nYesFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nYesFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
else if ( nStyle & WB_DEF_NO )
- nNoFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nNoFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
else
- nCancelFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nCancelFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
AddButton( StandardButtonType::Yes, RET_YES, nYesFlags );
AddButton( StandardButtonType::No, RET_NO, nNoFlags );
@@ -105,24 +105,24 @@ void MessBox::ImplInitButtons()
else if ( nStyle & WB_RETRY_CANCEL )
{
if ( nStyle & WB_DEF_CANCEL )
- nCancelFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nCancelFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
else // WB_DEF_RETRY
- nRetryFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nRetryFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
AddButton( StandardButtonType::Retry, RET_RETRY, nRetryFlags );
AddButton( StandardButtonType::Cancel, RET_CANCEL, nCancelFlags );
}
else if ( nStyle & WB_ABORT_RETRY_IGNORE )
{
- sal_uInt16 nAbortFlags = 0;
- sal_uInt16 nIgnoreFlags = 0;
+ ButtonDialogFlags nAbortFlags = ButtonDialogFlags::NONE;
+ ButtonDialogFlags nIgnoreFlags = ButtonDialogFlags::NONE;
if ( nStyle & WB_DEF_CANCEL )
- nAbortFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nAbortFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
else if ( nStyle & WB_DEF_RETRY )
- nRetryFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nRetryFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
else if ( nStyle & WB_DEF_IGNORE )
- nIgnoreFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nIgnoreFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
AddButton( StandardButtonType::Abort, RET_CANCEL, nAbortFlags );
AddButton( StandardButtonType::Retry, RET_RETRY, nRetryFlags );
@@ -130,7 +130,7 @@ void MessBox::ImplInitButtons()
}
else if ( nStyle & WB_OK )
{
- nOKFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
+ nOKFlags |= ButtonDialogFlags::Default | ButtonDialogFlags::Focus;
AddButton( StandardButtonType::OK, RET_OK, nOKFlags );
}
@@ -168,7 +168,7 @@ void MessBox::ImplPosControls()
{
if ( !mbHelpBtn )
{
- AddButton( StandardButtonType::Help, RET_HELP, BUTTONDIALOG_HELPBUTTON, 3 );
+ AddButton( StandardButtonType::Help, RET_HELP, ButtonDialogFlags::Help, 3 );
mbHelpBtn = true;
}
}
diff --git a/vcl/unx/x11/x11sys.cxx b/vcl/unx/x11/x11sys.cxx
index 6723c63b8047..e3eb453fcb37 100644
--- a/vcl/unx/x11/x11sys.cxx
+++ b/vcl/unx/x11/x11sys.cxx
@@ -141,7 +141,7 @@ int X11SalSystem::ShowNativeDialog( const OUString& rTitle, const OUString& rMes
sal_uInt16 nButton = 0;
for( std::list< OUString >::const_iterator it = rButtons.begin(); it != rButtons.end(); ++it )
{
- aWarn->AddButton( *it, nButton+1, nButton == (sal_uInt16)nDefButton ? BUTTONDIALOG_DEFBUTTON : 0 );
+ aWarn->AddButton( *it, nButton+1, nButton == (sal_uInt16)nDefButton ? ButtonDialogFlags::Default : ButtonDialogFlags::NONE );
nButton++;
}
aWarn->SetFocusButton( (sal_uInt16)nDefButton+1 );