]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/listbox.cpp
Compile fix for VC
[wxWidgets.git] / src / gtk / listbox.cpp
index f3c5f07d2e3ae7ec97fdd55731db855dcc5b3117..cc241866a7df76d25770104ee3b5f4b40fd3ede2 100644 (file)
 
 #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 <gdk/gdk.h>
@@ -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 );
         }