Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.07.18;
Скачать: 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 вся ветка

Текущий архив: 2002.07.18;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.012 c
3-58014
AlexA
2002-06-18 14:16
2002.07.18
Редко изменяемые данные


3-57959
Андрусь
2002-06-25 11:27
2002.07.18
Сохранение настроек в базе


14-58267
roman001
2002-06-19 18:15
2002.07.18
rxlib


3-57938
Weare
2002-06-25 13:12
2002.07.18
Проблема при открытии таблиц.


4-58365
GatesBill
2002-05-19 21:54
2002.07.18
как можно простым способом переименовать директорию?