Made icons configurable via a wxMApp virtual function. Tested on wxGTK only,
added it for all ports, though. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2953 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -779,3 +779,31 @@ int wxEntry( int argc, char *argv[] )
|
||||
return retValue;
|
||||
}
|
||||
|
||||
# include "wx/gtk/info.xpm"
|
||||
# include "wx/gtk/error.xpm"
|
||||
# include "wx/gtk/question.xpm"
|
||||
# include "wx/gtk/warning.xpm"
|
||||
|
||||
wxIcon
|
||||
wxApp::GetStdIcon(int which) const
|
||||
{
|
||||
switch(which)
|
||||
{
|
||||
case wxICON_INFORMATION:
|
||||
return wxIcon(info_xpm);
|
||||
break;
|
||||
case wxICON_HAND:
|
||||
return wxIcon(error_xpm);
|
||||
break;
|
||||
case wxICON_QUESTION:
|
||||
return wxIcon(question_xpm);
|
||||
break;
|
||||
case wxICON_EXCLAMATION:
|
||||
return wxIcon(warning_xpm);
|
||||
break;
|
||||
default:
|
||||
wxFAIL_MSG("requested non existent standard icon");
|
||||
return wxIcon(error_xpm);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -120,7 +120,8 @@ void wxButton::SetDefault(void)
|
||||
SetSize( m_x, m_y, m_width, m_height );
|
||||
}
|
||||
|
||||
static wxSize wxButton::GetDefaultSize()
|
||||
/* static */
|
||||
wxSize wxButton::GetDefaultSize()
|
||||
{
|
||||
return wxSize(80,26);
|
||||
}
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include "wx/layout.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/app.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -38,11 +39,6 @@
|
||||
#include "wx/gtk/msgdlg.h"
|
||||
#include "wx/statline.h"
|
||||
|
||||
#include "wx/gtk/info.xpm"
|
||||
#include "wx/gtk/error.xpm"
|
||||
#include "wx/gtk/question.xpm"
|
||||
#include "wx/gtk/warning.xpm"
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
// New dialog box implementations
|
||||
|
||||
@@ -107,19 +103,13 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString
|
||||
wxSize message_size( wxSplitMessage2( message, this, text_pos_x ) );
|
||||
|
||||
if (m_dialogStyle & wxICON_MASK)
|
||||
if (message_size.y < 50) message_size.y = 50;
|
||||
|
||||
if (m_dialogStyle & wxICON_INFORMATION)
|
||||
(void) new wxStaticBitmap( this, -1, wxBitmap( info_xpm ), wxPoint(15,message_size.y/2-16) );
|
||||
else
|
||||
if (m_dialogStyle & wxICON_HAND)
|
||||
(void) new wxStaticBitmap( this, -1, wxBitmap( error_xpm ), wxPoint(15,message_size.y/2-16) );
|
||||
else
|
||||
if (m_dialogStyle & wxICON_QUESTION)
|
||||
(void) new wxStaticBitmap( this, -1, wxBitmap( question_xpm ), wxPoint(15,message_size.y/2-16) );
|
||||
else
|
||||
if (m_dialogStyle & wxICON_EXCLAMATION)
|
||||
(void) new wxStaticBitmap( this, -1, wxBitmap( warning_xpm ), wxPoint(15,message_size.y/2-16) );
|
||||
{
|
||||
if (message_size.y < 50) message_size.y = 50;
|
||||
(void) new wxStaticBitmap( this, -1,
|
||||
wxTheApp->GetStdIcon(m_dialogStyle
|
||||
& wxICON_MASK),
|
||||
wxPoint(15,message_size.y/2-16) );
|
||||
}
|
||||
|
||||
wxButton *ok = (wxButton *) NULL;
|
||||
wxButton *cancel = (wxButton *) NULL;
|
||||
|
Reference in New Issue
Block a user