Вниз
Скачать: CL | DM;

Компонент   Найти похожие ветки 

← →
Alex ©   (2002-07-05 20:27) [0]

Как при написании компонента сделать такой, как например у "Font" плюсик с раскрытием вниз? и как обрабатывать его в "read&write"


← →
Eugene Lachinov ©   (2002-07-05 20:50) [1]

type
TMyFont = class(TPersistent)
private
FSize : Integer;
public
procedure Assign(Source : TPersistent); override;
published
property Size : Integer read FSize write FSize;
end;

TMyComponent = class(TComponent)
private
FMyFont : TMyFont;
procedure SetMyFont(Value : TMyFont);
public
constructor Create(AOwner : TComponent); override;
destructor Destroy; override;
published
property MyFont : TMyFont read FMyFont write SetMyFont;
end;

{ TMyFont }

procedure TMyFont.Assign(Source : TPersistent);
begin
if Source is TMyFont then
FSize := (Source as TMyFont).Size
end;

{ TMyComponent }

constructor TMyComponent.Create(AOwner : TComponent);
begin
FMyFont := TMyFont.Create;
inherited Create(AOwner)
end;

destructor TMyComponent.Destroy;
begin
FMyFont.Free;
inherited Destroy
end;

procedure TMyComponent.SetMyFont(Value : TMyFont);
begin
FMyFont.Assign(Value)
end;



← →
Alex   (2002-07-05 22:12) [2]

Спасибо!!!



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: -0.992 c
14-58323
jjjkkklll
2002-06-18 08:28
2002.07.18
VCL


1-58145
Plt
2002-07-04 10:26
2002.07.18
Word


7-58341
FinDelDev
2002-04-26 11:59
2002.07.18
Замена системных часов


6-58243
Crypter
2002-05-09 11:15
2002.07.18
Простой вопрос по сокетам


4-58363
МишА
2002-05-15 20:42
2002.07.18
SendMessage в Dos приложение




   Наверх