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

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

Наверх




Память: 0.47 MB
Время: 0.015 c
14-33304
egort
2003-07-24 11:47
2003.08.11
Люди Кто знает как поставить Delphi 4 на windows 2000 server


3-33045
Vitas2
2003-07-18 07:02
2003.08.11
Сортировка


3-33050
Z_man7777
2003-07-17 19:40
2003.08.11
Типы полей в InterBase6.0 FireBird


1-33145
Юля
2003-07-28 07:10
2003.08.11
Буфер


1-33166
KSergey
2003-07-28 14:27
2003.08.11
По поводу TInplaceEdit в TCustomGrid