]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_sttxt.cpp
wxGTK1 : wx/private/eventloopsourcesmanager.h was missing in evtloop.cpp
[wxWidgets.git] / src / xrc / xh_sttxt.cpp
CommitLineData
78d14f80 1/////////////////////////////////////////////////////////////////////////////
ccdc11bb 2// Name: src/xrc/xh_sttxt.cpp
b5d6954b 3// Purpose: XRC resource for wxStaticText
78d14f80
VS
4// Author: Bob Mitchell
5// Created: 2000/03/21
78d14f80
VS
6// Copyright: (c) 2000 Bob Mitchell and Verant Interactive
7// Licence: wxWindows licence
8/////////////////////////////////////////////////////////////////////////////
f80ea77b 9
78d14f80
VS
10// For compilers that support precompilation, includes "wx.h".
11#include "wx/wxprec.h"
12
13#ifdef __BORLANDC__
14 #pragma hdrstop
15#endif
16
ccdc11bb 17#if wxUSE_XRC && wxUSE_STATTEXT
a1e4ec87 18
78d14f80 19#include "wx/xrc/xh_sttxt.h"
ccdc11bb
WS
20
21#ifndef WX_PRECOMP
22 #include "wx/stattext.h"
23#endif
78d14f80 24
854e189f
VS
25IMPLEMENT_DYNAMIC_CLASS(wxStaticTextXmlHandler, wxXmlResourceHandler)
26
f80ea77b
WS
27wxStaticTextXmlHandler::wxStaticTextXmlHandler()
28: wxXmlResourceHandler()
78d14f80 29{
544fee32
VS
30 XRC_ADD_STYLE(wxST_NO_AUTORESIZE);
31 XRC_ADD_STYLE(wxALIGN_LEFT);
32 XRC_ADD_STYLE(wxALIGN_RIGHT);
33 XRC_ADD_STYLE(wxALIGN_CENTRE);
78d14f80
VS
34 AddWindowStyles();
35}
36
37wxObject *wxStaticTextXmlHandler::DoCreateResource()
f80ea77b 38{
544fee32 39 XRC_MAKE_INSTANCE(text, wxStaticText)
f2588180
VS
40
41 text->Create(m_parentAsWindow,
ccdc11bb
WS
42 GetID(),
43 GetText(wxT("label")),
44 GetPosition(), GetSize(),
45 GetStyle(),
46 GetName());
f2588180 47
78d14f80 48 SetupWindow(text);
f80ea77b 49
30aaee95
RD
50 long wrap = GetLong(wxT("wrap"), -1);
51 if (wrap != -1)
52 text->Wrap(wrap);
53
78d14f80
VS
54 return text;
55}
56
78d14f80
VS
57bool wxStaticTextXmlHandler::CanHandle(wxXmlNode *node)
58{
59 return IsOfClass(node, wxT("wxStaticText"));
60}
a1e4ec87 61
ccdc11bb 62#endif // wxUSE_XRC && wxUSE_STATTEXT