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
8 // Copyright: (c) 2005 David Norris
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 //===========================================================================
14 //===========================================================================
16 //---------------------------------------------------------------------------
17 // Pre-compiled header stuff
18 //---------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
27 #if wxUSE_XRC && wxUSE_HYPERLINKCTRL
29 //---------------------------------------------------------------------------
31 //---------------------------------------------------------------------------
33 #include "wx/xrc/xh_hyperlink.h"
38 #include "wx/hyperlink.h"
39 #include "wx/xrc/xmlres.h"
41 //===========================================================================
43 //===========================================================================
45 //---------------------------------------------------------------------------
46 // wxHyperlinkCtrlXmlHandler
47 //---------------------------------------------------------------------------
49 // Register with wxWindows' dynamic class subsystem.
50 IMPLEMENT_DYNAMIC_CLASS(wxHyperlinkCtrlXmlHandler
, wxXmlResourceHandler
)
52 wxHyperlinkCtrlXmlHandler::wxHyperlinkCtrlXmlHandler()
54 XRC_ADD_STYLE(wxHL_CONTEXTMENU
);
55 XRC_ADD_STYLE(wxHL_ALIGN_LEFT
);
56 XRC_ADD_STYLE(wxHL_ALIGN_RIGHT
);
57 XRC_ADD_STYLE(wxHL_ALIGN_CENTRE
);
58 XRC_ADD_STYLE(wxHL_DEFAULT_STYLE
);
63 wxObject
*wxHyperlinkCtrlXmlHandler::DoCreateResource()
65 XRC_MAKE_INSTANCE(control
, wxHyperlinkCtrl
)
67 control
->Create(m_parentAsWindow
, GetID(),
68 GetParamValue(wxT("label")), GetParamValue(wxT("url")),
69 GetPosition(), GetSize(),
70 GetStyle(wxT("style"), wxHL_DEFAULT_STYLE
),
78 bool wxHyperlinkCtrlXmlHandler::CanHandle(wxXmlNode
*node
)
80 return IsOfClass(node
, wxT("wxHyperlinkCtrl"));
83 #endif // wxUSE_XRC && wxUSE_HYPERLINKCTRL