📄 bargraph.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
#include "Bargraph.h"
//---------------------------------------------------------------------------
#pragma link "SctRep"
#pragma link "SctVar"
#pragma link "SctBtn"
#pragma link "SctCtrl"
#pragma resource "*.dfm"
TFormBarGraph *FormBarGraph;
//---------------------------------------------------------------------------
__fastcall TFormBarGraph::TFormBarGraph(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TFormBarGraph::AreaLabelBeforePrint(TSctLabel *lb)
{
AreaLabel->Width = Integer((tableCountry->FieldByName("AREA")->AsFloat / 12000000)
* 270);
if (AreaLabel->Width > 270) AreaLabel->Width = 270;
}
//---------------------------------------------------------------------
void __fastcall TFormBarGraph::FormClose(TObject *Sender,
TCloseAction &Action)
{
Action = caFree;
}
//---------------------------------------------------------------------
void __fastcall TFormBarGraph::SctTextLabel7LabelPrintWhen(TSctLabel *lb,
bool &Result)
{
Result = tableCountry->FieldByName("AREA")->AsInteger > 12000000;
}
//---------------------------------------------------------------------
void __fastcall TFormBarGraph::SctTextLabel9LabelPrintWhen(TSctLabel *lb,
bool &Result)
{
Result = tableCountry->FieldByName("POPULATION")->AsInteger > 100000000;
}
//---------------------------------------------------------------------
void __fastcall TFormBarGraph::PopulationLabelBeforePrint(TSctLabel *lb)
{
PopulationLabel->Width = Integer((tableCountry->FieldByName("POPULATION")->AsFloat
/ 100000000) * 270);
if (PopulationLabel->Width > 270) PopulationLabel->Width = 270;
}
//---------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -