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 » LineEdit, EditFields, DocEdit » How to print the selected text in a LineEdit
How to print the selected text in a LineEdit [message #3598] Mon, 05 June 2006 15:54 Go to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

the procedure it is quite obvious:

1) select the text inside the LineEdit;
2) get the selected string with:
  String text = editor.GetSelection();

3) pass the string text to Report as discussed in another thread in this forum.

The problem: the selected text doens't contain the newline (\n) char. This means that you loose the format and the vertical alignment.
Any idea how to grab the text but preserving the newline char if it is present?

Luigi

[Updated on: Mon, 05 June 2006 15:55]

Report message to a moderator

Re: How to print the selected text in a LineEdit [message #3601 is a reply to message #3598] Mon, 05 June 2006 16:35 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
forlano wrote on Mon, 05 June 2006 09:54

Hello,

the procedure it is quite obvious:

1) select the text inside the LineEdit;
2) get the selected string with:
  String text = editor.GetSelection();

3) pass the string text to Report as discussed in another thread in this forum.

The problem: the selected text doens't contain the newline (\n) char. This means that you loose the format and the vertical alignment.
Any idea how to grab the text but preserving the newline char if it is present?

Luigi


Well, Report accepts Qtf. '\n' is ignored in QTF. Moreover, some sequences would be interpreted as control codes...

Solution:

String DeQtfLf(const char *s);

- escapes control sequences AND replaces '\n' with '&' (qtf line end).

Mirek


Re: How to print the selected text in a LineEdit [message #3602 is a reply to message #3601] Mon, 05 June 2006 16:46 Go to previous message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
luzr wrote on Mon, 05 June 2006 16:35


Solution:

String DeQtfLf(const char *s);

- escapes control sequences AND replaces '\n' with '&' (qtf line end).

Mirek


Yes, now works very nice.
Thank you Smile

Luigi
Previous Topic: EditField and the Enter Key[SOLVED]
Next Topic: About the beahaviour of FileSel fs.Type
Goto Forum:
  


Current Time: Thu Mar 28 13:34:19 CET 2024

Total time taken to generate the page: 0.00826 seconds