Applied Ryan's native wxListBox and wxCheckListBox patch

in slightly modified form..


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37769 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2006-03-01 21:51:42 +00:00
parent 4eccd3a10f
commit 4a46cbe8c6
8 changed files with 1167 additions and 796 deletions

View File

@@ -10,10 +10,6 @@
#ifndef __GTKLISTBOXH__
#define __GTKLISTBOXH__
#include "wx/list.h"
class WXDLLIMPEXP_BASE wxSortedArrayString;
//-----------------------------------------------------------------------------
// wxListBox
//-----------------------------------------------------------------------------
@@ -84,27 +80,29 @@ public:
// implementation from now on
void GtkAddItem( const wxString &item, int pos=-1 );
int GtkGetIndex( GtkWidget *item ) const;
GtkWidget *GetConnectWidget();
bool IsOwnGtkWindow( GdkWindow *window );
GdkWindow* GetGtkBinWindow();
void OnInternalIdle();
#if wxUSE_TOOLTIPS
void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
#endif // wxUSE_TOOLTIPS
GtkList *m_list;
wxList m_clientList;
struct _GtkTreeView *m_treeview;
struct _GtkListStore *m_liststore;
#if wxUSE_CHECKLISTBOX
bool m_hasCheckBoxes;
#endif // wxUSE_CHECKLISTBOX
int m_prevSelection;
bool m_blockEvent;
bool m_spacePressed;
virtual void FixUpMouseEvent(GtkWidget *widget, wxCoord& x, wxCoord& y);
struct _GtkTreeEntry* GtkGetEntry(int pos) const;
void GtkInsertItems(const wxArrayString& items,
void** clientData, int pos);
void GtkSetSelection(int n, const bool select, const bool blockEvent);
protected:
virtual wxSize DoGetBestSize() const;
@@ -119,18 +117,7 @@ protected:
virtual wxClientData* DoGetItemClientObject(int n) const;
void DoApplyWidgetStyle(GtkRcStyle *style);
// return the string label for the given item
wxString GetRealLabel(struct _GList *item) const;
// Widgets that use the style->base colour for the BG colour should
// override this and return true.
virtual bool UseGTKStyleBase() const { return true; }
private:
// this array is only used for controls with wxCB_SORT style, so only
// allocate it if it's needed (hence using pointer)
wxSortedArrayString *m_strings;
DECLARE_DYNAMIC_CLASS(wxListBox)
};