Now Available!

Native .Net
Components

TList WinForms
for
.Net Framework

&

MetaDraw WinForms
for
.Net Framework



Bennet-Tec
Components
Make you
look sharp!



Home

Company

Products

Order Forms

How To

Downloads

Updates

Support

Registration

Dependencies

Links

Compatibility

Site Map


Basic How To


How To Build a Hypertext Application

View On-Line Sample
Return to main How To Page

ALLText HT/Pro has been specifically designed to include features for the support of Hypertext systems. Specifically we have added the following Hypertext supporting enhancements to our standard ALLText product.

  1. The ability to assign a hypertext tag phrase to any string. The general idea is to create a select region, and assign a Tag number using the HTag property. Any string with an assigned tag is now a hot phrase and will be supported by the MouseHPointer, the Find_HTag function and the ATXChange event.
  2. The ability to assign a different mouse pointer which will automatically be displayed when passing over any hypertext tagged region. The MouseHPointer property determines which mouse pointer will be associated with hypertext regions.
  3. The ability to use ALLText as a bound control. ALLText HT/Pro is a data aware control. This means that you can use the data control to move between records, automatically updating the content of the ALLText control. One way to make use of this is to use the HTag value of any tagged phrase as a keyed index in a database. When a user double clicks on a tagged phrase, moving to the record pointed to by this value and display the new information.
  4. The ability to take action when a user moves his cursor into a tagged phrase. The ATXChange event is triggered whenever the cursor moves into or out of a tagged phrase. The event parameters include the HTag value of both the previous and current region.
  5. The ability to find a given hypertext phrase via the tag number. The Find_HTag function allows you to jump forward to any hypertext phrase.

ALLText HT/Pro was designed largely to address the needs of a large section of our users for Hypertext design functionality. To this end ALLText HT/Pro is a bound control, and supports hypertext tagging.

Selecting a phrase and then setting ALLText HT/Pro`s HTag property (ALLText1.HTag=22) creates a tagged region associated with a tag value. You can easily read off that tag value at any time, such as during a double click event when you may wish to use the value to pop up a definition window, move to a new document, or even initiate some other program.

Tagged phrases are automatically sensed when moving the cursor or the mouse. When moving the mouse over a HyperText tagged region, the mouse pointer will automatically change from that specified by the MousePointer property to that specified by ALLText`s MouseHPointer property. Depending on the ChangeEventMask property, the movement of the cursor into or out of a tagged area may also generate an ATXChange event. Mouse movements will also trigger this event once MousePointer and MouseHPointer properties have been set to distinct values.

The Find_HTag function (make sure you have included the constants definition file in your project to capture this function declaration) may be used to locate and move to a given occurrence of a tagged region, or to select the entire current hypertext phrase (if the cursor is positioned within such a phrase).

Sub ALLText1_Click()

If HTag = 0 then exit sub

' select the current tagged phrase.

x% = ALLText1.FindHTag(TagNumber, 0)

End Sub

Note that Tagging may also be useful in other applications - For example you may wish to create a Write Protected field. Simply tag the field with a value and either set the writeprotect value during the ATXChange event as the user enters or leaves the field, or check the Tag value during trap key press events to determine whether to allow a particular action. Using different tags will even allow you to create regions accessible for editing by different authors in a Multi-Author environment.

HTAG Property

The HTag property associates an integer valued Hypertext Tag with a string within ALLText. It is set and read in a manner analagous to Font properties (FontBold, etc). This is very useful for Hypertext applications, and in fact mouse movements over HTagged text may result in ATXChange events (depending on the ChangeEventMask property) and will trigger a change in the MousePointer to that defined by the MouseHPointer property.

Setting ALLText.Htag=x& assigns a tag value of x& to the selected area. If no selection is active (ALLText.Select is FALSE) then the tag value is assigned to any characters then typed by the end-user at that location. The tag value can not however remain without a character to be assigned to - Setting HTag without selected text and then changing the cursor location invalidates the tag.

Reading x&=ALLText.Htag returns the tag value to the Right of the caret (use HTagL to get the value to the left), or if text is selected, returns the tag value of the selected text. If the current selection covers more than one tag value, then the property returns a value of ATX_TAG_UNDEFINED (0x80000000).

Access:

Runtime only, Read/Write

Remarks:

Setting a HTag value other than 0 creates a Hypertext region. The mouse displayed over such a region is controlled via the MouseHPointer property. Moving into or out of such a region triggers the ATXChange event.

Specific Tagged regions may be found using the Find_HTag function.

Setting a HTag value of 0 undoes these effects.

Note that reading the HTag value may also extend the selection if the TagReadSelect property is set to 1. If no text is selected and current position is within some tag area then the tagged area is automatically selected. Also a selection contains only one tag value and previously spanned only a portion of the text with that value, then reading HTag with the TagReadSelect property will automatically extend the selection to include the full contiguous region with that tag value. No extension to the selected region occurs if the initial selection included text of varied tag values or if the tag value of the selected text is 0.


Copyright© 2003 Bennet-Tec Information Systems, Inc. All rights reserved.