Calling a Refresh() before the window is created no longer
gives an assert. Nothing will happen. Added wxTreeCtrl::InsertItem( paret, before, ... ), Correct some places with incorrectly indented code. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5126 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -112,24 +112,24 @@ bool wxMask::Create( const wxBitmap& bitmap,
|
||||
|
||||
for (int j = 0; j < image.GetHeight(); j++)
|
||||
{
|
||||
int start_x = -1;
|
||||
int i;
|
||||
for (i = 0; i < image.GetWidth(); i++)
|
||||
int start_x = -1;
|
||||
int i;
|
||||
for (i = 0; i < image.GetWidth(); i++)
|
||||
{
|
||||
if ((data[index] == red) &&
|
||||
(data[index+1] == green) &&
|
||||
(data[index+2] == blue))
|
||||
{
|
||||
if (start_x == -1)
|
||||
start_x = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (start_x != -1)
|
||||
{
|
||||
gdk_draw_line( m_bitmap, gc, start_x, j, i-1, j );
|
||||
start_x = -1;
|
||||
}
|
||||
if ((data[index] == red) &&
|
||||
(data[index+1] == green) &&
|
||||
(data[index+2] == blue))
|
||||
{
|
||||
if (start_x == -1)
|
||||
start_x = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (start_x != -1)
|
||||
{
|
||||
gdk_draw_line( m_bitmap, gc, start_x, j, i-1, j );
|
||||
start_x = -1;
|
||||
}
|
||||
}
|
||||
index += 3;
|
||||
}
|
||||
@@ -193,16 +193,16 @@ GdkBitmap *wxMask::GetBitmap() const
|
||||
class wxBitmapRefData: public wxObjectRefData
|
||||
{
|
||||
public:
|
||||
wxBitmapRefData();
|
||||
~wxBitmapRefData();
|
||||
wxBitmapRefData();
|
||||
~wxBitmapRefData();
|
||||
|
||||
GdkPixmap *m_pixmap;
|
||||
GdkBitmap *m_bitmap;
|
||||
wxMask *m_mask;
|
||||
int m_width;
|
||||
int m_height;
|
||||
int m_bpp;
|
||||
wxPalette *m_palette;
|
||||
GdkPixmap *m_pixmap;
|
||||
GdkBitmap *m_bitmap;
|
||||
wxMask *m_mask;
|
||||
int m_width;
|
||||
int m_height;
|
||||
int m_bpp;
|
||||
wxPalette *m_palette;
|
||||
};
|
||||
|
||||
wxBitmapRefData::wxBitmapRefData()
|
||||
@@ -388,7 +388,7 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
|
||||
{
|
||||
wxCHECK_MSG( Ok() &&
|
||||
(rect.x >= 0) && (rect.y >= 0) &&
|
||||
(rect.x+rect.width <= M_BMPDATA->m_width) && (rect.y+rect.height <= M_BMPDATA->m_height),
|
||||
(rect.x+rect.width <= M_BMPDATA->m_width) && (rect.y+rect.height <= M_BMPDATA->m_height),
|
||||
wxNullBitmap, wxT("invalid bitmap or bitmap region") );
|
||||
|
||||
wxBitmap ret( rect.width, rect.height, M_BMPDATA->m_bpp );
|
||||
@@ -397,14 +397,14 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
|
||||
if (ret.GetPixmap())
|
||||
{
|
||||
GdkGC *gc = gdk_gc_new( ret.GetPixmap() );
|
||||
gdk_draw_pixmap( ret.GetPixmap(), gc, GetPixmap(), rect.x, rect.y, 0, 0, rect.width, rect.height );
|
||||
gdk_gc_destroy( gc );
|
||||
gdk_draw_pixmap( ret.GetPixmap(), gc, GetPixmap(), rect.x, rect.y, 0, 0, rect.width, rect.height );
|
||||
gdk_gc_destroy( gc );
|
||||
}
|
||||
else
|
||||
{
|
||||
GdkGC *gc = gdk_gc_new( ret.GetBitmap() );
|
||||
gdk_draw_bitmap( ret.GetBitmap(), gc, GetBitmap(), rect.x, rect.y, 0, 0, rect.width, rect.height );
|
||||
gdk_gc_destroy( gc );
|
||||
gdk_draw_bitmap( ret.GetBitmap(), gc, GetBitmap(), rect.x, rect.y, 0, 0, rect.width, rect.height );
|
||||
gdk_gc_destroy( gc );
|
||||
}
|
||||
|
||||
if (GetMask())
|
||||
@@ -414,10 +414,10 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
|
||||
mask->m_bitmap = gdk_pixmap_new( parent, rect.width, rect.height, 1 );
|
||||
|
||||
GdkGC *gc = gdk_gc_new( mask->m_bitmap );
|
||||
gdk_draw_bitmap( mask->m_bitmap, gc, M_BMPDATA->m_mask->m_bitmap, 0, 0, rect.x, rect.y, rect.width, rect.height );
|
||||
gdk_gc_destroy( gc );
|
||||
gdk_draw_bitmap( mask->m_bitmap, gc, M_BMPDATA->m_mask->m_bitmap, 0, 0, rect.x, rect.y, rect.width, rect.height );
|
||||
gdk_gc_destroy( gc );
|
||||
|
||||
ret.SetMask( mask );
|
||||
ret.SetMask( mask );
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user