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