connectionsunit.pas

来自「三层的通用架构」· PAS 代码 · 共 63 行

PAS
63
字号
unit ConnectionsUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, Menus;

type
  TConnectionsForm = class(TForm)
    ListView1: TListView;
    StatusBar1: TStatusBar;
    PopupMenu1: TPopupMenu;
    F1: TMenuItem;
    U1: TMenuItem;
    procedure ListView1DblClick(Sender: TObject);
    procedure F1Click(Sender: TObject);
    procedure U1Click(Sender: TObject);
    procedure PopupMenu1Popup(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  ConnectionsForm: TConnectionsForm;

implementation

uses MainUnit;

{$R *.dfm}

procedure TConnectionsForm.ListView1DblClick(Sender: TObject);
begin
  if ListView1.Selected <> nil then
    ListView1.Selected.Checked := not ListView1.Selected.Checked;
end;

procedure TConnectionsForm.F1Click(Sender: TObject);
begin
  if ListView1.Selected <> nil then
    ListView1.Selected.Checked := not ListView1.Selected.Checked;
end;

procedure TConnectionsForm.U1Click(Sender: TObject);
begin
  TheMainForm.ConnectionsUpdate;
end;

procedure TConnectionsForm.PopupMenu1Popup(Sender: TObject);
begin
  F1.Enabled := ListView1.Selected <> nil;
  if F1.Enabled then
    if ListView1.Selected.Checked then
      F1.Caption := '取消标记(&F)'
    else
      F1.Caption := '标记(&F)';
end;

end.

⌨️ 快捷键说明

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