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

📄 afgrids.pas

📁 漏洞扫描系列中HB Network Scanner 测试用练习代码
💻 PAS
字号:
unit afgrids;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  EPLabels, VCLBase, BmpCtrls, EPGrids, EPCtrls, MediaLib, EffBtns,
  EPButtons, ExtCtrls;

type
  TfmGrids = class(TForm)
    epImage1: TepImage;
    ALabel12: TepLabel;
    ADrawGrid1: TepDrawGrid;
    ALabel13: TepLabel;
    AStringGrid1: TepStringGrid;
    ABMPCheckBox29: TepBMPCheckBox;
    ABMPCheckBox9: TepBMPCheckBox;
    ABMPCheckBox8: TepBMPCheckBox;
    ABMPCheckBox7: TepBMPCheckBox;
    ATextLabel2: TepTextLabel;
    epBitmap1: TepBitmap;
    epBitmap2: TepBitmap;
    epEfTrRndBtn1: TepEfTrRndBtn;
    Timer1: TTimer;
    ERP: TepEffectRndPanel;
    epLabel1: TepLabel;
    epSpeedButton1: TepSpeedButton;
    WL: TepWaveLabel;
    procedure ABMPCheckBox7Click(Sender: TObject);
    procedure ABMPCheckBox8Click(Sender: TObject);
    procedure ABMPCheckBox9Click(Sender: TObject);
    procedure ABMPCheckBox29Click(Sender: TObject);
    procedure ADrawGrid1DrawCell(Sender: TObject; Col, Row: Longint;
      Rect: TRect; State: TGridDrawState);
    procedure epEfTrRndBtn1Click(Sender: TObject);
    procedure epSpeedButton1Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fmGrids: TfmGrids;
  I: Integer;
implementation

{$R *.DFM}


procedure TfmGrids.ABMPCheckBox7Click(Sender: TObject);
begin
  ADrawGrid1.FixedTransparent := ABMPCheckBox7.Checked;
  AStringGrid1.FixedTransparent := ABMPCheckBox7.Checked;
  ERP.InvalidatePanel;
end;

procedure TfmGrids.ABMPCheckBox8Click(Sender: TObject);
begin
  if ABMPCheckBox8.Checked
  then
    begin
      ADrawGrid1.Options := ADrawGrid1.Options + [goRowSelect];
      AStringGrid1.Options := ADrawGrid1.Options + [goRowSelect];
    end
  else
    begin
      ADrawGrid1.Options := ADrawGrid1.Options - [goRowSelect] + [goEditing];
      AStringGrid1.Options := ADrawGrid1.Options - [goRowSelect] + [goEditing];
    end;
  ERP.InvalidatePanel;
end;

procedure TfmGrids.ABMPCheckBox9Click(Sender: TObject);
begin
  ADrawGrid1.TransparentSelect := ABMPCheckBox9.Checked;
  AStringGrid1.TransparentSelect := ABMPCheckBox9.Checked;
  ERP.InvalidatePanel;
end;

procedure TfmGrids.ABMPCheckBox29Click(Sender: TObject);
begin
  ADrawGrid1.Transparent := ABMPCheckBox29.Checked;
  AStringGrid1.Transparent := ABMPCheckBox29.Checked;
  ERP.InvalidatePanel;
end;

procedure TfmGrids.ADrawGrid1DrawCell(Sender: TObject; Col, Row: Longint;
  Rect: TRect; State: TGridDrawState);
begin
 with ADrawGrid1.Canvas do
  begin
    Brush.Style := bsClear;
    if (Col = 0) or (Row = 0)
    then
      begin
        Pen.Color := clBlack;
        Ellipse(Rect.Left + 20, Rect.Top + 5,
                  Rect.Right - 20, Rect.Bottom - 5);
      end
    else
    if (Col mod 2 = 0)
    then
      begin
        if gdSelected in State
        then
          Pen.Color := clBlue
        else
          Pen.Color := clYellow;
        Rectangle(Rect.Left + 5, Rect.Top + 5,
                  Rect.Right - 5, Rect.Bottom - 5);
      end
    else
      begin
        if gdSelected in State
        then
          Pen.Color := clRed
        else
          Pen.Color := clLime;
        Rectangle(Rect.Left + 5, Rect.Top + 5,
                  Rect.Right - 5, Rect.Bottom - 5);
      end;
  end;
end;

procedure TfmGrids.epEfTrRndBtn1Click(Sender: TObject);
begin
  ADrawGrid1.Enabled := ERP.Visible;
  AStringGrid1.Enabled := ERP.Visible;
  ERP.Visible := not ERP.Visible;
  Timer1.Enabled := ERP.Visible;
end;

procedure TfmGrids.epSpeedButton1Click(Sender: TObject);
begin
  ERP.Visible := False;
  ADrawGrid1.Enabled := not ERP.Visible;
  AStringGrid1.Enabled := not ERP.Visible;
  Timer1.Enabled := ERP.Visible;
end;

procedure TfmGrids.Timer1Timer(Sender: TObject);
begin
  WL.XDiv := WL.XDiv + I;
  if WL.XDiv > 20 then I := -2;
  if WL.XDiv < 8 then I := 2;
end;

procedure TfmGrids.FormCreate(Sender: TObject);
begin
  WL.XDiv := 22;
  I := -2;
end;

end.

⌨️ 快捷键说明

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