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
22 wxListBox( wxWindow
*parent
, wxWindowID id
,
23 const wxPoint
& pos
= wxDefaultPosition
,
24 const wxSize
& size
= wxDefaultSize
,
25 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
27 const wxValidator
& validator
= wxDefaultValidator
,
28 const wxString
& name
= wxListBoxNameStr
)
30 #if wxUSE_CHECKLISTBOX
31 m_hasCheckBoxes
= FALSE
;
32 #endif // wxUSE_CHECKLISTBOX
33 Create(parent
, id
, pos
, size
, n
, choices
, style
, validator
, name
);
35 wxListBox( wxWindow
*parent
, wxWindowID id
,
38 const wxArrayString
& choices
,
40 const wxValidator
& validator
= wxDefaultValidator
,
41 const wxString
& name
= wxListBoxNameStr
)
43 #if wxUSE_CHECKLISTBOX
44 m_hasCheckBoxes
= FALSE
;
45 #endif // wxUSE_CHECKLISTBOX
46 Create(parent
, id
, pos
, size
, choices
, style
, validator
, name
);
50 bool Create(wxWindow
*parent
, wxWindowID id
,
51 const wxPoint
& pos
= wxDefaultPosition
,
52 const wxSize
& size
= wxDefaultSize
,
53 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
55 const wxValidator
& validator
= wxDefaultValidator
,
56 const wxString
& name
= wxListBoxNameStr
);
57 bool Create(wxWindow
*parent
, wxWindowID id
,
60 const wxArrayString
& choices
,
62 const wxValidator
& validator
= wxDefaultValidator
,
63 const wxString
& name
= wxListBoxNameStr
);
65 // implement base class pure virtuals
67 virtual void Delete(int n
);
69 virtual int GetCount() const;
70 virtual wxString
GetString(int n
) const;
71 virtual void SetString(int n
, const wxString
& s
);
72 virtual int FindString(const wxString
& s
, bool bCase
= false) const;
74 virtual bool IsSelected(int n
) const;
75 virtual int GetSelection() const;
76 virtual int GetSelections(wxArrayInt
& aSelections
) const;
78 static wxVisualAttributes
79 GetClassDefaultAttributes(wxWindowVariant variant
= wxWINDOW_VARIANT_NORMAL
);
81 // implementation from now on
83 GtkWidget
*GetConnectWidget();
84 bool IsOwnGtkWindow( GdkWindow
*window
);
85 GdkWindow
* GetGtkBinWindow();
86 void OnInternalIdle();
89 void ApplyToolTip( GtkTooltips
*tips
, const wxChar
*tip
);
90 #endif // wxUSE_TOOLTIPS
92 struct _GtkTreeView
*m_treeview
;
93 struct _GtkListStore
*m_liststore
;
95 #if wxUSE_CHECKLISTBOX
97 #endif // wxUSE_CHECKLISTBOX
102 struct _GtkTreeEntry
* GtkGetEntry(int pos
) const;
103 void GtkInsertItems(const wxArrayString
& items
,
104 void** clientData
, int pos
);
105 void GtkSetSelection(int n
, const bool select
, const bool blockEvent
);
108 virtual wxSize
DoGetBestSize() const;
109 virtual void DoSetSelection(int n
, bool select
);
110 virtual int DoAppend(const wxString
& item
);
111 virtual void DoInsertItems(const wxArrayString
& items
, int pos
);
112 virtual void DoSetItems(const wxArrayString
& items
, void **clientData
);
113 virtual void DoSetFirstItem(int n
);
114 virtual void DoSetItemClientData(int n
, void* clientData
);
115 virtual void* DoGetItemClientData(int n
) const;
116 virtual void DoSetItemClientObject(int n
, wxClientData
* clientData
);
117 virtual wxClientData
* DoGetItemClientObject(int n
) const;
118 void DoApplyWidgetStyle(GtkRcStyle
*style
);
121 DECLARE_DYNAMIC_CLASS(wxListBox
)
124 #endif // __GTKLISTBOXH__