This is a special version of the standard TTASEnter object. Using this object you can allow the user to enter a value 'normally', and/or by chaining to a program routine when the user clicks on the button.
PALETTE ICON & EXAMPLE
PROPERTIES
The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.
Appearance
Glyph | If you have chosen a custom glyph in GlyphKind below this is where you would choose the .bmp file that would be used instead of the standard ones that come with this object. |
Behavior
Entry
Font
Hint
Misc
Other
AutoSelect | If this property is checked (True) when the user activates this object, either by clicking on it, pressing the TAB key, or executing the FOCUS command, any Text that is currently displayed will be marked as selected. The user will be able to enter a new value just by typing. If the user wants to start at a certain character they will have to move the edit cursor to that character with the mouse or arrow keys. Default value is True. This can be changed at runtime. |
ButtonHint | This is the hint that will be displayed to the user when they hover over the button that displays the calendar. This can be changed at runtime. |
ButtonWidth | The size of the button in pixels. Defaults to 20. This can be changed at runtime. |
CharCase | Use this property to determine what case the characters will be entered in. To force upper case use ecUpperCase, to force lower case use ecLowerCase and to allow either use ecNormal. The default value is ecNormal. This property can be modified during runtime. The values are defined in COMPILERCONSTANTS.TXT. |
ClickKey | Choose the key stroke the user can use to have the same effect as clicking the button. This would be in addition to clicking the button. The default value is Alt+Down (alt key + down arrow). |
DirectInput | If this is clicked (set to .True.), the user will be able to enter the text directly. If this is not clicked (set to .False.) the only way they will be able to set the text value is to click the button and have the routine that is called set the Text value. The default is checked. This can be changed during runtime. |
EditMask | This will control the structure of the field that can be entered. An Edit Mask Property Editor can be accessed by clicking on the button in the property field. |
NOTE: If you specify an EditMask value the Change event will be ignored.
GlyphKind | This will determine what appears on the button in this object. The options are: gkCustom (this will use what ever you have chosen in the Glyph property above), gkDefault (the default value, displays a blank button), gkDropDown (a standard drop down arrow glyph), gkEllipsis (a standard ellipsis glyph). |
MaxLength | The maximum number of characters the user can enter for this object. If you have connected this to a field in your program with the FieldName property then this will be set automatically when the program runs to the size of the field. |
NumGlyphs | If you have two glyphs that can be displayed, one normally, and the second when the user clicks the button, then this would be two. The default value is one. |
SelectStart | This property allows you to set the location of the cursor within the text window. The primary purpose of this property is to reset the text line within the object window. If the user exits the object and the text line is longer than the window and the beginning of the text line is hidden, you can force the text line to redisplay from the beginning by setting this property to 0. |
Text | This is the actual data that has been entered by the user or that comes from the field value if this is attached to a field in your program. The value can be accessed during runtime and is automatically updated if you have set the FieldName property value. The property value will also be saved automatically to the field when the user moves to the next object. You can also set this property during the routine that is executed when the user clicks the button. |
Position
TAS Pro
AllowedChrs | You can specify the characters that are allowed to be entered for this object. Do not separate the values with commas, for example, if you want to allow A, B and C only you would make this property: ABC. Default value is blank. This can be changed at runtime. |
DfltValue | This value will be inserted automatically into the field if the field is blank when the object is chosen on the form. If you want to use a constant value surround the value in quotes, e.g., 'ABC' or '100.50' etc. If you want to use a field, then just put in the field name. The default value is blank. This can be changed during runtime. |
NOTE: You can't use an expression here. However, this is a perfect use of the VALUE option in the DEFINE field command. Just define a field, set the VALUE option to what ever expression you want to use, and put that field name into the DfltValue property.
FldModified | NOTE: This is a runtime only property and will not show up in the Object Inspector. |
EVENTS
This object has events that are called depending on what the user does. The events are routines in your program that may return a value (generally .True. or .False.) or just alert your program that something is happening. An event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (listed below). For example, the Change event below would be: ObjectName.Change:
Change | This event is called every time the user makes a change to the data of this object. That includes entering a new character, deleting a character, etc. Each time this event is executed the field that is attached to this object through the FieldName property is updated so that you can check the characters entered, modified, etc. through the field. Be cautious about using this since it will slow down the entry process. |
NOTE: If you enter a value for the EditMask the Change event will be ignored.
Click | This event is called if the user clicks the button on the object. |
Disp | This event is called when the field that is attached to the object is to be refreshed on the screen. This can happen when a record is read, after a calculation, etc. |
Post | This event is called when the user moves from the current object to another. By default this event will return .True. If you return .False. This will keep the user from leaving this object. This will stop the process from continuing, This can be used to make sure settings are proper after leaving the object. To force the user to stay on the current object, if there is a problem, you may also use the Valid event instead of this. |
Pre | This event is called when the user moves into an object. If you use this event you must return .True. or .False. when you return (RET) from the routine. If you return .True. the user is allowed to access the object. If you return .False. the object that was active before they got to this object will get the focus again. This keeps the user from accessing an object that you don't want to be active. Commonly used in application where some fields are accessible sometimes (RET .TRUE.) and aren't others (RET .FALSE.). |
The process by which these events are called is:
Pre - This occurs when focus changes to the object.
Change - During field entry.
Post - Called after Valid returns .True. (if there is a Valid event) and before the Pre for the next object.
Disp - Is called anytime the form/object is refreshed.
Click - Is called anytime the user clicks the button.
Page url: http://www.cassoftware.com/tas/manual/ttascomboenter.htm