Click here to Skip to main content
12,824,787 members (40,443 online)
Click here to Skip to main content


43 bookmarked
Posted 2 Feb 2007

TDL: Protocol for .dan.g.'s ToDoList, Useful for SVN Users

, 25 Apr 2008 CPOL
Register a fake protocol of TDL: to make tdl:///filename.tdl?tid available
// HyperLinkWrapper class
// Created by J.Fan.
// Wrap a TLabel object and make it like hyper link.

#ifndef HyperlinkWrapperH
#define HyperlinkWrapperH
#include <vcl.h>

class HyperlinkWrapper {

    public: class Style {
        public: TColor Color;
        public: bool Bold;
        public: bool Underline;
        public: bool Italic;
        public: bool Strike;

        public: __fastcall Style(TColor color = clBlack, bool bold = false,
            bool underline = false, bool italic = false, bool strike = false);

    private: Style linkStyle;
    private: Style hoverStyle;
    private: TList* labels;

    public: static __fastcall void openUrl(const TCHAR* url);

    public: __fastcall HyperlinkWrapper();
    public: __property Style LinkStyle = {read = linkStyle, write = setLinkStyle};
    public: __property Style HoverStyle = {read = hoverStyle, write = setHoverStyle};

    public: void __fastcall wrap(TLabel* label);

    private: void __fastcall setLinkStyle(const Style& style);
    private: void __fastcall setHoverStyle(const Style& style);

    private: void __fastcall onLabelMouseEnter(TObject* sender);
    private: void __fastcall onLabelMouseLeave(TObject* sender);

    private: void __fastcall applyStyle(TLabel* label, const Style& style);


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

China China
James Fancy, is a software engineer from China. He enjoys and familiar with Java, C++ and some script languages.

If you can read Chinese word, here is one of James Fancy's BLOG:

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170308.1 | Last Updated 25 Apr 2008
Article Copyright 2007 by jamesfancy
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid