X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aa61d3525370a9b9fa8c797d9b7f89d96994db5f..85e5bb6a953e5dffd5c52d907b4ca0767a544bcc:/src/gtk/listbox.cpp diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index f3c5f07d2e..cc241866a7 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -13,8 +13,11 @@ #if wxUSE_LISTBOX +#ifndef WX_PRECOMP + #include "wx/dynarray.h" +#endif + #include "wx/listbox.h" -#include "wx/dynarray.h" #include "wx/arrstr.h" #include "wx/utils.h" #include "wx/intl.h" @@ -25,7 +28,7 @@ #include "wx/gtk/treeentry_gtk.h" #if wxUSE_TOOLTIPS -#include "wx/tooltip.h" + #include "wx/tooltip.h" #endif #include @@ -467,6 +470,9 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC ); } + + GtkScrolledWindowSetBorder(m_widget, style); + m_treeview = GTK_TREE_VIEW( gtk_tree_view_new( ) ); //wxListBox doesn't have a header :) @@ -997,6 +1003,11 @@ void wxListBox::DoSetFirstItem( int n ) int wxListBox::DoListHitTest(const wxPoint& point) const { + // gtk_tree_view_get_path_at_pos() also gets items that are not visible and + // we only want visible items we need to check for it manually here + if ( !GetClientRect().Inside(point) ) + return wxNOT_FOUND; + // need to translate from master window since it is in client coords gint binx, biny; gdk_window_get_geometry(gtk_tree_view_get_bin_window(m_treeview), @@ -1054,7 +1065,7 @@ void wxListBox::DoApplyWidgetStyle(GtkRcStyle *style) GdkWindow *window = gtk_tree_view_get_bin_window(m_treeview); if (window) { - m_backgroundColour.CalcPixel( gdk_window_get_colormap( window ) ); + m_backgroundColour.CalcPixel( gdk_drawable_get_colormap( window ) ); gdk_window_set_background( window, m_backgroundColour.GetColor() ); gdk_window_clear( window ); }