]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/listbox.h
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__
15 #pragma interface "listbox.h"
20 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
24 class wxListBox
: public wxListBoxBase
29 wxListBox( wxWindow
*parent
, wxWindowID id
,
30 const wxPoint
& pos
= wxDefaultPosition
,
31 const wxSize
& size
= wxDefaultSize
,
32 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
34 const wxValidator
& validator
= wxDefaultValidator
,
35 const wxString
& name
= wxListBoxNameStr
)
37 #if wxUSE_CHECKLISTBOX
38 m_hasCheckBoxes
= FALSE
;
39 #endif // wxUSE_CHECKLISTBOX
40 Create(parent
, id
, pos
, size
, n
, choices
, style
, validator
, name
);
44 bool Create(wxWindow
*parent
, wxWindowID id
,
45 const wxPoint
& pos
= wxDefaultPosition
,
46 const wxSize
& size
= wxDefaultSize
,
47 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
49 const wxValidator
& validator
= wxDefaultValidator
,
50 const wxString
& name
= wxListBoxNameStr
);
52 // implement base class pure virtuals
54 virtual void Delete(int n
);
56 virtual int GetCount() const;
57 virtual wxString
GetString(int n
) const;
58 virtual void SetString(int n
, const wxString
& s
);
59 virtual int FindString(const wxString
& s
) const;
61 virtual bool IsSelected(int n
) const;
62 virtual void SetSelection(int n
, bool select
= TRUE
);
63 virtual int GetSelection() const;
64 virtual int GetSelections(wxArrayInt
& aSelections
) const;
66 virtual int DoAppend(const wxString
& item
);
67 virtual void DoInsertItems(const wxArrayString
& items
, int pos
);
68 virtual void DoSetItems(const wxArrayString
& items
, void **clientData
);
70 virtual void DoSetFirstItem(int n
);
72 virtual void DoSetItemClientData(int n
, void* clientData
);
73 virtual void* DoGetItemClientData(int n
) const;
74 virtual void DoSetItemClientObject(int n
, wxClientData
* clientData
);
75 virtual wxClientData
* DoGetItemClientObject(int n
) const;
77 // implementation from now on
79 void GtkAddItem( const wxString
&item
, int pos
=-1 );
80 int GtkGetIndex( GtkWidget
*item
) const;
81 GtkWidget
*GetConnectWidget();
82 bool IsOwnGtkWindow( GdkWindow
*window
);
83 void ApplyWidgetStyle();
84 void OnInternalIdle();
87 void ApplyToolTip( GtkTooltips
*tips
, const wxChar
*tip
);
88 #endif // wxUSE_TOOLTIPS
93 #if wxUSE_CHECKLISTBOX
95 #endif // wxUSE_CHECKLISTBOX
100 virtual void FixUpMouseEvent(GtkWidget
*widget
, wxCoord
& x
, wxCoord
& y
);
103 virtual wxSize
DoGetBestSize() const;
105 // return the string label for the given item
106 wxString
GetRealLabel(struct _GList
*item
) const;
109 // this array is only used for controls with wxCB_SORT style, so only
110 // allocate it if it's needed (hence using pointer)
111 wxSortedArrayString
*m_strings
;
113 DECLARE_DYNAMIC_CLASS(wxListBox
)
116 #endif // __GTKLISTBOXH__