Componentes.Terceros.DevExp.../official/x.36/ExpressQuantumGrid 6/Demos/Delphi/UnboundModeDemo/UnboundModeDemoCustomField.pas
2008-06-02 17:37:37 +00:00

50 lines
1.1 KiB
ObjectPascal

unit UnboundModeDemoCustomField;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, cxButtons, cxLookAndFeelPainters;
type
TUnboundModeDemoCustomFieldForm = class(TForm)
lbHeight: TLabel;
lbWidth: TLabel;
lbMineCount: TLabel;
edtHeight: TEdit;
edtWidth: TEdit;
edtMineCount: TEdit;
btnOK: TcxButton;
bntCancel: TcxButton;
procedure edtKeyPress(Sender: TObject; var Key: Char);
procedure bntCancelClick(Sender: TObject);
public
function ShowModal: Integer; override;
end;
implementation
uses UnboundModeDemoTypes;
{$R *.DFM}
function TUnboundModeDemoCustomFieldForm.ShowModal: Integer;
begin
SetFormPosition(Self, 25, 25);
Result := inherited ShowModal;
end;
procedure TUnboundModeDemoCustomFieldForm.edtKeyPress(Sender: TObject;
var Key: Char);
begin
if (Key < '0') or ('9' < Key) then
Key := Char(7);
end;
procedure TUnboundModeDemoCustomFieldForm.bntCancelClick(Sender: TObject);
begin
Close;
end;
end.