Add wxMessageDialog::GetEffectiveIcon() and use it in all ports.
Remove code duplication and inconsistencies among different ports by using a single function in the base class for the determination of the effective icon style to use, correctly handling both wxICON_NONE and the absence of any wxICON_XXX styles. Closes #11822. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63725 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -168,6 +168,26 @@ public:
|
||||
protected:
|
||||
long GetMessageDialogStyle() const { return m_dialogStyle; }
|
||||
|
||||
// based on message dialog style, returns exactly one of: wxICON_NONE,
|
||||
// wxICON_ERROR, wxICON_WARNING, wxICON_QUESTION, wxICON_INFORMATION
|
||||
long GetEffectiveIcon() const
|
||||
{
|
||||
if ( m_dialogStyle & wxICON_NONE )
|
||||
return wxICON_NONE;
|
||||
else if ( m_dialogStyle & wxICON_ERROR )
|
||||
return wxICON_ERROR;
|
||||
else if ( m_dialogStyle & wxICON_WARNING )
|
||||
return wxICON_WARNING;
|
||||
else if ( m_dialogStyle & wxICON_QUESTION )
|
||||
return wxICON_QUESTION;
|
||||
else if ( m_dialogStyle & wxICON_INFORMATION )
|
||||
return wxICON_INFORMATION;
|
||||
else if ( m_dialogStyle & wxYES )
|
||||
return wxICON_QUESTION;
|
||||
else
|
||||
return wxICON_INFORMATION;
|
||||
}
|
||||
|
||||
|
||||
// for the platforms not supporting separate main and extended messages
|
||||
// this function should be used to combine both of them in a single string
|
||||
|
Reference in New Issue
Block a user