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 » how to simulate text links?
icon5.gif  how to simulate text links? [message #22127] Fri, 19 June 2009 04:27 Go to next message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
i need to write a couple of lines of text and when user clicks one, an image is shown. Thus, they are much like text links in web browsers. How to?
in Paint(),
w.DrawRect(GetSize(), SColorFace());
w.DrawText(0, 0, "Graphical introduction", Arial(30).Underline(), Blue);

Then how to determine the text's area so that I know user clicks on it? Font::GetHeight() may be working, but how about the width? FontInfo::GetWidth(int) seems okay, but i'll have to count the charcters one by one. Is there an easy way please? thank you.
Re: how to simulate text links? [message #22130 is a reply to message #22127] Fri, 19 June 2009 09:36 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello bonami

Try with "\upp\tutorial\Draw03" demo.

index.php?t=getfile&id=1806&private=0

Best regards
Koldo


Best regards
IƱaki
Re: how to simulate text links? [message #22132 is a reply to message #22127] Fri, 19 June 2009 10:38 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
bonami wrote on Thu, 18 June 2009 22:27

i need to write a couple of lines of text and when user clicks one, an image is shown. Thus, they are much like text links in web browsers. How to?



Use RichTextView or RichTextCtrl and WhenLink.

See QTF docs about how to defined links in QTF text.

Mirek
Re: how to simulate text links? [message #22134 is a reply to message #22127] Fri, 19 June 2009 12:00 Go to previous message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
i thought of using controls like RichTextView, but i thought the border around the control could not be hidden.
Thanks to Mirek, I'm now using RichTextCtrl.

[Updated on: Fri, 19 June 2009 12:08]

Report message to a moderator

Previous Topic: Menus on dual monitors (Windows)
Next Topic: Problem with ScrollContainer...
Goto Forum:
  


Current Time: Sat Apr 20 06:00:24 CEST 2024

Total time taken to generate the page: 2.04469 seconds