mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Focus new node in parameters list after clicking "Add". Also, add new parameters at the focused tree position. See http://www.heidisql.com/forum.php?t=11132.
This commit is contained in:
@ -215,14 +215,20 @@ end;
|
|||||||
procedure TfrmRoutineEditor.btnAddParamClick(Sender: TObject);
|
procedure TfrmRoutineEditor.btnAddParamClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
Param: TRoutineParam;
|
Param: TRoutineParam;
|
||||||
|
Position: Integer;
|
||||||
begin
|
begin
|
||||||
Param := TRoutineParam.Create;
|
Param := TRoutineParam.Create;
|
||||||
Param.Name := 'Param'+IntToStr(Parameters.Count+1);
|
Param.Name := 'Param'+IntToStr(Parameters.Count+1);
|
||||||
Param.Datatype := 'INT';
|
Param.Datatype := 'INT';
|
||||||
Param.Context := 'IN';
|
Param.Context := 'IN';
|
||||||
Parameters.Add(Param);
|
if Assigned(listParameters.FocusedNode) then
|
||||||
|
Position := listParameters.FocusedNode.Index+1
|
||||||
|
else
|
||||||
|
Position := Parameters.Count;
|
||||||
|
Parameters.Insert(Position, Param);
|
||||||
// See List.OnPaint:
|
// See List.OnPaint:
|
||||||
listParameters.Repaint;
|
listParameters.Repaint;
|
||||||
|
SelectNode(listParameters, Position);
|
||||||
Modification(Sender);
|
Modification(Sender);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user