1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/listbox.h
3 // Purpose: wxListBox class declaration
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef __GTKLISTBOXH__
11 #define __GTKLISTBOXH__
13 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
17 class WXDLLIMPEXP_CORE wxListBox
: public wxListBoxBase
25 wxListBox( wxWindow
*parent
, wxWindowID id
,
26 const wxPoint
& pos
= wxDefaultPosition
,
27 const wxSize
& size
= wxDefaultSize
,
28 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
30 const wxValidator
& validator
= wxDefaultValidator
,
31 const wxString
& name
= wxListBoxNameStr
)
34 Create(parent
, id
, pos
, size
, n
, choices
, style
, validator
, name
);
36 wxListBox( wxWindow
*parent
, wxWindowID id
,
39 const wxArrayString
& choices
,
41 const wxValidator
& validator
= wxDefaultValidator
,
42 const wxString
& name
= wxListBoxNameStr
)
45 Create(parent
, id
, pos
, size
, choices
, style
, validator
, name
);
49 bool Create(wxWindow
*parent
, wxWindowID id
,
50 const wxPoint
& pos
= wxDefaultPosition
,
51 const wxSize
& size
= wxDefaultSize
,
52 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
54 const wxValidator
& validator
= wxDefaultValidator
,
55 const wxString
& name
= wxListBoxNameStr
);
56 bool Create(wxWindow
*parent
, wxWindowID id
,
59 const wxArrayString
& choices
,
61 const wxValidator
& validator
= wxDefaultValidator
,
62 const wxString
& name
= wxListBoxNameStr
);
64 // implement base class pure virtuals
66 virtual void Delete(int n
);
68 virtual size_t GetCount() const;
69 virtual wxString
GetString(int n
) const;
70 virtual void SetString(int n
, const wxString
& s
);
71 virtual int FindString(const wxString
& s
, bool bCase
= false) const;
73 virtual bool IsSelected(int n
) const;
74 virtual int GetSelection() const;
75 virtual int GetSelections(wxArrayInt
& aSelections
) const;
77 static wxVisualAttributes
78 GetClassDefaultAttributes(wxWindowVariant variant
= wxWINDOW_VARIANT_NORMAL
);
80 // implementation from now on
82 GtkWidget
*GetConnectWidget();
83 bool IsOwnGtkWindow( GdkWindow
*window
);
84 void OnInternalIdle();
87 void ApplyToolTip( GtkTooltips
*tips
, const wxChar
*tip
);
88 #endif // wxUSE_TOOLTIPS
90 struct _GtkTreeView
*m_treeview
;
91 struct _GtkListStore
*m_liststore
;
93 #if wxUSE_CHECKLISTBOX
95 #endif // wxUSE_CHECKLISTBOX
100 struct _GtkTreeEntry
* GtkGetEntry(int pos
) const;
101 void GtkInsertItems(const wxArrayString
& items
,
102 void** clientData
, size_t pos
);
103 void GtkSetSelection(int n
, const bool select
, const bool blockEvent
);
106 virtual wxSize
DoGetBestSize() const;
107 virtual void DoSetSelection(int n
, bool select
);
108 virtual int DoAppend(const wxString
& item
);
109 virtual void DoInsertItems(const wxArrayString
& items
, int pos
);
110 virtual void DoSetItems(const wxArrayString
& items
, void **clientData
);
111 virtual void DoSetFirstItem(int n
);
112 virtual void DoSetItemClientData(int n
, void* clientData
);
113 virtual void* DoGetItemClientData(int n
) const;
114 virtual void DoSetItemClientObject(int n
, wxClientData
* clientData
);
115 virtual wxClientData
* DoGetItemClientObject(int n
) const;
116 virtual int DoListHitTest(const wxPoint
& point
) const;
118 void DoApplyWidgetStyle(GtkRcStyle
*style
);
121 void Init(); //common construction
123 DECLARE_DYNAMIC_CLASS(wxListBox
)
126 #endif // __GTKLISTBOXH__