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 » Adding simple Append to TextCtrl?
Adding simple Append to TextCtrl? [message #49771] Sun, 29 April 2018 14:18 Go to next message
luoganda is currently offline  luoganda
Messages: 213
Registered: November 2016
Experienced Member
It would be neat to have TextCtrl.Append, eg from
TextCtrl.Insert(TextCtrl.GetLength(),"someString"); into
TextCtrl.Append("someString); or TextCtrl.Cat("someString);
Re: Adding simple Append to TextCtrl? [message #49773 is a reply to message #49771] Sun, 29 April 2018 20:12 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14257
Registered: November 2005
Ultimate Member
OK, why not. In the trunk now.
Re: Adding simple Append to TextCtrl? [message #61085 is a reply to message #49773] Mon, 11 November 2024 17:01 Go to previous message
kov_serg is currently offline  kov_serg
Messages: 42
Registered: August 2008
Location: Russia
Member
How about AppendPreservingSelection for interactive adding text to control:
void LineEdit_Append2(LineEdit &edit, const String &text) {
	int64 pos=edit.GetCursor64(), len=edit.GetLength64();
	int64 h,t; bool sel=edit.GetSelection(h,t);
	edit.Append(text);
	if (pos==len) {
		len=edit.GetLength();
		edit.SetCursor(len);
		if (sel && t==pos) t=len;
	}
	if (sel) edit.SetSelection(h,t);
}

It keeps selection and cursor position if it was at the end.
Previous Topic: Rescale image without filter
Goto Forum:
  


Current Time: Tue May 13 08:11:05 CEST 2025

Total time taken to generate the page: 0.02595 seconds