|
35 | 35 | GroupBox1: TGroupBox; |
36 | 36 | StringGrid1: TStringGrid; |
37 | 37 | Procedure Button3Click(Sender: TObject); |
| 38 | + Procedure Button4Click(Sender: TObject); |
| 39 | + Procedure Button5Click(Sender: TObject); |
38 | 40 | Procedure FormCreate(Sender: TObject); |
39 | 41 | private |
40 | 42 |
|
|
70 | 72 | StringGrid1.Cells[1, i + 1] := inifile.ReadString('FileAssociations', 'cmd' + inttostr(i), ''); |
71 | 73 | StringGrid1.Cells[2, i + 1] := inifile.ReadString('FileAssociations', 'Params' + inttostr(i), ''); |
72 | 74 | End; |
| 75 | + StringGrid1.AutoSizeColumns; |
73 | 76 | End; |
74 | 77 |
|
75 | 78 | Procedure TForm7.SaveTo(Const Inifile: TIniFile); |
|
105 | 108 | StringGrid1.Cells[0, index] := form8.Edit1.Text; |
106 | 109 | StringGrid1.Cells[1, index] := form8.Edit2.Text; |
107 | 110 | StringGrid1.Cells[2, index] := form8.Edit3.Text; |
| 111 | + StringGrid1.AutoSizeColumns; |
108 | 112 | End; |
109 | 113 | End; |
110 | 114 |
|
| 115 | +Procedure TForm7.Button4Click(Sender: TObject); |
| 116 | +Begin |
| 117 | + // Edit |
| 118 | + If StringGrid1.Selection.Top > 0 Then Begin |
| 119 | + form8.InitWith(StringGrid1.Cells[0, StringGrid1.Selection.Top], |
| 120 | + StringGrid1.Cells[1, StringGrid1.Selection.Top], |
| 121 | + StringGrid1.Cells[2, StringGrid1.Selection.Top] |
| 122 | + ); |
| 123 | + If form8.ShowModal = mrOK Then Begin |
| 124 | + StringGrid1.Cells[0, StringGrid1.Selection.Top] := form8.Edit1.Text; |
| 125 | + StringGrid1.Cells[1, StringGrid1.Selection.Top] := form8.Edit2.Text; |
| 126 | + StringGrid1.Cells[2, StringGrid1.Selection.Top] := form8.Edit3.Text; |
| 127 | + StringGrid1.AutoSizeColumns; |
| 128 | + End; |
| 129 | + End; |
| 130 | +End; |
| 131 | + |
| 132 | +Procedure TForm7.Button5Click(Sender: TObject); |
| 133 | +Begin |
| 134 | + If StringGrid1.Selection.Top > 0 Then |
| 135 | + StringGrid1.DeleteRow(StringGrid1.Selection.Top); |
| 136 | +End; |
| 137 | + |
111 | 138 | End. |
112 | 139 |
|
0 commit comments