There was one shortcoming in my Delphi IDE explorer that has irked me since the beginning: It was disabled while a modal dialog was shown in the IDE, so there was no way to inspect the controls on the current dialog. The option to follow the focus ameliorated this a bit because it was now … Continue reading Enabling a form while another form is being shown modally
Day: April 9, 2016
Do not enumerate on TTreeNode.Item
Note to self: Do not enumerate on TTreeNode.Item, it's highly inefficient. Consider this code: [delphi] procedure SelectFocusedControl(_ActCtrl: TWinControl; _Parent: TTreeNode); var j: Integer; CtrlItem: TTreeNode; begin for j := 0 to _Parent.Count - 1 do begin CtrlItem := _Parent.Item[j]; if CtrlItem.Data = _ActCtrl then begin CtrlItem.Selected := true; break; end else SelectFocusedControl(_ActCtrl, CtrlItem); end; end; … Continue reading Do not enumerate on TTreeNode.Item