]>
Commit | Line | Data |
---|---|---|
17e91437 | 1 | ///////////////////////////////////////////////////////////////////////////// |
28583246 | 2 | // Name: src/xrc/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 | |
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 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) | |
21 | #pragma implementation "hyperlink.h" | |
22 | #endif | |
23 | ||
24 | // For compilers that support precompilation, includes "wx.h". | |
25 | #include "wx/wxprec.h" | |
26 | ||
27 | #ifdef __BORLANDC__ | |
28 | #pragma hdrstop | |
29 | #endif | |
30 | ||
28583246 WS |
31 | #if wxUSE_XRC && wxUSE_HYPERLINKCTRL |
32 | ||
17e91437 VZ |
33 | //--------------------------------------------------------------------------- |
34 | // Includes | |
35 | //--------------------------------------------------------------------------- | |
36 | ||
17e91437 VZ |
37 | #include "wx/xrc/xh_hyperlink.h" |
38 | ||
28583246 WS |
39 | #ifndef WX_PRECOMP |
40 | #endif | |
41 | ||
42 | #include "wx/hyperlink.h" | |
43 | #include "wx/xrc/xmlres.h" | |
17e91437 VZ |
44 | |
45 | //=========================================================================== | |
46 | // Implementation | |
47 | //=========================================================================== | |
48 | ||
49 | //--------------------------------------------------------------------------- | |
50 | // wxHyperlinkCtrlXmlHandler | |
51 | //--------------------------------------------------------------------------- | |
52 | ||
53 | // Register with wxWindows' dynamic class subsystem. | |
54 | IMPLEMENT_DYNAMIC_CLASS(wxHyperlinkCtrlXmlHandler, wxXmlResourceHandler) | |
55 | ||
56 | wxHyperlinkCtrlXmlHandler::wxHyperlinkCtrlXmlHandler() | |
57 | { | |
58 | AddWindowStyles(); | |
59 | } | |
60 | ||
61 | wxObject *wxHyperlinkCtrlXmlHandler::DoCreateResource() | |
62 | { | |
63 | XRC_MAKE_INSTANCE(control, wxHyperlinkCtrl) | |
64 | ||
65 | SetupWindow(control); | |
66 | control->Create(m_parentAsWindow, GetID(), | |
67 | GetParamValue(wxT("label")), GetParamValue(wxT("url")), | |
68 | GetPosition(), GetSize(), GetStyle()); | |
69 | ||
70 | return control; | |
71 | } | |
72 | ||
73 | bool wxHyperlinkCtrlXmlHandler::CanHandle(wxXmlNode *node) | |
74 | { | |
75 | return IsOfClass(node, wxT("wxHyperlinkCtrl")); | |
76 | } | |
77 | ||
28583246 | 78 | #endif // wxUSE_XRC && wxUSE_HYPERLINKCTRL |