Редактор формы run-time

Status
Not open for further replies.

dmitrigan

Member
Joined
May 1, 2007
Messages
10
Reaction score
0
Age
48
Location
Ставрополь
Всем привет!
Есть ли что то готовое для добавления своему приложению на Дельфях визуального редактора формы? ну там набросать компонентов, можно даже без обработчиков событий.. сохранить -загрузить ... и т.п.
если есть примеры, буду очень благодарен.
 

LeshaRB

Botnet Operator
Exploit Developer
Joined
Jun 11, 2022
Messages
320
Reaction score
451
Location
Canada
Deposit
$ 150
Книга одна есть там все эти примеры описаны
 

LeshaRB

Botnet Operator
Exploit Developer
Joined
Jun 11, 2022
Messages
320
Reaction score
451
Location
Canada
Deposit
$ 150
Всем привет!
Есть ли что то готовое для добавления своему приложению на Дельфях визуального редактора формы? ну там набросать компонентов, можно даже без обработчиков событий.. сохранить -загрузить ... и т.п.
если есть примеры, буду очень благодарен.

Автора вспомнил
Марко Канту

Книга по-моему delphi для профессионалов
Там глава посвящена это все описано хоршо

У меня старая редакция и она дома (поэтому с названием могу ошибаться) если еще интересно будет скину название
 

Hazarin

Member
Joined
Sep 11, 2007
Messages
10
Reaction score
0
EControl Form Designer - не оно?
На мой взгляд самое то, тем более, что в соседнем топике выложили недавно ссылку на посл версию
 

mike.alimov

Member
Joined
Aug 13, 2013
Messages
15
Reaction score
2
Location
Ташкент
Form Designer от greatis.com попробуйте, правда он платный, но его можно найти и бесплатно
 

eflc

Exploit Developer
Joined
Jul 17, 2021
Messages
67
Reaction score
22
Age
37
Если у кого-нибудь есть ссылочка, буду багодарен :)
 
Joined
Oct 1, 2009
Messages
21
Reaction score
13
Age
55
вот такой код я использую для подгрузки DFM
раньше был очень короткий но заглючил с девками
https://www.devexpress.com/Support/Center/Question/Details/T275318
поэтому пришлось чуть поменять дельфовскуй исходную InitInheritedComponent1

constructor TForm11.Create(AOwner: TComponent); // override;

Inherited CreateNew(AOwner);
if (ClassType <> TForm11) and not(csDesigning in ComponentState) then
if not InitInheritedComponent1(Self, TForm) then
raise EResNotFound.CreateFmt('TForm11 res', [ClassName]);

OldCreateOrder := False;



function InternalReadComponentRes1(const ResName: UnicodeString;
HInst: THandle; var Instance: TComponent): Boolean; overload;
var
HRsrc: THandle;
begin { avoid possible EResNotFound exception }
if HInst = 0 then
HInst := HInstance;
HRsrc := FindResourceW(HInst, PWideChar(ResName), PWideChar(RT_RCDATA));
Result := HRsrc <> 0;
if not Result then
Exit;

with TResourceStream.Create(HInst, ResName, RT_RCDATA) do
try
Instance := ReadComponent(Instance);
finally
Free;
end;
Result := True;
end;

function ReadFromDFM(filename: UnicodeString;
var Instance: TComponent): Boolean;
var
fs: TFileStream;
Buffer: array [0 .. 0] of Byte;
ms: TMemoryStream;
begin
fs := TFileStream.Create(filename, fmOpenRead);

fs.Read(Buffer, 1); // read the first 4 bytes
fs.Seek(0, 0);

if Buffer[0] <> $FF then
begin // is it a DFM resource?
ms := TMemoryStream.Create;

ObjectTextToBinary(fs, ms);

ms.Seek(0, soFromBeginning);
ms.ReadComponent(Instance);
ms.Free;
fs.Free;
end
else
begin
fs.Free;
ReadComponentResFile(filename, Instance);
end;
end;

function InitInheritedComponent1(Instance: TComponent;
RootAncestor: TClass): Boolean;

function InitComponent1(ClassType: TClass): Boolean;
begin
Result := False;
if (ClassType = TComponent) or (ClassType = RootAncestor) then
Exit;
Result := InitComponent1(ClassType.ClassParent);

if ClassType.ClassParent.ClassParent = TForm11 then
Result := ReadFromDFM( ClassType.UnitName + '.dfm',

Instance) or Result
else
Result := InternalReadComponentRes1(ClassType.ClassName,
FindResourceHInstance(FindClassHInstance(ClassType)), Instance)
or Result;

end;

var
LocalizeLoading: Boolean;
begin
GlobalNameSpace.BeginWrite; // hold lock across all ancestor loads (performance)
try
LocalizeLoading := (Instance.ComponentState * [csInline, csLoading]) = [];
if LocalizeLoading then
BeginGlobalLoading; // push new loadlist onto stack
try
Result := InitComponent1(Instance.ClassType);
if LocalizeLoading then
NotifyGlobalLoading; // call Loaded
finally
if LocalizeLoading then
EndGlobalLoading; // pop loadlist off stack
end;
finally
GlobalNameSpace.EndWrite;
end;
end;
 
Status
Not open for further replies.
Top