]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/common/choiccmn.cpp
Fix wxGrid editors background painting.
[wxWidgets.git] / src / common / choiccmn.cpp
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: src/common/choiccmn.cpp
3// Purpose: common (to all ports) wxChoice functions
4// Author: Vadim Zeitlin
5// Modified by:
6// Created: 26.07.99
7// RCS-ID: $Id$
8// Copyright: (c) wxWidgets team
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12// ============================================================================
13// declarations
14// ============================================================================
15
16// ----------------------------------------------------------------------------
17// headers
18// ----------------------------------------------------------------------------
19
20// For compilers that support precompilation, includes "wx.h".
21#include "wx/wxprec.h"
22
23#ifdef __BORLANDC__
24 #pragma hdrstop
25#endif
26
27#if wxUSE_CHOICE
28
29#include "wx/choice.h"
30
31#ifndef WX_PRECOMP
32#endif
33
34const char wxChoiceNameStr[] = "choice";
35
36
37wxDEFINE_FLAGS( wxChoiceStyle )
38wxBEGIN_FLAGS( wxChoiceStyle )
39// new style border flags, we put them first to
40// use them for streaming out
41wxFLAGS_MEMBER(wxBORDER_SIMPLE)
42wxFLAGS_MEMBER(wxBORDER_SUNKEN)
43wxFLAGS_MEMBER(wxBORDER_DOUBLE)
44wxFLAGS_MEMBER(wxBORDER_RAISED)
45wxFLAGS_MEMBER(wxBORDER_STATIC)
46wxFLAGS_MEMBER(wxBORDER_NONE)
47
48// old style border flags
49wxFLAGS_MEMBER(wxSIMPLE_BORDER)
50wxFLAGS_MEMBER(wxSUNKEN_BORDER)
51wxFLAGS_MEMBER(wxDOUBLE_BORDER)
52wxFLAGS_MEMBER(wxRAISED_BORDER)
53wxFLAGS_MEMBER(wxSTATIC_BORDER)
54wxFLAGS_MEMBER(wxBORDER)
55
56// standard window styles
57wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
58wxFLAGS_MEMBER(wxCLIP_CHILDREN)
59wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
60wxFLAGS_MEMBER(wxWANTS_CHARS)
61wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
62wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
63wxFLAGS_MEMBER(wxVSCROLL)
64wxFLAGS_MEMBER(wxHSCROLL)
65
66wxEND_FLAGS( wxChoiceStyle )
67
68wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxChoice, wxControl, "wx/choice.h")
69
70wxBEGIN_PROPERTIES_TABLE(wxChoice)
71wxEVENT_PROPERTY( Select, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEvent )
72
73wxPROPERTY( Font, wxFont, SetFont, GetFont , wxEMPTY_PARAMETER_VALUE, \
74 0 /*flags*/, wxT("Helpstring"), wxT("group"))
75wxPROPERTY_COLLECTION( Choices, wxArrayString, wxString, AppendString, \
76 GetStrings, 0 /*flags*/, wxT("Helpstring"), wxT("group"))
77wxPROPERTY( Selection,int, SetSelection, GetSelection, wxEMPTY_PARAMETER_VALUE, \
78 0 /*flags*/, wxT("Helpstring"), wxT("group"))
79
80/*
81 TODO PROPERTIES
82 selection (long)
83 content (list)
84 item
85 */
86
87wxPROPERTY_FLAGS( WindowStyle, wxChoiceStyle, long, SetWindowStyleFlag, \
88 GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \
89 wxT("Helpstring"), wxT("group")) // style
90wxEND_PROPERTIES_TABLE()
91
92wxEMPTY_HANDLERS_TABLE(wxChoice)
93
94wxCONSTRUCTOR_4( wxChoice, wxWindow*, Parent, wxWindowID, Id, \
95 wxPoint, Position, wxSize, Size )
96
97// ============================================================================
98// implementation
99// ============================================================================
100
101wxChoiceBase::~wxChoiceBase()
102{
103 // this destructor is required for Darwin
104}
105
106// ----------------------------------------------------------------------------
107// misc
108// ----------------------------------------------------------------------------
109
110void wxChoiceBase::Command(wxCommandEvent& event)
111{
112 SetSelection(event.GetInt());
113 (void)GetEventHandler()->ProcessEvent(event);
114}
115
116#endif // wxUSE_CHOICE