Type: | Submodule | Parent Module: | ModuleCMethods |
Module | Submodule_Methods_HideDisab |
Version / Date | Version 2.2 - 23rd January 2002. |
Author (Organisation) | Kevin Gale (Newcastle Computer Services Plc) |
keving@ncs-plc.co.uk |
This submodule converts certain commands that use tab order to manipulate fields on windows with equivalent notation commands. If possible the field will be referenced using its $name property. If a number of fields are manipulated using a range (say field number 6 to 9) then if the range does not exceed a preset threshold, then the command will be converted to reference each field within the range. Otherwise the notation method "$sendall" is used to manipulate fields within a From and To range of $order. Note that this approach has the disadvantage that changing the tab order of the fields on the window will have an effect on the fields modified by the notation command whereas the first 2 approaches remove this dependency.
Search for the following commands in methods:
Process any line of code found that contains one of these commands. The aim is to replace existing commands that use the $order property to reference a field with the name of the field.
Process the code line as follows:
For a command that is simple and where the numerical difference between the "To" and "From" fields is less than a threshold held in an instance variable called "iExpandOrderLimit", look up the name of all referenced fields using the $order property of each.
If the command refers to a single field using its $order property, then convert the command to use a notation command of the form "Do $cinst.$objs.myField.$enabled.$assign(kTrue)" to set the appropriate property.
If the command refers to a range of fields their $order property and the range does not exceed the threshold, then convert the command to use a appropriate command that refers to each field by $name.
For example "Enable fields OBSOLETE COMMAND 2 to 4" might be converted to "Enable fields {myField2,myField3,myField4}".
If the command uses an expression or a range that exceeds the threshold then convert the command to use a notation command of the form "Do $cinst.$objs.1001.$enabled.$assign(kTrue)" to set the appropriate property.
For command that use complex parameter, calculations, square bracket notation or a range of field numbers that exceeds the threshold, use a notation command of the form "Do $cinst.$objs.$sendall($ref.$visible.$assign(kFalse),($ref.$order>=lFromField)&($ref.$order<=lToField)"
In cases where only a complex "From" parameter has been used the notation command would be of the form "Do $cinst.$objs.$sendall($ref.$visible.$assign(kFalse),$ref.$order=lFromField)"