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:
Robert Roebling
1999-12-28 13:08:04 +00:00
parent 9b6b575004
commit f2593d0dda
18 changed files with 350 additions and 306 deletions

View File

@@ -24,9 +24,9 @@
class wxAccelRefData: public wxObjectRefData
{
public:
wxAccelRefData();
wxAccelRefData();
wxList m_accels;
wxList m_accels;
};
wxAccelRefData::wxAccelRefData()

View File

@@ -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;

View File

@@ -218,15 +218,15 @@ void wxBitmapButton::SetBitmap()
else
{
if (m_isSelected)
{
the_one = m_selected;
}
{
the_one = m_selected;
}
else
{
{
if (m_hasFocus)
the_one = m_focus;
the_one = m_focus;
else
the_one = m_bitmap;
the_one = m_bitmap;
}
}

View File

@@ -77,7 +77,7 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label,
!CreateBase( parent, id, pos, size, style, validator, name ))
{
wxFAIL_MSG( wxT("wxButton creation failed") );
return FALSE;
return FALSE;
}
/*

View File

@@ -77,7 +77,7 @@ bool wxCheckBox::Create(wxWindow *parent,
!CreateBase( parent, id, pos, size, style, validator, name ))
{
wxFAIL_MSG( wxT("wxCheckBox creation failed") );
return FALSE;
return FALSE;
}
wxControl::SetLabel( label );
@@ -191,11 +191,11 @@ void wxCheckBox::OnInternalIdle()
if (GTK_TOGGLE_BUTTON(m_widgetCheckbox)->event_window && cursor.Ok())
{
/* I now set the cursor the anew in every OnInternalIdle call
as setting the cursor in a parent window also effects the
windows above so that checking for the current cursor is
not possible. */
as setting the cursor in a parent window also effects the
windows above so that checking for the current cursor is
not possible. */
gdk_window_set_cursor( GTK_TOGGLE_BUTTON(m_widgetCheckbox)->event_window, cursor.GetCursor() );
gdk_window_set_cursor( GTK_TOGGLE_BUTTON(m_widgetCheckbox)->event_window, cursor.GetCursor() );
}
UpdateWindowUI();

View File

@@ -152,15 +152,18 @@ wxDataObject::wxDataObject()
bool wxDataObject::IsSupportedFormat(const wxDataFormat& format, Direction dir) const
{
size_t nFormatCount = GetFormatCount(dir);
if ( nFormatCount == 1 ) {
if ( nFormatCount == 1 )
{
return format == GetPreferredFormat();
}
else {
else
{
wxDataFormat *formats = new wxDataFormat[nFormatCount];
GetAllFormats(formats,dir);
size_t n;
for ( n = 0; n < nFormatCount; n++ ) {
for ( n = 0; n < nFormatCount; n++ )
{
if ( formats[n] == format )
break;
}

View File

@@ -2776,8 +2776,7 @@ void wxWindow::WarpPointer( int x, int y )
void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
{
wxCHECK_RET( (m_widget != NULL), wxT("invalid window") );
if (!m_widget) return;
if (!m_widget->window) return;
if (eraseBackground && m_wxwindow && m_wxwindow->window)