VCL: Simplify MessBox and its children initialisation.
Change-Id: Icf24af615e6020b40f92f565194b2328e99f47ad Reviewed-on: https://gerrit.libreoffice.org/26199 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
committed by
Noel Grandin
parent
272a8afa60
commit
4ccc83fb25
@@ -41,7 +41,6 @@ protected:
|
|||||||
OUString maCheckBoxText;
|
OUString maCheckBoxText;
|
||||||
bool mbCheck;
|
bool mbCheck;
|
||||||
|
|
||||||
SAL_DLLPRIVATE void ImplInitMessBoxData();
|
|
||||||
SAL_DLLPRIVATE void ImplInitButtons();
|
SAL_DLLPRIVATE void ImplInitButtons();
|
||||||
SAL_DLLPRIVATE void ImplPosControls();
|
SAL_DLLPRIVATE void ImplPosControls();
|
||||||
|
|
||||||
@@ -67,9 +66,6 @@ public:
|
|||||||
|
|
||||||
class VCL_DLLPUBLIC InfoBox : public MessBox
|
class VCL_DLLPUBLIC InfoBox : public MessBox
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
SAL_DLLPRIVATE void ImplInitInfoBoxData();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
InfoBox( vcl::Window* pParent, const OUString& rMessage );
|
InfoBox( vcl::Window* pParent, const OUString& rMessage );
|
||||||
InfoBox( vcl::Window* pParent, WinBits nStyle,
|
InfoBox( vcl::Window* pParent, WinBits nStyle,
|
||||||
@@ -80,9 +76,6 @@ public:
|
|||||||
|
|
||||||
class VCL_DLLPUBLIC WarningBox : public MessBox
|
class VCL_DLLPUBLIC WarningBox : public MessBox
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
SAL_DLLPRIVATE void ImplInitWarningBoxData();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WarningBox( vcl::Window* pParent, WinBits nStyle,
|
WarningBox( vcl::Window* pParent, WinBits nStyle,
|
||||||
const OUString& rMessage );
|
const OUString& rMessage );
|
||||||
@@ -94,9 +87,6 @@ public:
|
|||||||
|
|
||||||
class VCL_DLLPUBLIC ErrorBox : public MessBox
|
class VCL_DLLPUBLIC ErrorBox : public MessBox
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
SAL_DLLPRIVATE void ImplInitErrorBoxData();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ErrorBox( vcl::Window* pParent, WinBits nStyle,
|
ErrorBox( vcl::Window* pParent, WinBits nStyle,
|
||||||
const OUString& rMessage );
|
const OUString& rMessage );
|
||||||
|
@@ -51,15 +51,6 @@ static void ImplInitMsgBoxImageList()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessBox::ImplInitMessBoxData()
|
|
||||||
{
|
|
||||||
mpVCLMultiLineEdit = nullptr;
|
|
||||||
mpFixedImage = nullptr;
|
|
||||||
mbHelpBtn = false;
|
|
||||||
mpCheckBox = nullptr;
|
|
||||||
mbCheck = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MessBox::ImplInitButtons()
|
void MessBox::ImplInitButtons()
|
||||||
{
|
{
|
||||||
WinBits nStyle = GetStyle();
|
WinBits nStyle = GetStyle();
|
||||||
@@ -140,9 +131,10 @@ void MessBox::ImplInitButtons()
|
|||||||
MessBox::MessBox( vcl::Window* pParent, WinBits nStyle,
|
MessBox::MessBox( vcl::Window* pParent, WinBits nStyle,
|
||||||
const OUString& rTitle, const OUString& rMessage ) :
|
const OUString& rTitle, const OUString& rMessage ) :
|
||||||
ButtonDialog( WINDOW_MESSBOX ),
|
ButtonDialog( WINDOW_MESSBOX ),
|
||||||
maMessText( rMessage )
|
maMessText( rMessage ),
|
||||||
|
mbHelpBtn( false ),
|
||||||
|
mbCheck( false )
|
||||||
{
|
{
|
||||||
ImplInitMessBoxData();
|
|
||||||
ImplInit( pParent, nStyle | WB_MOVEABLE | WB_HORZ | WB_CENTER );
|
ImplInit( pParent, nStyle | WB_MOVEABLE | WB_HORZ | WB_CENTER );
|
||||||
ImplInitButtons();
|
ImplInitButtons();
|
||||||
|
|
||||||
@@ -379,7 +371,13 @@ Size MessBox::GetOptimalSize() const
|
|||||||
return Size( 250, 100 );
|
return Size( 250, 100 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void InfoBox::ImplInitInfoBoxData()
|
InfoBox::InfoBox( vcl::Window* pParent, const OUString& rMessage ) :
|
||||||
|
InfoBox( pParent, WB_OK | WB_DEF_OK, rMessage )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
InfoBox::InfoBox( vcl::Window* pParent, WinBits nStyle, const OUString& rMessage ) :
|
||||||
|
MessBox( pParent, nStyle, OUString(), rMessage )
|
||||||
{
|
{
|
||||||
// Default Text is the display title from the application
|
// Default Text is the display title from the application
|
||||||
if ( GetText().isEmpty() )
|
if ( GetText().isEmpty() )
|
||||||
@@ -388,25 +386,15 @@ void InfoBox::ImplInitInfoBoxData()
|
|||||||
SetImage( InfoBox::GetStandardImage() );
|
SetImage( InfoBox::GetStandardImage() );
|
||||||
}
|
}
|
||||||
|
|
||||||
InfoBox::InfoBox( vcl::Window* pParent, const OUString& rMessage ) :
|
|
||||||
MessBox( pParent, WB_OK | WB_DEF_OK, OUString(), rMessage )
|
|
||||||
{
|
|
||||||
ImplInitInfoBoxData();
|
|
||||||
}
|
|
||||||
|
|
||||||
InfoBox::InfoBox( vcl::Window* pParent, WinBits nStyle, const OUString& rMessage ) :
|
|
||||||
MessBox( pParent, nStyle, OUString(), rMessage )
|
|
||||||
{
|
|
||||||
ImplInitInfoBoxData();
|
|
||||||
}
|
|
||||||
|
|
||||||
Image InfoBox::GetStandardImage()
|
Image InfoBox::GetStandardImage()
|
||||||
{
|
{
|
||||||
ImplInitMsgBoxImageList();
|
ImplInitMsgBoxImageList();
|
||||||
return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 4 );
|
return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 4 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void WarningBox::ImplInitWarningBoxData()
|
WarningBox::WarningBox( vcl::Window* pParent, WinBits nStyle,
|
||||||
|
const OUString& rMessage ) :
|
||||||
|
MessBox( pParent, nStyle, OUString(), rMessage )
|
||||||
{
|
{
|
||||||
// Default Text is the display title from the application
|
// Default Text is the display title from the application
|
||||||
if ( GetText().isEmpty() )
|
if ( GetText().isEmpty() )
|
||||||
@@ -415,13 +403,6 @@ void WarningBox::ImplInitWarningBoxData()
|
|||||||
SetImage( WarningBox::GetStandardImage() );
|
SetImage( WarningBox::GetStandardImage() );
|
||||||
}
|
}
|
||||||
|
|
||||||
WarningBox::WarningBox( vcl::Window* pParent, WinBits nStyle,
|
|
||||||
const OUString& rMessage ) :
|
|
||||||
MessBox( pParent, nStyle, OUString(), rMessage )
|
|
||||||
{
|
|
||||||
ImplInitWarningBoxData();
|
|
||||||
}
|
|
||||||
|
|
||||||
void WarningBox::SetDefaultCheckBoxText()
|
void WarningBox::SetDefaultCheckBoxText()
|
||||||
{
|
{
|
||||||
ResMgr* pResMgr = ImplGetResMgr();
|
ResMgr* pResMgr = ImplGetResMgr();
|
||||||
@@ -435,7 +416,9 @@ Image WarningBox::GetStandardImage()
|
|||||||
return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 3 );
|
return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 3 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ErrorBox::ImplInitErrorBoxData()
|
ErrorBox::ErrorBox( vcl::Window* pParent, WinBits nStyle,
|
||||||
|
const OUString& rMessage ) :
|
||||||
|
MessBox( pParent, nStyle, OUString(), rMessage )
|
||||||
{
|
{
|
||||||
// Default Text is the display title from the application
|
// Default Text is the display title from the application
|
||||||
if ( GetText().isEmpty() )
|
if ( GetText().isEmpty() )
|
||||||
@@ -444,13 +427,6 @@ void ErrorBox::ImplInitErrorBoxData()
|
|||||||
SetImage( ErrorBox::GetStandardImage() );
|
SetImage( ErrorBox::GetStandardImage() );
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorBox::ErrorBox( vcl::Window* pParent, WinBits nStyle,
|
|
||||||
const OUString& rMessage ) :
|
|
||||||
MessBox( pParent, nStyle, OUString(), rMessage )
|
|
||||||
{
|
|
||||||
ImplInitErrorBoxData();
|
|
||||||
}
|
|
||||||
|
|
||||||
Image ErrorBox::GetStandardImage()
|
Image ErrorBox::GetStandardImage()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -466,7 +442,8 @@ Image ErrorBox::GetStandardImage()
|
|||||||
return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 1 );
|
return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QueryBox::ImplInitQueryBoxData()
|
QueryBox::QueryBox( vcl::Window* pParent, WinBits nStyle, const OUString& rMessage ) :
|
||||||
|
MessBox( pParent, nStyle, OUString(), rMessage )
|
||||||
{
|
{
|
||||||
// Default Text is the display title from the application
|
// Default Text is the display title from the application
|
||||||
if ( GetText().isEmpty() )
|
if ( GetText().isEmpty() )
|
||||||
@@ -475,12 +452,6 @@ void QueryBox::ImplInitQueryBoxData()
|
|||||||
SetImage( QueryBox::GetStandardImage() );
|
SetImage( QueryBox::GetStandardImage() );
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBox::QueryBox( vcl::Window* pParent, WinBits nStyle, const OUString& rMessage ) :
|
|
||||||
MessBox( pParent, nStyle, OUString(), rMessage )
|
|
||||||
{
|
|
||||||
ImplInitQueryBoxData();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QueryBox::SetDefaultCheckBoxText()
|
void QueryBox::SetDefaultCheckBoxText()
|
||||||
{
|
{
|
||||||
ResMgr* pResMgr = ImplGetResMgr();
|
ResMgr* pResMgr = ImplGetResMgr();
|
||||||
|
Reference in New Issue
Block a user