stocksmodify.pas

来自「DevExpress公司出品的Borland Delphi和C++ Builde」· PAS 代码 · 共 68 行

PAS
68
字号
unit StocksModify;

interface

uses
  SysUtils, Classes,  Windows, Messages, Graphics, Controls, Forms, StdCtrls, ExtCtrls,
  cxSSCtrls, cxSSTypes, cxSSRes;

type
  TStocksModifyForm = class(TForm)
    gpPanel: TPanel;
    rbShiftCol: TRadioButton;
    rbShiftRw: TRadioButton;
    rbRw: TRadioButton;
    rbCol: TRadioButton;
    btnOk: TButton;
    btnCancel: TButton;
    cxLB: TcxLabelBevel;
    procedure FormKeyPress(Sender: TObject; var Key: Char);
  private
    FModifySheet: TcxSSCellsModify;
  public
    function Execute(AModifySheet: TcxSSModifyType): Boolean;
    property Modify: TcxSSCellsModify read FModifySheet write FModifySheet;
  end;

var
  StocksModifyForm: TStocksModifyForm;

implementation
  {$R *.dfm}

function TStocksModifyForm.Execute(AModifySheet: TcxSSModifyType): Boolean;
begin
  if AModifySheet = mtInsert then
    SetCaptions([Self, cxLB, rbShiftCol, rbShiftRw, rbRw, rbCol, btnOk, btnCancel],
      [scxSpreadSheetInsertCells, scxSpreadSheetInsertCells,
      scxSpreadSheetShiftCellRight, scxSpreadSheetShiftCellTop,
      scxSpreadSheetAllRow,  scxSpreadSheetAllColumn, scxFormOk, scxFormCancel])
  else
    SetCaptions([Self, cxLB, rbShiftCol, rbShiftRw, rbRw, rbCol, btnOk, btnCancel],
       [scxSpreadSheetDeleteCells, scxSpreadSheetDeleteCells,
       scxSpreadSheetShiftCellLeft, scxSpreadSheetShiftCellTop,
       scxSpreadSheetAllRow,  scxSpreadSheetAllColumn, scxFormOk, scxFormCancel]);
  Result := inherited ShowModal = mrOk;
  if Result then
  begin
    if rbShiftCol.Checked then
      FModifySheet := msShiftCol
    else
      if rbShiftRw.Checked then
        FModifySheet := msShiftRow
      else
        if rbRw.Checked then
          FModifySheet := msAllRow
        else
          FModifySheet := msAllCol
  end;
end;

procedure TStocksModifyForm.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if Key = #27 then
    Close;
end;

end.

⌨️ 快捷键说明

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