Applied colour patch for better 8-bit support,

Improved handling of inserting controls into
    a toolbar that don't have any def width. This
    works for all controls but wxComboBox.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8930 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2000-12-16 12:27:26 +00:00
parent 0a07a7d852
commit 47c93b637e
8 changed files with 108 additions and 108 deletions

View File

@@ -655,6 +655,21 @@ static long map_to_wx_keysym( KeySym keysym )
return (key_code);
}
//-----------------------------------------------------------------------------
// "size_request" of m_widget
//-----------------------------------------------------------------------------
static void gtk_window_size_request_callback( GtkWidget *widget, GtkRequisition *requisition, wxWindow *win )
{
int w,h;
win->GetSize( &w, &h );
if (w < 2) w = 2;
if (h < 2) h = 2;
requisition->height = h;
requisition->width = w;
}
//-----------------------------------------------------------------------------
// "expose_event" of m_wxwindow
//-----------------------------------------------------------------------------
@@ -2454,19 +2469,30 @@ void wxWindow::PostCreation()
if (m_wxwindow)
{
/* Catch native resize events. */
// Catch native resize events
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "size_allocate",
GTK_SIGNAL_FUNC(gtk_window_size_callback), (gpointer)this );
/* Initialize XIM support. */
// Initialize XIM support
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "realize",
GTK_SIGNAL_FUNC(gtk_wxwindow_realized_callback), (gpointer) this );
/* And resize XIM window. */
// And resize XIM window
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "size_allocate",
GTK_SIGNAL_FUNC(gtk_wxwindow_size_callback), (gpointer)this );
}
if (!GTK_IS_COMBO(m_widget))
{
// This is needed if we want to add our windows into native
// GTK control, such as the toolbar. With this callback, the
// toolbar gets to know the correct size (the one set by the
// programmer). Sadly, it misbehaves for wxComboBox. FIXME
// when moving to GTK 2.0.
gtk_signal_connect( GTK_OBJECT(m_widget), "size_request",
GTK_SIGNAL_FUNC(gtk_window_size_request_callback), (gpointer) this );
}
m_hasVMT = TRUE;
}