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 » RichText,QTF,RTF... » QTF Justification
QTF Justification [message #2453] Thu, 13 April 2006 10:16 Go to next message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member
Sorry for the FAQ, but is it possible to get:

RichTextView e;
e.SetQTF("&[< Left][> Right]&");

...to work?

Only works if I add:
e.SetQTF("&[< Left]&[> Right]&");

but then they are no longer on the same line.


Re: QTF Justification [message #2454 is a reply to message #2453] Thu, 13 April 2006 11:24 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

This is like in any other text editor. Justification is set to the whole line. If you want to have part of line aligned to the left and rest of line aligned to the right use transparent table and set proper align mode in each cell.
Re: QTF Justification [message #2460 is a reply to message #2454] Thu, 13 April 2006 14:30 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
You can also use right-aligned tab....

Mirek
Re: QTF Justification [message #2481 is a reply to message #2453] Fri, 14 April 2006 02:37 Go to previous messageGo to next message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member

Thanks! That answers it..

It is these small questions that are hard to get answers for when you've just started.

Like if I use a RichTextView (as I want coloured text) as a log Window output, (just adding lines) I can't get it to auto scroll/view the last line. With DocEdit I used
.SetCursor(.GetLength());
.ScrollView(0, .GetLength());

.. but with RichText there is no SetCursor(). But that could have something to do with the way I "add a line".
rtv <<= ~rtv + newline;

.. is there a better way?


Is there a nice way to sort DropList?


All tiny questions not worth asking on their own, but on the list of things I need to track down to make the application a nice experience Smile


Re: QTF Justification [message #2489 is a reply to message #2481] Fri, 14 April 2006 09:42 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I guess you should use RichEdit instead. And insert at the end instead of regenerating the whole text (that is slow).

Sort DropList - no, not really, usually it is better to sort data before putting them into DropList...

MIrek
Re: QTF Justification [message #2492 is a reply to message #2489] Fri, 14 April 2006 10:35 Go to previous messageGo to next message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member

Yeah, figured that would be expensive, but if I wanted colour, it didn't seem like I had a choice..

Not that I have a RichEdit type either, newer version needed?

Re: QTF Justification [message #2494 is a reply to message #2492] Fri, 14 April 2006 11:15 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
lundman wrote on Fri, 14 April 2006 04:35


Yeah, figured that would be expensive, but if I wanted colour, it didn't seem like I had a choice..

Not that I have a RichEdit type either, newer version needed?




Is not part of CtrlLib, you have to add RichEdit package... (in other words, standard "GUI application" template does not add it, you have to add it manually).

Mirek
Re: QTF Justification [message #2500 is a reply to message #2494] Sat, 15 April 2006 07:22 Go to previous messageGo to next message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member

Right, got that working ok and well.. it's quite amusing Smile

So for a log output window, its got a Ruler, spell checks all the lines I print out, with non-printable chars replaced by placemarkers ... but I assume I can probably disable most of that.

Re: QTF Justification [message #2503 is a reply to message #2500] Sat, 15 April 2006 14:30 Go to previous messageGo to next message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member

Actually, sorry to be dense, but, I can't see a Insert/Add of strings/text to the end of a RichEdit. I can only re-assign the full thing like I did before. True I have a ScrollToCursor() at least so maybe I can sort the scrolling out.

Re: QTF Justification [message #2559 is a reply to message #2503] Mon, 17 April 2006 22:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
You have Select and you have PasteText... Also, NoRuler.

Mirek
Re: QTF Justification [message #2583 is a reply to message #2559] Tue, 18 April 2006 05:45 Go to previous messageGo to next message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member
Thanks.

PasteText, and indeed Insert, both take RichText. I have not yet been able to find out how to go from String to RichText. SetFooter() is about the only method that deals with String. (and GetPlainText() ).

Although, I can use:
	RichEdit p;
	RichText a;
	
	p <<= the_new_input_String;
	a = p.CopyText(0, p.GetLength());

	bot.output.Select(bot.output.GetLength(), 1);
	bot.output.SetEditable(true);
	bot.output.PasteText(a);
	bot.output.SetEditable(false);


Ugly as hell, but that'll do.. Now to get rid of those "space" and "newline" icon indicators.

ShowCodes(Null) seems to do that.

Turning off the spellchecker... not possible? Can't even change colour, they are hardcoded as Red/LtRed.








Re: QTF Justification [message #2585 is a reply to message #2583] Tue, 18 April 2006 08:32 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
lundman wrote on Mon, 17 April 2006 23:45

Thanks.

PasteText, and indeed Insert, both take RichText. I have not yet been able to find out how to go from String to RichText.



ParseQTF

Quote:


Turning off the spellchecker... not possible? Can't even change colour, they are hardcoded as Red/LtRed.



Set language of your text to "none". (In qtf - "[%00-00 ")

Mirek
Re: QTF Justification [message #2587 is a reply to message #2585] Tue, 18 April 2006 08:38 Go to previous messageGo to next message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member

I was just looking at setting the language to null, but could only find global functions. I didn't think to set it in QTF.

Of course, it only remembers that setting until the "&", so I would have to set it for everyline.. thats not the end of the world though.

Re: QTF Justification [message #2588 is a reply to message #2587] Tue, 18 April 2006 08:55 Go to previous messageGo to next message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member
I take that back, setting it once works.

I believe I am now happy, thanks for your patience.

Re: QTF Justification [message #2610 is a reply to message #2588] Wed, 19 April 2006 02:51 Go to previous messageGo to next message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member

Actually... I find that if you resize the window the font(!) changes size with it. That is quite undesirable and quite peculiar... Can I turn that off? I don't set Zoomable() for the Layout, but that makes no difference.

Looking at the sources, Paint seems to call GetZoom, that just gets the rectangle of the widget, making the suspect I can not turn that off.

Re: QTF Justification [message #2625 is a reply to message #2610] Wed, 19 April 2006 09:35 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
lundman wrote on Tue, 18 April 2006 20:51


Actually... I find that if you resize the window the font(!) changes size with it. That is quite undesirable and quite peculiar... Can I turn that off? I don't set Zoomable() for the Layout, but that makes no difference.

Looking at the sources, Paint seems to call GetZoom, that just gets the rectangle of the widget, making the suspect I can not turn that off.





Yes, that is correct. Looks like I have mislead you somewhat here... (I did not realized there will be this zooming problem...)

Anyway, perhaps it is the time to use ArrayCtrl as suggested? Smile

In fact, even creating your own widget would not be that hard. Maybe it is even better option than trying to adapt something else (simple widgets development always was U++'s primary goal).

Mirek
Re: QTF Justification [message #2630 is a reply to message #2625] Wed, 19 April 2006 13:50 Go to previous message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member
Looks like this:

http://netbsd.interq.or.jp/~lundman/ansi.jpg

If I can find a monospaced font (C2 isn't) and fix the Zoom thing it would be ok.

Not sure ArrayCtrl can do this any better?

Zooming the font is very strange behavior Smile




Wait... b&w part is monospaced - must be a convertion bug !

[Updated on: Wed, 19 April 2006 13:52]

Report message to a moderator

Previous Topic: Scrollable log window with colour text
Next Topic: RichEdit Questions
Goto Forum:
  


Current Time: Fri Mar 29 09:36:18 CET 2024

Total time taken to generate the page: 0.01813 seconds