]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/choice.h
code using ms_PaintDC changed a little (a couple of asserts added, the behaviour
[wxWidgets.git] / include / wx / msw / choice.h
CommitLineData
2bda0e17
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: choice.h
3// Purpose: wxChoice class
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart and Markus Holzem
9// Licence: wxWindows license
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef __CHOICEH__
13#define __CHOICEH__
14
15#ifdef __GNUG__
16#pragma interface "choice.h"
17#endif
18
19#include "wx/control.h"
20
21WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr;
22
23// Choice item
24class WXDLLEXPORT wxChoice: public wxControl
25{
26 DECLARE_DYNAMIC_CLASS(wxChoice)
27
28 public:
29 int no_strings;
30
31 inline wxChoice(void) { no_strings = 0; }
32
debe6624 33 inline wxChoice(wxWindow *parent, wxWindowID id,
2bda0e17
KB
34 const wxPoint& pos = wxDefaultPosition,
35 const wxSize& size = wxDefaultSize,
debe6624
JS
36 int n = 0, const wxString choices[] = NULL,
37 long style = 0,
2bda0e17
KB
38 const wxValidator& validator = wxDefaultValidator,
39 const wxString& name = wxChoiceNameStr)
40 {
41 Create(parent, id, pos, size, n, choices, style, validator, name);
42 }
43
debe6624 44 bool Create(wxWindow *parent, wxWindowID id,
2bda0e17
KB
45 const wxPoint& pos = wxDefaultPosition,
46 const wxSize& size = wxDefaultSize,
debe6624
JS
47 int n = 0, const wxString choices[] = NULL,
48 long style = 0,
2bda0e17
KB
49 const wxValidator& validator = wxDefaultValidator,
50 const wxString& name = wxChoiceNameStr);
51
52 virtual void Append(const wxString& item);
debe6624 53 virtual void Delete(int n);
2bda0e17
KB
54 virtual void Clear(void);
55 virtual int GetSelection(void) const ;
debe6624 56 virtual void SetSelection(int n);
2bda0e17 57 virtual int FindString(const wxString& s) const;
debe6624
JS
58 virtual wxString GetString(int n) const ;
59 virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
2bda0e17
KB
60 virtual wxString GetStringSelection(void) const ;
61 virtual bool SetStringSelection(const wxString& sel);
62
63 virtual inline int Number(void) const { return no_strings; }
64 virtual void Command(wxCommandEvent& event);
65
debe6624 66 virtual bool MSWCommand(WXUINT param, WXWORD id);
2bda0e17 67
debe6624 68 virtual inline void SetColumns(int WXUNUSED(n) = 1 ) { /* No effect */ } ;
2bda0e17
KB
69 virtual inline int GetColumns(void) const { return 1 ; };
70
debe6624 71 virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
2bda0e17
KB
72 WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
73
74 long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
75};
76
77#endif
78 // __CHOICEH__