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

По поводу TInplaceEdit в TCustomGrid   Найти похожие ветки 

 
KSergey ©   (2003-07-28 14:27) [0]

В коде VCL увидел не понятную мне штуку (модуль Grids):

TInplaceEdit = class(TCustomMaskEdit)
private
...
procedure SetGrid(Value: TCustomGrid);
...


при этом

TCustomGrid = class(TCustomControl)
private
...
FInplaceEdit: TInplaceEdit; // это просто показываю о какой переменной речь
...

procedure TCustomGrid.UpdateEdit;
...
begin
FInplaceEdit := CreateEditor; { фактически здесь TInplaceEdit.Create(Self) }
FInplaceEdit.SetGrid(Self); // !!!!!
...


Т.е. идет извне обращение к приватному методу класса! Или я проглядел назначение дружественного класса? А где оно тогда? Нифига не понимаю...


 
Semin Aleksei   (2003-07-28 14:31) [1]

В одном модуле это возможно.


 
VMcL ©   (2003-07-28 14:32) [2]

A private member is invisible outside of the unit or program where its class is declared. In other words, a private method cannot be called from another module, and a private field or property cannot be read or written to from another module. By placing related class declarations in the same module, you can give the classes access to one another’s private members without making those members more widely accessible.


 
KSergey ©   (2003-07-28 14:43) [3]

Вот это да.. Не знал.. Как-то это странно, ну да уж как есть.
Спасибо.


 
Толик ©   (2003-07-28 14:43) [4]

Понятия friend в Делфях нет. Внутри одного модуля всё доступно всем.


 
KSergey ©   (2003-07-28 15:07) [5]

Толик © (28.07.03 14:43)

Точно-точно! Что-то такое читал... но не запомнилось...

Еще раз всем спасибо



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

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



Память: 0.46 MB
Время: 0.01 c
3-33058
mikhasenko.anton
2003-07-18 14:13
2003.08.11
Компонент TDBF - не могу понять почему при создании


8-33233
bkv
2003-04-18 15:56
2003.08.11
Создание черно - белого TBitmap


1-33108
crash_rider
2003-07-29 21:23
2003.08.11
Преобразование Pointer а Array в Плагине Winamp?


1-33201
Nucl
2003-07-28 17:09
2003.08.11
Что выполняется быстрее ?


1-33214
IntLex
2003-07-27 11:08
2003.08.11
Word




   Наверх