1 /////////////////////////////////////////////////////////////////////////////
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
)
47 inline wxListBox( wxWindow
*parent
, wxWindowID id
,
48 const wxPoint
& pos
= wxDefaultPosition
,
49 const wxSize
& size
= wxDefaultSize
,
50 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
52 const wxValidator
& validator
= wxDefaultValidator
,
53 const wxString
& name
= wxListBoxNameStr
)
55 m_hasCheckBoxes
= FALSE
;
56 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 SetClientData( int n
, void* clientData
);
72 void* GetClientData( int n
);
73 void SetClientObject( int n
, wxClientData
* clientData
);
74 wxClientData
* GetClientObject( int n
);
79 void Deselect( int n
);
80 int FindString( const wxString
&item
) const;
81 int GetSelection(void) const;
82 int GetSelections( class wxArrayInt
&) const;
83 wxString
GetString( int n
) const;
84 wxString
GetStringSelection(void) const;
86 bool Selected( int n
);
87 void Set( int n
, const wxString
*choices
);
88 void SetFirstItem( int n
);
89 void SetFirstItem( const wxString
&item
);
90 void SetSelection( int n
, bool select
= TRUE
);
91 void SetString( int n
, const wxString
&string
);
92 void SetStringSelection( const wxString
&string
, bool select
= TRUE
);
94 #if wxUSE_DRAG_AND_DROP
95 void SetDropTarget( wxDropTarget
*dropTarget
);
97 void SetToolTip( wxToolTip
*tip
);
98 void SetToolTip( const wxString
&tip
);
103 void AppendCommon( const wxString
&item
);
104 int GetIndex( GtkWidget
*item
) const;
105 GtkWidget
*GetConnectWidget();
106 bool IsOwnGtkWindow( GdkWindow
*window
);
107 void ApplyWidgetStyle();
110 wxList m_clientDataList
;
111 wxList m_clientObjectList
;
112 bool m_hasCheckBoxes
;
115 #endif // __GTKLISTBOXH__