]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/msw/choice.h
Modified generic wxTreeCtrl to work under non-Unix platforms simultaneously
[wxWidgets.git] / include / wx / msw / choice.h
... / ...
CommitLineData
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#ifdef __GNUG__
16 #pragma interface "choice.h"
17#endif
18
19// ----------------------------------------------------------------------------
20// Choice item
21// ----------------------------------------------------------------------------
22
23class WXDLLEXPORT wxChoice : public wxChoiceBase
24{
25 DECLARE_DYNAMIC_CLASS(wxChoice)
26
27public:
28 // ctors
29 wxChoice() { }
30 virtual ~wxChoice();
31
32 wxChoice(wxWindow *parent,
33 wxWindowID id,
34 const wxPoint& pos = wxDefaultPosition,
35 const wxSize& size = wxDefaultSize,
36 int n = 0, const wxString choices[] = NULL,
37 long style = 0,
38 const wxValidator& validator = wxDefaultValidator,
39 const wxString& name = wxChoiceNameStr)
40 {
41 Create(parent, id, pos, size, n, choices, style, validator, name);
42 }
43
44 bool Create(wxWindow *parent,
45 wxWindowID id,
46 const wxPoint& pos = wxDefaultPosition,
47 const wxSize& size = wxDefaultSize,
48 int n = 0, const wxString choices[] = NULL,
49 long style = 0,
50 const wxValidator& validator = wxDefaultValidator,
51 const wxString& name = wxChoiceNameStr);
52
53 // implement base class pure virtuals
54 virtual int DoAppend(const wxString& item);
55 virtual void Delete(int n);
56 virtual void Clear();
57
58 virtual int GetCount() const;
59 virtual int GetSelection() const;
60 virtual void SetSelection(int n);
61
62 virtual int FindString(const wxString& s) const;
63 virtual wxString GetString(int n) const;
64 virtual void SetString(int n, const wxString& s);
65
66 // MSW only
67 virtual bool MSWCommand(WXUINT param, WXWORD id);
68 long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
69 virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
70 WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
71
72protected:
73 virtual void DoSetItemClientData( int n, void* clientData );
74 virtual void* DoGetItemClientData( int n ) const;
75 virtual void DoSetItemClientObject( int n, wxClientData* clientData );
76 virtual wxClientData* DoGetItemClientObject( int n ) const;
77
78 // MSW implementation
79 virtual wxSize DoGetBestSize() const;
80 virtual void DoSetSize(int x, int y,
81 int width, int height,
82 int sizeFlags = wxSIZE_AUTO);
83
84 // free all memory we have (used by Clear() and dtor)
85 void Free();
86};
87
88#endif // _WX_CHOICE_H_