mirror of https://gitlab.com/basile.b/dexed.git
add btn to kill current process in the procinput widget
This commit is contained in:
parent
1e73d618b5
commit
5da8863db3
|
@ -44,7 +44,7 @@ inherited CEProcInputWidget: TCEProcInputWidget
|
|||
Left = 0
|
||||
Height = 26
|
||||
Top = 2
|
||||
Width = 556
|
||||
Width = 528
|
||||
Align = alClient
|
||||
BorderSpacing.Top = 2
|
||||
BorderSpacing.Bottom = 2
|
||||
|
@ -52,7 +52,7 @@ inherited CEProcInputWidget: TCEProcInputWidget
|
|||
TabOrder = 0
|
||||
end
|
||||
object btnClose: TBitBtn
|
||||
Left = 584
|
||||
Left = 556
|
||||
Height = 30
|
||||
Hint = 'close the process input stream'
|
||||
Top = 0
|
||||
|
@ -64,7 +64,7 @@ inherited CEProcInputWidget: TCEProcInputWidget
|
|||
TabOrder = 1
|
||||
end
|
||||
object btnSend: TBitBtn
|
||||
Left = 556
|
||||
Left = 528
|
||||
Height = 30
|
||||
Hint = 'send the text to hte process'
|
||||
Top = 0
|
||||
|
@ -75,6 +75,18 @@ inherited CEProcInputWidget: TCEProcInputWidget
|
|||
Spacing = 0
|
||||
TabOrder = 2
|
||||
end
|
||||
object btnKill: TBitBtn
|
||||
Left = 584
|
||||
Height = 30
|
||||
Hint = 'kill the process'
|
||||
Top = 0
|
||||
Width = 28
|
||||
Align = alRight
|
||||
Layout = blGlyphBottom
|
||||
OnClick = btnKillClick
|
||||
Spacing = 0
|
||||
TabOrder = 3
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -15,11 +15,13 @@ type
|
|||
|
||||
TCEProcInputWidget = class(TCEWidget, ICEProcInputHandler)
|
||||
btnClose: TBitBtn;
|
||||
btnKill: TBitBtn;
|
||||
btnSend: TBitBtn;
|
||||
Panel1: TPanel;
|
||||
txtInp: TEdit;
|
||||
txtExeName: TStaticText;
|
||||
procedure btnCloseClick(Sender: TObject);
|
||||
procedure btnKillClick(Sender: TObject);
|
||||
procedure btnSendClick(Sender: TObject);
|
||||
procedure txtInpKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
private
|
||||
|
@ -64,6 +66,7 @@ begin
|
|||
fMru.Insert(0, '(your input here)');
|
||||
AssignPng(btnClose, 'pencil_delete');
|
||||
AssignPng(btnSend, 'pencil_go');
|
||||
AssignPng(btnKill, 'cancel');
|
||||
end;
|
||||
|
||||
destructor TCEProcInputWidget.destroy;
|
||||
|
@ -145,6 +148,12 @@ begin
|
|||
fProc.CloseInput;
|
||||
end;
|
||||
|
||||
procedure TCEProcInputWidget.btnKillClick(Sender: TObject);
|
||||
begin
|
||||
if fProc.isNotNil then
|
||||
fProc.Terminate(0);
|
||||
end;
|
||||
|
||||
procedure TCEProcInputWidget.txtInpKeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
begin
|
||||
|
|
Loading…
Reference in New Issue