Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Creating a hyperlink label
Re: Creating a hyperlink label [message #43796 is a reply to message #43792] Tue, 14 October 2014 09:57 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3361
Registered: August 2008
Senior Veteran
Thank you Mirek, you are right. New implementation is:

class HyperlinkLabel : public Label {
public:
	HyperlinkLabel() {
		NoIgnoreMouse();
		SetInk(LtBlue());
	}
	HyperlinkLabel& SetHyperlink(const char* str) 		{hyperlink = str; return *this;}

private:
	String hyperlink;
	virtual Image CursorImage(Point p, dword keyflags) 	{return Image::Hand();}
	virtual void LeftDown(Point p, dword keyflags) 		{LaunchWebBrowser(hyperlink);}
};

Quote:
Final note: If you need hyperlink, you might be happier using RichTextCtrl instead of Label...
IMHO Rolling Eyes it is very handy to have an hyperlink in a Label, mainly included in .usc so it can be filled directly in the Layout editor with no code. It could be in the Label too Rolling Eyes Rolling Eyes


Best regards
IƱaki
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Using a Button to load a window/form using Run. THISBACK syntax
Next Topic: Win32: custom WM_XXXXX message processing
Goto Forum:
  


Current Time: Tue May 14 01:02:00 CEST 2024

Total time taken to generate the page: 0.04993 seconds