⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wwprprx.pas

📁 InfoPower_Studio 2007 v5.0.1.3 banben
💻 PAS
字号:
unit wwprprx;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Wwintl, ExtCtrls, wwdbedit, Mask, Wwdotdot, StdCtrls, Buttons;

type
  TwwEditRegexForm = class(TForm)
    OKBtn: TBitBtn;
    CancelBtn: TBitBtn;
    GroupBox1: TGroupBox;
    Label2: TLabel;
    PictureDescription: TMemo;
    Button1: TButton;
    Button2: TButton;
    AutoFill: TCheckBox;
    NewPicture: TwwDBComboDlg;
    GroupBox2: TGroupBox;
    Label1: TLabel;
    wwPictureEdit1: TwwDBEdit;
    Button3: TButton;
    Status: TPanel;
    Button4: TButton;
    wwIntl1: TwwIntl;
    procedure Button1Click(Sender: TObject);
    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    procedure Button3Click(Sender: TObject);
    procedure wwPictureEdit1Change(Sender: TObject);
  private
  public
    Component : TwwCustomMaskEdit;
    OrigRegexMaskMask : String;
    OrigCaseSensitive : Boolean;
  end;

var
  EditRegexForm: TwwEditRegexForm;

function wwPrpEdit_RegexMask( AComponent : TwwCustomMaskEdit ) : Boolean;

implementation

{$R *.dfm}

uses
  wwcommon, ipdsgn;

function wwPrpEdit_RegexMask( AComponent : TwwCustomMaskEdit ) : Boolean;
begin
  Result := false;
  with EditRegexForm.create(Application) do try
     Component:=AComponent;
     OrigRegexMaskMask := AComponent.RegexMask.Mask;
     OrigCaseSensitive := AComponent.RegexMask.CaseSensitive;
    if ShowModal=mrOK then begin
     result:= True;
    end
  finally
    Free;
  end;
end;

procedure TwwEditRegexForm.Button1Click(Sender: TObject);
begin
  try
    if ( not wwPictureEdit1.IsValidRegexMask( NewPicture.Text )) then
      Status.Caption := 'Invalid Regular Expression Syntax'
    else
      Status.Caption := 'Regular Expression is valid';
  finally
  end;
end;

procedure TwwEditRegexForm.Button3Click(Sender: TObject);
begin
  try
    if ( wwPictureEdit1.IsValidRegexValue( wwPictureEdit1.Text ) ) then
      Status.Caption := 'Value is valid'
    else
      Status.Caption := 'Regular Expression does not accept value';
  finally
  end;
end;

procedure TwwEditRegexForm.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if ( key = vk_f1 ) then
    wwALinkHelp( Handle, 'Regex_Masks' );
end;

procedure TwwEditRegexForm.wwPictureEdit1Change(Sender: TObject);
begin
  try
    if ( wwPictureEdit1.IsValidRegexValue( wwPictureEdit1.Text ) ) then
      Status.Caption := 'Value is valid'
    else
      Status.Caption := 'Regular Expression does not accept value';
  finally
  end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -