Re[3]: Класс TWinControl и его наследники
От: s.ts  
Дата: 27.10.03 15:59
Оценка: 15 (2)
Здравствуйте, s.ts, Вы писали:

ST>Здравствуйте, Slicer [Mirkwood], Вы писали:


SM>>CreateParentedControl — что за зверь такой? Он публичный? И чем отличается от CreateParented? В D3 его нет...


SM>>Slicer



ST>
ST>constructor TWidgetControl.CreateParented(ParentWidget: QWidgetH);
ST>begin
ST>  FParentWidget := ParentWidget;
ST>  Create(nil);
ST>end;
ST>

Еще:
class function TWidgetControl.CreateParentedControl(ParentWidget: QWidgetH): TWidgetControl;
begin
  Result := CreateParented(ParentWidget);
end;

Но это из CLX (перепутал я).


В VCL :
class function TWinControl.CreateParentedControl(ParentWindow: HWnd): TWinControl;
begin
  Result := TWinControl(NewInstance);
  Result.FParentWindow := ParentWindow;
  Result.Create(nil);
end;


Из хелпа:

Description

Call CreateParentedControl to embed a new control in a non-VCL parent.

CreateParentedControl allocates memory for a new instance of the same class as the control (Delphi) or is the class specified by the vmt parameter (C++), sets its ParentWindow property to ParentWindow, and calls the constructor, passing in nil (Delphi) or NULL (C++) for the Owner parameter. CreateParentedControl returns the newly created control.

CreateParentedControl has the same purpose as CreateParented, but is a simple class function instead of a constructor. Unlike CreateParented, CreateParentedControl can be called from C++ code.
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.