]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/choice.h
Applied patch [ 837515 ] wxIPaddress + docs patch
[wxWidgets.git] / include / wx / msw / choice.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: choice.h
3 // Purpose: wxChoice class
4 // Author: Julian Smart
5 // Modified by: Vadim Zeitlin to derive from wxChoiceBase
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_CHOICE_H_
13 #define _WX_CHOICE_H_
14
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "choice.h"
17 #endif
18
19 // ----------------------------------------------------------------------------
20 // Choice item
21 // ----------------------------------------------------------------------------
22
23 class WXDLLEXPORT wxChoice : public wxChoiceBase
24 {
25 public:
26 // ctors
27 wxChoice();
28 virtual ~wxChoice();
29
30 wxChoice(wxWindow *parent,
31 wxWindowID id,
32 const wxPoint& pos = wxDefaultPosition,
33 const wxSize& size = wxDefaultSize,
34 int n = 0, const wxString choices[] = NULL,
35 long style = 0,
36 const wxValidator& validator = wxDefaultValidator,
37 const wxString& name = wxChoiceNameStr);
38
39 bool Create(wxWindow *parent,
40 wxWindowID id,
41 const wxPoint& pos = wxDefaultPosition,
42 const wxSize& size = wxDefaultSize,
43 int n = 0, const wxString choices[] = NULL,
44 long style = 0,
45 const wxValidator& validator = wxDefaultValidator,
46 const wxString& name = wxChoiceNameStr);
47
48 // implement base class pure virtuals
49 virtual int DoAppend(const wxString& item);
50 virtual int DoInsert(const wxString& item, int pos);
51 virtual void Delete(int n);
52 virtual void Clear();
53
54 virtual int GetCount() const;
55 virtual int GetSelection() const;
56 virtual void SetSelection(int n);
57
58 virtual int FindString(const wxString& s) const;
59 virtual wxString GetString(int n) const;
60 virtual void SetString(int n, const wxString& s);
61
62 // MSW only
63 virtual bool MSWCommand(WXUINT param, WXWORD id);
64 long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
65 virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
66 WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
67
68 protected:
69 virtual void DoMoveWindow(int x, int y, int width, int height);
70 virtual void DoSetItemClientData( int n, void* clientData );
71 virtual void* DoGetItemClientData( int n ) const;
72 virtual void DoSetItemClientObject( int n, wxClientData* clientData );
73 virtual wxClientData* DoGetItemClientObject( int n ) const;
74
75 // MSW implementation
76 virtual wxSize DoGetBestSize() const;
77 virtual void DoSetSize(int x, int y,
78 int width, int height,
79 int sizeFlags = wxSIZE_AUTO);
80
81 // free all memory we have (used by Clear() and dtor)
82 void Free();
83
84 DECLARE_DYNAMIC_CLASS_NO_COPY(wxChoice)
85 };
86
87 #endif // _WX_CHOICE_H_