]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/listbox.h
Warning fixes.
[wxWidgets.git] / include / wx / gtk / listbox.h
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
853dcc57 2// Name: wx/gtk/listbox.h
ff8bfdbb 3// Purpose: wxListBox class declaration
c801d85f 4// Author: Robert Roebling
58614078
RR
5// Id: $Id$
6// Copyright: (c) 1998 Robert Roebling
65571936 7// Licence: wxWindows licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
c801d85f
KB
10#ifndef __GTKLISTBOXH__
11#define __GTKLISTBOXH__
12
c801d85f
KB
13//-----------------------------------------------------------------------------
14// wxListBox
15//-----------------------------------------------------------------------------
16
20123d49 17class WXDLLIMPEXP_CORE wxListBox : public wxListBoxBase
c801d85f 18{
fd0eed64 19public:
2ee3ee1b 20 // ctors and such
b6e5dfef
JS
21 wxListBox()
22 {
23 Init();
24 }
ff8bfdbb
VZ
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,
29 long style = 0,
30 const wxValidator& validator = wxDefaultValidator,
31 const wxString& name = wxListBoxNameStr )
32 {
b6e5dfef 33 Init();
ff8bfdbb
VZ
34 Create(parent, id, pos, size, n, choices, style, validator, name);
35 }
584ad2a3
MB
36 wxListBox( wxWindow *parent, wxWindowID id,
37 const wxPoint& pos,
38 const wxSize& size,
39 const wxArrayString& choices,
40 long style = 0,
41 const wxValidator& validator = wxDefaultValidator,
42 const wxString& name = wxListBoxNameStr )
43 {
b6e5dfef 44 Init();
584ad2a3
MB
45 Create(parent, id, pos, size, choices, style, validator, name);
46 }
ff8bfdbb
VZ
47 virtual ~wxListBox();
48
b6e5dfef
JS
49 void Init(); //common construction
50
ff8bfdbb
VZ
51 bool Create(wxWindow *parent, wxWindowID id,
52 const wxPoint& pos = wxDefaultPosition,
53 const wxSize& size = wxDefaultSize,
54 int n = 0, const wxString choices[] = (const wxString *) NULL,
55 long style = 0,
56 const wxValidator& validator = wxDefaultValidator,
57 const wxString& name = wxListBoxNameStr);
584ad2a3
MB
58 bool Create(wxWindow *parent, wxWindowID id,
59 const wxPoint& pos,
60 const wxSize& size,
61 const wxArrayString& choices,
62 long style = 0,
63 const wxValidator& validator = wxDefaultValidator,
64 const wxString& name = wxListBoxNameStr);
ff8bfdbb 65
2ee3ee1b
VZ
66 // implement base class pure virtuals
67 virtual void Clear();
68 virtual void Delete(int n);
69
70 virtual int GetCount() const;
71 virtual wxString GetString(int n) const;
72 virtual void SetString(int n, const wxString& s);
853dcc57 73 virtual int FindString(const wxString& s, bool bCase = false) const;
2ee3ee1b
VZ
74
75 virtual bool IsSelected(int n) const;
2ee3ee1b
VZ
76 virtual int GetSelection() const;
77 virtual int GetSelections(wxArrayInt& aSelections) const;
78
9d522606
RD
79 static wxVisualAttributes
80 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
853dcc57 81
2ee3ee1b 82 // implementation from now on
c801d85f 83
ff8bfdbb
VZ
84 GtkWidget *GetConnectWidget();
85 bool IsOwnGtkWindow( GdkWindow *window );
5e014a0c 86 void OnInternalIdle();
ff8bfdbb
VZ
87
88#if wxUSE_TOOLTIPS
4de6207a 89 void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
ff8bfdbb
VZ
90#endif // wxUSE_TOOLTIPS
91
4a46cbe8
RR
92 struct _GtkTreeView *m_treeview;
93 struct _GtkListStore *m_liststore;
88ac883a
VZ
94
95#if wxUSE_CHECKLISTBOX
ff8bfdbb 96 bool m_hasCheckBoxes;
88ac883a 97#endif // wxUSE_CHECKLISTBOX
c801d85f 98
bac95742 99 bool m_blockEvent;
4a46cbe8 100 bool m_spacePressed;
8161b5b9 101
4a46cbe8
RR
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);
3ae4c570 106
f68586e5
VZ
107protected:
108 virtual wxSize DoGetBestSize() const;
6f02a879
VZ
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;
c00fed0e
VZ
118 virtual int DoListHitTest(const wxPoint& point) const;
119
6f02a879 120 void DoApplyWidgetStyle(GtkRcStyle *style);
f68586e5 121
2ee3ee1b 122private:
2ee3ee1b
VZ
123 DECLARE_DYNAMIC_CLASS(wxListBox)
124};
dcf924a3 125
c801d85f 126#endif // __GTKLISTBOXH__