EvaluateDlg: Evaluate a entry when it is selected with mouse in cmbExpression

git-svn-id: trunk@60047 -
This commit is contained in:
michl 2019-01-09 15:59:57 +00:00
parent 9bfc86dedf
commit 5f6279e73e
2 changed files with 20 additions and 0 deletions

View File

@ -135,6 +135,8 @@ inherited EvaluateDlg: TEvaluateDlg
ItemHeight = 13
OnChange = cmbExpressionChange
OnKeyDown = cmbExpressionKeyDown
OnKeyUp = cmbExpressionKeyUp
OnSelect = cmbExpressionSelect
TabOrder = 2
end
object txtResult: TMemo[5]

View File

@ -74,6 +74,9 @@ type
tbWatch: TToolButton;
tbModify: TToolButton;
tbEvaluate: TToolButton;
procedure cmbExpressionKeyUp(Sender: TObject; var {%H-}Key: Word;
{%H-}Shift: TShiftState);
procedure cmbExpressionSelect(Sender: TObject);
procedure cmbNewValueKeyDown(Sender: TObject; var Key: Word;
{%H-}Shift: TShiftState);
procedure FormClose(Sender: TObject; var {%H-}CloseAction: TCloseAction);
@ -92,6 +95,7 @@ type
procedure tbWatchClick(Sender: TObject);
private
fSkipKeySelect: Boolean;
fHistDirection:TEvalHistDirection;
procedure EvaluateCallback(Sender: TObject; ASuccess: Boolean;
ResultText: String; ResultDBGType: TDBGType);
@ -123,6 +127,7 @@ constructor TEvaluateDlg.Create(TheOwner:TComponent);
begin
inherited Create(TheOwner);
fSkipKeySelect := False;
Caption := lisKMEvaluateModify;
cmbExpression.Items.Assign(InputHistories.HistoryLists.
GetList(ClassName,True,rltCaseSensitive));
@ -229,6 +234,7 @@ end;
procedure TEvaluateDlg.cmbExpressionKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
fSkipKeySelect := True;
if (Key = VK_RETURN) and tbEvaluate.Enabled
then begin
Evaluate;
@ -313,6 +319,18 @@ begin
end;
end;
procedure TEvaluateDlg.cmbExpressionKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
fSkipKeySelect := False;
end;
procedure TEvaluateDlg.cmbExpressionSelect(Sender: TObject);
begin
if not fSkipKeySelect then
Evaluate;
end;
procedure TEvaluateDlg.FormShow(Sender: TObject);
begin
cmbExpression.SetFocus;