PDA

Просмотр полной версии : Нужна помощь , Компоненты и классы


Sherman
22.01.2012, 02:38
Что-то под ночь подтупливаю....
Нужна помощь....


unit uMain;

interface

uses
VirtualTrees,
uBaseListTreeView, uBaseListView,
acAlphaImageList;

type
// HACK класса
// Тут я перекрываю класс TVirtualStringTree своим объявленным в uBaseListTreeView
TVirtualStringTree = class (uBaseListTreeView.TBaseListTreeView)


описание в uBaseListTreeView:
unit uBaseListTreeView;

interface

uses
VirtualTrees;

type
TBaseListTreeView = class(TVirtualStringTree)

Все хорошо, но понадобилось добавить на форму тот же компонент, но перекрыть его классом , объявленным в uBaseListView

Как это лучше сделать, что то правда - туплю???

update...

Эксперименты с вариантом:
type
TMainForm = class(TForm)
Panel1: TPanel;
Splitter1: TSplitter;
TreeImageList: TsAlphaImageList;
Panel2: TPanel;
Panel3: TPanel;
BaseListTree : uBaseListTreeView.TVirtualStringTree;
BaseList : uBaseListView.TVirtualStringTree;
Button1: TButton;
Button2: TButton;

Провалились :(
BaseList - потомок uBaseListTreeView.TVirtualStringTree и никак не хочет быть потомком uBaseListView.TVirtualStringTree

update...

Вобщем, пошел по пути наименьшего сопротивления и выход нашел в переопределении еще одного компонента... по типу:


type
TVirtualStringTree = class(TBaseListTreeView);
type
TVirtualDrawTree = class(TBaseListView);

type
TMainForm = class(TForm)
BaseListTree: TVirtualStringTree;
BaseList: TVirtualDrawTree;

unit uBaseListTreeView;
type
TBaseListTreeView = class(TVirtualStringTree)

unit uBaseListView;
type
TBaseListView = class(TVirtualStringTree)