1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
__fastcall TMCustomControl::TMCustomControl(Classes::TComponent* AOwner, String ImageFile) : TCustomControl(Owner)
{
Im_selected = false;
Height = 120;
Width = 140;
//bevel/deco
m_bevel = new TBevel(this);
m_bevel->Parent = this;
m_bevel->SetBounds(Left, Top, Width, Height);
m_bevel->Style = bsRaised;
//checkbox et évènement 'OnClick()' du checkbox
m_chk = new TCheckBox(this);
m_chk->Parent = (this);
m_chk->Top = Top + 2;
m_chk->Width = 17;
m_chk->Left = (Left + Width) - (m_chk->Width - 1);
m_chk->OnClick = ChkClick;
m_chk->Visible = true;
//image
m_Image = new TImage(this);
m_Image->Parent = (this);
m_Image->Top = (m_chk->Top + m_chk->Height) + 1;
m_Image->Left = Left + 2;
m_Image->Width = Width - 2;
m_Image->Height - 2;
Graphics::TBitmap *pict = new Graphics::TBitmap;
pict->LoadFromFile(ImageFile);
m_Image->Picture->Assign(pict);
m_Image->Visible = true;
delete pict;
fileN = ImageFile;
}
//--------------------------------------------------------------------------- |
Partager