Главная страница
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.016 c
14-33322
Мимо проходил
2003-07-24 14:45
2003.08.11
Брата никто не видел?


1-33096
Kaylang
2003-07-29 17:01
2003.08.11
Убрать рельефность кнопки


14-33261
Jeer
2003-07-23 15:17
2003.08.11
Занимательная экономика


11-33087
_Ed_
2002-12-06 18:07
2003.08.11
Hicon ---> HBitmap


1-33149
zam
2003-07-28 11:10
2003.08.11
Работа с Toolbar