Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

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
tdl-app_exe.zip
TdlApp.exe
tdl-app_src.zip
MainFormUnit.dfm
res
tdl.ico
TdlApp.bdsproj
TdlApp.res
tdl_scr.zip
ToDoList.wsf
////////////////////////////////////////////////////////////
// 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);
};

#endif

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.

License

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

Share

About the Author

jamesfancy

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:
http://hi.baidu.com/jamesfancy

| Advertise | Privacy | Mobile
Web04 | 2.8.141022.2 | Last Updated 25 Apr 2008
Article Copyright 2007 by jamesfancy
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid