]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_hyperlink.cpp
wxUSE_PROPGRID is now recognized by source and header files
[wxWidgets.git] / src / xrc / xh_hyperlink.cpp
CommitLineData
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
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
17e91437
VZ
20// For compilers that support precompilation, includes "wx.h".
21#include "wx/wxprec.h"
22
23#ifdef __BORLANDC__
24#pragma hdrstop
25#endif
26
28583246
WS
27#if wxUSE_XRC && wxUSE_HYPERLINKCTRL
28
17e91437
VZ
29//---------------------------------------------------------------------------
30// Includes
31//---------------------------------------------------------------------------
32
17e91437
VZ
33#include "wx/xrc/xh_hyperlink.h"
34
28583246
WS
35#ifndef WX_PRECOMP
36#endif
37
38#include "wx/hyperlink.h"
39#include "wx/xrc/xmlres.h"
17e91437
VZ
40
41//===========================================================================
42// Implementation
43//===========================================================================
44
45//---------------------------------------------------------------------------
46// wxHyperlinkCtrlXmlHandler
47//---------------------------------------------------------------------------
48
49// Register with wxWindows' dynamic class subsystem.
50IMPLEMENT_DYNAMIC_CLASS(wxHyperlinkCtrlXmlHandler, wxXmlResourceHandler)
51
52wxHyperlinkCtrlXmlHandler::wxHyperlinkCtrlXmlHandler()
53{
ba142bfb
RD
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);
92ad37af 59
17e91437
VZ
60 AddWindowStyles();
61}
62
63wxObject *wxHyperlinkCtrlXmlHandler::DoCreateResource()
64{
65 XRC_MAKE_INSTANCE(control, wxHyperlinkCtrl)
66
9acbe413
VZ
67 control->Create
68 (
69 m_parentAsWindow,
70 GetID(),
71 GetText(wxT("label")),
72 GetParamValue(wxT("url")),
73 GetPosition(), GetSize(),
74 GetStyle(wxT("style"), wxHL_DEFAULT_STYLE),
75 GetName()
76 );
17e91437 77
92ad37af
VS
78 SetupWindow(control);
79
17e91437
VZ
80 return control;
81}
82
83bool wxHyperlinkCtrlXmlHandler::CanHandle(wxXmlNode *node)
84{
85 return IsOfClass(node, wxT("wxHyperlinkCtrl"));
86}
87
28583246 88#endif // wxUSE_XRC && wxUSE_HYPERLINKCTRL