Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-04

Creating SDK like system

8 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

ik

Hello,

I was requested to create a Windows program that can be changed (the interface) using some sort of SDK.
I have never created such systems before, and I'm looking to understand how I design something like that in a program written in Lazarus.

Thanks

Ido

LINESIP - Opening the source for communication
http://www.linesip.com
http://www.linesip.co.il
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110413/0ce37182/attachment.html>

Reply by email

Daniel Franzini
to ik

Maybe you should start making your program customizable using DLLs with GUI resources (strings, bitmaps). That's the initial approach I would take if I had to design such a thing.

Another thing one may use is to embed some sort of scripting languague interpreter and exposing GUI behavior through to the interpreter. Lua, Python and Pascal itself are good candidates.

2011/4/13 ik

Show quoted text 25 lines
Hello, I was requested to create a Windows program that can be changed (the interface) using some sort of SDK. I have never created such systems before, and I'm looking to understand how I design something like that in a program written in Lazarus. Thanks Ido LINESIP - Opening the source for communication http://www.linesip.com http://www.linesip.co.il -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Daniel "Let us change our traditional attitude to the construction of programs. Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do." (Donald Knuth) "Yes, technogeeks can be funny, even if only to each other." ( http://www.boogieonline.com/revolution/science/humor/)" "Man is driven to create; I know I really love to create things. And while I'm not good at painting, drawing, or music, I can write software." (Yukihiro Matsumoto, a.k.a. ``Matz'') -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110413/9938108d/attachment.html>

Reply by email

Felipe Monteiro de Carvalho
to ik: I was requested to create a Windows program that can be changed (the interface) using…

It depends on a lot on the kind of level that you want to expose in your API. Also will the API be accessed from Pascal or C?

One design goes like this:

Main Program --> Plugin DLL

In the DLL make one routine which will receive a structure filled with pointers to APIs exported by the main program. Then the plugin DLL can use those APIs.

One example of API that the main program can expose:

function AddTEditToMainForm(APos: TPoint; ASize: TSize; ACaption: PChar): TEdit;
begin
  Result := TEdit.Create(MyForm);
  Result.Parent := MyForm;
  Result.Width := ASize.Width; // or similar, don't remember what comes in TSize
  // do the same for the other coordinates and other stuff too
end;

In C TEdit can be treated as an opaque pointer.

Similarly from Pascal when importing this function one option is threading the TEdit as an opaque pointer to avoid the problem of getting an unified memory and a unified RTL.

The plugin system in the Virtual Magnifying Glass works like that: http://sourceforge.net/projects/magnifier/

Felipe Monteiro de Carvalho

Reply by email

Michael Schnell
to ik: I was requested to create a Windows program that can be changed (the interface) using…
ik wrote 6 lines
I was requested to create a Windows program that can be changed (the interface) using some sort of SDK. I have never created such systems before, and I'm looking to understand how I design something like that in a program written in Lazarus.

Lazarus provides a GUI designer. Maybe you can strip-down and modify it according to your needs.

The LCL provides lots of elements for the designer to use. Maybe you can select some and modify and enhance them according to your needs.

The code of the GUI elements is "living" as well at design time as at run time to create and draw the elements and "visually" assign parameters to them.

The Lazarus GUI designer creates a resource stream from these "visual" parameters that is compiled into the target executable.

The executable executes the GUI elements' code to have them draw themselves according to the stored parameters.

So maybe Lazarus itself is a good starting point.

-Michael

Reply by email

ik
to Michael Schnell

Thank you all for your answers, now I returned the ball to the client to understand better what type of changes they want to be able to do, so I'll know what to design.

Ido

Michael Schnell wrote 34 lines
On 04/13/2011 05:12 PM, ik wrote: > I was requested to create a Windows program that can be changed (the > interface) using some sort of SDK. > I have never created such systems before, and I'm looking to understand > how I design something like that in a program written in Lazarus. > > Lazarus provides a GUI designer. Maybe you can strip-down and modify it according to your needs. The LCL provides lots of elements for the designer to use. Maybe you can select some and modify and enhance them according to your needs. The code of the GUI elements is "living" as well at design time as at run time to create and draw the elements and "visually" assign parameters to them. The Lazarus GUI designer creates a resource stream from these "visual" parameters that is compiled into the target executable. The executable executes the GUI elements' code to have them draw themselves according to the stored parameters. So maybe Lazarus itself is a good starting point. -Michael -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110414/09721657/attachment.html>

Reply by email

Hans-Peter Diettrich
to ik: I was requested to create a Windows program that can be changed (the interface) using…
I was requested to create a Windows program that can be changed (the interface) using some sort of SDK.

That's very vague. Does the requestor have a specific idea about such an SDK, together with the functionality of the program? It sounds to me like "something like XYZ has".

When it's about the creation or modification of the GUI, an "SDK" could create the resource files (.lfm) of the forms. Everything else (event handlers...) should be predefined in the application, with flags (properties) in the .lfm to enable or configure that functionality, and the usual assignment of handlers to the events of the components.

DoDi

Reply by email

ik
to Hans-Peter Diettrich: That's very vague. Does the requestor have a specific idea about such an SDK, together…
Hans-Peter Diettrich wrote 11 lines
ik schrieb: I was requested to create a Windows program that can be changed (the > interface) using some sort of SDK. > That's very vague. Does the requestor have a specific idea about such an SDK, together with the functionality of the program? It sounds to me like "something like XYZ has".

It is vegue, but because I have never done it before, I didn't know what exactly to ask.
Now I understand it better, and send several questions what exactly is needed,

Show quoted text 7 lines
When it's about the creation or modification of the GUI, an "SDK" could create the resource files (.lfm) of the forms. Everything else (event handlers...) should be predefined in the application, with flags (properties) in the .lfm to enable or configure that functionality, and the usual assignment of handlers to the events of the components.

That's one way. Another way I was thinking was to allow to edit the lfm file, and also to provide a dll with some API like "register button", with it's name and to be able to register a callback back to the the API when it was used.

DoDi

Ido

Show quoted text 9 lines
-- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110414/a0755284/attachment.html>

Reply by email