]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/os2/listbox.h
pressing PageDown and then PageUp should return to the same item
[wxWidgets.git] / include / wx / os2 / listbox.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: listbox.h
3// Purpose: wxListBox class
4// Author: David Webster
5// Modified by:
6// Created: 10/09/99
7// RCS-ID: $Id$
8// Copyright: (c) David Webster
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_LISTBOX_H_
13#define _WX_LISTBOX_H_
14
15// ----------------------------------------------------------------------------
16// simple types
17// ----------------------------------------------------------------------------
18
19#if wxUSE_OWNER_DRAWN
20 class WXDLLEXPORT wxOwnerDrawn;
21
22 // define the array of list box items
23 #include <wx/dynarray.h>
24
25 WX_DEFINE_EXPORTED_ARRAY(wxOwnerDrawn *, wxListBoxItemsArray);
26#endif // wxUSE_OWNER_DRAWN
27
28// forward decl for GetSelections()
29class wxArrayInt;
30
31// ----------------------------------------------------------------------------
32// List box control
33// ----------------------------------------------------------------------------
34
35class WXDLLEXPORT wxListBox : public wxListBoxBase
36{
37public:
38 // ctors and such
39 wxListBox();
40 wxListBox( wxWindow* pParent
41 ,wxWindowID vId
42 ,const wxPoint& rPos = wxDefaultPosition
43 ,const wxSize& rSize = wxDefaultSize
44 ,int n = 0
45 ,const wxString asChoices[] = NULL
46 ,long lStyle = 0
47 ,const wxValidator& rValidator = wxDefaultValidator
48 ,const wxString& rsName = wxListBoxNameStr)
49 {
50 Create( pParent
51 ,vId
52 ,rPos
53 ,rSize
54 ,n
55 ,asChoices
56 ,lStyle
57 ,rValidator
58 ,rsName
59 );
60 }
61
62 bool Create( wxWindow* pParent
63 ,wxWindowID vId
64 ,const wxPoint& rPos = wxDefaultPosition
65 ,const wxSize& rSize = wxDefaultSize
66 ,int n = 0
67 ,const wxString asChoices[] = NULL
68 ,long lStyle = 0
69 ,const wxValidator& rValidator = wxDefaultValidator
70 ,const wxString& rsName = wxListBoxNameStr
71 );
72
73 virtual ~wxListBox();
74
75 //
76 // Implement base class pure virtuals
77 //
78 virtual void Clear(void);
79 virtual void Delete(int n);
80
81 virtual int GetCount(void) const;
82 virtual wxString GetString(int n) const;
83 virtual void SetString( int n
84 ,const wxString& rsString
85 );
86 virtual int FindString(const wxString& rsString) const;
87
88 virtual bool IsSelected(int n) const;
89 virtual void SetSelection( int n
90 ,bool bSelect = TRUE
91 );
92 virtual int GetSelection(void) const;
93 virtual int GetSelections(wxArrayInt& raSelections) const;
94
95 virtual int DoAppend(const wxString& rsItem);
96 virtual void DoInsertItems( const wxArrayString& raItems
97 ,int rPos
98 );
99 virtual void DoSetItems( const wxArrayString& raItems
100 ,void ** ppClientData
101 );
102
103 virtual void DoSetFirstItem(int n);
104
105 virtual void DoSetItemClientData( int n
106 ,void* pClientData
107 );
108 virtual void* DoGetItemClientData(int n) const;
109 virtual void DoSetItemClientObject( int n
110 ,wxClientData* pClientData
111 );
112 virtual wxClientData* DoGetItemClientObject(int n) const;
113
114 //
115 // wxCheckListBox support
116 //
117#if wxUSE_OWNER_DRAWN
118 long OS2OnMeasure(WXMEASUREITEMSTRUCT *item);
119 bool OS2OnDraw(WXDRAWITEMSTRUCT *item);
120
121 virtual wxOwnerDrawn* CreateItem(size_t n);
122 wxOwnerDrawn* GetItem(size_t n) const { return m_aItems[n]; }
123 int GetItemIndex(wxOwnerDrawn *item) const { return m_aItems.Index(item); }
124#endif // wxUSE_OWNER_DRAWN
125
126 bool OS2Command( WXUINT uParam
127 ,WXWORD wId
128 );
129 virtual void SetupColours(void);
130
131protected:
132
133 bool HasMultipleSelection(void) const;
134 virtual wxSize DoGetBestSize(void) const;
135
136 int m_nNumItems;
137 int m_nSelected;
138
139
140#if wxUSE_OWNER_DRAWN
141 //
142 // Control items
143 //
144 wxListBoxItemsArray m_aItems;
145#endif
146
147private:
148 DECLARE_DYNAMIC_CLASS(wxListBox)
149}; // end of wxListBox
150
151#endif
152 // _WX_LISTBOX_H_