{ *************************************************************************** }
{                                                                             }
{ EControl Syntax Editor SDK                                                  }
{                                                                             }
{ Copyright (c) 2004 - 2008 EControl Ltd., Zaharov Michael                    }
{     www.econtrol.ru                                                         }
{     support@econtrol.ru                                                     }
{                                                                             }
{ *************************************************************************** }
{$I ecSyntEdit.INC}

unit ecFInCmdTreeDlg;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  Dialogs, ecFTextDlg, StdCtrls, ExtCtrls, Menus, ActnList;

type
  TFindTextInCmdTreeDlg = class(TFindTextDlg)
    RadioGroup4: TRadioGroup;
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FindTextInCmdTreeDlg: TFindTextInCmdTreeDlg;

implementation

{$R *.dfm}

procedure TFindTextInCmdTreeDlg.FormCloseQuery(Sender: TObject;
  var CanClose: Boolean);
begin
  inherited;
  if ModalResult = mrOk then
    try
      case RadioGroup4.ItemIndex of
        1: if TextToShortCut(ComboBox1.Text) = 0 then
             raise Exception.Create('Invalid shortcut.');
        2: StrToInt(ComboBox1.Text);
      end;
    except
      Application.HandleException(Self);
      CanClose := False;
    end;
end;

end.
