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 » Get, modify and set text of RichEdit(WithToolBar)
Get, modify and set text of RichEdit(WithToolBar) [message #14424] Tue, 26 February 2008 09:13 Go to next message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
Hi,
Is it possible to specify a top offset for page on RichEdit? I would like that text begin on the half of the page on the first page and begin on the top on the other pages.
Well, my pooor solution is, during printing get text from the richedit, insert some blank paragraphs on the top, print and then restore the original text. I am waiting for a flikering but I have no other solution.

Thus I use the code (yet before inserting blank paragraphs):

String strQTF << txText.GetQTF(CHARSET_ISO8859_1);
txText.SetQTF(strQTF);

When the text is restored the word UTF-8 appears on the beginning...
Which is the right way to get and set the text of richEdit control? by the way, How do I insert blank paragraphs on top? I am ysing the simbol & but it doesnt work.

A better solution would also be appreciated.

Thank you
Alex
Re: Get, modify and set text of RichEdit(WithToolBar) [message #14449 is a reply to message #14424] Tue, 26 February 2008 21:08 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
alex100 wrote on Tue, 26 February 2008 03:13


Thus I use the code (yet before inserting blank paragraphs):

String strQTF << txText.GetQTF(CHARSET_ISO8859_1);
txText.SetQTF(strQTF);

When the text is restored the word UTF-8 appears on the beginning...



Not reproduced. I tried:
String FileName()
{
//	return "d:/test.qtf";
	return GetExeDirFile("test.qtf");
}


GUI_APP_MAIN
{
//	ChClassicSkin();
//	ChStdSkin();
//	SetLanguage(LNG_('P','L','P','L'));

//	InstallCrashDump();

	DUMP(GUI_PopUpEffect());
	RichEditWithToolBar e;

	DUMP(ScrollBarSize());

	e.Pick(ParseQTF(LoadFile(FileName())));
	TopWindow w;
	w.SetRect(0, 0, 700, 500);
	w.Sizeable().Zoomable();
	w.Add(e.SizePos());
	w.Run();
	
	String strQTF = e.GetQTF(CHARSET_ISO8859_1);
	e.SetQTF(strQTF);
	w.Run();

	String x = e.GetQTF();
	SaveFile(FileName(), x);
	LOG("Exit");
}


Mirek
Re: Get, modify and set text of RichEdit(WithToolBar) [message #14453 is a reply to message #14449] Tue, 26 February 2008 21:43 Go to previous messageGo to next message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
Thanks for your help but it doent work yet

I dont need to save nor load any file. I want tp present on screen richEdit blank, then user writes something and I need by code to pull writen text down in order to put an header on the writen text.
So I need to know how to get richedit contents to memory, pull text down (returns or empty patagraphs) and then put the modified text again in the rich edit.

Does richedit supports headers?

Hope someone help me,

Alex
Re: Get, modify and set text of RichEdit(WithToolBar) [message #14454 is a reply to message #14453] Tue, 26 February 2008 21:45 Go to previous messageGo to next message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
Also, if U use this code:

String strQTF = txText.GetQTF(CHARSET_ISO8859_1);
txText.SetQTF(strQTF);

the word "UTF-8" appears before the text.

Alex
Re: Get, modify and set text of RichEdit(WithToolBar) [message #14456 is a reply to message #14454] Tue, 26 February 2008 22:04 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
alex100 wrote on Tue, 26 February 2008 15:45

Also, if U use this code:

String strQTF = txText.GetQTF(CHARSET_ISO8859_1);
txText.SetQTF(strQTF);

the word "UTF-8" appears before the text.

Alex


Well, this is what I do in above example and it seems to work OK (?).

Mirek
Re: Get, modify and set text of RichEdit(WithToolBar) [message #14459 is a reply to message #14456] Tue, 26 February 2008 22:37 Go to previous messageGo to next message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
No, it doesnt work...

Supose I have a form with the RichEditWithToolbar (txText) and a button. When I run the app I write "Hello" on the blank RichEdit. Then I push the button and I saw "UTF-8 Hello" on the RichEdit. Is this normal behaviour. If so How do I remove the UTF-8 part of the Text.

Note: Button has this code:

String strQTF = txText.GetQTF(CHARSET_ISO8859_1);
txText.SetQTF(strQTF);

This is the first problem. Then I need to insert soveral blank lines on the text before put it on the RichEdit.

Any help?

Alex
Re: Get, modify and set text of RichEdit(WithToolBar) [message #14461 is a reply to message #14459] Tue, 26 February 2008 23:59 Go to previous messageGo to next message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
One way could be:

RichText clip=txText.CopyText(0,MAXINT); //Get text
txText.Clear(); //Clear RichEdit
//Insert some empty lines on the top of the text
txText.PasteText(clip); //Put text again on the RichText

But during the PasteText it appends an extra "return" key on the end of the text, this means that for each PasteText it appends a new paragraph. Why append a new empty paragraph during the PasteText?

Sad

Alex
Re: Get, modify and set text of RichEdit(WithToolBar) [message #14463 is a reply to message #14459] Wed, 27 February 2008 00:27 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
alex100 wrote on Tue, 26 February 2008 16:37

No, it doesnt work...

Supose I have a form with the RichEditWithToolbar (txText) and a button. When I run the app I write "Hello" on the blank RichEdit. Then I push the button and I saw "UTF-8 Hello" on the RichEdit. Is this normal behaviour. If so How do I remove the UTF-8 part of the Text.

Note: Button has this code:

String strQTF = txText.GetQTF(CHARSET_ISO8859_1);
txText.SetQTF(strQTF);

This is the first problem. Then I need to insert soveral blank lines on the text before put it on the RichEdit.

Any help?

Alex


Please, do not suppose, post a testcase (small compilable package that demonstrates the issue, zipped). Will take less time than trying to describe the situation...

Mirek
Re: Get, modify and set text of RichEdit(WithToolBar) [message #14479 is a reply to message #14463] Wed, 27 February 2008 10:16 Go to previous messageGo to next message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
Ok, you are right, here is a simple example called PullText

Alex
  • Attachment: PullText.zip
    (Size: 1.37KB, Downloaded 265 times)
Re: Get, modify and set text of RichEdit(WithToolBar) [message #14486 is a reply to message #14479] Wed, 27 February 2008 10:55 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
alex100 wrote on Wed, 27 February 2008 04:16

Ok, you are right, here is a simple example called PullText

Alex


Excellent, thanks. U++ bug, now fixed.

Quick fix: RichText/EncodeQTF.cpp 490:

			qtf << "%" << LNGAsText(SetLNGCharset(lang, CHARSET_DEFAULT));


Mirek
Re: Get, modify and set text of RichEdit(WithToolBar) [message #14487 is a reply to message #14486] Wed, 27 February 2008 11:06 Go to previous message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
Great!
Thank you too!

Alex
PS: No doubt, on next messages I will append always an example application, if applicable.
Previous Topic: openGL and texture
Next Topic: How to turn off Ctrl Updatable action?
Goto Forum:
  


Current Time: Thu Apr 25 15:44:37 CEST 2024

Total time taken to generate the page: 0.02118 seconds