X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e47c778924ef4f0456edd5912cf7a2131ecb634f..b6349b169bd17e208da0f7c447bea94cb08eefd1:/src/gtk/window.cpp diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index f2022e177e..c631f3b014 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -438,10 +438,16 @@ void wxgtk_combo_size_request_callback(GtkWidget *widget, 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; } } @@ -2313,7 +2319,17 @@ bool wxWindowGTK::Create( wxWindow *parent, 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); @@ -3757,8 +3773,15 @@ void wxWindowGTK::DoSetToolTip( wxToolTip *tip ) 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 @@ -4212,6 +4235,26 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) ) gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy ); m_clipPaintRegion = false; + + 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); + } } void wxWindowGTK::GtkScrolledWindowSetBorder(GtkWidget* w, int wxstyle)