1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxListBox class declaration
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 #ifndef __GTKLISTBOXH__
12 #define __GTKLISTBOXH__
19 #include "wx/object.h"
21 #include "wx/control.h"
23 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
30 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
34 extern const char *wxListBoxNameStr
;
36 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
40 class wxListBox
: public wxControl
42 DECLARE_DYNAMIC_CLASS(wxListBox
)
46 wxListBox( wxWindow
*parent
, wxWindowID id
,
47 const wxPoint
& pos
= wxDefaultPosition
,
48 const wxSize
& size
= wxDefaultSize
,
49 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
51 const wxValidator
& validator
= wxDefaultValidator
,
52 const wxString
& name
= wxListBoxNameStr
)
54 #if wxUSE_CHECKLISTBOX
55 m_hasCheckBoxes
= FALSE
;
56 #endif // wxUSE_CHECKLISTBOX
57 Create(parent
, id
, pos
, size
, n
, choices
, style
, validator
, name
);
61 bool Create(wxWindow
*parent
, wxWindowID id
,
62 const wxPoint
& pos
= wxDefaultPosition
,
63 const wxSize
& size
= wxDefaultSize
,
64 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
66 const wxValidator
& validator
= wxDefaultValidator
,
67 const wxString
& name
= wxListBoxNameStr
);
69 void Append( const wxString
&item
);
70 void Append( const wxString
&item
, void* clientData
);
71 void Append( const wxString
&item
, wxClientData
* clientData
);
73 void InsertItems(int nItems
, const wxString items
[], int pos
);
75 void SetClientData( int n
, void* clientData
);
76 void* GetClientData( int n
);
77 void SetClientObject( int n
, wxClientData
* clientData
);
78 wxClientData
* GetClientObject( int n
);
80 void SetClientObject( wxClientData
*data
) { wxControl::SetClientObject( data
); }
81 wxClientData
*GetClientObject() const { return wxControl::GetClientObject(); }
82 void SetClientData( void *data
) { wxControl::SetClientData( data
); }
83 void *GetClientData() const { return wxControl::GetClientData(); }
88 void Deselect( int n
);
89 int FindString( const wxString
&item
) const;
90 int GetSelection(void) const;
91 int GetSelections( class wxArrayInt
&) const;
92 wxString
GetString( int n
) const;
93 wxString
GetStringSelection(void) const;
95 bool Selected( int n
);
96 void Set( int n
, const wxString
*choices
);
97 void SetFirstItem( int n
);
98 void SetFirstItem( const wxString
&item
);
99 void SetSelection( int n
, bool select
= TRUE
);
100 void SetString( int n
, const wxString
&string
);
101 void SetStringSelection( const wxString
&string
, bool select
= TRUE
);
103 #if wxUSE_DRAG_AND_DROP
104 void SetDropTarget( wxDropTarget
*dropTarget
);
109 void AppendCommon( const wxString
&item
);
110 int GetIndex( GtkWidget
*item
) const;
111 GtkWidget
*GetConnectWidget();
112 bool IsOwnGtkWindow( GdkWindow
*window
);
113 void ApplyWidgetStyle();
116 void ApplyToolTip( GtkTooltips
*tips
, const wxChar
*tip
);
117 #endif // wxUSE_TOOLTIPS
120 wxList m_clientDataList
;
121 wxList m_clientObjectList
;
123 #if wxUSE_CHECKLISTBOX
124 bool m_hasCheckBoxes
;
125 #endif // wxUSE_CHECKLISTBOX
128 #endif // __GTKLISTBOXH__