FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Pls provide more extensive sample code for RichTextBox

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
Lynn



Joined: 27 Aug 2004
Posts: 89

PostPosted: Tue Apr 26, 2005 10:00 am    Post subject: Pls provide more extensive sample code for RichTextBox Reply with quote

Thanks for providing the RichTextBox as part of the latest release of Dfl.

I would appreciate a more elaborate example of using this control. I suppose I am being lazy and should figure it out myself, but you are the expert and there is something to be said for having source code showing the correct way of doing things.<g>

Can your RichTextBox do the following? (and, if so, please provide an example)

Superscript, letters in black, letters in red, italics, multiline, bold, bold inside of italic, and selection highlighting. Such as.

Superscript goes here Then the developers said,"DFL is wonderful" and proceeded to astonish the world with the app they developed.

Also, I will doing Search within text, and want to highlight the found text. If you have the time, can your example also show the capability of highlighting perhaps the 10th thru 30th letters ... which spans the different font sizes.

Thanks very much. Your DFL library was the last thing I was waiting on to proceed with an application. Full speed ahead <g>
Back to top
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Tue Apr 26, 2005 12:04 pm    Post subject: Re: Pls provide more extensive sample code for RichTextBox Reply with quote

Lynn wrote:
Can your RichTextBox do the following? (and, if so, please provide an example)

Superscript, letters in black, letters in red, italics, multiline, bold, bold inside of italic, and selection highlighting. Such as.

Superscript goes here Then the developers said,"DFL is wonderful" and proceeded to astonish the world with the app they developed.

Also, I will doing Search within text, and want to highlight the found text. If you have the time, can your example also show the capability of highlighting perhaps the 10th thru 30th letters ... which spans the different font sizes.

Try this, http://www.vathix.com/d/dfl/charformat.html - temporary location because dprogramming.com apparently expired even though I had auto-renew enabled. I renewed it and see that auto-renew is in fact enabled, oh well; it'll take a day or so to propagate DNS info. Razz

RichTextBox does not yet support subscript/superscript, but I've added it to my todo list.

- Chris
Back to top
View user's profile Send private message
Lynn



Joined: 27 Aug 2004
Posts: 89

PostPosted: Tue Apr 26, 2005 12:58 pm    Post subject: Reply with quote

Works great. You're good <g>

Would you like to submit this as a DFL tutorial? ... I could do that if it would save you time, but you should be the acknowledged author.

If it helps, here is some information about superscript, but several links are more related to Visual Basic and dot.net

http://www.developerfusion.co.uk/show/2026/5/

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsrichtextboxclassselectioncharoffsettopic.asp

More Win32 Api related?

http://win32assembly.online.fr/tut33.html

http://www.codeproject.com/useritems/fontDraw.asp

Again, if it would help, I've still got a fair number of "legacy points" from ExpertsExchange, which used to be VERY helpful getting technical questions answered. I suppose I could also look around inside wxWidgets and/or the MFC source code to see how that code accomplishes superscript.

Or you may already know how to do superscript ...
Back to top
View user's profile Send private message
jcc7



Joined: 22 Feb 2004
Posts: 657
Location: Muskogee, OK, USA

PostPosted: Tue Apr 26, 2005 4:53 pm    Post subject: Re: Pls provide more extensive sample code for RichTextBox Reply with quote

Vathix wrote:
Lynn wrote:
Can your RichTextBox do the following? (and, if so, please provide an example)

...

Try this, http://www.vathix.com/d/dfl/charformat.html
Wow, that's cool! I was thinking of something like...

Code:
{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033
{\\fonttbl{\\f0\\froman\\fprq2\\fcharset0 Times New Roman;}
{\\f1\\froman\\fprq2\\fcharset0 Garamond;}{\\f2\\fswiss\\fprq2\\fcharset0 Verdana;}}
{\\colortbl ;\\red255\\green255\\blue0;\\red0\\green0\\blue0;\\red0\\green255\\blue255;
\\red128\\green128\\blue128;\\red255\\green0\\blue0;\\red0\\green255\\blue0;\\red0\\green0\\blue255;
\\red255\\green255\\blue255;}
\\viewkind4\\uc1\\pard\\qc\\cf1\\b\\i\\f0\\fs72 Win32 GUI\\cf2\\f1\\par
\\cf8\\fs20 Sample Application
\\par\\cf3\\fs36 D Win32 Application based on\\par BCX Built-in GUI Functions\\cf4\\i0\\f2
\\par\\cf5\\ul\\b0 D\\cf6 E\\cf7 M\\cf1 O\\cf4\\ulnone
\\par\\par\\cf8\\fs20 Ported to D by jcc7\\par\\cf8\\fs20 April 26, 2005
\\par\\par\\cf8\\fs20 My D page:\\par\\cf8\\fs20 http://jcc_7.tripod.com/d/\\cf4\\par}
but you method looks a lot better. Wink
Back to top
View user's profile Send private message AIM Address
Lynn



Joined: 27 Aug 2004
Posts: 89

PostPosted: Tue Apr 26, 2005 6:28 pm    Post subject: Reply with quote

Quote:
because dprogramming.com apparently expired even though I had auto-renew enabled. I renewed it and see that auto-renew is in fact enabled, oh well; it'll take a day or so to propagate DNS info.


Something to consider. I've found it quite easy to get a SourceForge project approved. They provide quite suitable webhosting for free for approved projects. I think their reliability was so-so years ago, but seems to have improved.

Who do you use for web-hosting? I've had good experience with www.godaddy.com for actually registering ($8.95/yr) a domain and simple webhosting for $3.95/month. You can register a domain name and have it point to the sourceforge hosting to avoid paying for webhosting.

HTH
Back to top
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Sun May 22, 2005 6:26 am    Post subject: Reply with quote

Sorry, somehow I didn't see those last 2 messages until now.

Today's snapshot supports subscript and superscript, http://www.dprogramming.com/dfl/snapshots/ - see the charformat example, also available at http://www.dprogramming.com/dfl/charformat.html .

Lynn wrote:
Who do you use for web-hosting? I've had good experience with www.godaddy.com for actually registering ($8.95/yr) a domain and simple webhosting for $3.95/month. You can register a domain name and have it point to the sourceforge hosting to avoid paying for webhosting.

Was using 1and1, $30 for 6 months; but recently got a VPS that gives me a lot of control. The domain expiring was just an accident.

- Chris
Back to top
View user's profile Send private message
Lynn



Joined: 27 Aug 2004
Posts: 89

PostPosted: Sun May 22, 2005 6:54 am    Post subject: Reply with quote

Wow! ... Tabs ... I'll give them a try.

And thanks also for the Rtf superscript!
Back to top
View user's profile Send private message
mitja



Joined: 18 Feb 2005
Posts: 19

PostPosted: Mon Aug 29, 2005 3:45 am    Post subject: Reply with quote

Hi!

Could you please explain how to align text which is in at least 2 columns?
I used the code for aligning I had for console version of the app, but unlike in console, where fonts are differently displayed, this code doesn't work too well.
I would like to have the data in the second column aligned under the first datum (Dan Brown). So it would look more like a table.
How do I achieve this?

Back to top
View user's profile Send private message
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Mon Aug 29, 2005 7:03 am    Post subject: Reply with quote

mitja wrote:
Hi!

Could you please explain how to align text which is in at least 2 columns?
I used the code for aligning I had for console version of the app, but unlike in console, where fonts are differently displayed, this code doesn't work too well.
I would like to have the data in the second column aligned under the first datum (Dan Brown). So it would look more like a table.
How do I achieve this?


Using the Win32 API this is how I'd do it ...

Two quick methods are to use fixed width fonts, but often that doesn't look so pretty, and the other is to define your own tabstop locations and use tabs.

To set tabstops, you need to create and initialize a PARAFORMAT struct with the PFM_TABSTOPS mask, set the cTabCount to 1 and store the absolute tabstop position (in 1000ths of inches) in the rgxTabs array. Finally send the EM_SETPARAFORMAT message with lParam containing the address of the PARAFORMAT struct. Clean up after yourself and then inserts tabs into the data stream to create the effect of a 2-column table.
_________________
--
Derek
skype name: derek.j.parnell
Back to top
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Thu Sep 01, 2005 5:46 am    Post subject: RTF tables Reply with quote

Or you could try making an actual table using RTF: http://msdn.microsoft.com/library/en-us/dnrtfspec/html/rtfspec.asp - here's some example code in ASP: http://www.devx.com/asp/Article/17964/1763/page/3 - RTF can be set in DFL using the rtf or selectedRtf properties.
Would be cool to have code that generated RTF tables based on some set properties.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group