Add support for wxICON_AUTH_NEEDED to wxMessageDialog.
Allow showing the standard "Authentication needed" dialog in the message boxes under MSW. Closes #15121. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73877 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -666,6 +666,7 @@ wxMSW:
|
|||||||
- Generate menu highlight events for popup menus in wxDialog (Sam Partington).
|
- Generate menu highlight events for popup menus in wxDialog (Sam Partington).
|
||||||
- Return more native shell icons from wxArtProvider (Markus Juergens).
|
- Return more native shell icons from wxArtProvider (Markus Juergens).
|
||||||
- Fix filter checks in wxDir::FindFirst/Next() (Catalin Raceanu).
|
- Fix filter checks in wxDir::FindFirst/Next() (Catalin Raceanu).
|
||||||
|
- Add support for wxICON_AUTH_NEEDED to wxMessageDialog (Chris Spencer).
|
||||||
|
|
||||||
wxOSX/Cocoa:
|
wxOSX/Cocoa:
|
||||||
|
|
||||||
|
@@ -1924,9 +1924,10 @@ enum wxBorder
|
|||||||
#define wxMORE 0x00010000
|
#define wxMORE 0x00010000
|
||||||
#define wxSETUP 0x00020000
|
#define wxSETUP 0x00020000
|
||||||
#define wxICON_NONE 0x00040000
|
#define wxICON_NONE 0x00040000
|
||||||
|
#define wxICON_AUTH_NEEDED 0x00080000
|
||||||
|
|
||||||
#define wxICON_MASK \
|
#define wxICON_MASK \
|
||||||
(wxICON_EXCLAMATION|wxICON_HAND|wxICON_QUESTION|wxICON_INFORMATION|wxICON_NONE)
|
(wxICON_EXCLAMATION|wxICON_HAND|wxICON_QUESTION|wxICON_INFORMATION|wxICON_NONE|wxICON_AUTH_NEEDED)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Background styles. See wxWindow::SetBackgroundStyle
|
* Background styles. See wxWindow::SetBackgroundStyle
|
||||||
|
@@ -209,8 +209,9 @@ public:
|
|||||||
{ return m_help.empty() ? GetDefaultHelpLabel() : m_help; }
|
{ return m_help.empty() ? GetDefaultHelpLabel() : m_help; }
|
||||||
|
|
||||||
// based on message dialog style, returns exactly one of: wxICON_NONE,
|
// based on message dialog style, returns exactly one of: wxICON_NONE,
|
||||||
// wxICON_ERROR, wxICON_WARNING, wxICON_QUESTION, wxICON_INFORMATION
|
// wxICON_ERROR, wxICON_WARNING, wxICON_QUESTION, wxICON_INFORMATION,
|
||||||
long GetEffectiveIcon() const
|
// wxICON_AUTH_NEEDED
|
||||||
|
virtual long GetEffectiveIcon() const
|
||||||
{
|
{
|
||||||
if ( m_dialogStyle & wxICON_NONE )
|
if ( m_dialogStyle & wxICON_NONE )
|
||||||
return wxICON_NONE;
|
return wxICON_NONE;
|
||||||
|
@@ -27,6 +27,8 @@ public:
|
|||||||
|
|
||||||
virtual int ShowModal();
|
virtual int ShowModal();
|
||||||
|
|
||||||
|
virtual long GetEffectiveIcon() const;
|
||||||
|
|
||||||
// implementation-specific
|
// implementation-specific
|
||||||
|
|
||||||
// return the font used for the text in the message box
|
// return the font used for the text in the message box
|
||||||
|
@@ -68,6 +68,15 @@ const char wxMessageBoxCaptionStr[] = "Message";
|
|||||||
Displays an information symbol. This icon is used by default if
|
Displays an information symbol. This icon is used by default if
|
||||||
@c wxYES_NO is not given so it is usually unnecessary to specify it
|
@c wxYES_NO is not given so it is usually unnecessary to specify it
|
||||||
explicitly.
|
explicitly.
|
||||||
|
@style{wxICON_AUTH_NEEDED}
|
||||||
|
Displays an authentication needed symbol. This style is only supported
|
||||||
|
for message dialogs under wxMSW when a task dialog is used to implement
|
||||||
|
them (i.e. when running under Windows Vista or later). In other cases
|
||||||
|
the default icon selection logic will be used. Note this can be
|
||||||
|
combined with other styles to provide a fallback. For instance, using
|
||||||
|
wxICON_AUTH_NEEDED | wxICON_QUESTION will show a shield symbol on
|
||||||
|
Windows Vista or above and a question symbol on other platforms.
|
||||||
|
@since 2.9.5
|
||||||
@style{wxSTAY_ON_TOP}
|
@style{wxSTAY_ON_TOP}
|
||||||
Makes the message box stay on top of all other windows and not only
|
Makes the message box stay on top of all other windows and not only
|
||||||
just its parent (currently implemented only under MSW and GTK).
|
just its parent (currently implemented only under MSW and GTK).
|
||||||
|
@@ -3005,7 +3005,8 @@ bool TestMessageBoxDialog::Create()
|
|||||||
"&Information icon",
|
"&Information icon",
|
||||||
"&Question icon",
|
"&Question icon",
|
||||||
"&Warning icon",
|
"&Warning icon",
|
||||||
"&Error icon"
|
"&Error icon",
|
||||||
|
"A&uth needed icon"
|
||||||
};
|
};
|
||||||
|
|
||||||
wxCOMPILE_TIME_ASSERT( WXSIZEOF(icons) == MsgDlgIcon_Max, IconMismatch );
|
wxCOMPILE_TIME_ASSERT( WXSIZEOF(icons) == MsgDlgIcon_Max, IconMismatch );
|
||||||
@@ -3106,6 +3107,10 @@ long TestMessageBoxDialog::GetStyle()
|
|||||||
case MsgDlgIcon_Error:
|
case MsgDlgIcon_Error:
|
||||||
style |= wxICON_ERROR;
|
style |= wxICON_ERROR;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MsgDlgIcon_AuthNeeded:
|
||||||
|
style |= wxICON_AUTH_NEEDED;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_chkCentre->IsChecked() )
|
if ( m_chkCentre->IsChecked() )
|
||||||
|
@@ -249,6 +249,7 @@ private:
|
|||||||
MsgDlgIcon_Question,
|
MsgDlgIcon_Question,
|
||||||
MsgDlgIcon_Warning,
|
MsgDlgIcon_Warning,
|
||||||
MsgDlgIcon_Error,
|
MsgDlgIcon_Error,
|
||||||
|
MsgDlgIcon_AuthNeeded,
|
||||||
MsgDlgIcon_Max
|
MsgDlgIcon_Max
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -629,6 +629,18 @@ int wxMessageDialog::ShowModal()
|
|||||||
return ShowMessageBox();
|
return ShowMessageBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long wxMessageDialog::GetEffectiveIcon() const
|
||||||
|
{
|
||||||
|
// only use the auth needed icon if available, otherwise fallback to the default logic
|
||||||
|
if ( (m_dialogStyle & wxICON_AUTH_NEEDED) &&
|
||||||
|
wxMSWMessageDialog::HasNativeTaskDialog() )
|
||||||
|
{
|
||||||
|
return wxICON_AUTH_NEEDED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return wxMessageDialogBase::GetEffectiveIcon();
|
||||||
|
}
|
||||||
|
|
||||||
void wxMessageDialog::DoCentre(int dir)
|
void wxMessageDialog::DoCentre(int dir)
|
||||||
{
|
{
|
||||||
#ifdef wxHAS_MSW_TASKDIALOG
|
#ifdef wxHAS_MSW_TASKDIALOG
|
||||||
@@ -738,6 +750,10 @@ void wxMSWTaskDialogConfig::MSWCommonTaskDialogInit(TASKDIALOGCONFIG &tdc)
|
|||||||
case wxICON_INFORMATION:
|
case wxICON_INFORMATION:
|
||||||
tdc.pszMainIcon = TD_INFORMATION_ICON;
|
tdc.pszMainIcon = TD_INFORMATION_ICON;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case wxICON_AUTH_NEEDED:
|
||||||
|
tdc.pszMainIcon = TD_SHIELD_ICON;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// custom label button array that can hold all buttons in use
|
// custom label button array that can hold all buttons in use
|
||||||
|
Reference in New Issue
Block a user