Use this object to put a mini-word processor on your form. This is similar to the TMemo object, except that it's connected to a field in a data file.
PALETTE ICON & EXAMPLE
The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.
|WordWrap||This would normally be checked (set to .True.) so that the lines the user enters will be wrapped automatically. If you set this to .False. (unchecked) the lines will scroll to the left as the user enters characters that would stretch beyond the edge of the object.|
|Lines||This a string list that contains the lines that make up the memo. When you read a record that has a memo field attached that value will show up in this object automatically. Also, when you save the record, if there is anything in this object it will be saved to the record.|
|MaxLength||If you want to limit the number of characters that can be entered you would put that number here. If it is set to 0 there is no limit. This can be changed during runtime.|
|ScrollBars||You would set this option to attach scroll bars to the memo area. This will allow the user to move the memo easily if they exceed the space available. The options are: ssBoth (both vertical and horizontal scroll bars), ssHorizontal (horizontal scroll bars only), ssNone (no scroll bars, in this case the user would use up/down and left/right arrows to move around the memo if it exceeds the size available) and ssVertical (vertical scroll bars only). The default value is ssNone. If you check the WordWrap property (set to .True.) then you may not need horizontal scroll bars at all.|
|WantReturns||If you want to allow the user to enter returns (separate sections of the memo) then this should be checked. This is the default value.|
|WantTabs||If you want to allow the user to enter tabs then this should be checked. This is the default value.|
|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.|
NOTE: In the case of the TTASMemo this property works a little differently. Each time the user enters the object, the object makes a copy of what's presently there. Then, if you access this property, the stored version is compared to the current value. If it's different this property returns True, if not, it returns False. When the user enters the object the next time a copy will again be made and that will be compared when this property is checked. Also, when you check this property, if the field has been changed, and there is an attached field (FieldName above other than NONE), that field will be updated at the same time.
NOTE: If you place a TTASMemo object on a TPanel object you will no longer be able to set the TabOrder for the TTASMemo. It will look to you like it's the only object on the TPanel, even if there are others.
NOTE: If you check the ReturnIsTab option you will not be able to enter returns in the TTASMemo regardless of your setting in WantsReturns. Each time the user presses the ENTER key the program will move to the next object in the TabOrder list.
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 Text 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.|
|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.