don't use wxApp::GetStdIcon
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
3a72b4eff0
commit
389d906b21
@ -29,6 +29,7 @@
|
||||
#include "wx/tglbtn.h"
|
||||
#include "wx/notebook.h"
|
||||
#include "wx/imaglist.h"
|
||||
#include "wx/artprov.h"
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
#include "wx/tooltip.h"
|
||||
@ -721,12 +722,12 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
|
||||
panel = new wxPanel(m_notebook);
|
||||
|
||||
#if !defined(__WXMOTIF__) && !defined(__WIN16__) // wxStaticBitmap not working under Motif yet; and icons not allowed under WIN16.
|
||||
wxIcon icon = wxTheApp->GetStdIcon(wxICON_INFORMATION);
|
||||
wxIcon icon = wxArtProvider::GetIcon(wxART_INFORMATION);
|
||||
wxStaticBitmap *bmpStatic = new wxStaticBitmap(panel, -1, icon,
|
||||
wxPoint(10, 10));
|
||||
|
||||
bmpStatic = new wxStaticBitmap(panel, -1, wxNullIcon, wxPoint(50, 10));
|
||||
bmpStatic->SetIcon(wxTheApp->GetStdIcon(wxICON_QUESTION));
|
||||
bmpStatic->SetIcon(wxArtProvider::GetIcon(wxART_QUESTION));
|
||||
#endif // !Motif
|
||||
|
||||
wxBitmap bitmap( 100, 100 );
|
||||
@ -751,9 +752,9 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
|
||||
}
|
||||
#endif
|
||||
|
||||
wxBitmap bmp1(wxTheApp->GetStdIcon(wxICON_INFORMATION)),
|
||||
bmp2(wxTheApp->GetStdIcon(wxICON_WARNING)),
|
||||
bmp3(wxTheApp->GetStdIcon(wxICON_QUESTION));
|
||||
wxBitmap bmp1(wxArtProvider::GetBitmap(wxART_INFORMATION)),
|
||||
bmp2(wxArtProvider::GetBitmap(wxART_WARNING)),
|
||||
bmp3(wxArtProvider::GetBitmap(wxART_QUESTION));
|
||||
wxBitmapButton *bmpBtn = new wxBitmapButton
|
||||
(
|
||||
panel, -1,
|
||||
|
@ -37,6 +37,7 @@
|
||||
|
||||
#include "wx/colordlg.h"
|
||||
#include "wx/image.h"
|
||||
#include "wx/artprov.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// ressources
|
||||
@ -368,7 +369,7 @@ MyCanvas::MyCanvas(MyFrame *parent)
|
||||
m_owner = parent;
|
||||
m_show = Show_Default;
|
||||
m_smile_bmp = wxBitmap(smile_xpm);
|
||||
m_std_icon = wxTheApp->GetStdIcon(wxICON_INFORMATION);
|
||||
m_std_icon = wxArtProvider::GetIcon(wxART_INFORMATION);
|
||||
}
|
||||
|
||||
void MyCanvas::DrawTestBrushes(wxDC& dc)
|
||||
@ -553,9 +554,9 @@ void MyCanvas::DrawDefault(wxDC& dc)
|
||||
|
||||
memdc.SelectObject( wxNullBitmap );
|
||||
dc.DrawBitmap( bitmap, 10, 170 );
|
||||
wxImage image( bitmap );
|
||||
wxImage image = bitmap.ConvertToImage();
|
||||
image.Rescale( 60,210 );
|
||||
bitmap = image.ConvertToBitmap();
|
||||
bitmap = wxBitmap(image);
|
||||
dc.DrawBitmap( bitmap, 50, 170 );
|
||||
|
||||
// test the rectangle outline drawing - there should be one pixel between
|
||||
|
@ -41,6 +41,7 @@
|
||||
|
||||
#include "wx/sizer.h"
|
||||
#include "wx/notebook.h"
|
||||
#include "wx/artprov.h"
|
||||
|
||||
#include "widgets.h"
|
||||
|
||||
@ -320,10 +321,11 @@ void NotebookWidgetsPage::CreateImageList()
|
||||
{
|
||||
// create a dummy image list with a few icons
|
||||
m_imageList = new wxImageList(32, 32);
|
||||
m_imageList->Add(wxTheApp->GetStdIcon(wxICON_INFORMATION));
|
||||
m_imageList->Add(wxTheApp->GetStdIcon(wxICON_QUESTION));
|
||||
m_imageList->Add(wxTheApp->GetStdIcon(wxICON_WARNING));
|
||||
m_imageList->Add(wxTheApp->GetStdIcon(wxICON_ERROR));
|
||||
wxSize size(32, 32);
|
||||
m_imageList->Add(wxArtProvider::GetIcon(wxART_INFORMATION, wxART_OTHER, size));
|
||||
m_imageList->Add(wxArtProvider::GetIcon(wxART_QUESTION, wxART_OTHER, size));
|
||||
m_imageList->Add(wxArtProvider::GetIcon(wxART_WARNING, wxART_OTHER, size));
|
||||
m_imageList->Add(wxArtProvider::GetIcon(wxART_ERROR, wxART_OTHER, size));
|
||||
}
|
||||
|
||||
m_notebook->SetImageList(m_imageList);
|
||||
|
@ -52,6 +52,7 @@
|
||||
#include "wx/file.h"
|
||||
#include "wx/textfile.h"
|
||||
#include "wx/statline.h"
|
||||
#include "wx/artprov.h"
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// for OutputDebugString()
|
||||
@ -734,8 +735,19 @@ wxLogDialog::wxLogDialog(wxWindow *parent,
|
||||
sizerButtons->Add(m_btnDetails, 0, wxCENTRE | wxTOP, MARGIN/2 - 1);
|
||||
|
||||
#ifndef __WIN16__
|
||||
wxIcon icon = wxTheApp->GetStdIcon((int)(style & wxICON_MASK));
|
||||
sizerAll->Add(new wxStaticBitmap(this, -1, icon), 0);
|
||||
wxBitmap bitmap;
|
||||
switch ( style & wxICON_MASK )
|
||||
{
|
||||
case wxICON_ERROR:
|
||||
bitmap = wxArtProvider::GetIcon(wxART_ERROR, wxART_MESSAGE_BOX); break;
|
||||
case wxICON_INFORMATION:
|
||||
bitmap = wxArtProvider::GetIcon(wxART_INFORMATION, wxART_MESSAGE_BOX); break;
|
||||
case wxICON_WARNING:
|
||||
bitmap = wxArtProvider::GetIcon(wxART_WARNING, wxART_MESSAGE_BOX); break;
|
||||
default:
|
||||
wxFAIL_MSG(_T("incorrect log style"));
|
||||
}
|
||||
sizerAll->Add(new wxStaticBitmap(this, -1, bitmap), 0);
|
||||
#endif // !Win16
|
||||
|
||||
const wxString& message = messages.Last();
|
||||
@ -795,11 +807,11 @@ void wxLogDialog::CreateDetailsControls()
|
||||
wxImageList *imageList = new wxImageList(ICON_SIZE, ICON_SIZE);
|
||||
|
||||
// order should be the same as in the switch below!
|
||||
static const int icons[] =
|
||||
static const wxChar* icons[] =
|
||||
{
|
||||
wxICON_ERROR,
|
||||
wxICON_EXCLAMATION,
|
||||
wxICON_INFORMATION
|
||||
wxART_ERROR,
|
||||
wxART_WARNING,
|
||||
wxART_INFORMATION
|
||||
};
|
||||
|
||||
bool loadedIcons = TRUE;
|
||||
@ -807,19 +819,20 @@ void wxLogDialog::CreateDetailsControls()
|
||||
#ifndef __WIN16__
|
||||
for ( size_t icon = 0; icon < WXSIZEOF(icons); icon++ )
|
||||
{
|
||||
wxBitmap bmp = wxTheApp->GetStdIcon(icons[icon]);
|
||||
wxBitmap bmp = wxArtProvider::GetBitmap(icons[icon], wxART_MESSAGE_BOX,
|
||||
wxSize(ICON_SIZE, ICON_SIZE));
|
||||
|
||||
// This may very well fail if there are insufficient colours available.
|
||||
// Degrade gracefully.
|
||||
if ( !bmp.Ok() )
|
||||
{
|
||||
wxLogError("FAILED fro %s:", icons[icon]);
|
||||
loadedIcons = FALSE;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
wxImage img(bmp);
|
||||
imageList->Add(img.Rescale(ICON_SIZE, ICON_SIZE).ConvertToBitmap());
|
||||
imageList->Add(bmp);
|
||||
}
|
||||
|
||||
m_listctrl->SetImageList(imageList, wxIMAGE_LIST_SMALL);
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "wx/generic/msgdlgg.h"
|
||||
#include "wx/artprov.h"
|
||||
|
||||
#if wxUSE_STATLINE
|
||||
#include "wx/statline.h"
|
||||
@ -72,9 +73,22 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent,
|
||||
// 1) icon
|
||||
if (style & wxICON_MASK)
|
||||
{
|
||||
wxStaticBitmap *icon = new wxStaticBitmap(
|
||||
this, -1, wxTheApp->GetStdIcon((int)(style & wxICON_MASK)));
|
||||
icon_text->Add( icon, 0, wxCENTER );
|
||||
wxBitmap bitmap;
|
||||
switch ( style & wxICON_MASK )
|
||||
{
|
||||
case wxICON_ERROR:
|
||||
bitmap = wxArtProvider::GetIcon(wxART_ERROR, wxART_MESSAGE_BOX); break;
|
||||
case wxICON_INFORMATION:
|
||||
bitmap = wxArtProvider::GetIcon(wxART_INFORMATION, wxART_MESSAGE_BOX); break;
|
||||
case wxICON_WARNING:
|
||||
bitmap = wxArtProvider::GetIcon(wxART_WARNING, wxART_MESSAGE_BOX); break;
|
||||
case wxICON_QUESTION:
|
||||
bitmap = wxArtProvider::GetIcon(wxART_QUESTION, wxART_MESSAGE_BOX); break;
|
||||
default:
|
||||
wxFAIL_MSG(_T("incorrect log style"));
|
||||
}
|
||||
wxStaticBitmap *icon = new wxStaticBitmap(this, -1, bitmap);
|
||||
icon_text->Add( icon, 0, wxCENTER );
|
||||
}
|
||||
|
||||
// 2) text
|
||||
|
Loading…
Reference in New Issue
Block a user