]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/listbox.h
Applied patch [ 1445031 ] wxString passed as ellipsis argument in richtexthtml.cpp
[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
ff8bfdbb
VZ
21 wxListBox();
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,
26 long style = 0,
27 const wxValidator& validator = wxDefaultValidator,
28 const wxString& name = wxListBoxNameStr )
29 {
88ac883a 30#if wxUSE_CHECKLISTBOX
ff8bfdbb 31 m_hasCheckBoxes = FALSE;
88ac883a 32#endif // wxUSE_CHECKLISTBOX
ff8bfdbb
VZ
33 Create(parent, id, pos, size, n, choices, style, validator, name);
34 }
584ad2a3
MB
35 wxListBox( wxWindow *parent, wxWindowID id,
36 const wxPoint& pos,
37 const wxSize& size,
38 const wxArrayString& choices,
39 long style = 0,
40 const wxValidator& validator = wxDefaultValidator,
41 const wxString& name = wxListBoxNameStr )
42 {
43#if wxUSE_CHECKLISTBOX
44 m_hasCheckBoxes = FALSE;
45#endif // wxUSE_CHECKLISTBOX
46 Create(parent, id, pos, size, choices, style, validator, name);
47 }
ff8bfdbb
VZ
48 virtual ~wxListBox();
49
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,
54 long style = 0,
55 const wxValidator& validator = wxDefaultValidator,
56 const wxString& name = wxListBoxNameStr);
584ad2a3
MB
57 bool Create(wxWindow *parent, wxWindowID id,
58 const wxPoint& pos,
59 const wxSize& size,
60 const wxArrayString& choices,
61 long style = 0,
62 const wxValidator& validator = wxDefaultValidator,
63 const wxString& name = wxListBoxNameStr);
ff8bfdbb 64
2ee3ee1b
VZ
65 // implement base class pure virtuals
66 virtual void Clear();
67 virtual void Delete(int n);
68
69 virtual int GetCount() const;
70 virtual wxString GetString(int n) const;
71 virtual void SetString(int n, const wxString& s);
853dcc57 72 virtual int FindString(const wxString& s, bool bCase = false) const;
2ee3ee1b
VZ
73
74 virtual bool IsSelected(int n) const;
2ee3ee1b
VZ
75 virtual int GetSelection() const;
76 virtual int GetSelections(wxArrayInt& aSelections) const;
77
9d522606
RD
78 static wxVisualAttributes
79 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
853dcc57 80
2ee3ee1b 81 // implementation from now on
c801d85f 82
ff8bfdbb
VZ
83 GtkWidget *GetConnectWidget();
84 bool IsOwnGtkWindow( GdkWindow *window );
5e014a0c 85 void OnInternalIdle();
ff8bfdbb
VZ
86
87#if wxUSE_TOOLTIPS
4de6207a 88 void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
ff8bfdbb
VZ
89#endif // wxUSE_TOOLTIPS
90
4a46cbe8
RR
91 struct _GtkTreeView *m_treeview;
92 struct _GtkListStore *m_liststore;
88ac883a
VZ
93
94#if wxUSE_CHECKLISTBOX
ff8bfdbb 95 bool m_hasCheckBoxes;
88ac883a 96#endif // wxUSE_CHECKLISTBOX
c801d85f 97
bac95742 98 bool m_blockEvent;
4a46cbe8 99 bool m_spacePressed;
8161b5b9 100
4a46cbe8
RR
101 struct _GtkTreeEntry* GtkGetEntry(int pos) const;
102 void GtkInsertItems(const wxArrayString& items,
103 void** clientData, int pos);
104 void GtkSetSelection(int n, const bool select, const bool blockEvent);
3ae4c570 105
f68586e5
VZ
106protected:
107 virtual wxSize DoGetBestSize() const;
6f02a879
VZ
108 virtual void DoSetSelection(int n, bool select);
109 virtual int DoAppend(const wxString& item);
110 virtual void DoInsertItems(const wxArrayString& items, int pos);
111 virtual void DoSetItems(const wxArrayString& items, void **clientData);
112 virtual void DoSetFirstItem(int n);
113 virtual void DoSetItemClientData(int n, void* clientData);
114 virtual void* DoGetItemClientData(int n) const;
115 virtual void DoSetItemClientObject(int n, wxClientData* clientData);
116 virtual wxClientData* DoGetItemClientObject(int n) const;
117 void DoApplyWidgetStyle(GtkRcStyle *style);
f68586e5 118
2ee3ee1b 119private:
2ee3ee1b
VZ
120 DECLARE_DYNAMIC_CLASS(wxListBox)
121};
dcf924a3 122
c801d85f 123#endif // __GTKLISTBOXH__