featuremodify.cpp

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

CPP
73
字号
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "FeatureModify.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFeatureModifyForm *FeatureModifyForm;
//---------------------------------------------------------------------------
__fastcall TFeatureModifyForm::TFeatureModifyForm(TComponent* Owner)
  : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TFeatureModifyForm::SetCaptions(AnsiString ACaptions[8])
{
  ((TControlAccess*)this)->Caption = ACaptions[0];
  cxLB->CaptionText = ACaptions[1];
  ((TControlAccess*)rbShiftCol)->Caption = ACaptions[2];
  ((TControlAccess*)rbShiftRw)->Caption = ACaptions[3];
  ((TControlAccess*)rbRw)->Caption = ACaptions[4];
  ((TControlAccess*)rbCol)->Caption = ACaptions[5];
  ((TControlAccess*)btnOk)->Caption = ACaptions[6];
  ((TControlAccess*)btnCancel)->Caption = ACaptions[7];
}

bool __fastcall TFeatureModifyForm::Execute(TcxSSModifyType AModifySheet)
{
  AnsiString ACaptions[8];
  ACaptions[2] = "Shift cells left";
  ACaptions[3] = "Shift cells top";
  ACaptions[4] = "Entire row";
  ACaptions[5] = "Entire column";
  ACaptions[6] = "&Ok";
  ACaptions[7] = "&Cancel";
  if (AModifySheet == mtInsert) {
    ACaptions[0] = "Insert";
    ACaptions[1] = "Insert";
    ACaptions[2] = "Shift cells right";
    SetCaptions(ACaptions);
  }
  else {
    ACaptions[0] = "Delete";
    ACaptions[1] = "Delete";
    SetCaptions(ACaptions);
  }
  bool Result;
  Result = TForm::ShowModal() == mrOk;
  if (Result) {
    if (rbShiftCol->Checked)
      FModifySheet = msShiftCol;
    else
      if (rbShiftRw->Checked)
        FModifySheet = msShiftRow;
      else
        if (rbRw->Checked)
          FModifySheet = msAllRow;
        else
          FModifySheet = msAllCol;
  }
  return Result;
}

void __fastcall TFeatureModifyForm::FormKeyPress(TObject *Sender,
      char &Key)
{
  if (Key == 27)
    Close();
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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