Include XPM under wxX11 for some samples; added comment about
non-working images in dragimag sample git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -40,7 +40,7 @@
|
|||||||
// resources
|
// resources
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__)
|
#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXX11__)
|
||||||
// logo for the about dialog
|
// logo for the about dialog
|
||||||
#include "bitmaps/life.xpm"
|
#include "bitmaps/life.xpm"
|
||||||
#endif
|
#endif
|
||||||
|
@@ -41,7 +41,7 @@
|
|||||||
// resources
|
// resources
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__)
|
#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXX11__)
|
||||||
// application icon
|
// application icon
|
||||||
#include "mondrian.xpm"
|
#include "mondrian.xpm"
|
||||||
|
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#include "dragimag.h"
|
#include "dragimag.h"
|
||||||
|
|
||||||
#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__)
|
#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXX11__)
|
||||||
#include "mondrian.xpm"
|
#include "mondrian.xpm"
|
||||||
#include "dragicon.xpm"
|
#include "dragicon.xpm"
|
||||||
#endif
|
#endif
|
||||||
@@ -190,7 +190,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
|
|||||||
{
|
{
|
||||||
// Can anyone explain why this test is necessary,
|
// Can anyone explain why this test is necessary,
|
||||||
// to prevent a gcc error?
|
// to prevent a gcc error?
|
||||||
#ifdef __WXMOTIF__
|
#if defined(__WXMOTIF__) || defined(__WXX11__)
|
||||||
wxIcon icon(dragicon_xpm);
|
wxIcon icon(dragicon_xpm);
|
||||||
#else
|
#else
|
||||||
wxIcon icon(wxICON(dragicon));
|
wxIcon icon(wxICON(dragicon));
|
||||||
@@ -394,6 +394,9 @@ bool MyApp::OnInit()
|
|||||||
{
|
{
|
||||||
wxString filename;
|
wxString filename;
|
||||||
filename.Printf(wxT("%s%d.png"), (const wxChar*)rootName, i);
|
filename.Printf(wxT("%s%d.png"), (const wxChar*)rootName, i);
|
||||||
|
/* For some reason under wxX11, the 2nd LoadFile in this loop fails, with
|
||||||
|
a BadMatch inside CreateFromImage (inside ConvertToBitmap). This happens even if you copy
|
||||||
|
the first file over the second file. */
|
||||||
if (image.LoadFile(filename, wxBITMAP_TYPE_PNG))
|
if (image.LoadFile(filename, wxBITMAP_TYPE_PNG))
|
||||||
{
|
{
|
||||||
DragShape* newShape = new DragShape(image.ConvertToBitmap());
|
DragShape* newShape = new DragShape(image.ConvertToBitmap());
|
||||||
|
@@ -614,6 +614,9 @@ bool wxBitmap::CreateFromImage( const wxImage& image, int depth )
|
|||||||
|
|
||||||
GC gc = XCreateGC( xdisplay, (Pixmap) M_BMPDATA->m_pixmap, 0, NULL );
|
GC gc = XCreateGC( xdisplay, (Pixmap) M_BMPDATA->m_pixmap, 0, NULL );
|
||||||
XPutImage( xdisplay, (Pixmap) M_BMPDATA->m_pixmap, gc, data_image, 0, 0, 0, 0, width, height );
|
XPutImage( xdisplay, (Pixmap) M_BMPDATA->m_pixmap, gc, data_image, 0, 0, 0, 0, width, height );
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
|
XSync(wxGlobalDisplay(), False);
|
||||||
|
#endif
|
||||||
|
|
||||||
XDestroyImage( data_image );
|
XDestroyImage( data_image );
|
||||||
XFreeGC( xdisplay, gc );
|
XFreeGC( xdisplay, gc );
|
||||||
|
Reference in New Issue
Block a user