Don't use stock items in wxMessageDialog
Stock items are deprecated since GTK+ 3.10 so corresponding labels should be used instead of them.
This commit is contained in:
@@ -50,27 +50,47 @@ wxMessageDialog::wxMessageDialog(wxWindow *parent,
|
|||||||
|
|
||||||
wxString wxMessageDialog::GetDefaultYesLabel() const
|
wxString wxMessageDialog::GetDefaultYesLabel() const
|
||||||
{
|
{
|
||||||
|
#if defined(__WXGTK3__) && GTK_CHECK_VERSION(3,10,0)
|
||||||
|
return wxConvertMnemonicsToGTK(wxGetStockLabel(wxID_YES));
|
||||||
|
#else
|
||||||
return GTK_STOCK_YES;
|
return GTK_STOCK_YES;
|
||||||
|
#endif // GTK >= 3.10 / < 3.10
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxMessageDialog::GetDefaultNoLabel() const
|
wxString wxMessageDialog::GetDefaultNoLabel() const
|
||||||
{
|
{
|
||||||
|
#if defined(__WXGTK3__) && GTK_CHECK_VERSION(3,10,0)
|
||||||
|
return wxConvertMnemonicsToGTK(wxGetStockLabel(wxID_NO));
|
||||||
|
#else
|
||||||
return GTK_STOCK_NO;
|
return GTK_STOCK_NO;
|
||||||
|
#endif // GTK >= 3.10 / < 3.10
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxMessageDialog::GetDefaultOKLabel() const
|
wxString wxMessageDialog::GetDefaultOKLabel() const
|
||||||
{
|
{
|
||||||
|
#if defined(__WXGTK3__) && GTK_CHECK_VERSION(3,10,0)
|
||||||
|
return wxConvertMnemonicsToGTK(wxGetStockLabel(wxID_OK));
|
||||||
|
#else
|
||||||
return GTK_STOCK_OK;
|
return GTK_STOCK_OK;
|
||||||
|
#endif // GTK >= 3.10 / < 3.10
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxMessageDialog::GetDefaultCancelLabel() const
|
wxString wxMessageDialog::GetDefaultCancelLabel() const
|
||||||
{
|
{
|
||||||
|
#if defined(__WXGTK3__) && GTK_CHECK_VERSION(3,10,0)
|
||||||
|
return wxConvertMnemonicsToGTK(wxGetStockLabel(wxID_CANCEL));
|
||||||
|
#else
|
||||||
return GTK_STOCK_CANCEL;
|
return GTK_STOCK_CANCEL;
|
||||||
|
#endif // GTK >= 3.10 / < 3.10
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxMessageDialog::GetDefaultHelpLabel() const
|
wxString wxMessageDialog::GetDefaultHelpLabel() const
|
||||||
{
|
{
|
||||||
|
#if defined(__WXGTK3__) && GTK_CHECK_VERSION(3,10,0)
|
||||||
|
return wxConvertMnemonicsToGTK(wxGetStockLabel(wxID_HELP));
|
||||||
|
#else
|
||||||
return GTK_STOCK_HELP;
|
return GTK_STOCK_HELP;
|
||||||
|
#endif // GTK >= 3.10 / < 3.10
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMessageDialog::DoSetCustomLabel(wxString& var, const ButtonLabel& label)
|
void wxMessageDialog::DoSetCustomLabel(wxString& var, const ButtonLabel& label)
|
||||||
@@ -83,7 +103,11 @@ void wxMessageDialog::DoSetCustomLabel(wxString& var, const ButtonLabel& label)
|
|||||||
}
|
}
|
||||||
else // stock label
|
else // stock label
|
||||||
{
|
{
|
||||||
|
#if defined(__WXGTK3__) && GTK_CHECK_VERSION(3,10,0)
|
||||||
|
var = wxConvertMnemonicsToGTK(wxGetStockLabel(stockId));
|
||||||
|
#else
|
||||||
var = wxGetStockGtkID(stockId);
|
var = wxGetStockGtkID(stockId);
|
||||||
|
#endif // GTK >= 3.10 / < 3.10
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user