]> git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_hyperlink.cpp
a5a0cd3eb8ba8b361a2108bf9d50bb365fd0a98f
[wxWidgets.git] / src / xrc / xh_hyperlink.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/hyperlink.cpp
3 // Purpose: Hyperlink control
4 // Author: David Norris <danorris@gmail.com>
5 // Modified by: Ryan Norton, Francesco Montorsi
6 // Created: 04/02/2005
7 // RCS-ID: $Id$
8 // Copyright: (c) 2005 David Norris
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 //===========================================================================
13 // Declarations
14 //===========================================================================
15
16 //---------------------------------------------------------------------------
17 // Pre-compiled header stuff
18 //---------------------------------------------------------------------------
19
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
22
23 #ifdef __BORLANDC__
24 #pragma hdrstop
25 #endif
26
27 #if wxUSE_XRC && wxUSE_HYPERLINKCTRL
28
29 //---------------------------------------------------------------------------
30 // Includes
31 //---------------------------------------------------------------------------
32
33 #include "wx/xrc/xh_hyperlink.h"
34
35 #ifndef WX_PRECOMP
36 #endif
37
38 #include "wx/hyperlink.h"
39 #include "wx/xrc/xmlres.h"
40
41 //===========================================================================
42 // Implementation
43 //===========================================================================
44
45 //---------------------------------------------------------------------------
46 // wxHyperlinkCtrlXmlHandler
47 //---------------------------------------------------------------------------
48
49 // Register with wxWindows' dynamic class subsystem.
50 IMPLEMENT_DYNAMIC_CLASS(wxHyperlinkCtrlXmlHandler, wxXmlResourceHandler)
51
52 wxHyperlinkCtrlXmlHandler::wxHyperlinkCtrlXmlHandler()
53 {
54 AddWindowStyles();
55 }
56
57 wxObject *wxHyperlinkCtrlXmlHandler::DoCreateResource()
58 {
59 XRC_MAKE_INSTANCE(control, wxHyperlinkCtrl)
60
61 SetupWindow(control);
62 control->Create(m_parentAsWindow, GetID(),
63 GetParamValue(wxT("label")), GetParamValue(wxT("url")),
64 GetPosition(), GetSize(), GetStyle());
65
66 return control;
67 }
68
69 bool wxHyperlinkCtrlXmlHandler::CanHandle(wxXmlNode *node)
70 {
71 return IsOfClass(node, wxT("wxHyperlinkCtrl"));
72 }
73
74 #endif // wxUSE_XRC && wxUSE_HYPERLINKCTRL