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

📄 customrowheightdemomain.cpp

📁 DevExpress ExpressQuantumGrid Suite v5.9 Full Source
💻 CPP
字号:
//---------------------------------------------------------------------------

#include <vcl.h>
#include "shellapi.hpp"
#pragma hdrstop

#include "CustomRowHeightDemoMain.h"
#include "CustomRowHeightDemoData.h"
#include "AboutDemoForm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "cxClasses"
#pragma link "cxControls"
#pragma link "cxCustomData"
#pragma link "cxData"
#pragma link "cxDBData"
#pragma link "cxEdit"
#pragma link "cxFilter"
#pragma link "cxGraphics"
#pragma link "cxGrid"
#pragma link "cxGridCustomTableView"
#pragma link "cxGridCustomView"
#pragma link "cxGridDBTableView"
#pragma link "cxGridLevel"
#pragma link "cxGridTableView"
#pragma link "cxStyles"
#pragma link "cxButtons"
#pragma link "cxCheckBox"
#pragma link "cxContainer"
#pragma link "cxGridCardView"
#pragma link "cxGridDBCardView"
#pragma link "cxLookAndFeelPainters"
#pragma link "cxMaskEdit"
#pragma link "cxSpinEdit"
#pragma link "cxTextEdit"
#pragma link "cxLookAndFeels"
#pragma resource "*.dfm"
TCustomRowHeightDemoMainForm *CustomRowHeightDemoMainForm;
//---------------------------------------------------------------------------
__fastcall TCustomRowHeightDemoMainForm::TCustomRowHeightDemoMainForm(TComponent* Owner)
  : TForm(Owner)
{
  FCurrentZoom = 50;
}
//---------------------------------------------------------------------------

void __fastcall TCustomRowHeightDemoMainForm::miAboutClick(TObject *Sender)
{
  ShowAboutDemoForm();
}
//---------------------------------------------------------------------------

void __fastcall TCustomRowHeightDemoMainForm::miExitClick(TObject *Sender)
{
  Close();
}
//---------------------------------------------------------------------------

void __fastcall TCustomRowHeightDemoMainForm::miZoomClick(TObject *Sender)
{
  ((TMenuItem*)Sender)->Checked = true;
  FCurrentZoom = GetZoomByMenuItem(((TMenuItem*)Sender)->MenuIndex);
  tvFilms->SizeChanged(false, false);
}
//---------------------------------------------------------------------------

void __fastcall TCustomRowHeightDemoMainForm::tvFilmsGetCellHeight(TcxCustomGridTableView *Sender,
    TcxCustomGridRecord *ARecord, TcxCustomGridTableItem *AItem,
    TcxGridTableDataCellViewInfo *ACellViewInfo, int &AHeight)
{
  if (AItem != tvFilmsPHOTO){
    AHeight = 0;
    return;
  }
  Variant AEditValue = ARecord->Values[tvFilmsPHOTO->Index];
  if (VarIsStr(AEditValue)){
    TPicture *APicture = new TPicture();
    try{
      LoadPicture(APicture,
        ((TcxImageProperties*)tvFilmsPHOTO->Properties)->GraphicClass, AEditValue);
      AHeight = APicture->Height;
      AHeight = div(AHeight * FCurrentZoom, 100).quot;
    }
    __finally{
      delete APicture;
    }
  }
}
//---------------------------------------------------------------------------

int TCustomRowHeightDemoMainForm::GetZoomByMenuItem(int AMenuItemIndex)
{
  const int Zoom[4]  = {100, 75, 50, 25};
  return Zoom[AMenuItemIndex];
}
//---------------------------------------------------------------------------


⌨️ 快捷键说明

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