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

📄 main.pas

📁 Korea, a data table control 韩国控件的DEMO 值得学习
💻 PAS
字号:
unit Main;

interface

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

type
  TFrmMain = class(TForm)
    mmMain: TMainMenu;
    cmFile: TMenuItem;
    N1: TMenuItem;
    cmFileExit: TMenuItem;
    cmRealGrid: TMenuItem;
    cmGridIntro: TMenuItem;
    cmGridColumn: TMenuItem;
    cmGroupMode: TMenuItem;
    cmGridEditing: TMenuItem;
    cmGridCells: TMenuItem;
    cmGridSorting: TMenuItem;
    cmGridFooters: TMenuItem;
    cmAbout: TMenuItem;
    cmGridEditKind: TMenuItem;
    cmGridEditKind2: TMenuItem;
    cmGridRowTypes: TMenuItem;
    procedure cmFileExitClick(Sender: TObject);
    procedure cmGridIntroClick(Sender: TObject);
    procedure cmGridColumnClick(Sender: TObject);
    procedure cmGroupModeClick(Sender: TObject);
    procedure cmGridEditingClick(Sender: TObject);
    procedure cmGridCellsClick(Sender: TObject);
    procedure cmAboutClick(Sender: TObject);
    procedure cmGridSortingClick(Sender: TObject);
    procedure cmGridFootersClick(Sender: TObject);
    procedure cmGridEditKindClick(Sender: TObject);
    procedure cmGridEditKind2Click(Sender: TObject);
    procedure cmGridRowTypesClick(Sender: TObject);
  private
    function CheckForm(AClass: TFormClass): Boolean;
  public
  end;

var
  frmMain: TFrmMain;

implementation

uses UGridIntro, UColumns, UGroupMode, UEditing, UCells, USorting, UFooters,
  UEditKind, UEditKind2, URowTypes;

{$R *.DFM}

(*** Private Methods ***)
function TFrmMain.CheckForm(AClass: TFormClass): Boolean;
var
  I: Integer;
begin
  Result := False;

  for I := 0 to MDIChildCount - 1 do
    if MDIChildren[I] is AClass then
      with MDIChildren[I] do
      begin
        if WindowState = wsMinimized then
          WindowState := wsNormal;
        BringToFront;

        Result := True;
        Break;
      end;
end;

(*** Menu Handlers ***)
procedure TFrmMain.cmFileExitClick(Sender: TObject);
begin
  Close;
end;

procedure TFrmMain.cmGridIntroClick(Sender: TObject);
begin
  if not CheckForm(TFrmGridIntro) then
    TFrmGridIntro.Create(Self);
end;

procedure TFrmMain.cmGridColumnClick(Sender: TObject);
begin
  if not CheckForm(TFrmColumns) then
    TFrmColumns.Create(Self);
end;

procedure TFrmMain.cmGroupModeClick(Sender: TObject);
begin
  if not CheckForm(TFrmGroupMode) then
    TFrmGroupMode.Create(Self);
end;

procedure TFrmMain.cmGridCellsClick(Sender: TObject);
begin
  if not CheckForm(TFrmCells) then
    TFrmCells.Create(Self);
end;

procedure TFrmMain.cmGridEditingClick(Sender: TObject);
begin
  if not CheckForm(TFrmEditing) then
    TFrmEditing.Create(Self);
end;

procedure TFrmMain.cmGridEditKindClick(Sender: TObject);
begin
  if not CheckForm(TFrmEditKind) then
    TFrmEditKind.Create(Self);
end;

procedure TFrmMain.cmGridEditKind2Click(Sender: TObject);
begin
  if not CheckForm(TFrmEditKind2) then
    TFrmEditKind2.Create(Self);
end;

procedure TFrmMain.cmGridSortingClick(Sender: TObject);
begin
  if not CheckForm(TFrmSorting) then
    TFrmSorting.Create(Self);
end;

procedure TFrmMain.cmGridFootersClick(Sender: TObject);
begin
  if not CheckForm(TFrmFooters) then
    TFrmFooters.Create(Self);
end;

procedure TFrmMain.cmGridRowTypesClick(Sender: TObject);
begin
  if not CheckForm(TFrmRowTypes) then
    TFrmRowTypes.Create(Self);
end;

procedure TFrmMain.cmAboutClick(Sender: TObject);
begin
  Windows.MessageBox(0, PChar('RealGrid Demo 0.9 ' + #13#10 + 'with Package Build 124(alpha)'),
                     'About RealGrid Demo', MB_ICONINFORMATION or MB_OK);
end;

end.

⌨️ 快捷键说明

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