convert BUTTON_ constants to enum class

Change-Id: I0fd391a6b2850e5d7dcbf2cb95cfa39ee5561bd9
This commit is contained in:
Noel Grandin 2015-03-26 12:54:04 +02:00
parent 402ae4c06c
commit 93ddb2cc0b
21 changed files with 99 additions and 96 deletions

View File

@ -913,7 +913,7 @@ NameClashQueryBox::NameClashQueryBox( vcl::Window* pParent,
AddButton( IDE_RESSTR(RID_STR_DLGIMP_CLASH_RENAME), RET_YES,
BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
AddButton( IDE_RESSTR(RID_STR_DLGIMP_CLASH_REPLACE), RET_NO, 0 );
AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
AddButton( StandardButtonType::CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
SetImage( QueryBox::GetStandardImage() );
}
@ -937,8 +937,8 @@ LanguageMismatchQueryBox::LanguageMismatchQueryBox( vcl::Window* pParent,
AddButton( IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_ADD), RET_YES,
BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
AddButton( IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_OMIT), RET_NO, 0 );
AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
AddButton( BUTTON_HELP, RET_HELP, BUTTONDIALOG_HELPBUTTON, 4 );
AddButton( StandardButtonType::CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
AddButton( StandardButtonType::HELP, RET_HELP, BUTTONDIALOG_HELPBUTTON, 4 );
SetImage( QueryBox::GetStandardImage() );
}

View File

@ -5309,10 +5309,10 @@ MessBox( pWindow, WB_DEF_YES, CUI_RES( RID_SVXSTR_REPLACE_ICON_CONFIRM ), CUI_R
SetImage( WarningBox::GetStandardImage() );
SetMessText( ReplaceIconName( aMessage ) );
RemoveButton( 1 );
AddButton( BUTTON_YES, 2, 0 );
AddButton( StandardButtonType::YES, 2, 0 );
AddButton( CUI_RES( RID_SVXSTR_YESTOALL ), 5, 0 );
AddButton( BUTTON_NO, 3, 0 );
AddButton( BUTTON_CANCEL, 4, 0 );
AddButton( StandardButtonType::NO, 3, 0 );
AddButton( StandardButtonType::CANCEL, 4, 0 );
}
SvxIconReplacementDialog :: SvxIconReplacementDialog(

View File

@ -77,7 +77,7 @@ void FmSearchDialog::initCommon( const Reference< XResultSet >& _rxCursor )
FmSearchDialog::FmSearchDialog(vcl::Window* pParent, const OUString& sInitialText, const ::std::vector< OUString >& _rContexts, sal_Int16 nInitialContext,
const Link& lnkContextSupplier)
:ModalDialog(pParent, "RecordSearchDialog", "cui/ui/fmsearchdialog.ui")
,m_sCancel ( Button::GetStandardText( BUTTON_CANCEL ) )
,m_sCancel( Button::GetStandardText( StandardButtonType::CANCEL ) )
,m_pPreSearchFocus( NULL )
,m_lnkContextSupplier(lnkContextSupplier)
,m_pConfig( NULL )

View File

@ -311,7 +311,7 @@ void SvxHyperlinkNewDocTp::DoApply ()
if( bOk )
{
WarningBox aWarning( this, WB_YES_NO, CUI_RESSTR(RID_SVXSTR_HYPERDLG_QUERYOVERWRITE) );
bCreate = aWarning.Execute() == BUTTON_YES;
bCreate = aWarning.Execute() == RET_YES;
}
}

View File

@ -425,12 +425,12 @@ namespace
sal_uInt16 nButtonID = 0;
switch ( _eType )
{
case BUTTON_YES: nButtonID = RET_YES; break;
case BUTTON_NO: nButtonID = RET_NO; break;
case BUTTON_OK: nButtonID = RET_OK; break;
case BUTTON_CANCEL: nButtonID = RET_CANCEL; break;
case BUTTON_RETRY: nButtonID = RET_RETRY; break;
case BUTTON_HELP: nButtonID = RET_HELP; break;
case StandardButtonType::YES: nButtonID = RET_YES; break;
case StandardButtonType::NO: nButtonID = RET_NO; break;
case StandardButtonType::OK: nButtonID = RET_OK; break;
case StandardButtonType::CANCEL: nButtonID = RET_CANCEL; break;
case StandardButtonType::RETRY: nButtonID = RET_RETRY; break;
case StandardButtonType::HELP: nButtonID = RET_HELP; break;
default:
OSL_FAIL( "lcl_addButton: invalid button id!" );
break;
@ -564,34 +564,34 @@ void OSQLMessageBox::impl_createStandardButtons( WinBits _nStyle )
{
if ( _nStyle & WB_YES_NO_CANCEL )
{
lcl_addButton( *this, BUTTON_YES, ( _nStyle & WB_DEF_YES ) != 0 );
lcl_addButton( *this, BUTTON_NO, ( _nStyle & WB_DEF_NO ) != 0 );
lcl_addButton( *this, BUTTON_CANCEL, ( _nStyle & WB_DEF_CANCEL ) != 0 );
lcl_addButton( *this, StandardButtonType::YES, ( _nStyle & WB_DEF_YES ) != 0 );
lcl_addButton( *this, StandardButtonType::NO, ( _nStyle & WB_DEF_NO ) != 0 );
lcl_addButton( *this, StandardButtonType::CANCEL, ( _nStyle & WB_DEF_CANCEL ) != 0 );
}
else if ( _nStyle & WB_OK_CANCEL )
{
lcl_addButton( *this, BUTTON_OK, ( _nStyle & WB_DEF_OK ) != 0 );
lcl_addButton( *this, BUTTON_CANCEL, ( _nStyle & WB_DEF_CANCEL ) != 0 );
lcl_addButton( *this, StandardButtonType::OK, ( _nStyle & WB_DEF_OK ) != 0 );
lcl_addButton( *this, StandardButtonType::CANCEL, ( _nStyle & WB_DEF_CANCEL ) != 0 );
}
else if ( _nStyle & WB_YES_NO )
{
lcl_addButton( *this, BUTTON_YES, ( _nStyle & WB_DEF_YES ) != 0 );
lcl_addButton( *this, BUTTON_NO, ( _nStyle & WB_DEF_NO ) != 0 );
lcl_addButton( *this, StandardButtonType::YES, ( _nStyle & WB_DEF_YES ) != 0 );
lcl_addButton( *this, StandardButtonType::NO, ( _nStyle & WB_DEF_NO ) != 0 );
}
else if ( _nStyle & WB_RETRY_CANCEL )
{
lcl_addButton( *this, BUTTON_RETRY, ( _nStyle & WB_DEF_RETRY ) != 0 );
lcl_addButton( *this, BUTTON_CANCEL, ( _nStyle & WB_DEF_CANCEL ) != 0 );
lcl_addButton( *this, StandardButtonType::RETRY, ( _nStyle & WB_DEF_RETRY ) != 0 );
lcl_addButton( *this, StandardButtonType::CANCEL, ( _nStyle & WB_DEF_CANCEL ) != 0 );
}
else
{
OSL_ENSURE( WB_OK & _nStyle, "OSQLMessageBox::impl_createStandardButtons: unsupported dialog style requested!" );
AddButton( BUTTON_OK, RET_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON );
AddButton( StandardButtonType::OK, RET_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON );
}
if ( !m_sHelpURL.isEmpty() )
{
lcl_addButton( *this, BUTTON_HELP, false );
lcl_addButton( *this, StandardButtonType::HELP, false );
OUString aTmp;
INetURLObject aHID( m_sHelpURL );
@ -628,7 +628,7 @@ void OSQLMessageBox::impl_addDetailsButton()
if ( bMoreDetailsAvailable )
{
AddButton( BUTTON_MORE, RET_MORE, 0 );
AddButton( StandardButtonType::MORE, RET_MORE, 0 );
PushButton* pButton = GetPushButton( RET_MORE );
OSL_ENSURE( pButton, "OSQLMessageBox::impl_addDetailsButton: just added this button, why isn't it there?" );
pButton->SetClickHdl( LINK( this, OSQLMessageBox, ButtonClickHdl ) );

View File

@ -161,7 +161,7 @@ namespace dbaui
if ( aWarnings.hasValue() )
{
OUString sMessage( ModuleRes( STR_WARNINGS_DURING_CONNECT ) );
sMessage = sMessage.replaceFirst( "$buttontext$", Button::GetStandardText( BUTTON_MORE ) );
sMessage = sMessage.replaceFirst( "$buttontext$", Button::GetStandardText( StandardButtonType::MORE ) );
sMessage = OutputDevice::GetNonMnemonicString( sMessage );
SQLWarning aContext;

View File

@ -342,7 +342,7 @@ void ORelationTableView::lookForUiActivities()
aDlg.RemoveButton(aDlg.GetButtonId(0));
aDlg.AddButton( ModuleRes(STR_QUERY_REL_EDIT), RET_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON);
aDlg.AddButton( ModuleRes(STR_QUERY_REL_CREATE), RET_YES, 0);
aDlg.AddButton(BUTTON_CANCEL,RET_CANCEL,0);
aDlg.AddButton( StandardButtonType::CANCEL,RET_CANCEL,0);
sal_uInt16 nRet = aDlg.Execute();
if( nRet == RET_CANCEL)
{

View File

@ -295,20 +295,22 @@ enum SymbolAlign { SYMBOLALIGN_LEFT, SYMBOLALIGN_RIGHT };
// ButtonDialog-Types
typedef sal_uInt16 StandardButtonType;
#define BUTTON_OK ((StandardButtonType)0)
#define BUTTON_CANCEL ((StandardButtonType)1)
#define BUTTON_YES ((StandardButtonType)2)
#define BUTTON_NO ((StandardButtonType)3)
#define BUTTON_RETRY ((StandardButtonType)4)
#define BUTTON_HELP ((StandardButtonType)5)
#define BUTTON_CLOSE ((StandardButtonType)6)
#define BUTTON_MORE ((StandardButtonType)7)
#define BUTTON_IGNORE ((StandardButtonType)8)
#define BUTTON_ABORT ((StandardButtonType)9)
#define BUTTON_LESS ((StandardButtonType)10)
#define BUTTON_RESET ((StandardButtonType)11)
#define BUTTON_COUNT 12
enum class StandardButtonType
{
OK = 0,
CANCEL = 1,
YES = 2,
NO = 3,
RETRY = 4,
HELP = 5,
CLOSE = 6,
MORE = 7,
IGNORE = 8,
ABORT = 9,
LESS = 10,
RESET = 11,
COUNT = 12,
};
// prominent place for ListBox window types

View File

@ -33,7 +33,7 @@ SvxPrtQryBox::SvxPrtQryBox(vcl::Window* pParent) :
BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON);
AddButton(SVX_RESSTR(RID_SVXSTR_QRY_PRINT_ALL), 2, 0);
AddButton(BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON);
AddButton(StandardButtonType::CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON);
SetButtonHelpText( RET_OK, OUString() );
}

View File

@ -665,7 +665,7 @@ void ColumnsWindow::Paint( const Rectangle& )
if ( nCol )
aText = OUString::number(nCol);
else
aText = comphelper::string::remove(Button::GetStandardText(BUTTON_CANCEL), '~');
aText = comphelper::string::remove(Button::GetStandardText(StandardButtonType::CANCEL), '~');
Size aTextSize(GetTextWidth( aText ), GetTextHeight());
DrawText( Point( ( aSize.Width() - aTextSize.Width() ) / 2, aSize.Height() - nTextHeight + 2 ), aText );

View File

@ -32,14 +32,14 @@ AlreadyOpenQueryBox::AlreadyOpenQueryBox( vcl::Window* pParent, ResMgr* pResMgr,
AddButton( ResId(STR_ALREADYOPEN_RETRY_SAVE_BTN, *pResMgr).toString(), RET_YES,
BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
AddButton( ResId(STR_ALREADYOPEN_SAVE_BTN, *pResMgr).toString(), RET_NO, 0 );
AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
AddButton( StandardButtonType::CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
}
else
{
AddButton( ResId(STR_ALREADYOPEN_READONLY_BTN, *pResMgr).toString(), RET_YES,
BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
AddButton( ResId(STR_ALREADYOPEN_OPEN_BTN, *pResMgr).toString(), RET_NO, 0 );
AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
AddButton( StandardButtonType::CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
}
SetButtonHelpText( RET_YES, OUString() );

View File

@ -29,7 +29,7 @@ FileChangedQueryBox::FileChangedQueryBox( vcl::Window* pParent, ResMgr* pResMgr
AddButton(ResId(STR_FILECHANGED_SAVEANYWAY_BTN, *pResMgr).toString(), RET_YES,
BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON);
AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
AddButton( StandardButtonType::CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
SetButtonHelpText( RET_YES, OUString() );
SetMessText(ResId(STR_FILECHANGED_MSG, *pResMgr).toString());

View File

@ -29,8 +29,8 @@ LockFailedQueryBox::LockFailedQueryBox( vcl::Window* pParent, ResMgr* pResMgr )
{
SetImage( ErrorBox::GetStandardImage() );
AddButton( BUTTON_OK, RET_OK, BUTTONDIALOG_OKBUTTON );
AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
AddButton( StandardButtonType::OK, RET_OK, BUTTONDIALOG_OKBUTTON );
AddButton( StandardButtonType::CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
SetMessText(ResId(STR_LOCKFAILED_MSG, *pResMgr ).toString());
SetCheckBoxText(ResId(STR_LOCKFAILED_DONTSHOWAGAIN, *pResMgr).toString());

View File

@ -32,7 +32,7 @@ OpenLockedQueryBox::OpenLockedQueryBox( vcl::Window* pParent, ResMgr* pResMgr, c
AddButton(ResId(STR_OPENLOCKED_OPENCOPY_BTN, *pResMgr).toString(), RET_NO, 0);
AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
AddButton( StandardButtonType::CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
SetButtonHelpText( RET_YES, OUString() );
SetButtonHelpText( RET_NO, OUString() );

View File

@ -30,7 +30,7 @@ TryLaterQueryBox::TryLaterQueryBox( vcl::Window* pParent, ResMgr* pResMgr, const
AddButton(ResId(STR_TRYLATER_RETRYSAVING_BTN, *pResMgr).toString(), RET_YES,
BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON);
AddButton(ResId(STR_TRYLATER_SAVEAS_BTN, *pResMgr).toString(), RET_NO, 0);
AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
AddButton( StandardButtonType::CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
SetButtonHelpText( RET_YES, OUString() );
SetButtonHelpText( RET_NO, OUString() );

View File

@ -42,7 +42,7 @@ using namespace com::sun::star;
namespace {
OUString GetNativeMessageBoxButtonText( int nButtonId, bool bUseResources )
OUString GetNativeMessageBoxButtonText( StandardButtonType nButtonId, bool bUseResources )
{
OUString aText;
if( bUseResources )
@ -53,27 +53,28 @@ OUString GetNativeMessageBoxButtonText( int nButtonId, bool bUseResources )
{
switch( nButtonId )
{
case BUTTON_OK:
case StandardButtonType::OK:
aText = "OK";
break;
case BUTTON_CANCEL:
case StandardButtonType::CANCEL:
aText = "Cancel";
break;
case BUTTON_ABORT:
case StandardButtonType::ABORT:
aText = "Abort";
break;
case BUTTON_RETRY:
case StandardButtonType::RETRY:
aText = "Retry";
break;
case BUTTON_IGNORE:
case StandardButtonType::IGNORE:
aText = "Ignore";
break;
case BUTTON_YES:
case StandardButtonType::YES:
aText = "Yes";
break;
case BUTTON_NO:
case StandardButtonType::NO:
aText = "No";
break;
default: break;
}
}
return aText;
@ -102,15 +103,15 @@ int SalGenericSystem::ShowNativeMessageBox( const OUString& rTitle, const OUStri
if( nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK ||
nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL )
{
aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_OK, bUseResources ) );
aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::OK, bUseResources ) );
nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK;
}
if( nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL ||
nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO )
{
aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_YES, bUseResources ) );
aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::YES, bUseResources ) );
nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES;
aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_NO, bUseResources ) );
aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::NO, bUseResources ) );
nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO;
if( nDefaultButton == SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO )
nDefButton = 1;
@ -121,21 +122,21 @@ int SalGenericSystem::ShowNativeMessageBox( const OUString& rTitle, const OUStri
{
if( nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL )
{
aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_RETRY, bUseResources ) );
aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::RETRY, bUseResources ) );
nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY;
}
aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_CANCEL, bUseResources ) );
aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::CANCEL, bUseResources ) );
nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL;
if( nDefaultButton == SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL )
nDefButton = aButtons.size()-1;
}
if( nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE )
{
aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_ABORT, bUseResources ) );
aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::ABORT, bUseResources ) );
nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT;
aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_RETRY, bUseResources ) );
aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::RETRY, bUseResources ) );
nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY;
aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_IGNORE, bUseResources ) );
aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::IGNORE, bUseResources ) );
nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE;
switch( nDefaultButton )
{

View File

@ -115,7 +115,7 @@ OUString Button::GetStandardText( StandardButtonType eButton )
{
sal_uInt32 nResId;
const char* pDefText;
} aResIdAry[BUTTON_COUNT] =
} aResIdAry[static_cast<int>(StandardButtonType::COUNT)] =
{
{ SV_BUTTONTEXT_OK, "~OK" },
{ SV_BUTTONTEXT_CANCEL, "~Cancel" },
@ -1653,7 +1653,7 @@ void OKButton::ImplInit( vcl::Window* pParent, WinBits nStyle )
{
PushButton::ImplInit( pParent, nStyle );
SetText( Button::GetStandardText( BUTTON_OK ) );
SetText( Button::GetStandardText( StandardButtonType::OK ) );
}
OKButton::OKButton( vcl::Window* pParent, WinBits nStyle ) :
@ -1698,7 +1698,7 @@ void CancelButton::ImplInit( vcl::Window* pParent, WinBits nStyle )
{
PushButton::ImplInit( pParent, nStyle );
SetText( Button::GetStandardText( BUTTON_CANCEL ) );
SetText( Button::GetStandardText( StandardButtonType::CANCEL ) );
}
CancelButton::CancelButton( vcl::Window* pParent, WinBits nStyle ) :
@ -1742,14 +1742,14 @@ void CancelButton::Click()
CloseButton::CloseButton( vcl::Window* pParent, WinBits nStyle )
: CancelButton(pParent, nStyle)
{
SetText( Button::GetStandardText( BUTTON_CLOSE ) );
SetText( Button::GetStandardText( StandardButtonType::CLOSE ) );
}
void HelpButton::ImplInit( vcl::Window* pParent, WinBits nStyle )
{
PushButton::ImplInit( pParent, nStyle | WB_NOPOINTERFOCUS );
SetText( Button::GetStandardText( BUTTON_HELP ) );
SetText( Button::GetStandardText( StandardButtonType::HELP ) );
}
HelpButton::HelpButton( vcl::Window* pParent, WinBits nStyle ) :

View File

@ -42,8 +42,8 @@ void MoreButton::ImplInit( vcl::Window* pParent, WinBits nStyle )
PushButton::ImplInit( pParent, nStyle );
mpMBData->maMoreText = Button::GetStandardText( BUTTON_MORE );
mpMBData->maLessText = Button::GetStandardText( BUTTON_LESS );
mpMBData->maMoreText = Button::GetStandardText( StandardButtonType::MORE );
mpMBData->maLessText = Button::GetStandardText( StandardButtonType::LESS );
ShowState();

View File

@ -296,18 +296,18 @@ void ButtonDialog::AddButton( StandardButtonType eType, sal_uInt16 nId,
pItem->mbOwnButton = true;
pItem->mnSepSize = nSepPixel;
if ( eType == BUTTON_OK )
if ( eType == StandardButtonType::OK )
nBtnFlags |= BUTTONDIALOG_OKBUTTON;
else if ( eType == BUTTON_HELP )
else if ( eType == StandardButtonType::HELP )
nBtnFlags |= BUTTONDIALOG_HELPBUTTON;
else if ( (eType == BUTTON_CANCEL) || (eType == BUTTON_CLOSE) )
else if ( (eType == StandardButtonType::CANCEL) || (eType == StandardButtonType::CLOSE) )
nBtnFlags |= BUTTONDIALOG_CANCELBUTTON;
pItem->mpPushButton = ImplCreatePushButton( nBtnFlags );
// Standard-Buttons have the right text already
if ( !((eType == BUTTON_OK) && (pItem->mpPushButton->GetType() == WINDOW_OKBUTTON)) ||
!((eType == BUTTON_CANCEL) && (pItem->mpPushButton->GetType() == WINDOW_CANCELBUTTON)) ||
!((eType == BUTTON_HELP) && (pItem->mpPushButton->GetType() == WINDOW_HELPBUTTON)) )
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)) )
{
pItem->mpPushButton->SetText( Button::GetStandardText( eType ) );
}

View File

@ -2171,14 +2171,14 @@ short MessageDialog::Execute()
break;
case VCL_BUTTONS_YES_NO:
pBtn = new PushButton(pButtonBox);
pBtn->SetText(Button::GetStandardText(BUTTON_YES));
pBtn->SetText(Button::GetStandardText(StandardButtonType::YES));
pBtn->Show();
m_aOwnedButtons.push_back(pBtn);
m_aResponses[pBtn] = RET_YES;
pBtn = new PushButton(pButtonBox);
pBtn->SetStyle(pBtn->GetStyle() & WB_DEFBUTTON);
pBtn->SetText(Button::GetStandardText(BUTTON_NO));
pBtn->SetText(Button::GetStandardText(StandardButtonType::NO));
pBtn->Show();
m_aOwnedButtons.push_back(pBtn);
m_aResponses[pBtn] = RET_NO;

View File

@ -75,8 +75,8 @@ void MessBox::ImplInitButtons()
else // WB_DEF_OK
nOKFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
AddButton( BUTTON_OK, RET_OK, nOKFlags );
AddButton( BUTTON_CANCEL, RET_CANCEL, nCancelFlags );
AddButton( StandardButtonType::OK, RET_OK, nOKFlags );
AddButton( StandardButtonType::CANCEL, RET_CANCEL, nCancelFlags );
}
else if ( nStyle & WB_YES_NO )
{
@ -86,8 +86,8 @@ void MessBox::ImplInitButtons()
nNoFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
nNoFlags |= BUTTONDIALOG_CANCELBUTTON;
AddButton( BUTTON_YES, RET_YES, nYesFlags );
AddButton( BUTTON_NO, RET_NO, nNoFlags );
AddButton( StandardButtonType::YES, RET_YES, nYesFlags );
AddButton( StandardButtonType::NO, RET_NO, nNoFlags );
}
else if ( nStyle & WB_YES_NO_CANCEL )
{
@ -98,9 +98,9 @@ void MessBox::ImplInitButtons()
else
nCancelFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
AddButton( BUTTON_YES, RET_YES, nYesFlags );
AddButton( BUTTON_NO, RET_NO, nNoFlags );
AddButton( BUTTON_CANCEL, RET_CANCEL, nCancelFlags );
AddButton( StandardButtonType::YES, RET_YES, nYesFlags );
AddButton( StandardButtonType::NO, RET_NO, nNoFlags );
AddButton( StandardButtonType::CANCEL, RET_CANCEL, nCancelFlags );
}
else if ( nStyle & WB_RETRY_CANCEL )
{
@ -109,8 +109,8 @@ void MessBox::ImplInitButtons()
else // WB_DEF_RETRY
nRetryFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
AddButton( BUTTON_RETRY, RET_RETRY, nRetryFlags );
AddButton( BUTTON_CANCEL, RET_CANCEL, nCancelFlags );
AddButton( StandardButtonType::RETRY, RET_RETRY, nRetryFlags );
AddButton( StandardButtonType::CANCEL, RET_CANCEL, nCancelFlags );
}
else if ( nStyle & WB_ABORT_RETRY_IGNORE )
{
@ -124,15 +124,15 @@ void MessBox::ImplInitButtons()
else if ( nStyle & WB_DEF_IGNORE )
nIgnoreFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
AddButton( BUTTON_ABORT, RET_CANCEL, nAbortFlags );
AddButton( BUTTON_RETRY, RET_RETRY, nRetryFlags );
AddButton( BUTTON_IGNORE, RET_IGNORE, nIgnoreFlags );
AddButton( StandardButtonType::ABORT, RET_CANCEL, nAbortFlags );
AddButton( StandardButtonType::RETRY, RET_RETRY, nRetryFlags );
AddButton( StandardButtonType::IGNORE, RET_IGNORE, nIgnoreFlags );
}
else if ( nStyle & WB_OK )
{
nOKFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
AddButton( BUTTON_OK, RET_OK, nOKFlags );
AddButton( StandardButtonType::OK, RET_OK, nOKFlags );
}
}
@ -162,7 +162,7 @@ void MessBox::ImplPosControls()
{
if ( !mbHelpBtn )
{
AddButton( BUTTON_HELP, RET_HELP, BUTTONDIALOG_HELPBUTTON, 3 );
AddButton( StandardButtonType::HELP, RET_HELP, BUTTONDIALOG_HELPBUTTON, 3 );
mbHelpBtn = true;
}
}