]> git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_hyperlink.cpp
XRC spec: document wxRibbon* XRC handler.
[wxWidgets.git] / src / xrc / xh_hyperlink.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/xh_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 // Copyright: (c) 2005 David Norris
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 //===========================================================================
12 // Declarations
13 //===========================================================================
14
15 //---------------------------------------------------------------------------
16 // Pre-compiled header stuff
17 //---------------------------------------------------------------------------
18
19 // For compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
21
22 #ifdef __BORLANDC__
23 #pragma hdrstop
24 #endif
25
26 #if wxUSE_XRC && wxUSE_HYPERLINKCTRL
27
28 //---------------------------------------------------------------------------
29 // Includes
30 //---------------------------------------------------------------------------
31
32 #include "wx/xrc/xh_hyperlink.h"
33
34 #ifndef WX_PRECOMP
35 #endif
36
37 #include "wx/hyperlink.h"
38 #include "wx/xrc/xmlres.h"
39
40 //===========================================================================
41 // Implementation
42 //===========================================================================
43
44 //---------------------------------------------------------------------------
45 // wxHyperlinkCtrlXmlHandler
46 //---------------------------------------------------------------------------
47
48 // Register with wxWindows' dynamic class subsystem.
49 IMPLEMENT_DYNAMIC_CLASS(wxHyperlinkCtrlXmlHandler, wxXmlResourceHandler)
50
51 wxHyperlinkCtrlXmlHandler::wxHyperlinkCtrlXmlHandler()
52 {
53 XRC_ADD_STYLE(wxHL_CONTEXTMENU);
54 XRC_ADD_STYLE(wxHL_ALIGN_LEFT);
55 XRC_ADD_STYLE(wxHL_ALIGN_RIGHT);
56 XRC_ADD_STYLE(wxHL_ALIGN_CENTRE);
57 XRC_ADD_STYLE(wxHL_DEFAULT_STYLE);
58
59 AddWindowStyles();
60 }
61
62 wxObject *wxHyperlinkCtrlXmlHandler::DoCreateResource()
63 {
64 XRC_MAKE_INSTANCE(control, wxHyperlinkCtrl)
65
66 control->Create
67 (
68 m_parentAsWindow,
69 GetID(),
70 GetText(wxT("label")),
71 GetParamValue(wxT("url")),
72 GetPosition(), GetSize(),
73 GetStyle(wxT("style"), wxHL_DEFAULT_STYLE),
74 GetName()
75 );
76
77 SetupWindow(control);
78
79 return control;
80 }
81
82 bool wxHyperlinkCtrlXmlHandler::CanHandle(wxXmlNode *node)
83 {
84 return IsOfClass(node, wxT("wxHyperlinkCtrl"));
85 }
86
87 #endif // wxUSE_XRC && wxUSE_HYPERLINKCTRL