]> git.saurik.com Git - wxWidgets.git/blob - src/common/choiccmn.cpp
use the native msg box if available, fall back to wxWin one instead of doing the...
[wxWidgets.git] / src / common / choiccmn.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: 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) wxWindows team
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 // ============================================================================
13 // declarations
14 // ============================================================================
15
16 // ----------------------------------------------------------------------------
17 // headers
18 // ----------------------------------------------------------------------------
19
20 #ifdef __GNUG__
21 #pragma implementation "choicebase.h"
22 #endif
23
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
26
27 #ifdef __BORLANDC__
28 #pragma hdrstop
29 #endif
30
31 #ifndef WX_PRECOMP
32 #include "wx/choice.h"
33 #endif
34
35 // ============================================================================
36 // implementation
37 // ============================================================================
38
39 // ----------------------------------------------------------------------------
40 // selection
41 // ----------------------------------------------------------------------------
42
43 bool wxChoiceBase::SetStringSelection(const wxString& s)
44 {
45 int sel = FindString(s);
46 wxCHECK_MSG( sel != -1, FALSE,
47 wxT("invalid string in wxChoice::SetStringSelection") );
48
49 Select(sel);
50
51 return TRUE;
52 }
53
54 // ----------------------------------------------------------------------------
55 // misc
56 // ----------------------------------------------------------------------------
57
58 void wxChoiceBase::Command(wxCommandEvent& event)
59 {
60 SetSelection(event.m_commandInt);
61 (void)ProcessEvent(event);
62 }