//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "TestButton.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------
// ValidCtrCheck is used to assure that the components created do not have
// any pure virtual functions.
//
static inline void ValidCtrCheck(TTestButton *)
{
new TTestButton(NULL);
}
//---------------------------------------------------------------------------
__fastcall TTestButton::TTestButton(TComponent* Owner)
: TButton(Owner)
{
Image = new TImage(this);
Image->Parent = this;
Image->Center = true;
Image->Top = 0;
Image->Left = 0;
Image->Picture->LoadFromFile("C:\\TestButton\\123.jpg");
}
//---------------------------------------------------------------------------
void __fastcall TTestButton::SetFSize(ButtonSize Value){
switch(Value){
case _10X20:
Width = 10;
Height = 20;
break;
case _30X40:
Width = 30;
Height = 40;
break;
case _50X60:
Width = 50;
Height = 60;
break;
}
FSize = Value;
}
//---------------------------------------------------------------------------
namespace Testbutton
{
void __fastcall PACKAGE Register()
{
TComponentClass classes[1] = {__classid(TTestButton)};
RegisterComponents("Test", classes, 0);
}
}
//---------------------------------------------------------------------------
Ly8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KCiNpbmNsdWRlIDx2Y2wuaD4KCiNwcmFnbWEgaGRyc3RvcAoKI2luY2x1ZGUgIlRlc3RCdXR0b24uaCIKI3ByYWdtYSBwYWNrYWdlKHNtYXJ0X2luaXQpCi8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi8vIFZhbGlkQ3RyQ2hlY2sgaXMgdXNlZCB0byBhc3N1cmUgdGhhdCB0aGUgY29tcG9uZW50cyBjcmVhdGVkIGRvIG5vdCBoYXZlCi8vIGFueSBwdXJlIHZpcnR1YWwgZnVuY3Rpb25zLgovLwoKc3RhdGljIGlubGluZSB2b2lkIFZhbGlk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