tsc_FormControlList

This class is a list of controls/fields (tsc_Control and subclasses) that are present on a tsc_Form.  See the base class, tsc_ControlListBase, for a more complete description of this class' operation.  Obtain an instance of this class from the tsc_Form that hosts it.

Public methods

tsc_Control* Add (class tsc_Control* control);
Adds a control to the end of the list.  The control must have been allocated on the heap using new, since all controls that are present in the list will be deleted when the list destructor is called from the tsc_Form destructor.

Each control in this list must have a unique identifier; if you wish to add another field with the same identifier (eg, to display the same prompt text), then a new x_Code for the second field must be generated using AddXCode, as in the following example where X_Height is being used for two fields:

myForm.Controls.Add (new tsc_VertDistanceField (X_Height, 0.0)); 

x_Code secondHeightId = tsc_SurveyCore::AddXCode (tsc_SurveyCore::Translate(X_Height)); 

myForm.Controls.Add (new tsc_VertDistanceField (secondHeightId, 0.0)); 

This technique would not work for a third X_Height field; AddXCode() will continue to return the same x_Code.

Note that Add returns the control pointer unchanged to allow this sort of construct:

tsc_Control* mysk = Controls.Add (new tsc_SoftkeyControl (X_Measure));

Inherited from tsc_ControlListBase

See tsc_ControlListBase for further information.

bool Contains (class tsc_Control* control);
Returns true if the control is present in the list (by pointer compare).

void Remove (class tsc_Control* control);
Removes a control from the list.  The memory for the control is automatically deallocated.

void DeleteAll ();
Removes all controls from the list.  Do not call this function on an open window.  DeleteAll is called automatically during window destruction, and this will deallocate the memory for all controls in the list.

int Count();
Returns the number of controls in the list.