Welcome to Foxite.COM Community Weblog Sign in | Join | Help



Enhanced RTF Tool Revealed

I have finished isolating the RTF control from my project so I am now giving it to you as a basis or for whatever you may want to do with it.

Some more features I have not mentioned earlier is "hot tracking" inside RTF.  It means that when you clicked on a text inside the RTF control, it will show you the formatting it currently has like Bold, Italic, Underline, Alignment (Justification), Font Name, and Font Size; by changing the appearances of the respective buttons above the RTF control.  In addition, the color bar will also show the current color of a selected text inside the RTF.

I also have removed the conversion to PDF format of the RTF contents as this is dependent on the pdf printer which may or may not be installed on your unit.  To see how it can be done in my preference, please read "Am I being too persistent?" blog (lower part).


There are many things we can do more with this tool but I will leave the rest of other enhancements with your own imaginations.

Notes:

1.  This tool needs Richtx32.ocx (RTF Control)  which is part of VFP installation.  So I expect that you have that installed on your machines (under \windows\system32).  If you don't have that one, you can surf the web and place it in the folder where the exe is.  Then register it on your unit via this command:  regsvr32 richtx32.ocx

2.  This tool also uses ToClipboard() function which I have used in the image insertion.  That function utilizes "System.App" which can be sourced on the VFPX website so if you don't have it yet, that image insertion feature will not work.  Better get it on the abovementioned site if you still haven't have that one.  You should also place that in the folder where your exe is.

3.  I employed anchoring on objects here so if you are using a VFP without that feature yet, just remove those (if it is not autoremoved for you) for it to function properly.





And as promised, since this is an open source, you will also have the cool bitmap images I have pieced together.  Again, attachment is redirected  due to the same reason that I wanted to know how many downloads it will have.  So get it from  here.  Enjoy!

Added Notes (November 22, 2009):
  • Backspace is using KeyAscii of 8 which is the same value of Ctrl+H which I used in image insertion on the sample.  So pressing Backspace anytime activates that Image Insertion button.  To fix it, you can either disable the shortcut in the Keypress Event of the RTF object (look for IF keyascii = 8 && Ctrl+H) or you can try using another key combination for the image insertion button.
  • The property of the RTF HideSelected should be .F. so that the selection does not disappear when you lose focus by clicking on a button.
Thanks to Bernard Bout for these useful tips and findings.





Published Saturday, November 21, 2009 3:29 AM by sandstorm36
Filed Under: , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Enhanced RTF Tool Revealed

Friday, January 08, 2010 6:08 PM by Ehsan Abidi Ashtiani(EsiKhoob)
Thank you for sharing your software.

If you read the VFP9 Help for AutoYield  , it says to put:
_vfp.AutoYield = .F.
when you use ActiveXs.
so I put it at your program , and some of my problems has solved( Right_to_left languages like Farsi or Arabic)

#No, I haven't read that.  Thanks for sharing that.  Others who might experience some problems on ActiveX will find this useful

What do you think?

(required) 
required 
(required)