#pragma implementation "listbox.h"
#endif
+#ifdef __VMS
+#define gtk_scrolled_window_add_with_viewport gtk_scrolled_window_add_with_vi
+#define gtk_container_set_focus_vadjustment gtk_container_set_focus_vadjust
+#define gtk_scrolled_window_get_vadjustment gtk_scrolled_window_get_vadjust
+#endif
+
#include "wx/listbox.h"
#if wxUSE_LISTBOX
#include "wx/tooltip.h"
#endif
-#include "gdk/gdk.h"
-#include "gtk/gtk.h"
-#include "gdk/gdkkeysyms.h"
+# include <gdk/gdk.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
//-----------------------------------------------------------------------------
// idle system
}
#if wxUSE_CHECKLISTBOX
- if ((gdk_event->keyval != ' ') && (listbox->m_hasCheckBoxes) && (!ret))
+ if ((gdk_event->keyval == ' ') && (listbox->m_hasCheckBoxes) && (!ret))
{
int sel = listbox->GtkGetIndex( widget );
if (!listbox->m_hasVMT) return;
if (g_blockEventsOnDrag) return;
-
+
wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, listbox->GetId() );
event.SetEventObject( listbox );
PostCreation();
- SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_WINDOW ) );
+ SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_LISTBOX ) );
SetForegroundColour( parent->GetForegroundColour() );
SetFont( parent->GetFont() );
wxCHECK_MSG( m_list != NULL, FALSE, wxT("invalid listbox") );
GList *target = g_list_nth( m_list->children, n );
- if (target)
- {
- GList *child = m_list->selection;
- while (child)
- {
- if (child->data == target->data) return TRUE;
- child = child->next;
- }
- }
-
- wxFAIL_MSG(wxT("wrong listbox index"));
-
- return FALSE;
+
+ wxCHECK_MSG( target, FALSE, wxT("invalid listbox index") );
+
+ return (GTK_WIDGET(target->data)->state == GTK_STATE_SELECTED) ;
}
void wxListBox::SetSelection( int n, bool select )
bool wxListBox::IsOwnGtkWindow( GdkWindow *window )
{
- if (wxWindow::IsOwnGtkWindow( window )) return TRUE;
+ if (GTK_WIDGET(m_list)->window == window) return TRUE;
GList *child = m_list->children;
while (child)