]>
Commit | Line | Data |
---|---|---|
17e91437 | 1 | ///////////////////////////////////////////////////////////////////////////// |
dd47af27 | 2 | // Name: src/xrc/xh_hyperlink.cpp |
17e91437 VZ |
3 | // Purpose: Hyperlink control |
4 | // Author: David Norris <danorris@gmail.com> | |
5 | // Modified by: Ryan Norton, Francesco Montorsi | |
6 | // Created: 04/02/2005 | |
17e91437 VZ |
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 | ||
17e91437 VZ |
19 | // For compilers that support precompilation, includes "wx.h". |
20 | #include "wx/wxprec.h" | |
21 | ||
22 | #ifdef __BORLANDC__ | |
23 | #pragma hdrstop | |
24 | #endif | |
25 | ||
28583246 WS |
26 | #if wxUSE_XRC && wxUSE_HYPERLINKCTRL |
27 | ||
17e91437 VZ |
28 | //--------------------------------------------------------------------------- |
29 | // Includes | |
30 | //--------------------------------------------------------------------------- | |
31 | ||
17e91437 VZ |
32 | #include "wx/xrc/xh_hyperlink.h" |
33 | ||
28583246 WS |
34 | #ifndef WX_PRECOMP |
35 | #endif | |
36 | ||
37 | #include "wx/hyperlink.h" | |
38 | #include "wx/xrc/xmlres.h" | |
17e91437 VZ |
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 | { | |
ba142bfb RD |
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); | |
92ad37af | 58 | |
17e91437 VZ |
59 | AddWindowStyles(); |
60 | } | |
61 | ||
62 | wxObject *wxHyperlinkCtrlXmlHandler::DoCreateResource() | |
63 | { | |
64 | XRC_MAKE_INSTANCE(control, wxHyperlinkCtrl) | |
65 | ||
9acbe413 VZ |
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 | ); | |
17e91437 | 76 | |
92ad37af VS |
77 | SetupWindow(control); |
78 | ||
17e91437 VZ |
79 | return control; |
80 | } | |
81 | ||
82 | bool wxHyperlinkCtrlXmlHandler::CanHandle(wxXmlNode *node) | |
83 | { | |
84 | return IsOfClass(node, wxT("wxHyperlinkCtrl")); | |
85 | } | |
86 | ||
28583246 | 87 | #endif // wxUSE_XRC && wxUSE_HYPERLINKCTRL |