Procedure

ResetControl

Module

fODBase

Last Modified

7/15/2014 3:26:40 PM

Comments

Clears text, deselects items, does not remove listbox or combobox items

Scope

Interfaced

Declaration

procedure ResetControl(AControl: TControl);

Called-By Hierarchy


                                 ResetControl
               TfrmODMedIn.ResetOnMedChange┤ 
                  TfrmODMedIn.SetupDialog┤ │ 
          TfrmODMedIn.cboMedicationSelect┘ │ 
               TfrmODMedIn.CheckFormAlt┘   │ 
          TfrmODMedIn.cboDispenseExit┤     │ 
    TfrmODMedIn.cboDispenseMouseClick┘     │ 
 TfrmODMedIn.cboMedicationSelect...┘       │ 
              TfrmODMedOut.ResetOnMedChange┤ 
                 TfrmODMedOut.SetupDialog┤ │ 
         TfrmODMedOut.cboMedicationSelect┘ │ 
              TfrmODMedOut.CheckFormAlt┘   │ 
         TfrmODMedOut.cboDispenseExit┤     │ 
   TfrmODMedOut.cboDispenseMouseClick┘     │ 
TfrmODMedOut.cboMedicationSelect...┘       │ 
              TfrmODMedNVA.ResetOnMedChange┘ 
                  TfrmODMedNVA.InitDialog┤   
                TfrmODMedNVA.FormCreate┘ │   
              TfrmODMedNVA.btnSelectClick┤   
              TfrmODMedNVA.UMDelayClick┘ │   
            TfrmODMedNVA.CheckFormAltDose┘   
            TfrmODMedNVA.cboDosageClick┘     
           TfrmODMedNVA.cboDosageExit┘       

Called-By

Name Declaration Comments
TfrmODMedIn.ResetOnMedChange procedure ResetOnMedChange; -
TfrmODMedOut.ResetOnMedChange procedure ResetOnMedChange; -
TfrmODMedNVA.ResetOnMedChange procedure ResetOnMedChange; -


Source

283   procedure ResetControl(AControl: TControl);
284   { clears text, deselects items, does not remove listbox or combobox items }
285   begin
286     if AControl is TLabel then with TLabel(AControl) do Caption := ''
287     else if AControl is TStaticText then with TStaticText(AControl) do Caption := ''
288     else if AControl is TButton then with TButton(AControl) do Caption := ''
289     else if AControl is TEdit then with TEdit(AControl) do Text := ''
290     else if AControl is TMemo then with TMemo(AControl) do Clear
291     else if AControl is TRichEdit then with TRichEdit(AControl) do Clear
292     else if AControl is TListBox then with TListBox(AControl) do ItemIndex := -1
293     else if AControl is TORComboBox then with TORComboBox(AControl) do
294     begin
295       Text := '';
296       ItemIndex := -1;
297     end
298     else if AControl is TComboBox then with TComboBox(AControl) do
299     begin
300       Text := '';
301       ItemIndex := -1;
302     end;
303   end;