GtkRequisition entry_req;
entry_req.width = 2;
entry_req.height = 2;
- (* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(gcombo->button) )->size_request )
- (gcombo->button, &entry_req );
+ (* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(gcombo->entry) )->size_request )
+ (gcombo->entry, &entry_req );
- requisition->width = w - entry_req.width;
+ GtkRequisition button_req;
+ button_req.width = 2;
+ button_req.height = 2;
+ (* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(gcombo->button) )->size_request )
+ (gcombo->button, &button_req );
+
+ requisition->width = w - button_req.width;
requisition->height = entry_req.height;
}
}
// time anymore.
GtkPizza *pizza = GTK_PIZZA( widget );
- if (gdk_event->window != pizza->bin_window) return FALSE;
+ if (gdk_event->window != pizza->bin_window)
+ {
+ // block expose events on GTK_WIDGET(pizza)->window,
+ // all drawing is done on pizza->bin_window
+ return true;
+ }
#if 0
// GDK sends surplus button down events
// before a double click event. We
// need to filter these out.
- if (gdk_event->type == GDK_BUTTON_PRESS)
+ if ((gdk_event->type == GDK_BUTTON_PRESS) && (win->m_wxwindow))
{
GdkEvent *peek_event = gdk_event_peek();
if (peek_event)
alloc->height );
#endif
- GTK_PIZZA(win->m_wxwindow)->m_width = win->GetClientSize().x;
-
win->m_oldClientWidth = client_width;
win->m_oldClientHeight = client_height;
GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT_GET_CLASS(m_widget) );
scroll_class->scrollbar_spacing = 0;
- gtk_scrolled_window_set_policy( scrolledWindow, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
+ if (HasFlag(wxALWAYS_SHOW_SB))
+ {
+ gtk_scrolled_window_set_policy( scrolledWindow, GTK_POLICY_ALWAYS, GTK_POLICY_ALWAYS );
+
+ scrolledWindow->hscrollbar_visible = TRUE;
+ scrolledWindow->vscrollbar_visible = TRUE;
+ }
+ else
+ {
+ gtk_scrolled_window_set_policy( scrolledWindow, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
+ }
m_scrollBar[ScrollDir_Horz] = GTK_RANGE(scrolledWindow->hscrollbar);
m_scrollBar[ScrollDir_Vert] = GTK_RANGE(scrolledWindow->vscrollbar);
m_wxwindow = gtk_pizza_new();
#ifndef __WXUNIVERSAL__
- GtkPizza *pizza = GTK_PIZZA(m_wxwindow);
-
- if (HasFlag(wxRAISED_BORDER))
- {
- gtk_pizza_set_shadow_type( pizza, GTK_MYSHADOW_OUT );
- }
- else if (HasFlag(wxSUNKEN_BORDER))
- {
- gtk_pizza_set_shadow_type( pizza, GTK_MYSHADOW_IN );
- }
- else if (HasFlag(wxSIMPLE_BORDER))
- {
- gtk_pizza_set_shadow_type( pizza, GTK_MYSHADOW_THIN );
- }
- else
- {
- gtk_pizza_set_shadow_type( pizza, GTK_MYSHADOW_NONE );
- }
+ 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__
gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow );
GetScrollbarWidth(m_widget, dw, dh);
}
-#ifndef __WXUNIVERSAL__
- if (HasFlag(wxRAISED_BORDER) || HasFlag(wxSUNKEN_BORDER))
- {
- // shadow border size is 2
- dw += 2 * 2;
- dh += 2 * 2;
- }
- if (HasFlag(wxSIMPLE_BORDER))
- {
- // simple border size is 1
- dw += 1 * 2;
- dh += 1 * 2;
- }
-#endif // __WXUNIVERSAL__
+ const int border = GTK_CONTAINER(m_wxwindow)->border_width;
+ dw += 2 * border;
+ dh += 2 * border;
width += dw;
height += dh;
if (m_hasScrolling)
GetScrollbarWidth(m_widget, dw, dh);
-#ifndef __WXUNIVERSAL__
- if (HasFlag(wxRAISED_BORDER) || HasFlag(wxSUNKEN_BORDER))
- {
- // shadow border size is 2
- dw += 2 * 2;
- dh += 2 * 2;
- }
- if (HasFlag(wxSIMPLE_BORDER))
- {
- // simple border size is 1
- dw += 1 * 2;
- dh += 1 * 2;
- }
-#endif // __WXUNIVERSAL__
+ const int border = GTK_CONTAINER(m_wxwindow)->border_width;
+ dw += 2 * border;
+ dh += 2 * border;
w -= dw;
h -= dh;
void wxWindowGTK::ApplyToolTip( GtkTooltips *tips, const wxChar *tip )
{
- wxString tmp( tip );
- gtk_tooltips_set_tip( tips, GetConnectWidget(), wxGTK_CONV(tmp), (gchar*) NULL );
+ if (tip)
+ {
+ wxString tmp( tip );
+ gtk_tooltips_set_tip( tips, GetConnectWidget(), wxGTK_CONV(tmp), (gchar*) NULL );
+ }
+ else
+ {
+ gtk_tooltips_set_tip( tips, GetConnectWidget(), NULL, NULL);
+ }
}
#endif // wxUSE_TOOLTIPS
gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy );
m_clipPaintRegion = false;
+
+#if wxUSE_CARET
+ bool restoreCaret = (GetCaret() != NULL && GetCaret()->IsVisible());
+ if (restoreCaret)
+ {
+ wxRect caretRect(GetCaret()->GetPosition(), GetCaret()->GetSize());
+ if (dx > 0)
+ caretRect.width += dx;
+ else
+ {
+ caretRect.x += dx; caretRect.width -= dx;
+ }
+ if (dy > 0)
+ caretRect.height += dy;
+ else
+ {
+ caretRect.y += dy; caretRect.height -= dy;
+ }
+
+ RefreshRect(caretRect);
+ }
+#endif
}
void wxWindowGTK::GtkScrolledWindowSetBorder(GtkWidget* w, int wxstyle)