1. fixed (to test) the bug with bitmaps without masks in wxImageList
2. reorganized wxImageList a bit, created a new wxInvertMask() function 3. an incredibly ugly fix (?) for "unsatisfied constraints" warnings 4. added wxIcon and wxBitmap ctors from XPM 5. XPM handler now creates bitmaps with mask 6. added wxPrinterDC::BitBlt() and DrawBitmap(), cleared the horrible mess in the wxDC methods with the same names git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -177,8 +177,8 @@ public:
|
||||
bool SatisfyConstraints(wxWindowBase *win, int *noChanges);
|
||||
bool AreSatisfied() const
|
||||
{
|
||||
return left.GetDone() && top.GetDone() && right.GetDone() &&
|
||||
bottom.GetDone() && centreX.GetDone() && centreY.GetDone();
|
||||
return left.GetDone() && top.GetDone() &&
|
||||
width.GetDone() && height.GetDone();
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -480,15 +480,15 @@ DECLARE_LOG_FUNCTION2(SysError, long lErrCode);
|
||||
// make life easier for people using VC++ IDE: clicking on the message
|
||||
// will take us immediately to the place of the failed API
|
||||
#ifdef __VISUALC__
|
||||
#define wxLogApiError(api, rc) \
|
||||
wxLogDebug(wxT("%s(%d): '%s' failed with error 0x%08lx (%s)."), \
|
||||
__TFILE__, __LINE__, api, \
|
||||
#define wxLogApiError(api, rc) \
|
||||
wxLogDebug(wxT("%s(%d): '%s' failed with error 0x%08lx (%s)."), \
|
||||
__TFILE__, __LINE__, _T(api), \
|
||||
rc, wxSysErrorMsg(rc))
|
||||
#else // !VC++
|
||||
#define wxLogApiError(api, rc) \
|
||||
wxLogDebug(wxT("In file %s at line %d: '%s' failed with " \
|
||||
"error 0x%08lx (%s)."), \
|
||||
__TFILE__, __LINE__, api, \
|
||||
#define wxLogApiError(api, rc) \
|
||||
wxLogDebug(wxT("In file %s at line %d: '%s' failed with " \
|
||||
"error 0x%08lx (%s)."), \
|
||||
__TFILE__, __LINE__, _T(api), \
|
||||
rc, wxSysErrorMsg(rc))
|
||||
#endif // VC++/!VC++
|
||||
|
||||
|
@@ -78,7 +78,8 @@ public:
|
||||
wxBitmap(const char bits[], int width, int height, int depth = 1);
|
||||
|
||||
// Initialize with XPM data
|
||||
wxBitmap(char **data, wxControl *anItem = NULL);
|
||||
wxBitmap(const char **data) { CreateFromXpm(data); }
|
||||
wxBitmap(char **data) { CreateFromXpm((const char **)data); }
|
||||
|
||||
// Load a file or resource
|
||||
wxBitmap(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE);
|
||||
@@ -116,7 +117,7 @@ public:
|
||||
|
||||
virtual ~wxBitmap();
|
||||
|
||||
// GRG, Dic/99
|
||||
// get the given part of bitmap
|
||||
wxBitmap GetSubBitmap( const wxRect& rect ) const;
|
||||
|
||||
// copies the contents and mask of the given (colour) icon to the bitmap
|
||||
@@ -182,6 +183,9 @@ protected:
|
||||
virtual wxGDIImageRefData *CreateData() const
|
||||
{ return new wxBitmapRefData; }
|
||||
|
||||
// creates the bitmap from XPM data, supposed to be called from ctor
|
||||
bool CreateFromXpm(const char **bits);
|
||||
|
||||
private:
|
||||
#ifdef __WIN32__
|
||||
// common part of CopyFromIcon/CopyFromCursor for Win32
|
||||
|
@@ -138,6 +138,9 @@ public:
|
||||
m_bOwnsDC = bOwnsDC;
|
||||
}
|
||||
|
||||
const wxBitmap& GetSelectedBitmap() const { return m_selectedBitmap; }
|
||||
wxBitmap& GetSelectedBitmap() { return m_selectedBitmap; }
|
||||
|
||||
protected:
|
||||
virtual void DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
|
||||
int style = wxFLOOD_SURFACE);
|
||||
|
@@ -1,19 +1,19 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dcprint.h
|
||||
// Name: wx/msw/dcprint.h
|
||||
// Purpose: wxPrinterDC class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DCPRINT_H_
|
||||
#define _WX_DCPRINT_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dcprint.h"
|
||||
#pragma interface "dcprint.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_PRINTING_ARCHITECTURE
|
||||
@@ -36,12 +36,20 @@ DECLARE_CLASS(wxPrinterDC)
|
||||
|
||||
~wxPrinterDC(void);
|
||||
|
||||
bool StartDoc(const wxString& message);
|
||||
void EndDoc(void);
|
||||
void StartPage(void);
|
||||
void EndPage(void);
|
||||
// override some base class virtuals
|
||||
virtual bool StartDoc(const wxString& message);
|
||||
virtual void EndDoc();
|
||||
virtual void StartPage();
|
||||
virtual void EndPage();
|
||||
|
||||
protected:
|
||||
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
||||
bool useMask = FALSE);
|
||||
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
|
||||
wxCoord width, wxCoord height,
|
||||
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||
int rop = wxCOPY, bool useMask = FALSE);
|
||||
|
||||
wxPrintData m_printData;
|
||||
};
|
||||
|
||||
|
@@ -60,15 +60,23 @@ public:
|
||||
class WXDLLEXPORT wxIcon : public wxIconBase
|
||||
{
|
||||
public:
|
||||
wxIcon();
|
||||
// ctors
|
||||
// default
|
||||
wxIcon() { }
|
||||
|
||||
// Copy constructors
|
||||
// copy
|
||||
wxIcon(const wxIcon& icon) { Ref(icon); }
|
||||
|
||||
// from raw data
|
||||
wxIcon(const char bits[], int width, int height);
|
||||
// from XPM data
|
||||
wxIcon(const char **data) { CreateIconFromXpm(data); }
|
||||
wxIcon(char **data) { CreateIconFromXpm((const char **)data); }
|
||||
// from resource/file
|
||||
wxIcon(const wxString& name,
|
||||
long type = wxBITMAP_TYPE_ICO_RESOURCE,
|
||||
int desiredWidth = -1, int desiredHeight = -1);
|
||||
|
||||
virtual ~wxIcon();
|
||||
|
||||
virtual bool LoadFile(const wxString& name,
|
||||
@@ -93,6 +101,12 @@ protected:
|
||||
return new wxIconRefData;
|
||||
}
|
||||
|
||||
// create from XPM data
|
||||
void CreateIconFromXpm(const char **data);
|
||||
|
||||
// create from bitmap (which should have a mask unless it's monochrome)
|
||||
void CopyFromBitmap(const wxBitmap& bmp);
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxIcon)
|
||||
};
|
||||
|
@@ -231,6 +231,10 @@ inline void wxRGBToColour(wxColour& c, COLORREF rgb)
|
||||
extern void HIMETRICToPixel(LONG *x, LONG *y);
|
||||
extern void PixelToHIMETRIC(LONG *x, LONG *y);
|
||||
|
||||
// Windows convention of the mask is opposed to the wxWindows one, so we need
|
||||
// to invert the mask each time we pass one/get one to/from Windows
|
||||
extern HBITMAP wxInvertMask(HBITMAP hbmpMask, int w = 0, int h = 0);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// small helper classes
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@@ -617,7 +617,7 @@ public:
|
||||
virtual void SetConstraintSizes(bool recurse = TRUE);
|
||||
virtual bool LayoutPhase1(int *noChanges);
|
||||
virtual bool LayoutPhase2(int *noChanges);
|
||||
virtual bool DoPhase(int);
|
||||
virtual bool DoPhase(int phase);
|
||||
|
||||
// these methods are virtual but normally won't be overridden
|
||||
virtual void SetSizeConstraint(int x, int y, int w, int h);
|
||||
|
Reference in New Issue
Block a user