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__
22 #include "wx/object.h"
24 #include "wx/control.h"
26 //-----------------------------------------------------------------------------
28 //-----------------------------------------------------------------------------
33 //-----------------------------------------------------------------------------
35 //-----------------------------------------------------------------------------
37 extern const char *wxListBoxNameStr
;
39 //-----------------------------------------------------------------------------
41 //-----------------------------------------------------------------------------
43 class wxListBox
: public wxControl
45 DECLARE_DYNAMIC_CLASS(wxListBox
)
49 wxListBox( wxWindow
*parent
, wxWindowID id
,
50 const wxPoint
& pos
= wxDefaultPosition
,
51 const wxSize
& size
= wxDefaultSize
,
52 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
54 const wxValidator
& validator
= wxDefaultValidator
,
55 const wxString
& name
= wxListBoxNameStr
)
57 #if wxUSE_CHECKLISTBOX
58 m_hasCheckBoxes
= FALSE
;
59 #endif // wxUSE_CHECKLISTBOX
60 Create(parent
, id
, pos
, size
, n
, choices
, style
, validator
, name
);
64 bool Create(wxWindow
*parent
, wxWindowID id
,
65 const wxPoint
& pos
= wxDefaultPosition
,
66 const wxSize
& size
= wxDefaultSize
,
67 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
69 const wxValidator
& validator
= wxDefaultValidator
,
70 const wxString
& name
= wxListBoxNameStr
);
72 void Append( const wxString
&item
);
73 void Append( const wxString
&item
, void* clientData
);
74 void Append( const wxString
&item
, wxClientData
* clientData
);
76 void InsertItems(int nItems
, const wxString items
[], int pos
);
78 void SetClientData( int n
, void* clientData
);
79 void* GetClientData( int n
);
80 void SetClientObject( int n
, wxClientData
* clientData
);
81 wxClientData
* GetClientObject( int n
);
83 void SetClientObject( wxClientData
*data
) { wxControl::SetClientObject( data
); }
84 wxClientData
*GetClientObject() const { return wxControl::GetClientObject(); }
85 void SetClientData( void *data
) { wxControl::SetClientData( data
); }
86 void *GetClientData() const { return wxControl::GetClientData(); }
91 void Deselect( int n
);
92 int FindString( const wxString
&item
) const;
93 int GetSelection(void) const;
94 int GetSelections( class wxArrayInt
&) const;
95 wxString
GetString( int n
) const;
96 wxString
GetStringSelection(void) const;
98 bool Selected( int n
);
99 void Set( int n
, const wxString
*choices
);
100 void SetFirstItem( int n
);
101 void SetFirstItem( const wxString
&item
);
102 void SetSelection( int n
, bool select
= TRUE
);
103 void SetString( int n
, const wxString
&string
);
104 void SetStringSelection( const wxString
&string
, bool select
= TRUE
);
106 #if wxUSE_DRAG_AND_DROP
107 void SetDropTarget( wxDropTarget
*dropTarget
);
112 void DisableEvents();
114 void AppendCommon( const wxString
&item
);
115 int GetIndex( GtkWidget
*item
) const;
116 GtkWidget
*GetConnectWidget();
117 bool IsOwnGtkWindow( GdkWindow
*window
);
118 void ApplyWidgetStyle();
121 void ApplyToolTip( GtkTooltips
*tips
, const wxChar
*tip
);
122 #endif // wxUSE_TOOLTIPS
125 wxList m_clientDataList
;
126 wxList m_clientObjectList
;
128 #if wxUSE_CHECKLISTBOX
129 bool m_hasCheckBoxes
;
130 #endif // wxUSE_CHECKLISTBOX
135 #endif // __GTKLISTBOXH__