Changeset 538 for Registry/Demo/UFormMain.pas
- Timestamp:
- Aug 6, 2019, 1:55:55 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Registry/Demo/UFormMain.pas
r392 r538 17 17 AConnectionDelete: TAction; 18 18 AConnectionModify: TAction; 19 AValueAdd: TAction; 20 AValueEdit: TAction; 21 AValueDelete: TAction; 19 22 AImport: TAction; 20 23 AExport: TAction; … … 25 28 MenuItem2: TMenuItem; 26 29 MenuItem3: TMenuItem; 30 MenuItem4: TMenuItem; 31 MenuItem5: TMenuItem; 32 MenuItem6: TMenuItem; 33 PopupMenu1: TPopupMenu; 27 34 Splitter1: TSplitter; 28 35 StatusBar1: TStatusBar; 29 36 TreeView1: TTreeView; 37 procedure AValueAddExecute(Sender: TObject); 30 38 procedure FormShow(Sender: TObject); 31 39 procedure ListView1Data(Sender: TObject; Item: TListItem); … … 33 41 function RegValueToString(Name: string): string; 34 42 procedure LoadNode(Node: TTreeNode; Key: TRegKey); 43 procedure ReloadTreeNode(Node: TTreeNode; Reg: TGeneralRegistry); 35 44 public 36 45 procedure ReloadValues; … … 75 84 ReloadKeys; 76 85 ReloadValues; 86 end; 87 88 procedure TFormMain.AValueAddExecute(Sender: TObject); 89 begin 90 // Core.ActiveRegistry.Write; 77 91 end; 78 92 … … 120 134 end; 121 135 136 procedure TFormMain.ReloadTreeNode(Node: TTreeNode; Reg: TGeneralRegistry); 137 var 138 Keys: TStrings; 139 I: Integer; 140 NewNode: TTreeNode; 141 begin 142 Keys := TStringList.Create; 143 Reg.GetKeyNames(Keys); 144 for I := 0 to Keys.Count - 1 do begin 145 NewNode := Node.TreeNodes.AddChild(Node, Keys[I]); 146 Reg.OpenKey(Keys[I], False); 147 ReloadTreeNode(NewNode, Reg); 148 end; 149 Keys.Free; 150 end; 151 122 152 procedure TFormMain.ReloadKeys; 123 153 var 124 154 NewNode: TTreeNode; 125 155 begin 156 TreeView1.Items.Clear; 126 157 NewNode := TreeView1.Items.AddChild(nil, 'Local computer'); 158 ReloadTreeNode(NewNode, Core.ActiveRegistry); 159 NewNode.Expand(True); 127 160 end; 128 161
Note:
See TracChangeset
for help on using the changeset viewer.