Index of Sample Applications With Source Code
Hello all and welcome to the freshest edition of the TX Text Control Newsletter! As promised in last weeks' edition we have created an index of all of sample applications we have published in this newsletter over the past six months. Naturally, every week this index will be updated to reflect the new sample applications that we copy onto our web server. Please have a look for yourself.
Here you can read a brief description of what a certain sample actually does and you can download runnable Visual Basic and / or Delphi code, so that you can see the sample in action. Please feel free to change the code as you wish - it is there to help you learn how to use TX Text Control.
Do not forget that if you wish to talk to other TX Text Control users, you can post questions and participate in discussions in the TX Text Control Discussion Forum 24 hours a day, seven days a week. The Discussion Forum is there to help you and to help you help others!.
Top TX Tip: Letter Wizard Part 2
This week we are continuing with the second part of our Letter Wizard. (The first part is available here.)
The next step of our sample application involves inserting fields as Marked Text Fields so that we can change what we have inserted at a latter point in time. Only once we have implemented this feature is our Letter Wizard really usable.
When we are done, you will be able to open a dialog box, enter data into the pre-defined fields, click on a button and then the data that you entered will be inserted into the letter. However, as we are now dealing with Marked Text Fields, you will be able to add, expand and remove all the data fields at will at any point after the data has been inserted.
The Field_Insert() function inserts the fields from the dialog box into the active Text Control - i.e. into your letter. Once we have done that, the function Field_Merge() fills out these fields with the data that we entered into the dialog box. Fields which are not filled out in the dialog box are still inserted, but with empty strings, so that they can get a value later on.
To simply the processing of the single fields we have built in another feature to our example: By clicking with the right mouse button on one of the Marked Text Fields, a pop-up menu appears which shows all the possible values for that field. Selecting one of them inserts that value in to the currently active document.
We used the MouseDown event to create this example. Here is the Visual Basic code:
Private Sub TXTextControl1_MouseDown(Button As Integer, Shift As
Integer, X As Single, Y As Single)
If Button = 2 Then
TXTextControl1.SelStart = TXTextControl1.InputPosFromPoint(X, Y)
FieldId = TXTextControl1.FieldAtInputPos
If FieldId = 0 Then Exit Sub
TXTextControl1.FieldCurrent = FieldId
If TXTextControl1.FieldData(FieldId) = "closing" Then
Form1.PopupMenu mnu_closing, , X, Y
If TXTextControl1.FieldData(FieldId) = "salutation" Then
Form1.PopupMenu mnu_salutation, , X, Y
If TXTextControl1.FieldData(FieldId) = "reference_line" Then
Form1.PopupMenu mnu_reference, , X, Y
If TXTextControl1.FieldData(FieldId) = "mailing_instructions" Then
Form1.PopupMenu mnu_instructions, , X, Y
If TXTextControl1.FieldData(FieldId) = "attention" Then
Form1.PopupMenu mnu_attn, , X, Y
We use FieldAtInputPos to find out where the mouse currently is. If it is over one of our Marked Text Fields, a pop up menu is opened which contains all the possible entries for that field.
As usual, you can download the entire code and runnable example.
Free Advertising For Your TX Text Control Application
For you long-time TX users, I guess you are getting fed up of reading about this, but as there are more than 1400 new TX Text Control Newsletters readers per month, I do have to repeat this about once a month. Please do not despair!
So, to all you new to TX Text Control: We would like to give you the opportunity of free advertising for your TX Text Control based product on our web site.
All we ask is that you send us your text, as well as a few screenshots detailing how you used TX Text Control in your software application and within about two days of receiving this material, we will add your story, along with your logo and your name to our sample application pages.
So far we have had a terrific response to our request for sample TX Text Control applications from the hard core TX users, but I am know there are thousands of other TX based applications out there - all of which should be added to the sample application page. Just send me a short text, explaining how you used TX Text Control to implement your application and you get free advertising for this product on our web site. I'm looking forward to receiving your material!
Worthwhile Site: Links4News.com
The team of Links4News.com surfs the Internet continuously in order to find and categorize the best Internet- and Ecommerce-related news-sites. Links4News.com feels that people should be offered only relevant information so that you can do more in less time. By visiting Links4News.com on a daily basis you will stay informed on the best and latest news surrounding developments in the New Economy. If you want to keep up with new sites, categories, "The Site Of The Week" and many other items then subscribe to our Newsletter right now. It's Free! See you soon on http://www.links4news.com.
The Newsletter Team