Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2002.07.18;
Скачать: [xml.tar.bz2];

Вниз

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

 
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;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.005 c
3-58025
Yang
2002-06-27 14:19
2002.07.18
DBase в Access


8-58230
Ash
2002-01-31 02:51
2002.07.18
Уважаемые мастера, фактура поверхности в рисунке...


14-58286
SeF
2002-06-21 03:24
2002.07.18
ловля багов


6-58252
maxi
2002-05-08 10:31
2002.07.18
Глюк в TSocketConnection и в клиенте (Midas, DCOM)


14-58269
gss
2002-06-10 16:24
2002.07.18
Async Professional и D6





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский