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 m_hasCheckBoxes
= FALSE
;
55 Create(parent
, id
, pos
, size
, n
, choices
, style
, validator
, name
);
59 bool Create(wxWindow
*parent
, wxWindowID id
,
60 const wxPoint
& pos
= wxDefaultPosition
,
61 const wxSize
& size
= wxDefaultSize
,
62 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
64 const wxValidator
& validator
= wxDefaultValidator
,
65 const wxString
& name
= wxListBoxNameStr
);
67 void Append( const wxString
&item
);
68 void Append( const wxString
&item
, void* clientData
);
69 void Append( const wxString
&item
, wxClientData
* clientData
);
71 void InsertItems(int nItems
, const wxString items
[], int pos
);
73 void SetClientData( int n
, void* clientData
);
74 void* GetClientData( int n
);
75 void SetClientObject( int n
, wxClientData
* clientData
);
76 wxClientData
* GetClientObject( int n
);
78 void SetClientObject( wxClientData
*data
) { wxControl::SetClientObject( data
); }
79 wxClientData
*GetClientObject() const { return wxControl::GetClientObject(); }
80 void SetClientData( void *data
) { wxControl::SetClientData( data
); }
81 void *GetClientData() const { return wxControl::GetClientData(); }
86 void Deselect( int n
);
87 int FindString( const wxString
&item
) const;
88 int GetSelection(void) const;
89 int GetSelections( class wxArrayInt
&) const;
90 wxString
GetString( int n
) const;
91 wxString
GetStringSelection(void) const;
93 bool Selected( int n
);
94 void Set( int n
, const wxString
*choices
);
95 void SetFirstItem( int n
);
96 void SetFirstItem( const wxString
&item
);
97 void SetSelection( int n
, bool select
= TRUE
);
98 void SetString( int n
, const wxString
&string
);
99 void SetStringSelection( const wxString
&string
, bool select
= TRUE
);
101 #if wxUSE_DRAG_AND_DROP
102 void SetDropTarget( wxDropTarget
*dropTarget
);
107 void AppendCommon( const wxString
&item
);
108 int GetIndex( GtkWidget
*item
) const;
109 GtkWidget
*GetConnectWidget();
110 bool IsOwnGtkWindow( GdkWindow
*window
);
111 void ApplyWidgetStyle();
114 void ApplyToolTip( GtkTooltips
*tips
, const wxChar
*tip
);
115 #endif // wxUSE_TOOLTIPS
118 wxList m_clientDataList
;
119 wxList m_clientObjectList
;
120 bool m_hasCheckBoxes
;
123 #endif // __GTKLISTBOXH__