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