Had to change the time point, when widgets are

created (no longer forced). This seems to break
  wxNotebook...


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2276 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-04-24 21:57:18 +00:00
parent 38444daf66
commit 2b07d71308
19 changed files with 363 additions and 206 deletions

View File

@@ -1294,6 +1294,40 @@ static gint gtk_scrollbar_button_release_callback( GtkRange *widget,
return FALSE;
}
//-----------------------------------------------------------------------------
// "realize" from m_widget
//-----------------------------------------------------------------------------
/* we cannot set colours, fonts and cursors before the widget has
been realized, so we do this directly after realization */
static gint
gtk_window_realized_callback( GtkWidget *widget, wxWindow *win )
{
if (win->m_font != *wxSWISS_FONT)
{
wxFont font( win->m_font );
win->m_font = wxNullFont;
win->SetFont( font );
}
if (win->m_backgroundColour != wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE ))
{
wxColour bg( win->m_backgroundColour );
win->m_backgroundColour = wxNullColour;
win->SetBackgroundColour( bg );
}
if (win->m_foregroundColour != *wxBLACK)
{
wxColour fg( win->m_foregroundColour );
win->m_foregroundColour = wxNullColour;
win->SetForegroundColour( fg );
}
return FALSE;
}
//-----------------------------------------------------------------------------
// InsertChild for wxWindow.
//-----------------------------------------------------------------------------
@@ -1750,13 +1784,12 @@ void wxWindow::PostCreation()
ConnectWidget( GetConnectWidget() );
/* we force the creation of wxFrame and wxDialog in the respective code */
if (m_parent) gtk_widget_realize( m_widget );
if (m_wxwindow) gtk_widget_realize( m_wxwindow );
SetCursor( *wxSTANDARD_CURSOR );
/* we cannot set colours, fonts and cursors before the widget has
been realized, so we do this directly after realization */
gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
GTK_SIGNAL_FUNC(gtk_window_realized_callback), (gpointer) this );
m_hasVMT = TRUE;
}
@@ -2071,6 +2104,8 @@ void wxWindow::ClientToScreen( int *x, int *y )
{
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (!m_widget->window) return;
GdkWindow *source = (GdkWindow *) NULL;
if (m_wxwindow)
source = m_wxwindow->window;
@@ -2098,6 +2133,8 @@ void wxWindow::ScreenToClient( int *x, int *y )
{
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (!m_widget->window) return;
GdkWindow *source = (GdkWindow *) NULL;
if (m_wxwindow)
source = m_wxwindow->window;
@@ -2351,6 +2388,8 @@ void wxWindow::Raise()
{
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (!m_widget->window) return;
if (m_widget) gdk_window_raise( m_widget->window );
}
@@ -2358,6 +2397,8 @@ void wxWindow::Lower()
{
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (!m_widget->window) return;
if (m_widget) gdk_window_lower( m_widget->window );
}
@@ -2459,8 +2500,9 @@ void wxWindow::SetCursor( const wxCursor &cursor )
*m_cursor = *wxSTANDARD_CURSOR;
}
if ((m_widget) && (m_widget->window))
gdk_window_set_cursor( m_widget->window, m_cursor->GetCursor() );
if (!m_widget->window) return;
gdk_window_set_cursor( m_widget->window, m_cursor->GetCursor() );
if ((m_wxwindow) && (m_wxwindow->window))
gdk_window_set_cursor( m_wxwindow->window, m_cursor->GetCursor() );
@@ -2475,6 +2517,8 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
{
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (!m_widget->window) return;
if (eraseBackground && m_wxwindow && m_wxwindow->window)
{
if (rect)
@@ -2540,6 +2584,8 @@ void wxWindow::Clear()
{
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
if (!m_widget->window) return;
if (m_wxwindow && m_wxwindow->window)
{
gdk_window_clear( m_wxwindow->window );
@@ -2596,6 +2642,8 @@ void wxWindow::SetBackgroundColour( const wxColour &colour )
m_backgroundColour = colour;
if (!m_backgroundColour.Ok()) return;
if (!m_widget->window) return;
if (m_wxwindow && m_wxwindow->window)
{
/* wxMSW doesn't clear the window here. I don't do that
@@ -2636,6 +2684,8 @@ void wxWindow::SetForegroundColour( const wxColour &colour )
m_foregroundColour = colour;
if (!m_foregroundColour.Ok()) return;
if (!m_widget->window) return;
wxColour sysbg = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE );
if (sysbg.Red() == colour.Red() &&
sysbg.Green() == colour.Green() &&
@@ -2896,6 +2946,8 @@ void wxWindow::CaptureMouse()
wxCHECK_RET( g_capturing == FALSE, _T("CaptureMouse called twice") );
if (!m_widget->window) return;
GtkWidget *connect_widget = GetConnectWidget();
gtk_grab_add( connect_widget );
gdk_pointer_grab( connect_widget->window, FALSE,
@@ -2915,6 +2967,8 @@ void wxWindow::ReleaseMouse()
wxCHECK_RET( g_capturing == TRUE, _T("ReleaseMouse called twice") );
if (!m_widget->window) return;
GtkWidget *connect_widget = GetConnectWidget();
gtk_grab_remove( connect_widget );
gdk_pointer_ungrab ( GDK_CURRENT_TIME );