Procedure

TfrmReminderTree.LinkTopControls

Module

fReminderTree

Last Modified

7/15/2014 3:26:38 PM

Visibility

Protected

Owner

TfrmReminderTree

Declaration

procedure LinkTopControls(FromTree: boolean);

Called-By Hierarchy


   TfrmReminderTree.LinkTopControls
TfrmReminderTree.RemindersChanged┤ 
    TfrmReminderTree.FormCreate┤ │ 
   TfrmReminderTree.FormDestroy┘ │ 
          TfrmReminderTree.Resync┘ 
   TfrmReminderTree.lbRemChange┤   
    TfrmReminderTree.tvRemClick┤   
TfrmReminderTree.tvRemKeyDown┘ │   
   TfrmReminderTree.tvRemChange┘   

Called-By

Name Declaration Comments
TfrmReminderTree.RemindersChanged procedure RemindersChanged(Sender: TObject); -
TfrmReminderTree.Resync procedure Resync(FromTree: boolean); -


Source

157   procedure TfrmReminderTree.LinkTopControls(FromTree: boolean);
158   var
159     idx: integer;
160   
161   begin
162     if(not FLinking) then
163     begin
164       FLinking := TRUE;
165       try
166         if(FromTree) then
167         begin
168           if(assigned(tvRem.Selected)) then
169           begin
170             idx := lbRem.Items.IndexOfObject(tvRem.Selected);
171             lbRem.ItemIndex := idx;
172             tvRem.Selected := TTreeNode(lbRem.Items.Objects[lbRem.ItemIndex]);
173             tvRem.SetFocus;
174           end
175           else
176             lbRem.ItemIndex := -1;
177         end
178         else
179         begin
180           if(lbRem.ItemIndex < 0) then
181             tvRem.Selected := nil
182           else
183             begin
184               tvRem.Selected := TTreeNode(lbRem.Items.Objects[lbRem.ItemIndex]);
185               tvRem.SetFocus;
186             end;
187         end;
188       finally
189         FLinking := FALSE;
190       end;
191     end;
192   end;