109 lines
2.2 KiB
ObjectPascal
109 lines
2.2 KiB
ObjectPascal
|
|
unit U_PatternColorHelp;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, StdCtrls, ExtCtrls, DB, ADODB, StrUtils;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmPatternColorHelp = class(TForm)
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
Button1: TButton;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Button2: TButton;
|
|||
|
|
QSHX: TEdit;
|
|||
|
|
JSHX: TEdit;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
YSSL: TEdit;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
ps: TEdit;
|
|||
|
|
sl: TEdit;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
GS: TEdit;
|
|||
|
|
GL: TEdit;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
procedure Button2Click(Sender: TObject);
|
|||
|
|
procedure Button1Click(Sender: TObject);
|
|||
|
|
procedure QSHXKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
private
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
FFFIDS: string;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmPatternColorHelp: TfrmPatternColorHelp;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmPatternColorHelp.Button2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPatternColorHelp.QSHXKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
var
|
|||
|
|
edt: TEdit;
|
|||
|
|
str, strL, strR: string;
|
|||
|
|
p: integer;
|
|||
|
|
begin
|
|||
|
|
// <20><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD>, ע<><D7A2>Ҫȥ<D2AA><C8A5>ѡ<EFBFBD>в<EFBFBD><D0B2><EFBFBD>(<28><>Ϊ<EFBFBD>ᱻ<EFBFBD><E1B1BB>д).
|
|||
|
|
edt := TEdit(Sender);
|
|||
|
|
str := edt.text;
|
|||
|
|
if Length(edt.SelText) <> 0 then
|
|||
|
|
begin
|
|||
|
|
strL := LeftStr(edt.text, edt.SelStart);
|
|||
|
|
strR := RightStr(edt.text, Length(edt.text) - edt.SelStart - edt.SelLength);
|
|||
|
|
str := strL + strR;
|
|||
|
|
end;
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/С<><D0A1><EFBFBD><EFBFBD>/<2F>˸<EFBFBD><CBB8><EFBFBD>
|
|||
|
|
if not (Key in [#8, #13, #127, '.', '-', '0'..'9']) then
|
|||
|
|
Key := #0;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>С<EFBFBD><D0A1><EFBFBD><EFBFBD>
|
|||
|
|
if Key = '.' then
|
|||
|
|
begin
|
|||
|
|
p := Pos('.', edt.Text);
|
|||
|
|
if p > 0 then
|
|||
|
|
Key := #0;
|
|||
|
|
end;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD>ڵ<EFBFBD>һλ<D2BB><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>'-'<27><>
|
|||
|
|
if Key = '-' then
|
|||
|
|
begin
|
|||
|
|
if edt.SelStart > 0 then
|
|||
|
|
Key := #0;
|
|||
|
|
p := Pos('-', edt.Text);
|
|||
|
|
if p > 0 then
|
|||
|
|
Key := #0;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPatternColorHelp.Button1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
// if Trim(QSHX.Text) = '' then
|
|||
|
|
// begin
|
|||
|
|
// Application.MessageBox('<27><>ʼ<EFBFBD><CABC><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
|
// Exit;
|
|||
|
|
// end;
|
|||
|
|
// if Trim(JSHX.Text) = '' then
|
|||
|
|
// begin
|
|||
|
|
// Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
|
// Exit;
|
|||
|
|
// end;
|
|||
|
|
// if Trim(YSSL.Text) = '' then
|
|||
|
|
// begin
|
|||
|
|
// Application.MessageBox('<27><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
|
// Exit;
|
|||
|
|
// end;
|
|||
|
|
ModalResult := 1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|