Вниз
Скачать: 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.44 MB
Время: 0.01 c
1-58205
Jesuit
2002-07-06 03:10
2002.07.18
Подскажите плиз как сравнить два разных времени ?


14-58325
Filat
2002-06-17 19:13
2002.07.18
Как запретить исходящий трафик по выбранным мной IP?


3-57963
Oleon
2002-06-24 11:39
2002.07.18
Помогите, пожалуйста, укорить работу.


3-57951
Tutov Roman
2002-06-25 16:39
2002.07.18
непонятка с таблицами парадокс


3-58024
jen_bond
2002-06-28 01:17
2002.07.18
Подскажите что выбрать




   Наверх