[Lazarus] Creating SDK like system

classic Classic list List threaded Threaded
8 messages Options
ik
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Creating SDK like system

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



--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Creating SDK like system

Daniel Franzini
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 <[hidden email]>
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
[hidden email]
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'')

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Creating SDK like system

Felipe Monteiro de Carvalho
In reply to this post by ik
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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Creating SDK like system

Michael Schnell
In reply to this post by ik
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
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
ik
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Creating SDK like system

ik
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


On Thu, Apr 14, 2011 at 10:47, Michael Schnell <[hidden email]> wrote:
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
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Creating SDK like system

Hans-Peter Diettrich
In reply to this post by ik
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".

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


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Creating SDK like system

Michael Schnell
In reply to this post by ik
BTW.:
Maybe for your needs a resource stream is not even a good idea. I
suppose it's not difficult to have a program read it's GUI design from a
file instead of from the resource steam. So you can modify the look
independently from the executable.

-Michael

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
ik
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Creating SDK like system

ik
In reply to this post by Hans-Peter Diettrich


On Thu, Apr 14, 2011 at 13:15, Hans-Peter Diettrich <[hidden email]> wrote:
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,
 

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
 



--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus