summaryrefslogtreecommitdiff
path: root/vcl/source/window/msgbox.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/window/msgbox.cxx')
-rw-r--r--vcl/source/window/msgbox.cxx67
1 files changed, 34 insertions, 33 deletions
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 07eafcac357a..ae4c148d5807 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -70,10 +70,10 @@ void MessBox::ImplInitMessBoxData()
mpFixedText = NULL;
mpFixedImage = NULL;
mnSoundType = 0;
- mbHelpBtn = FALSE;
- mbSound = TRUE;
+ mbHelpBtn = sal_False;
+ mbSound = sal_True;
mpCheckBox = NULL;
- mbCheck = FALSE;
+ mbCheck = sal_False;
}
// -----------------------------------------------------------------------
@@ -81,11 +81,11 @@ void MessBox::ImplInitMessBoxData()
void MessBox::ImplInitButtons()
{
WinBits nStyle = GetStyle();
- USHORT nOKFlags = BUTTONDIALOG_OKBUTTON;
- USHORT nCancelFlags = BUTTONDIALOG_CANCELBUTTON;
- USHORT nRetryFlags = 0;
- USHORT nYesFlags = 0;
- USHORT nNoFlags = 0;
+ sal_uInt16 nOKFlags = BUTTONDIALOG_OKBUTTON;
+ sal_uInt16 nCancelFlags = BUTTONDIALOG_CANCELBUTTON;
+ sal_uInt16 nRetryFlags = 0;
+ sal_uInt16 nYesFlags = 0;
+ sal_uInt16 nNoFlags = 0;
if ( nStyle & WB_OK_CANCEL )
{
@@ -133,8 +133,8 @@ void MessBox::ImplInitButtons()
}
else if ( nStyle & WB_ABORT_RETRY_IGNORE )
{
- USHORT nAbortFlags = 0;
- USHORT nIgnoreFlags = 0;
+ sal_uInt16 nAbortFlags = 0;
+ sal_uInt16 nIgnoreFlags = 0;
if ( nStyle & WB_DEF_CANCEL )
nAbortFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
@@ -186,16 +186,15 @@ MessBox::MessBox( Window* pParent, const ResId& rResId ) :
ImplInitMessBoxData();
GetRes( rResId.SetRT( RSC_MESSBOX ) );
- USHORT nHiButtons = ReadShortRes();
- USHORT nLoButtons = ReadShortRes();
- USHORT nHiDefButton = ReadShortRes();
- USHORT nLoDefButton = ReadShortRes();
- USHORT nHiHelpId = ReadShortRes();
- USHORT nLoHelpId = ReadShortRes();
- /* USHORT bSysModal = */ ReadShortRes();
- SetHelpId( ((ULONG)nHiHelpId << 16) + nLoHelpId );
- WinBits nBits = (((ULONG)nHiButtons << 16) + nLoButtons) |
- (((ULONG)nHiDefButton << 16) + nLoDefButton);
+ sal_uInt16 nHiButtons = ReadShortRes();
+ sal_uInt16 nLoButtons = ReadShortRes();
+ sal_uInt16 nHiDefButton = ReadShortRes();
+ sal_uInt16 nLoDefButton = ReadShortRes();
+ rtl::OString aHelpId( ReadByteStringRes() );
+ /* sal_uInt16 bSysModal = */ ReadShortRes();
+ SetHelpId( aHelpId );
+ WinBits nBits = (((sal_uLong)nHiButtons << 16) + nLoButtons) |
+ (((sal_uLong)nHiDefButton << 16) + nLoDefButton);
ImplInit( pParent, nBits | WB_MOVEABLE | WB_HORZ | WB_CENTER );
ImplLoadRes( rResId );
@@ -227,12 +226,12 @@ MessBox::~MessBox()
void MessBox::ImplPosControls()
{
- if ( GetHelpId() )
+ if ( GetHelpId().getLength() )
{
if ( !mbHelpBtn )
{
AddButton( BUTTON_HELP, BUTTONID_HELP, BUTTONDIALOG_HELPBUTTON, 3 );
- mbHelpBtn = TRUE;
+ mbHelpBtn = sal_True;
}
}
else
@@ -240,7 +239,7 @@ void MessBox::ImplPosControls()
if ( mbHelpBtn )
{
RemoveButton( BUTTONID_HELP );
- mbHelpBtn = FALSE;
+ mbHelpBtn = sal_False;
}
}
@@ -258,7 +257,7 @@ void MessBox::ImplPosControls()
long nMaxLineWidth;
long nWidth;
WinBits nWinStyle = WB_LEFT | WB_WORDBREAK | WB_NOLABEL | WB_INFO;
- USHORT nTextStyle = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP | TEXT_DRAW_LEFT;
+ sal_uInt16 nTextStyle = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP | TEXT_DRAW_LEFT;
if ( mpFixedText )
delete mpFixedText;
@@ -277,7 +276,7 @@ void MessBox::ImplPosControls()
// Message-Text um Tabs bereinigen
XubString aTabStr( RTL_CONSTASCII_USTRINGPARAM( " " ) );
- USHORT nIndex = 0;
+ sal_uInt16 nIndex = 0;
while ( nIndex != STRING_NOTFOUND )
nIndex = aMessText.SearchAndReplace( '\t', aTabStr, nIndex );
@@ -414,6 +413,8 @@ void MessBox::ImplPosControls()
}
mpFixedText = new FixedText( this, nWinStyle );
+ if( mpFixedText->GetStyle() & WB_EXTRAOFFSET ) // TODO: use CalcMinimumSize() instead
+ aFixedSize.Width() += 2;
mpFixedText->SetPosSizePixel( aTextPos, aFixedSize );
mpFixedText->SetText( aMessText );
mpFixedText->Show();
@@ -435,14 +436,14 @@ void MessBox::StateChanged( StateChangedType nType )
// -----------------------------------------------------------------------
-BOOL MessBox::GetCheckBoxState() const
+sal_Bool MessBox::GetCheckBoxState() const
{
return mpCheckBox ? mpCheckBox->IsChecked() : mbCheck;
}
// -----------------------------------------------------------------------
-void MessBox::SetCheckBoxState( BOOL bCheck )
+void MessBox::SetCheckBoxState( sal_Bool bCheck )
{
if( mpCheckBox ) mpCheckBox->Check( bCheck );
mbCheck = bCheck;
@@ -459,10 +460,10 @@ void MessBox::SetDefaultCheckBoxText()
// -----------------------------------------------------------------------
-BOOL MessBox::SetModeImage( const Image& rImage )
+sal_Bool MessBox::SetModeImage( const Image& rImage )
{
SetImage( rImage );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -494,7 +495,7 @@ void InfoBox::ImplInitInfoBoxData()
SetText( Application::GetDisplayName() );
SetImage( InfoBox::GetStandardImage() );
- mnSoundType = ((USHORT)SOUND_INFO)+1;
+ mnSoundType = ((sal_uInt16)SOUND_INFO)+1;
}
// -----------------------------------------------------------------------
@@ -530,7 +531,7 @@ void WarningBox::ImplInitWarningBoxData()
SetText( Application::GetDisplayName() );
SetImage( WarningBox::GetStandardImage() );
- mnSoundType = ((USHORT)SOUND_WARNING)+1;
+ mnSoundType = ((sal_uInt16)SOUND_WARNING)+1;
}
// -----------------------------------------------------------------------
@@ -576,7 +577,7 @@ void ErrorBox::ImplInitErrorBoxData()
SetText( Application::GetDisplayName() );
SetImage( ErrorBox::GetStandardImage() );
- mnSoundType = ((USHORT)SOUND_ERROR)+1;
+ mnSoundType = ((sal_uInt16)SOUND_ERROR)+1;
}
// -----------------------------------------------------------------------
@@ -613,7 +614,7 @@ void QueryBox::ImplInitQueryBoxData()
SetText( Application::GetDisplayName() );
SetImage( QueryBox::GetStandardImage() );
- mnSoundType = ((USHORT)SOUND_QUERY)+1;
+ mnSoundType = ((sal_uInt16)SOUND_QUERY)+1;
}
// -----------------------------------------------------------------------