better layout for simple one param messages, closes #11810
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64066 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -61,18 +61,26 @@ int wxMessageDialog::ShowModal()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// (the standard alert has two slots [title, text]
|
||||||
|
// for the three wxStrings [caption, message, extended message])
|
||||||
|
//
|
||||||
|
// if the extended text is empty we use the caption and
|
||||||
|
// the message (for backwards compatibility)
|
||||||
|
//
|
||||||
|
// if the extended text is not empty we ignore the caption
|
||||||
|
// and use the message and the extended message
|
||||||
|
|
||||||
// work out what to display
|
|
||||||
// if the extended text is empty then we use the caption as the title
|
|
||||||
// and the message as the text (for backwards compatibility)
|
|
||||||
// but if the extended message is not empty then we use the message as the title
|
|
||||||
// and the extended message as the text because that makes more sense
|
|
||||||
|
|
||||||
wxString msgtitle,msgtext;
|
wxString msgtitle,msgtext;
|
||||||
if(m_extendedMessage.IsEmpty())
|
if(m_extendedMessage.IsEmpty())
|
||||||
{
|
{
|
||||||
msgtitle = m_caption;
|
if ( m_caption.IsEmpty() )
|
||||||
msgtext = m_message;
|
msgtitle = m_message;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msgtitle = m_caption;
|
||||||
|
msgtext = m_message;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -150,7 +158,7 @@ int wxMessageDialog::ShowModal()
|
|||||||
wxCFStringRef cfCancelString( GetCancelLabel().c_str(), GetFont().GetEncoding() );
|
wxCFStringRef cfCancelString( GetCancelLabel().c_str(), GetFont().GetEncoding() );
|
||||||
|
|
||||||
wxCFStringRef cfTitle( msgtitle, GetFont().GetEncoding() );
|
wxCFStringRef cfTitle( msgtitle, GetFont().GetEncoding() );
|
||||||
wxCFStringRef cfText( msgtext, GetFont().GetEncoding() );
|
wxCFStringRef cfText = msgtext.IsEmpty() ? NULL : wxCFStringRef( msgtext, GetFont().GetEncoding() );
|
||||||
|
|
||||||
param.movable = true;
|
param.movable = true;
|
||||||
param.flags = 0;
|
param.flags = 0;
|
||||||
|
Reference in New Issue
Block a user