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__
14 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
15 #pragma interface "listbox.h"
20 class WXDLLIMPEXP_BASE wxSortedArrayString
;
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
26 class wxListBox
: public wxListBoxBase
31 wxListBox( wxWindow
*parent
, wxWindowID id
,
32 const wxPoint
& pos
= wxDefaultPosition
,
33 const wxSize
& size
= wxDefaultSize
,
34 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
36 const wxValidator
& validator
= wxDefaultValidator
,
37 const wxString
& name
= wxListBoxNameStr
)
39 #if wxUSE_CHECKLISTBOX
40 m_hasCheckBoxes
= FALSE
;
41 #endif // wxUSE_CHECKLISTBOX
42 Create(parent
, id
, pos
, size
, n
, choices
, style
, validator
, name
);
46 bool Create(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 // implement base class pure virtuals
56 virtual void Delete(int n
);
58 virtual int GetCount() const;
59 virtual wxString
GetString(int n
) const;
60 virtual void SetString(int n
, const wxString
& s
);
61 virtual int FindString(const wxString
& s
) const;
63 virtual bool IsSelected(int n
) const;
64 virtual void SetSelection(int n
, bool select
= TRUE
);
65 virtual int GetSelection() const;
66 virtual int GetSelections(wxArrayInt
& aSelections
) const;
68 virtual int DoAppend(const wxString
& item
);
69 virtual void DoInsertItems(const wxArrayString
& items
, int pos
);
70 virtual void DoSetItems(const wxArrayString
& items
, void **clientData
);
72 virtual void DoSetFirstItem(int n
);
74 virtual void DoSetItemClientData(int n
, void* clientData
);
75 virtual void* DoGetItemClientData(int n
) const;
76 virtual void DoSetItemClientObject(int n
, wxClientData
* clientData
);
77 virtual wxClientData
* DoGetItemClientObject(int n
) const;
79 // implementation from now on
81 void GtkAddItem( const wxString
&item
, int pos
=-1 );
82 int GtkGetIndex( GtkWidget
*item
) const;
83 GtkWidget
*GetConnectWidget();
84 bool IsOwnGtkWindow( GdkWindow
*window
);
85 void ApplyWidgetStyle();
86 void OnInternalIdle();
89 void ApplyToolTip( GtkTooltips
*tips
, const wxChar
*tip
);
90 #endif // wxUSE_TOOLTIPS
95 #if wxUSE_CHECKLISTBOX
97 #endif // wxUSE_CHECKLISTBOX
102 virtual void FixUpMouseEvent(GtkWidget
*widget
, wxCoord
& x
, wxCoord
& y
);
105 virtual wxSize
DoGetBestSize() const;
107 // return the string label for the given item
108 wxString
GetRealLabel(struct _GList
*item
) const;
111 // this array is only used for controls with wxCB_SORT style, so only
112 // allocate it if it's needed (hence using pointer)
113 wxSortedArrayString
*m_strings
;
115 DECLARE_DYNAMIC_CLASS(wxListBox
)
118 #endif // __GTKLISTBOXH__