Fixed a layout bug in MyFixed

More things done after realization
  wxListCtrl is grey now. Why?


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2278 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-04-25 01:00:34 +00:00
parent 7ef156f797
commit 58dea4b067
14 changed files with 97 additions and 52 deletions

View File

@@ -86,11 +86,11 @@ static gint gtk_dialog_configure_callback( GtkWidget *WXUNUSED(widget), GdkEvent
// "realize" from m_widget
//-----------------------------------------------------------------------------
/* we cannot MWM hints before the widget has been realized,
/* we cannot MWM hints and icons before the widget has been realized,
so we do this directly after realization */
static gint
gtk_dialog_realized_callback( GtkWidget *widget, wxWindow *win )
gtk_dialog_realized_callback( GtkWidget *widget, wxDialog *win )
{
/* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */
@@ -121,6 +121,14 @@ gtk_dialog_realized_callback( GtkWidget *widget, wxWindow *win )
else
gtk_window_set_policy(GTK_WINDOW(win->m_widget), 1, 1, 1);
/* reset the icon */
if (win->m_icon != wxNullIcon)
{
wxIcon icon( win->m_icon );
win->m_icon = wxNullIcon;
win->SetIcon( icon );
}
return FALSE;
}

View File

@@ -150,11 +150,11 @@ static gint gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventC
// "realize" from m_widget
//-----------------------------------------------------------------------------
/* we cannot MWM hints before the widget has been realized,
/* we cannot MWM hints and icons before the widget has been realized,
so we do this directly after realization */
static gint
gtk_frame_realized_callback( GtkWidget *widget, wxWindow *win )
gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
{
/* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */
@@ -185,6 +185,14 @@ gtk_frame_realized_callback( GtkWidget *widget, wxWindow *win )
else
gtk_window_set_policy(GTK_WINDOW(win->m_widget), 1, 1, 1);
/* reset the icon */
if (win->m_icon != wxNullIcon)
{
wxIcon icon( win->m_icon );
win->m_icon = wxNullIcon;
win->SetIcon( icon );
}
return FALSE;
}
@@ -334,7 +342,7 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
PostCreation();
/* we cannot set MWM hints before the widget has
/* we cannot set MWM hints and icons 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_frame_realized_callback), (gpointer) this );
@@ -927,6 +935,8 @@ void wxFrame::SetIcon( const wxIcon &icon )
m_icon = icon;
if (!icon.Ok()) return;
if (!m_widget->window) return;
wxMask *mask = icon.GetMask();
GdkBitmap *bm = (GdkBitmap *) NULL;
if (mask) bm = mask->GetBitmap();

View File

@@ -109,7 +109,7 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
(win->m_width == alloc->width) &&
(win->m_height == alloc->height))
{
// return;
return;
}
win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );

View File

@@ -319,18 +319,21 @@ gtk_myfixed_realize (GtkWidget *widget)
attributes.window_type = GDK_WINDOW_CHILD;
#if (GTK_MINOR_VERSION > 0)
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
attributes.width = widget->allocation.width;
attributes.height = widget->allocation.height;
if (myfixed->shadow_type != GTK_SHADOW_NONE)
{
attributes.x = 2;
attributes.y = 2;
}
else
{
attributes.x = 0;
attributes.y = 0;
}
attributes.width = MAX (1, (gint)widget->allocation.width - attributes.x * 2 );
attributes.height = MAX (1, (gint)widget->allocation.height - attributes.y * 2 );
{
attributes.x += 2;
attributes.y += 2;
attributes.width -= 4;
attributes.height -= 4;
}
if (attributes.width < 2) attributes.width = 2;
if (attributes.height < 2) attributes.height = 2;
#else
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;

View File

@@ -1314,14 +1314,14 @@ gtk_window_realized_callback( GtkWidget *widget, wxWindow *win )
if (win->m_backgroundColour != wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE ))
{
wxColour bg( win->m_backgroundColour );
win->m_backgroundColour = wxNullColour;
win->SetBackgroundColour( wxNullColour );
win->SetBackgroundColour( bg );
}
if (win->m_foregroundColour != *wxBLACK)
{
wxColour fg( win->m_foregroundColour );
win->m_foregroundColour = wxNullColour;
win->SetForegroundColour( wxNullColour );
win->SetForegroundColour( fg );
}
@@ -1489,9 +1489,10 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
m_vAdjust = gtk_range_get_adjustment( GTK_RANGE(s_window->vscrollbar) );
m_wxwindow = gtk_myfixed_new();
gtk_widget_show( m_wxwindow );
gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow );
#if (GTK_MINOR_VERSION > 0)
GtkMyFixed *myfixed = GTK_MYFIXED(m_wxwindow);
@@ -1589,8 +1590,6 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
gtk_signal_connect(GTK_OBJECT(m_vAdjust), "changed",
(GtkSignalFunc) gtk_window_vscroll_change_callback, (gpointer) this );
gtk_widget_show( m_wxwindow );
if (m_parent) m_parent->AddChild( this );
(m_parent->m_insertCallback)( m_parent, this );
@@ -3095,7 +3094,7 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
m_vAdjust->page_size = fthumb;
}
if (m_wxwindow->window)
if (m_wxwindow)
{
if (orient == wxHORIZONTAL)
gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "changed" );