thmdotdlg.~pas

来自「delphi 和mapx联合开发的例程 实现mapx的相应功能」· ~PAS 代码 · 共 67 行

~PAS
67
字号
unit ThmDotDlg;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons;

type
  TThmDotFrm = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    Label2: TLabel;
    ComboBox1: TComboBox;
    Button1: TButton;
    Button2: TButton;
    GroupBox1: TGroupBox;
    BitBtn1: TBitBtn;
    Label3: TLabel;
    ColorDialog1: TColorDialog;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure FormShow(DotV: double; DotS: integer; DotC: TColor);
  end;

var
  ThmDotFrm: TThmDotFrm;

implementation


{$R *.dfm}

procedure TThmDotFrm.FormShow(DotV: double; DotS: integer; DotC: TColor);
begin
  ThmDotfm:= TThmDotfm.Create(nil);
  with ThmDotfm do
  begin
    Edit1.Text:= FloatToStr(DotV);
    Case DotS of
      0: ComboBox1.Text:= '小点';
      1: ComboBox1.Text:= '大点';
    end;
    ColorDialog1.Color:= DotC;
    Label3.Color:= DotC;
    ShowModal;
  end;
end;

procedure TThmDotFrm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action:=Cafree;
  self:= nil;
end;

procedure TThmDotFrm.BitBtn1Click(Sender: TObject);
begin
  if ColorDialog1.Execute then
    Label3.Color:= ColorDialog1.Color;
end;

end.

⌨️ 快捷键说明

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