]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_comboctrl.cpp
Compile fixes for wxUSE_COLLPANE=0
[wxWidgets.git] / src / xrc / xh_comboctrl.cpp
CommitLineData
20072d3f
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: src/xrc/xh_comboctrl.cpp
3// Purpose: XRC resource for wxComboCtrl
4// Author: Jaakko Salli
5// Created: 2009/01/25
6// RCS-ID: $Id$
7// Copyright: (c) 2009 Jaakko Salli
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11// For compilers that support precompilation, includes "wx.h".
12#include "wx/wxprec.h"
13
14#ifdef __BORLANDC__
15 #pragma hdrstop
16#endif
17
18#if wxUSE_XRC && wxUSE_COMBOCTRL
19
20#include "wx/xrc/xh_comboctrl.h"
21
22#ifndef WX_PRECOMP
23 #include "wx/intl.h"
24 #include "wx/textctrl.h" // for wxTE_PROCESS_ENTER
25#endif
26
27#include "wx/combo.h"
28
29
30IMPLEMENT_DYNAMIC_CLASS(wxComboCtrlXmlHandler, wxXmlResourceHandler)
31
32wxComboCtrlXmlHandler::wxComboCtrlXmlHandler()
33 : wxXmlResourceHandler()
34{
35 XRC_ADD_STYLE(wxCB_SORT);
36 XRC_ADD_STYLE(wxCB_READONLY);
37 XRC_ADD_STYLE(wxTE_PROCESS_ENTER);
38 XRC_ADD_STYLE(wxCC_SPECIAL_DCLICK);
39 XRC_ADD_STYLE(wxCC_STD_BUTTON);
40 AddWindowStyles();
41}
42
43wxObject *wxComboCtrlXmlHandler::DoCreateResource()
44{
45 if( m_class == wxT("wxComboCtrl"))
46 {
47 XRC_MAKE_INSTANCE(control, wxComboCtrl)
48
49 control->Create(m_parentAsWindow,
50 GetID(),
51 GetText(wxT("value")),
52 GetPosition(), GetSize(),
53 GetStyle(),
54 wxDefaultValidator,
55 GetName());
56
57 SetupWindow(control);
58
59 return control;
60 }
61 return NULL;
62}
63
64bool wxComboCtrlXmlHandler::CanHandle(wxXmlNode *node)
65{
66 return IsOfClass(node, wxT("wxComboCtrl"));
67}
68
69#endif // wxUSE_XRC && wxUSE_COMBOBOX