1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
//////////////////////////////////////////////////////////////////////////////
// File: hyperlink.h
// Purpose: wxHyperLink control
// Maintainer: Wyo
// Created: 2003-04-07
// RCS-ID: $Id: hyperlink.h,v 1.1 2005/06/28 22:22:28 rwalton Exp $
// Copyright: (c) 2004 wxCode
// Licence: wxWindows
//////////////////////////////////////////////////////////////////////////////
#ifndef _MY_HYPERLINK_H_
#define _MY_HYPERLINK_H_
#ifdef __GNUG__
#pragma implementation "hyperlink.h"
#endif
//----------------------------------------------------------------------------
// information
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
// headers
//----------------------------------------------------------------------------
//! wxWidgets headers
//============================================================================
// declarations
//============================================================================
//----------------------------------------------------------------------------
//!
//----------------------------------------------------------------------------
//! wxHyperLink
class wxHyperLink: public wxStaticText {
DECLARE_DYNAMIC_CLASS (wxHyperLink)
public:
//! default constructor
wxHyperLink () {}
//! create constructor
wxHyperLink (wxWindow *parent,
wxWindowID id,
const wxString &label = wxEmptyString,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = 0,
const wxString &name = _T("HyperLink")) {
Create (parent, id, label, pos, size, style, name);
}
// function create
bool Create (wxWindow *parent,
wxWindowID id,
const wxString &label = wxEmptyString,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = 0,
const wxString &name = _T("HyperLink"));
// event handlers
void OnWindowEnter (wxMouseEvent& event);
void OnWindowLeave (wxMouseEvent& event);
void OnLinkActivate (wxMouseEvent& event);
// get/set settings
wxCursor GetHoverCursor ();
void SetHoverCursor (wxCursor cursor);
wxColour GetMarkedColour ();
void SetMarkedColour (wxColour colour);
wxColour GetNormalColour ();
void SetNormalColour (wxColour colour);
wxColour GetVisitedColour ();
void SetVisitedColour (wxColour colour);
wxString GetURL ();
void SetURL (const wxString &url);
//! execute according to mimetype
static void ExecuteLink (const wxString &link);
private:
//! hypertext variables
wxString m_URL;
bool m_Marked;
bool m_Visited;
//! style settings
wxCursor m_HoverCursor;
wxColour m_MarkedColour;
wxColour m_NormalColour;
wxColour m_VisitedColour;
wxColour m_BackgroundColour;
DECLARE_EVENT_TABLE()
};
#endif // _MY_HYPERLINK_H_
|