Restore border around non-scrolling widgets. The

border seems to have the wrong colour now (?).


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 2007-04-07 14:41:41 +00:00
parent ebe1d1579b
commit 3e09bcfd02
3 changed files with 50 additions and 9 deletions

View File

@ -32,6 +32,8 @@ struct _GtkPizza
guint m_xoffset;
guint m_yoffset;
gboolean m_noscroll;
GdkWindow *bin_window;
};
@ -39,6 +41,8 @@ WXDLLIMPEXP_CORE
GtkType gtk_pizza_get_type (void);
WXDLLIMPEXP_CORE
GtkWidget* gtk_pizza_new (void);
WXDLLIMPEXP_CORE
GtkWidget* gtk_pizza_new_no_scroll (void);
/* accessors */

View File

@ -215,6 +215,20 @@ gtk_pizza_new ()
GtkPizza *pizza;
pizza = g_object_new (gtk_pizza_get_type (), NULL);
pizza->m_noscroll = FALSE;
return GTK_WIDGET (pizza);
}
GtkWidget*
gtk_pizza_new_no_scroll ()
{
GtkPizza *pizza;
pizza = g_object_new (gtk_pizza_get_type (), NULL);
pizza->m_noscroll = TRUE;
return GTK_WIDGET (pizza);
}
@ -555,7 +569,20 @@ gtk_pizza_size_allocate (GtkWidget *widget,
if (h < 0)
h = 0;
if (GTK_WIDGET_REALIZED (widget))
if (!GTK_WIDGET_REALIZED (widget))
return;
if (pizza->m_noscroll)
{
if (only_resize)
gdk_window_resize( widget->window, allocation->width, allocation->height );
else
gdk_window_move_resize( widget->window, allocation->x, allocation->y,
allocation->width, allocation->height );
gdk_window_move_resize( pizza->bin_window, border, border, w, h );
}
else
{
if (only_resize)
gdk_window_resize( widget->window, w, h );

View File

@ -2324,21 +2324,31 @@ bool wxWindowGTK::Create( wxWindow *parent,
m_insertCallback = wxInsertChildInWindow;
m_wxwindow = gtk_pizza_new();
#ifndef __WXUNIVERSAL__
if (HasFlag(wxSIMPLE_BORDER))
gtk_container_set_border_width((GtkContainer*)m_wxwindow, 1);
else if (HasFlag(wxRAISED_BORDER) || HasFlag(wxSUNKEN_BORDER))
gtk_container_set_border_width((GtkContainer*)m_wxwindow, 2);
#endif // __WXUNIVERSAL__
if (!HasFlag(wxHSCROLL) && !HasFlag(wxVSCROLL))
{
m_wxwindow = gtk_pizza_new_no_scroll();
#ifndef __WXUNIVERSAL__
if (HasFlag(wxSIMPLE_BORDER))
gtk_container_set_border_width((GtkContainer*)m_wxwindow, 1);
else if (HasFlag(wxRAISED_BORDER) || HasFlag(wxSUNKEN_BORDER))
gtk_container_set_border_width((GtkContainer*)m_wxwindow, 2);
#endif // __WXUNIVERSAL__
m_widget = m_wxwindow;
}
else
{
m_wxwindow = gtk_pizza_new();
#ifndef __WXUNIVERSAL__
if (HasFlag(wxSIMPLE_BORDER))
gtk_container_set_border_width((GtkContainer*)m_wxwindow, 1);
else if (HasFlag(wxRAISED_BORDER) || HasFlag(wxSUNKEN_BORDER))
gtk_container_set_border_width((GtkContainer*)m_wxwindow, 2);
#endif // __WXUNIVERSAL__
m_widget = gtk_scrolled_window_new( (GtkAdjustment *) NULL, (GtkAdjustment *) NULL );
GtkScrolledWindow *scrolledWindow = GTK_SCROLLED_WINDOW(m_widget);