Sign in Join

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

Mailing lists / fpc-devel / 2006-01

Lazarus

14 messages · 9 people · –

Reply by email Subscribe to this list Your subscription

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

Felipe Monteiro de Carvalho
to VisionForce
VisionForce wrote
Is there a way I can change Lazarus to an MDI style instead of having that floating desktop style?

There is a missing part on Lazarus code before MDI can be implemented. This is Docking.

If you implement Docking, then things would be much easier =)

There is MDI-like support for apps created with Lazarus, but not for Lazarus itself. Take a look at:
http://wiki.lazarus.freepascal.org/index.php/MultiDoc

Felipe Monteiro de Carvalho

Reply by email

VisionForce
to Felipe Monteiro de Carvalho: There is a missing part on Lazarus code before MDI can be implemented. This is Docking.…

So where would I need to start if I wanted to add this to Lazarus?

Sincerely,
Alex C. Barberi
VisionForce
http://www.visionforceweb.com

Earlier message 23 lines
----- Original Message ----- From: "Felipe Monteiro de Carvalho" To: "FPC developers' list" Sent: Saturday, January 21, 2006 5:51 PM Subject: Re: [fpc-devel] Lazarus On 1/21/06, VisionForce wrote: > > Is there a way I can change Lazarus to an MDI style instead of having that > floating desktop style? There is a missing part on Lazarus code before MDI can be implemented. This is Docking. If you implement Docking, then things would be much easier =) There is MDI-like support for apps created with Lazarus, but not for Lazarus itself. Take a look at: http://wiki.lazarus.freepascal.org/index.php/MultiDoc -- Felipe Monteiro de Carvalho

Reply by email

Felipe Monteiro de Carvalho
to VisionForce
VisionForce wrote
So where would I need to start if I wanted to add this to Lazarus?

On Lazarus website, click on "Project Roadmap". There you will find the status of "Docking (= the combination of forms)". It is marked as "In Progress", so probably someone is already started working on this. Now you need to find who is working on Docking and ask him how you can help.

Vincent probably knows who is working with docking (if someone is at all).

To implement this feature, I would:

* Search (google) how docking can be done using the Windows API on a standard Windows API program

* Search (google) how docking can be done using Gtk on a standard Gtk program (if you want to add Linux support too)

* Research how to use the Delphi docking interface and try to make methods compatible with it.

I know at least that a few methods needs to be implemented on TControl:

function ManualDock(NewDockSite: TWinControl; DropControl: TControl =
nil; ControlSide: TAlign = alNone): Boolean;
procedure Dock (NewDockSite: TWinControl; ARect: TRect); dynamic;
function ManualFloat(ScreenPos: TRect): Boolean;

Use ManualFloat to undock the control programmatically.

ScreenPos is the rectangle in which the control is displayed when it starts floating

function GetDockEdge(MousePos: TPoint): TAlign; dynamic;

Use GetDockEdge to get the edge on which another control should be docked when it is dragged over the control.

MousePos is the position of the mouse.

GetDockEdge is called automatically during drag-and-dock operations involving the control.

------
There are probably many other things that need to be implemented =)

Felipe Monteiro de Carvalho

Reply by email

Mattias Gaertner
to Felipe Monteiro de Carvalho
Show quoted text 10 lines
On 1/21/06, VisionForce wrote: > So where would I need to start if I wanted to add this to Lazarus? On Lazarus website, click on "Project Roadmap". There you will find the status of "Docking (= the combination of forms)". It is marked as "In Progress", so probably someone is already started working on this. Now you need to find who is working on Docking and ask him how you can help. Vincent probably knows who is working with docking (if someone is at all).

Well, I'm working on it. At least from time to time I am.

Show quoted text 24 lines
To implement this feature, I would: * Search (google) how docking can be done using the Windows API on a standard Windows API program * Search (google) how docking can be done using Gtk on a standard Gtk program (if you want to add Linux support too) * Research how to use the Delphi docking interface and try to make methods compatible with it. I know at least that a few methods needs to be implemented on TControl: function ManualDock(NewDockSite: TWinControl; DropControl: TControl = nil; ControlSide: TAlign = alNone): Boolean; procedure Dock (NewDockSite: TWinControl; ARect: TRect); dynamic; function ManualFloat(ScreenPos: TRect): Boolean; Use ManualFloat to undock the control programmatically. ScreenPos is the rectangle in which the control is displayed when it starts floating

These already work. But some messages are not properly delegated in the win32 interface. Although this is more a CustomForm.Parent issue, than docking.

Show quoted text 9 lines
function GetDockEdge(MousePos: TPoint): TAlign; dynamic; Use GetDockEdge to get the edge on which another control should be docked when it is dragged over the control. MousePos is the position of the mouse. GetDockEdge is called automatically during drag-and-dock operations involving the control.

IMHO docking with TAlign alone is not intuitive for the user. It requires an internal tree of rows and columns, which the user can't see and limits the users choices for dock layouts. That's why I started another approach: Anchor docking. Here the internal representation fits to what the user sees
- WYSISWYG. It already works, even docking in pages. see below for the ToDos.

There are probably many other things that need to be implemented =)

Yes.
- A good dock manager with smart save and restore abilities. Especially for hidden/reshown forms.
- Fix the win32 message delegation.
- Frames for gtk forms
- Form.BoundsRect changes. I'm not sure yet, how.
- Drag&Drop docking

Mattias

Reply by email

Amir Aavani
to Felipe Monteiro de Carvalho: There is a missing part on Lazarus code before MDI can be implemented. This is Docking.…

dear friends,
I know that if want to use an external variable/procedure in fpc, i should use the following code:

function GetEnvironment (const Name: PChar): PChar; cdecl; external 'c'
name 'getenv';

but how could i add for example GetEnvironment function to a class (TEnvironment)!
Is there any good (OO) way?

Is it a good idea to use a following method:

TGetEnvironmentFunction= function : PChar;
TEnvironment= class (TObject)
private
  ...
public
  GetEnvironment: TGetEnvironment;
  procedure SetGetEnvironmentFunction (AFunction: TGetEnvironmentFunction);
  ...
end;
procedure TEnvironment.SetGetEnvironmentFunction (AFunction:
TGetEnvironmentFunction);
begin
  GetEnvironment:= AFunction;
end;

Reply by email

Geno Roupsky
to Amir Aavani

This particular function could be declared as this:

TEnvironment = class
public
  class function GetEnvironment(const Name: PChar): PChar; cdecl;
end;
class function GetEnvironment(const Name: PChar): PChar; cdecl; external
'c' name 'getenv';

Of course this is not very useful but the idea for methods is this. Just keep in mind that methods have a hidden parameter Self pointing to the object. When method is declared as cdecl it is the first parameter.

Tia,

Geno Roupsky

В вт, 2006-01-31 в 10:05 +0330, Amir Aavani написа:

Show quoted text 35 lines
dear friends, I know that if want to use an external variable/procedure in fpc, i should use the following code: function GetEnvironment (const Name: PChar): PChar; cdecl; external 'c' name 'getenv'; but how could i add for example GetEnvironment function to a class (TEnvironment)! Is there any good (OO) way? Is it a good idea to use a following method: TGetEnvironmentFunction= function : PChar; TEnvironment= class (TObject) private ... public GetEnvironment: TGetEnvironment; procedure SetGetEnvironmentFunction (AFunction: TGetEnvironmentFunction); ... end; procedure TEnvironment.SetGetEnvironmentFunction (AFunction: TGetEnvironmentFunction); begin GetEnvironment:= AFunction; end; _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Marco van de Voort
to Amir Aavani: I know that if want to use an external variable/procedure in fpc, i should use the…
Show quoted text 6 lines
dear friends, I know that if want to use an external variable/procedure in fpc, i should use the following code: function GetEnvironment (const Name: PChar): PChar; cdecl; external 'c' name 'getenv';

Note that this procedure is already available as "fpgetenv" from unit baseunix, and in a more friendly style as "getenvironmentvariable" using plain strings from sysutils.

Reply by email

Amir Aavani
to Geno Roupsky: This particular function could be declared as this: TEnvironment = class public class…

Thanks Geno
that works, but could you tell me what should i do for an external variable, var environ: ppchar; cvar; external;

Geno Roupsky wrote 11 lines
This particular function could be declared as this: TEnvironment = class public class function GetEnvironment(const Name: PChar): PChar; cdecl; end; class function GetEnvironment(const Name: PChar): PChar; cdecl; external 'c' name 'getenv';
  function TEnvironment.GetEnvironment(const Name: PChar): PChar; cdecl;
external
       'c' name 'getenv';
Show quoted text 54 lines
Of course this is not very useful but the idea for methods is this. Just keep in mind that methods have a hidden parameter Self pointing to the object. When method is declared as cdecl it is the first parameter. Tia, Geno Roupsky В вт, 2006-01-31 в 10:05 +0330, Amir Aavani написа: >dear friends, >I know that if want to use an external variable/procedure in fpc, i >should use the following code: > >function GetEnvironment (const Name: PChar): PChar; cdecl; external 'c' >name 'getenv'; > >but how could i add for example GetEnvironment function to a class >(TEnvironment)! >Is there any good (OO) way? > >Is it a good idea to use a following method: > >TGetEnvironmentFunction= function : PChar; >TEnvironment= class (TObject) >private > ... >public > GetEnvironment: TGetEnvironment; > procedure SetGetEnvironmentFunction (AFunction: TGetEnvironmentFunction); > ... >end; > >procedure TEnvironment.SetGetEnvironmentFunction (AFunction: >TGetEnvironmentFunction); >begin > GetEnvironment:= AFunction; >end; > > > >_______________________________________________ >fpc-devel maillist - >http://lists.freepascal.org/mailman/listinfo/fpc-devel > > > _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Tomas Stejskal
to Amir Aavani: I know that if want to use an external variable/procedure in fpc, i should use the…

I think better OO solution is to create wrapper method around the external function.

function getenv(const Name: PChar): PChar; cdecl; external 'c';
TEnvironment = class(TObject)
public
  function GetEnvironment(const AName: String): String;
end;
function TEnvironment.GetEnvironment(const AName: String): String;
begin
  Result := String(getenv(PChar(AName)));
end;

Tomas Stejskal

Amir Aavani wrote 35 lines
dear friends, I know that if want to use an external variable/procedure in fpc, i should use the following code: function GetEnvironment (const Name: PChar): PChar; cdecl; external 'c' name 'getenv'; but how could i add for example GetEnvironment function to a class (TEnvironment)! Is there any good (OO) way? Is it a good idea to use a following method: TGetEnvironmentFunction= function : PChar; TEnvironment= class (TObject) private ... public GetEnvironment: TGetEnvironment; procedure SetGetEnvironmentFunction (AFunction: TGetEnvironmentFunction); ... end; procedure TEnvironment.SetGetEnvironmentFunction (AFunction: TGetEnvironmentFunction); begin GetEnvironment:= AFunction; end; _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Daniël Mantione
to Amir Aavani

Op Fri, 3 Feb 2006, schreef Amir Aavani:

Any one call a webservice (WSDL) from Freepascal. I did it using Delphi, but now i want to do it by freepascal/Lazarus.

You are as clear as saying "I live in Europe and don't like my neighbourhood". Please be more specific.

Daniel

Reply by email

Michael Van Canneyt
to Daniël Mantione
Daniël Mantione wrote 10 lines
Op Fri, 3 Feb 2006, schreef Amir Aavani: > > Any one call a webservice (WSDL) from Freepascal. I did it using Delphi, but > now i want to do it by freepascal/Lazarus. You are as clear as saying "I live in Europe and don't like my neighbourhood". Please be more specific.

It's clear for me (but I live in Europe ;) )

FPC has all the components to which you need to call a WSDL, but does not offer a simple wrapper such as Delphi does.

The current way is to
- Create a request using the DOM components. This should be quite

   straightforward;

- Use some network components (Synapse, lnet, Indy) to send the request and receive the result.
- Use again DOM to analyze the result of the request.

FPC contains a xmlRPC implementation, which you can use and adapt to work with WDSL/SOAP. The protocol is similar, see the directory fcl/xml of the sources.

At a later stage, xmlRPC will be extended to be able to connect to a SOAP service. At that time, it will be simple to create a wrapper wich does all the above for you.

Michael.

Reply by email