//in
implementation...
//---------------------------------------------------------------------------
#include
<vcl\vcl.h>
#pragma
hdrstop
#include
"MyTabControl.h"
//---------------------------------------------------------------------------
static
inline TMyTabControl *ValidCtrCheck()
{
return new TMyTabControl(NULL);
}
//---------------------------------------------------------------------------
__fastcall
TMyTabControl::TMyTabControl(TComponent* Owner)
: TTabControl(Owner)
{
}
//---------------------------------------------------------------------------
void
__fastcall TMyTabControl::CreateParams(TCreateParams &Params)
{
TTabControl::CreateParams(Params);
switch (FTabOrientation)
{
case toBottom:
Params.Style = Params.Style | TCS_BOTTOM;
break;
case toLeft:
Params.Style = Params.Style | TCS_VERTICAL | TCS_MULTILINE;
MultiLine = true;
break;
case toRight:
Params.Style = Params.Style | TCS_VERTICAL | TCS_MULTILINE |
TCS_RIGHT;
MultiLine = true;
break;
}
}
//---------------------------------------------------------------------------
void
__fastcall TMyTabControl::SetTabOrientation(TTabOrientation Value)
{
if (FTabOrientation != Value)
{
FTabOrientation = Value;
RecreateWnd();
}
}
//---------------------------------------------------------------------------
namespace
Mytabcontrol
{
void __fastcall Register()
{
TComponentClass classes[1] = {__classid(TMyTabControl)};
RegisterComponents("Samples", classes, 0);
}
}
|