Re: [lazarus] Lazarus File bigger then Delphi File?

2007-01-17 Thread Florian Klaempfl
George Birbilis schrieb:
>>   let me ask you a few questions:
>>   are you still using 1.44 floppies?
>>   are you sending compiled execs 20 times a day via 56k
>> modem connection?
>>   no? then why 1 or 2 mb bigger is so bad for you?
>>   btw, delphi is NOT multiplatform. whant smaller exec
>> linux+windows?
>>   buy delphi, buy kylix, have a hard time porting
>> everything and tuning
>>   everything to work similar.
>>   size is a cost of multiplatform and RAD+functionality power.
>>   enough arguments? or should i add more?
>>
>>
>> I can't say anything.
>>
>>
> 
> I know this is an old thread, but regarding Delphi silly .exe bloating, for
> command-line apps, if you removed some units like forms or sysutils and uses
> windows unit (and respective API - even for just one call to MessageBox
> instead of ShowMessage) the .EXE would become say 50kb instead of 500kb.

The abstraction layers of sysutils and classes simply require space. Either
people has to live with it or don't use it. E.g. a simple uses of sysutils pulls
in a lot of code because of the rte to exception conversion including a lot of
resourcestrings etc.

> Pretty crazy, maybe fixed at versions after Delphi7 (had told Borland guys
> about it). Either the compiler didn't remove unused classes/code (in favor
> of RTTI and dynamic stuff or something?) or it was some resources linked in.

Smartlinking with classes having virtual methods is not working because the
compiler _can't_ know which methods are actually unused.

> 
> In some case I had found that moving such units from interface to
> implementation section at my units that the project was using it made the
> size much smaller for the .exe
> 
> 
> George Birbilis ([EMAIL PROTECTED])
> Computer & Informatics Engineer
> Microsoft MVP J# for 2004-2007
> Borland "Spirit of Delphi"
> 3D, QuickTime, QTVR, Java, Delphi,
> ActiveX, .NET components, Robotics
> http://www.kagi.com/birbilis
> http://birbilis.spaces.live.com
> 
> 
> 
> 
>   _  
> 
> avast! Antivirus  : Outbound message clean. 
> 
> 
> Virus Database (VPS): 0703-0, 13/01/2007
> Tested on: 17/1/2007 5:15:23 ??
> avast! - copyright (c) 1988-2007 ALWIL Software.
> 
> 
> 
> _
>  To unsubscribe: mail [EMAIL PROTECTED] with
> "unsubscribe" as the Subject
>archives at http://www.lazarus.freepascal.org/mailarchives

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Lazarus for Python (L4P)

2007-01-17 Thread Tiziano_mk

Michael Van Canneyt wrote:


On Wed, 17 Jan 2007, Tiziano_mk wrote:


(note: Issuing commands to OpenOffice can be easily done with Delphi, this is
explained in the OpenOffice SDK, but it uses the Uno OLE automation bridge.
Since OLE and COM is not available in other platforms, FPC doesn't support
them, so, this approach is not available for it)


OLE and COM are supported in FPC, but only on Windows. So in theory you
can automate OOo directly on Windows.

not in FPC 2.0.4, AFAIK, which is the current release.
I think you are talking of FPC 2.1.x.



IMHO a OOo interface should use OLE/COM on windows, and any other means
(for example python) on other platforms. Although I think that if python
can call openoffice, FPC should be able to do the same.

It's true, in fact pyuno is a DLL/so that implements a bridge on the OO
UNO APIs, but I have no idea how it works...

tiziano

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Lazarus AMD64 version bug ?

2007-01-17 Thread ik

I also have this problem.

If you will look at my email about it, you can find more details what
causing it.

Ido
On 1/18/07, Michael Van Canneyt <[EMAIL PROTECTED]> wrote:

Hello,

Clicking the middle mouse button in the Lazarus editor window
crashes the IDE with a 'Segmentation fault' if it's compiled
for AMD64. The IDE just exits, and prints
"Segmentation fault" on the terminal.

The exact same sources, compiled for i386 work fine, and clicking
the middle mouse button pastes the X selection in the editor.
(as I expected it to do).

Tried on Linux-AMD64, SuSE 10.1, today's SVN version of lazarus and FPC.

Michael.



--
http://ik.homelinux.org/

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Lazarus File bigger then Delphi File?

2007-01-17 Thread Graeme Geldenhuys

In the real world, bigger is always better! Well, that's the American
way of thinking.  How come that doesn't apply for Lazarus executables!
:-)


Graeme.



On 1/17/07, George Birbilis <[EMAIL PROTECTED]> wrote:

>   let me ask you a few questions:
>   are you still using 1.44 floppies?
>   are you sending compiled execs 20 times a day via 56k
> modem connection?
>   no? then why 1 or 2 mb bigger is so bad for you?
>   btw, delphi is NOT multiplatform. whant smaller exec
> linux+windows?
>   buy delphi, buy kylix, have a hard time porting
> everything and tuning
>   everything to work similar.
>   size is a cost of multiplatform and RAD+functionality power.
>   enough arguments? or should i add more?


_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Code completion formatted code incorrectly

2007-01-17 Thread Graeme Geldenhuys

On 1/17/07, Mattias Gaertner <[EMAIL PROTECTED]> wrote:

> Using Code Completion (pressing Ctrl-Space) in the interface section
> of a class, so I can override a method, formats the code incorrectly.
> I have Lazarus's "CodeTools Options -> Space tab" setup to not include
> any spaces in front of elements. No checkboxes are checked in the
> "Insert space in front of" groupbox.

What about Insert Space after?


For "Insert space after" I only have Colon, SemiColon and Comma checked.


Does the 'preview' in the options dialog show these spaces?
(Environment -> CodeTools options -> Spaces -> Preview)


The 'preview' window is correct.  What in generated for Class
Completion is different to the preview.


> Problem #2:
> Another problems, is that it doesn't put the 'override' keyword at
> the end!

This is not yet implemented.


No problem.



Yes. At the moment 'class completion' does not search/read the ancestor
class, so it can't know.



Thanks for the info...  I'll had the last two as feature requests to Mantis


--
Graeme Geldenhuys

There's no place like S34° 03.168'  E018° 49.342'

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Lazarus AMD64 version bug ?

2007-01-17 Thread tanila
Hi,

I have the same Problem on Linux-AMD64 / Debian (Etch)

regards
Tanila

Am Mittwoch, den 17.01.2007, 23:00 +0100 schrieb Michael Van Canneyt:
> Hello,
> 
> Clicking the middle mouse button in the Lazarus editor window 
> crashes the IDE with a 'Segmentation fault' if it's compiled 
> for AMD64. The IDE just exits, and prints 
> "Segmentation fault" on the terminal.
> 
> The exact same sources, compiled for i386 work fine, and clicking
> the middle mouse button pastes the X selection in the editor.
> (as I expected it to do).
> 
> Tried on Linux-AMD64, SuSE 10.1, today's SVN version of lazarus and FPC.
> 
> Michael.
> 
> _
>  To unsubscribe: mail [EMAIL PROTECTED] with
> "unsubscribe" as the Subject
>archives at http://www.lazarus.freepascal.org/mailarchives

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Loading Menus form a file at runtime.

2007-01-17 Thread Dave Coventry

Hi Darius, thanks for the reply.

> allMenus[i].OnClick:[EMAIL PROTECTED]
Thank you, that worked.

>Not shure what you want to say here. Can you be more specific?
Yes. The menu file is in the form: "Command=Open" and "Command=New". I 
need some way of Passing "New" or "Open" to my program once the user has 
selected  the menu item.


Darius Blaszijk wrote:
I'd like help on 2 linked problems: Firstly my App halts at 
"allMenus[i].OnClick:=Form1.MenuItem2Click;" with the error "Wrong 
Number of parameters specified."


Procedure MenuItem2Click is in Unit2 and is in the form "procedure 
TForm1.MenuItem2Click(Sender: TObject);" I understand, from Googling 
extensively, that this should work.
It should yes, but from what I can see you should use: 
allMenus[i].OnClick:[EMAIL PROTECTED] or add {$mode delphi} to the top 
of your unit. FPC has more strict syntax than delphi.


And secondly, how can I access the Command=new Name/Value pair once 
it does get to MenuItem2Click.

Not shure what you want to say here. Can you be more specific?

Darius



I hope this is reasonably clear. 


_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives





--
Dave Coventry
Tel:  +27(0)31 3092301
Fax:  +27(0)31 3092301
Cell: +27(0)82 3685983

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] Lazarus AMD64 version bug ?

2007-01-17 Thread Michael Van Canneyt
Hello,

Clicking the middle mouse button in the Lazarus editor window 
crashes the IDE with a 'Segmentation fault' if it's compiled 
for AMD64. The IDE just exits, and prints 
"Segmentation fault" on the terminal.

The exact same sources, compiled for i386 work fine, and clicking
the middle mouse button pastes the X selection in the editor.
(as I expected it to do).

Tried on Linux-AMD64, SuSE 10.1, today's SVN version of lazarus and FPC.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TXMLDocument from string

2007-01-17 Thread Michael Van Canneyt


On Wed, 17 Jan 2007, Vincent Snijders wrote:

> Michael Van Canneyt schreef:
> > 
> > On Wed, 17 Jan 2007, Vincent Snijders wrote:
> > 
> > > Mattias Gaertner schreef:
> > > > On Tue, 16 Jan 2007 19:42:32 +0100
> > > > Vincent Snijders <[EMAIL PROTECTED]> wrote:
> > > >
> > > >
> > > > It seems to be quite old: 2005-05-26. 
> > > It is. OTOH, not much LCL documentation has been added.
> > >
> > > I will create a new set, when fpdoc is fixed again:
> > > http://www.freepascal.org/mantis/view.php?id=8126
> > 
> > This bug is fixed.
> > 
> 
> I am updating already.

You have to admire it:
The merits of open source and community effort at work :-)

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TXMLDocument from string

2007-01-17 Thread Vincent Snijders

Michael Van Canneyt schreef:


On Wed, 17 Jan 2007, Vincent Snijders wrote:


Mattias Gaertner schreef:

On Tue, 16 Jan 2007 19:42:32 +0100
Vincent Snijders <[EMAIL PROTECTED]> wrote:


It seems to be quite old: 2005-05-26. 

It is. OTOH, not much LCL documentation has been added.

I will create a new set, when fpdoc is fixed again:
http://www.freepascal.org/mantis/view.php?id=8126


This bug is fixed.



I am updating already.

Vincent

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TXMLDocument from string

2007-01-17 Thread Michael Van Canneyt


On Wed, 17 Jan 2007, Vincent Snijders wrote:

> Mattias Gaertner schreef:
> > On Tue, 16 Jan 2007 19:42:32 +0100
> > Vincent Snijders <[EMAIL PROTECTED]> wrote:
> > 
> > 
> > It seems to be quite old: 2005-05-26. 
> 
> It is. OTOH, not much LCL documentation has been added.
> 
> I will create a new set, when fpdoc is fixed again:
> http://www.freepascal.org/mantis/view.php?id=8126

This bug is fixed.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Loading Menus form a file at runtime.

2007-01-17 Thread Darius Blaszijk
I'd like help on 2 linked problems: Firstly my App halts at 
"allMenus[i].OnClick:=Form1.MenuItem2Click;" with the error "Wrong Number 
of parameters specified."


Procedure MenuItem2Click is in Unit2 and is in the form "procedure 
TForm1.MenuItem2Click(Sender: TObject);" I understand, from Googling 
extensively, that this should work.
It should yes, but from what I can see you should use: 
allMenus[i].OnClick:[EMAIL PROTECTED] or add {$mode delphi} to the top of 
your unit. FPC has more strict syntax than delphi.


And secondly, how can I access the Command=new Name/Value pair once it 
does get to MenuItem2Click.

Not shure what you want to say here. Can you be more specific?

Darius



I hope this is reasonably clear. 


_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] Loading Menus form a file at runtime.

2007-01-17 Thread Dave Coventry

Hi,

I'm trying to import a set of menus from a TextFile in the form of:

[MnuItem-0]
   Name=&File
   TearOffName=POP1
   Command=POP1
   Visibility=12
[MnuItem-1]
   Name=&New...Ctrl+N
   Command=new
   HelpString=Creates a new file:  NEW
   Visibility=159
   SubLevel=1
[MnuItem-2]
   Name=&Open...Ctrl+O
   TearOffName=POP3
   Command=open
   HelpString=Opens an existing file:  OPEN
   Visibility=159
   SubLevel=1
...
...


My code is as follows
//
var allMenus:array[0..600]of TMenuItem;

procedure constructMenus;
var
 i,Level:integer;
 MenuTree:array[0..15]of integer;
 menulist:TstringList;
 TF:TextFile;
 ILine:string;
 SearchCharacter:PChar;
begin
 if FileExists(ExecPath+'menu.mnu')then
 begin
   AssignFile(TF,ExecPath+'menu.mnu');
   Reset(TF);
   i:=-1;
   menuList:=TStringList.Create;
   while not eof(TF)do
   begin
 Readln(TF,ILine);
 SearchCharacter:=StrScan(PChar(ILine),'[');
 if SearchCharacter<>nil then
 begin
   if SearchCharacter[0]='['then
   begin
 if menuList.Count>1 then
 begin
   inc(i);
   if menuList.Values['SubLevel']='' then Level:=0
   else Level:=strtoint(menuList.Values['SubLevel']);
   if Level=0 then
   begin
 allMenus[i]:=TMenuItem.Create(Form1.MainMenu1);
 allMenus[i].Caption:=menuList.Values['Name'];
 Form1.MainMenu1.Items.Add(allMenus[i]);
 MenuTree[0]:=i;
   end
   else
   begin
 allMenus[i]:=tmenuitem.create(allmenus[MenuTree[Level-1]]);
 allMenus[i].Caption:=menuList.Values['Name'];
 allMenus[i].Caption:=menuList.Values['HelpString'];
 allMenus[i].OnClick:=Form1.MenuItem2Click;
 allmenus[MenuTree[Level-1]].Add(allMenus[i]);
 MenuTree[Level]:=i;
   end;
 end;
 menuList.Clear
   end
   else menuList.Add(ILine);
 end
 else menuList.Add(ILine);
   end;
   menuList.Free;
   CloseFile(TF);
 end;
end;   
//
I'd like help on 2 linked problems: Firstly my App halts at 
"allMenus[i].OnClick:=Form1.MenuItem2Click;" with the error "Wrong 
Number of parameters specified."


Procedure MenuItem2Click is in Unit2 and is in the form "procedure 
TForm1.MenuItem2Click(Sender: TObject);" I understand, from Googling 
extensively, that this should work.


And secondly, how can I access the Command=new Name/Value pair once it 
does get to MenuItem2Click.


I hope this is reasonably clear.

--
Dave Coventry
Tel:  +27(0)31 3092301
Fax:  +27(0)31 3092301
Cell: +27(0)82 3685983

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TXMLDocument from string

2007-01-17 Thread Vincent Snijders

Mattias Gaertner schreef:

On Tue, 16 Jan 2007 19:42:32 +0100
Vincent Snijders <[EMAIL PROTECTED]> wrote:


It seems to be quite old: 2005-05-26. 



It is. OTOH, not much LCL documentation has been added.

I will create a new set, when fpdoc is fixed again:
http://www.freepascal.org/mantis/view.php?id=8126

Vincent

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Lazarus for Python (L4P)

2007-01-17 Thread Mattias Gaertner
On Wed, 17 Jan 2007 17:06:04 +0200
"George Birbilis" <[EMAIL PROTECTED]> wrote:

> > But when it comes to speed, you can't use Python. It's a script-
> > interpreter! Just like Matlab...
> 
> Matlab has compiler (into C)
> Python has compilers (see Microsoft's IronPython for .NET for example)
> 
> > Further one small remarks:
> > - Python isn't a programming language. Your introduction about
> > Python says: 'written in Python programming language. It is an
> > interesting interpreter'. Which is offcourse a contradiction in
> > terminis. I guess that you would never write something that stupid
> > about structural analysis in the book. (like: The structure is
> > statically determinate, so
> > it can't be solved by equations of statics)
> 
> Who says interpretted languages aren't programming languages? But
> anyway, there are compilers for Python (as I said in previous e-mail
> I've made compiler for Logo [generates Pascal from it] and you can do
> similarly for pretty any language combined with some small or bigger
> runtime [for reflection or name/value dictionaries etc.] for the
> dynamic stuff)
> 
> > About using Lazarus as a IDE for Python: some ppl here can react
> > very hostile to that idea. And that's for a reason. From time to
> > time ppl come here to tell us that Lazarus is great, but it's only
> > a pity that it's written/used for Pascal.
> 
> Which filetypes does the Laz IDE now highlight? For example can it
> highlight .XML or .XSL files? Since unihighlighter supports a ton of
> languages (have contributed highlighter for Logo myself for example
> some time ago) I don't see why the IDE shouldn't support all those
> and allow people to use it as a universal programming editor if they
> wish so apart from using it for Pascal projects (why use yet another
> text editor along with the nice Laz text editor?). Delphi has been
> doing that too and VS.net does the same too, can open and highlight
> many different filetypes and even provide intellisense for many of
> them

There is a default highlighter for xml.
You can edit the file extensions in the editor options, which are
highlighted by the xml highliter since I fixed a bug two weeks ago.

Mattias

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Code completion formatted code incorrectly

2007-01-17 Thread Mattias Gaertner
On Wed, 17 Jan 2007 10:11:23 +0200
"Graeme Geldenhuys" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> Using Code Completion (pressing Ctrl-Space) in the interface section
> of a class, so I can override a method, formats the code incorrectly.
> I have Lazarus's "CodeTools Options -> Space tab" setup to not include
> any spaces in front of elements. No checkboxes are checked in the
> "Insert space in front of" groupbox.

What about Insert Space after?

 
> Problem #1:
> This is how the original class has it's method defined. Notice that
> there is no spaces in front of the colons and semi-colons.
> 
> public
>   functionIsValid(const AErrors: TtiObjectErrors): boolean;
> overload; virtual;
> 
> 
> And this is how code completion inserts that method into a new class
> where I am trying to override the method.  Notice the formatting is
> different, it has spaces in front of the identifiers, colons and
> semi-colons.
> 
> public
> function IsValid ( const AErrors : TtiObjectErrors ) : boolean ;
> overload ; virtual ;

Does the 'preview' in the options dialog show these spaces?
(Environment -> CodeTools options -> Spaces -> Preview)

 
> Problem #2:
> Another problems, is that it doesn't put the 'override' keyword at
> the end!

This is not yet implemented.

 
> Problem #3:
> This is more a nice-to-have feature.  When I use the code completion
> in the new class as show above, it inserts the code at the cursor
> location, even if I am in the "private" or "protected" section of the
> class. I think it could be more intelligent and know that the
> overridden method must go into the same section as it was originally
> defined, in this case the "public" section.

Yes. At the moment 'class completion' does not search/read the ancestor
class, so it can't know.


Mattias

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TXMLDocument from string

2007-01-17 Thread Mattias Gaertner
On Tue, 16 Jan 2007 19:42:32 +0100
Vincent Snijders <[EMAIL PROTECTED]> wrote:

> Mattias Gaertner schreef:
> > On Tue, 16 Jan 2007 14:48:53 +0300
> > Al Boldi <[EMAIL PROTECTED]> wrote:
> > 
> >> Mattias Gaertner wrote:
> > There is too few information on that functions... sometime
> > programming with lazarus i feel blind.
> >
> > Where can i found a manual with all Lazarus functions, and where
> > can i search if i don't find anything there?
>  This manual does not yet exist.
>  The source code is your best source (sic) of information...
> >>> Don't be so negative.
> >>> You can try to press F1 on an identifier. Lazarus will open the
> >>> corresponding help webpage. Some functions are already documented.
> >>> Or search the wiki.
> >> Do you have to be online to get help?
> >>
> >> Is there a way to download this helpfile for offline usage?
> > 
> > AFAIK there are no help zip files yet. Of course there are tools
> > like wget to download the pages yourself.
> 
> There is 
> http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=138755

It seems to be quite old: 2005-05-26. 

Mattias

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] sqlite dataset in thread

2007-01-17 Thread Luiz Americo Pereira Camara

[EMAIL PROTECTED] wrote:

thanks Luiz.
  

It resolved your problem?

Luiz

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


RE: [lazarus] Lazarus File bigger then Delphi File?

2007-01-17 Thread George Birbilis
>   let me ask you a few questions:
>   are you still using 1.44 floppies?
>   are you sending compiled execs 20 times a day via 56k
> modem connection?
>   no? then why 1 or 2 mb bigger is so bad for you?
>   btw, delphi is NOT multiplatform. whant smaller exec
> linux+windows?
>   buy delphi, buy kylix, have a hard time porting
> everything and tuning
>   everything to work similar.
>   size is a cost of multiplatform and RAD+functionality power.
>   enough arguments? or should i add more?
>
> 
> I can't say anything.
>
> 

I know this is an old thread, but regarding Delphi silly .exe bloating, for
command-line apps, if you removed some units like forms or sysutils and uses
windows unit (and respective API - even for just one call to MessageBox
instead of ShowMessage) the .EXE would become say 50kb instead of 500kb.
Pretty crazy, maybe fixed at versions after Delphi7 (had told Borland guys
about it). Either the compiler didn't remove unused classes/code (in favor
of RTTI and dynamic stuff or something?) or it was some resources linked in.

In some case I had found that moving such units from interface to
implementation section at my units that the project was using it made the
size much smaller for the .exe


George Birbilis ([EMAIL PROTECTED])
Computer & Informatics Engineer
Microsoft MVP J# for 2004-2007
Borland "Spirit of Delphi"
3D, QuickTime, QTVR, Java, Delphi,
ActiveX, .NET components, Robotics
http://www.kagi.com/birbilis
http://birbilis.spaces.live.com




  _  

avast! Antivirus  : Outbound message clean. 


Virus Database (VPS): 0703-0, 13/01/2007
Tested on: 17/1/2007 5:15:23 ??
avast! - copyright (c) 1988-2007 ALWIL Software.



_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


RE: [lazarus] Lazarus for Python (L4P)

2007-01-17 Thread George Birbilis
 > IMHO a OOo interface should use OLE/COM on windows, and any other
> > means (for example python) on other platforms. Although I
> think that
> > if python can call openoffice, FPC should be able to do the same.

I'd expect OO to use XPCOM like Moz, but not sure what they used


George Birbilis ([EMAIL PROTECTED])
Computer & Informatics Engineer
Microsoft MVP J# for 2004-2007
Borland "Spirit of Delphi"
3D, QuickTime, QTVR, Java, Delphi,
ActiveX, .NET components, Robotics
http://www.kagi.com/birbilis
http://birbilis.spaces.live.com




  _  

avast! Antivirus  : Outbound message clean. 


Virus Database (VPS): 0703-0, 13/01/2007
Tested on: 17/1/2007 5:10:03 ??
avast! - copyright (c) 1988-2007 ALWIL Software.



_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


RE: [lazarus] Lazarus for Python (L4P)

2007-01-17 Thread George Birbilis
> OLE and COM are supported in FPC, but only on Windows. So in
> theory you can automate OOo directly on Windows.

Btw, are ActiveX controls supported (more or less)? E.g. could one place an
AX on a form? Is there any helper functionality about importing an AX (not
necesserily the types, just the reference for starters) and adding it on a
form? (you can talk to it via late binding [scripting say via PascalScript
or Python or whatever] if you don't have autoimported types from the IDE or
write the code for early binding yourself then)


George Birbilis ([EMAIL PROTECTED])
Computer & Informatics Engineer
Microsoft MVP J# for 2004-2007
Borland "Spirit of Delphi"
3D, QuickTime, QTVR, Java, Delphi,
ActiveX, .NET components, Robotics
http://www.kagi.com/birbilis
http://birbilis.spaces.live.com




  _  

avast! Antivirus  : Outbound message clean. 


Virus Database (VPS): 0703-0, 13/01/2007
Tested on: 17/1/2007 5:08:35 ??
avast! - copyright (c) 1988-2007 ALWIL Software.



_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


RE: [lazarus] Lazarus for Python (L4P)

2007-01-17 Thread George Birbilis
> But when it comes to speed, you can't use Python. It's a script-
> interpreter! Just like Matlab...

Matlab has compiler (into C)
Python has compilers (see Microsoft's IronPython for .NET for example)

> Further one small remarks:
> - Python isn't a programming language. Your introduction about Python
> says: 'written in Python programming language. It is an interesting
> interpreter'. Which is offcourse a contradiction in terminis. I guess
> that you would never write something that stupid about structural
> analysis in the book. (like: The structure is statically
> determinate, so
> it can't be solved by equations of statics)

Who says interpretted languages aren't programming languages? But anyway,
there are compilers for Python (as I said in previous e-mail I've made
compiler for Logo [generates Pascal from it] and you can do similarly for
pretty any language combined with some small or bigger runtime [for
reflection or name/value dictionaries etc.] for the dynamic stuff)

> About using Lazarus as a IDE for Python: some ppl here can react very
> hostile to that idea. And that's for a reason. From time to time ppl
> come here to tell us that Lazarus is great, but it's only a pity that
> it's written/used for Pascal.

Which filetypes does the Laz IDE now highlight? For example can it highlight
.XML or .XSL files? Since unihighlighter supports a ton of languages (have
contributed highlighter for Logo myself for example some time ago) I don't
see why the IDE shouldn't support all those and allow people to use it as a
universal programming editor if they wish so apart from using it for Pascal
projects (why use yet another text editor along with the nice Laz text
editor?). Delphi has been doing that too and VS.net does the same too, can
open and highlight many different filetypes and even provide intellisense
for many of them


George Birbilis ([EMAIL PROTECTED])
Computer & Informatics Engineer
Microsoft MVP J# for 2004-2007
Borland "Spirit of Delphi"
3D, QuickTime, QTVR, Java, Delphi,
ActiveX, .NET components, Robotics
http://www.kagi.com/birbilis
http://birbilis.spaces.live.com




  _  

avast! Antivirus  : Outbound message clean. 


Virus Database (VPS): 0703-0, 13/01/2007
Tested on: 17/1/2007 5:06:04 ??
avast! - copyright (c) 1988-2007 ALWIL Software.



_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


RE: [lazarus] Lazarus for Python (L4P)

2007-01-17 Thread George Birbilis
> Anyway, porting Python4Delphi to Lazarus is practically
> impossible, it needs COM. So even if one wish to waste his
> time porting to lazarus P4D on windows, it could never work
> on linux or other platforms.

Mozilla XPCOM is basically COM compatible (defined same strucure for
IUnknown interface etc.). However I wonder if the port to Kylix for
Python4Delphi uses COM at all. What is Python4Delphi, is it a python
interpretter or just an API port/wrapper for some Python
compiler/interpretter/engine? I don't think there's one Python engine, but
many that implement the language "spec", so the wrapper can choose another
engine for Unix or a very portable one for both Win and Unix. Anyway,
there's other COM implementations for Unix apart from XPCOM and one can
easily implement basic parts of COM anyway

> I just pointed out time ago that a better idea is to embed
> python with Free Pascal. I already made this and it works, on
> windows and on Linux.

You mean implement Python over ROPS or vice-versa? I think the 1st to be too
hard or impossible. I've made Logo over ROPS, but Logo isn't that complex
compared to Python I think (for example ROPS is not really OOP, since you
can't define class types, just consume them from the Delphi host)


George Birbilis ([EMAIL PROTECTED])
Computer & Informatics Engineer
Microsoft MVP J# for 2004-2007
Borland "Spirit of Delphi"
3D, QuickTime, QTVR, Java, Delphi,
ActiveX, .NET components, Robotics
http://www.kagi.com/birbilis
http://birbilis.spaces.live.com





  _  

avast! Antivirus  : Outbound message clean. 


Virus Database (VPS): 0703-0, 13/01/2007
Tested on: 17/1/2007 4:59:46 ??
avast! - copyright (c) 1988-2007 ALWIL Software.



_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


AW: [lazarus] Lazarus for Python (L4P)

2007-01-17 Thread Jörg Geppert
I always interested to automate Ooo. But I don´t found a good example
for Pascal. Is it possible to tell us where we can find these example? 

Jörg

-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Im Auftrag von Florian Klaempfl
Gesendet: Mittwoch, 17. Januar 2007 13:37
An: lazarus@miraclec.com
Betreff: Re: [lazarus] Lazarus for Python (L4P)


Michael Van Canneyt schrieb:
> 
> On Wed, 17 Jan 2007, Tiziano_mk wrote:
> 
>> Al Boldi wrote:
>>> Tiziano_mk wrote:
 I wish to add this missing item that i find more interesting:

 "Maybe you want to use python to control OpenOffice with Free 
 pascal?" It's possible, just embed FPC with the python "embedded" 
 in OpenOffice.

 During holydays I made successfully this test (on windows) and I am

 still investigating on the details.

 Sorry but by now I don't have documentation, work is in progress, 
 if someone is interested (and this thread shows how few people is 
 interested in this matter) I can give further details.
>>> Can you give further details?
>>>
>>>
>> ok, I try to give a brief overview, here I talk of FPC but read that 
>> as FPC/Lazarus, please:
>>
>> look at the Python Documentation: Extending and Embedding
>> (http://docs.python.org/ext/ext.html)
>>
>> This chapter explains the ways to use python with other applications,

>> it is C/C++ based but it is simple to translate all that in Pascal.
>>
>> Here you can see the concepts of Extending python with C/C++/FPC and 
>> Embedding python in C/C++/FPC.
>>
>> With this in mind you have not to port Python for Delphi to Lazarus, 
>> you can simply build a suite of (simple) units that make up the 
>> interface with the pythonxx.dll or pythonxx.so libraries, and this is

>> possible respecting the multiplatform requirements of FPC.
>>
>> Now, since you can easily launch python scripts or modules from an 
>> application compiled with FPC it is also possible to bind this 
>> application with the pythonxx.dll that OpenOffice installs with its 
>> binaries. This is an ordinary python distribution integrated with 
>> modules that interface python with the OO APIs.
>>
>> Now you need to look at PyUno documentation 
>> (http://udk.openoffice.org/python/python-bridge.html).
>> Here you can see how to use Python and the Python-UNO bridge to issue

>> commands to OpenOffice.
>>
>> With FPC you can only excecute the python Uno Bridge outside of the 
>> OpenOffice process, this is a bit slow, but it is enough to launch 
>> from FPC a simple helloworld.py that opens an OOWriter document and 
>> writes in the document the usual "HelloWorld!" string (I tested this 
>> on Windows, and I have to test if it really works also on Linux).
>>
>> (note: Issuing commands to OpenOffice can be easily done with Delphi,

>> this is explained in the OpenOffice SDK, but it uses the Uno OLE 
>> automation bridge. Since OLE and COM is not available in other 
>> platforms, FPC doesn't support them, so, this approach is not 
>> available for it)
> 
> OLE and COM are supported in FPC, but only on Windows. So in theory 
> you can automate OOo directly on Windows.

Even in practise, I've an almost working example at home.

> 
> IMHO a OOo interface should use OLE/COM on windows, and any other 
> means (for example python) on other platforms. Although I think that 
> if python can call openoffice, FPC should be able to do the same.
> 
> Michael.
> 
> _
>  To unsubscribe: mail [EMAIL PROTECTED] with
> "unsubscribe" as the Subject
>archives at http://www.lazarus.freepascal.org/mailarchives

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Lazarus for Python (L4P)

2007-01-17 Thread Florian Klaempfl
Michael Van Canneyt schrieb:
> 
> On Wed, 17 Jan 2007, Tiziano_mk wrote:
> 
>> Al Boldi wrote:
>>> Tiziano_mk wrote:
 I wish to add this missing item that i find more interesting:

 "Maybe you want to use python to control OpenOffice with Free pascal?"
 It's possible, just embed FPC with the python "embedded" in OpenOffice.

 During holydays I made successfully this test (on windows) and I am
 still investigating on the details.

 Sorry but by now I don't have documentation, work is in progress, if
 someone is interested (and this thread shows how few people is
 interested in this matter) I can give further details.
>>> Can you give further details?
>>>
>>>
>> ok, I try to give a brief overview, here I talk of FPC but read that as
>> FPC/Lazarus, please:
>>
>> look at the Python Documentation: Extending and Embedding
>> (http://docs.python.org/ext/ext.html)
>>
>> This chapter explains the ways to use python with other applications, it is
>> C/C++ based but it is simple to translate all that in Pascal.
>>
>> Here you can see the concepts of Extending python with C/C++/FPC and 
>> Embedding
>> python in C/C++/FPC.
>>
>> With this in mind you have not to port Python for Delphi to Lazarus, you can
>> simply build a suite of (simple) units that make up the interface with the
>> pythonxx.dll or pythonxx.so libraries, and this is possible respecting the
>> multiplatform requirements of FPC.
>>
>> Now, since you can easily launch python scripts or modules from an 
>> application
>> compiled with FPC it is also possible to bind this application with the
>> pythonxx.dll that OpenOffice installs with its binaries. This is an ordinary
>> python distribution integrated with modules that interface python with the OO
>> APIs.
>>
>> Now you need to look at PyUno documentation
>> (http://udk.openoffice.org/python/python-bridge.html).
>> Here you can see how to use Python and the Python-UNO bridge to issue 
>> commands
>> to OpenOffice.
>>
>> With FPC you can only excecute the python Uno Bridge outside of the 
>> OpenOffice
>> process, this is a bit slow, but it is enough to launch from FPC a simple
>> helloworld.py that opens an OOWriter document and writes in the document the
>> usual "HelloWorld!" string (I tested this on Windows, and I have to test if 
>> it
>> really works also on Linux).
>>
>> (note: Issuing commands to OpenOffice can be easily done with Delphi, this is
>> explained in the OpenOffice SDK, but it uses the Uno OLE automation bridge.
>> Since OLE and COM is not available in other platforms, FPC doesn't support
>> them, so, this approach is not available for it)
> 
> OLE and COM are supported in FPC, but only on Windows. So in theory you
> can automate OOo directly on Windows.

Even in practise, I've an almost working example at home.

> 
> IMHO a OOo interface should use OLE/COM on windows, and any other means
> (for example python) on other platforms. Although I think that if python
> can call openoffice, FPC should be able to do the same.
> 
> Michael.
> 
> _
>  To unsubscribe: mail [EMAIL PROTECTED] with
> "unsubscribe" as the Subject
>archives at http://www.lazarus.freepascal.org/mailarchives

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Lazarus for Python (L4P)

2007-01-17 Thread Michael Van Canneyt


On Wed, 17 Jan 2007, Tiziano_mk wrote:

> Al Boldi wrote:
> > Tiziano_mk wrote:
> > > I wish to add this missing item that i find more interesting:
> > >
> > > "Maybe you want to use python to control OpenOffice with Free pascal?"
> > > It's possible, just embed FPC with the python "embedded" in OpenOffice.
> > >
> > > During holydays I made successfully this test (on windows) and I am
> > > still investigating on the details.
> > >
> > > Sorry but by now I don't have documentation, work is in progress, if
> > > someone is interested (and this thread shows how few people is
> > > interested in this matter) I can give further details.
> > 
> > Can you give further details?
> > 
> > 
> 
> ok, I try to give a brief overview, here I talk of FPC but read that as
> FPC/Lazarus, please:
> 
> look at the Python Documentation: Extending and Embedding
> (http://docs.python.org/ext/ext.html)
> 
> This chapter explains the ways to use python with other applications, it is
> C/C++ based but it is simple to translate all that in Pascal.
> 
> Here you can see the concepts of Extending python with C/C++/FPC and Embedding
> python in C/C++/FPC.
> 
> With this in mind you have not to port Python for Delphi to Lazarus, you can
> simply build a suite of (simple) units that make up the interface with the
> pythonxx.dll or pythonxx.so libraries, and this is possible respecting the
> multiplatform requirements of FPC.
> 
> Now, since you can easily launch python scripts or modules from an application
> compiled with FPC it is also possible to bind this application with the
> pythonxx.dll that OpenOffice installs with its binaries. This is an ordinary
> python distribution integrated with modules that interface python with the OO
> APIs.
> 
> Now you need to look at PyUno documentation
> (http://udk.openoffice.org/python/python-bridge.html).
> Here you can see how to use Python and the Python-UNO bridge to issue commands
> to OpenOffice.
> 
> With FPC you can only excecute the python Uno Bridge outside of the OpenOffice
> process, this is a bit slow, but it is enough to launch from FPC a simple
> helloworld.py that opens an OOWriter document and writes in the document the
> usual "HelloWorld!" string (I tested this on Windows, and I have to test if it
> really works also on Linux).
> 
> (note: Issuing commands to OpenOffice can be easily done with Delphi, this is
> explained in the OpenOffice SDK, but it uses the Uno OLE automation bridge.
> Since OLE and COM is not available in other platforms, FPC doesn't support
> them, so, this approach is not available for it)

OLE and COM are supported in FPC, but only on Windows. So in theory you
can automate OOo directly on Windows.

IMHO a OOo interface should use OLE/COM on windows, and any other means
(for example python) on other platforms. Although I think that if python
can call openoffice, FPC should be able to do the same.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Lazarus for Python (L4P)

2007-01-17 Thread Tiziano_mk

Al Boldi wrote:

Tiziano_mk wrote:

I wish to add this missing item that i find more interesting:

"Maybe you want to use python to control OpenOffice with Free pascal?"
It's possible, just embed FPC with the python "embedded" in OpenOffice.

During holydays I made successfully this test (on windows) and I am
still investigating on the details.

Sorry but by now I don't have documentation, work is in progress, if
someone is interested (and this thread shows how few people is
interested in this matter) I can give further details.


Can you give further details?




ok, I try to give a brief overview, here I talk of FPC but read that as 
FPC/Lazarus, please:


look at the Python Documentation: Extending and Embedding 
(http://docs.python.org/ext/ext.html)


This chapter explains the ways to use python with other applications, it 
is C/C++ based but it is simple to translate all that in Pascal.


Here you can see the concepts of Extending python with C/C++/FPC and 
Embedding python in C/C++/FPC.


With this in mind you have not to port Python for Delphi to Lazarus, you 
can simply build a suite of (simple) units that make up the interface 
with the pythonxx.dll or pythonxx.so libraries, and this is possible 
respecting the multiplatform requirements of FPC.


Now, since you can easily launch python scripts or modules from an 
application compiled with FPC it is also possible to bind this 
application with the pythonxx.dll that OpenOffice installs with its 
binaries. This is an ordinary python distribution integrated with 
modules that interface python with the OO APIs.


Now you need to look at PyUno documentation 
(http://udk.openoffice.org/python/python-bridge.html).
Here you can see how to use Python and the Python-UNO bridge to issue 
commands to OpenOffice.


With FPC you can only excecute the python Uno Bridge outside of the 
OpenOffice process, this is a bit slow, but it is enough to launch from 
FPC a simple helloworld.py that opens an OOWriter document and writes in 
the document the usual "HelloWorld!" string (I tested this on Windows, 
and I have to test if it really works also on Linux).


(note: Issuing commands to OpenOffice can be easily done with Delphi, 
this is explained in the OpenOffice SDK, but it uses the Uno OLE 
automation bridge. Since OLE and COM is not available in other 
platforms, FPC doesn't support them, so, this approach is not available 
for it)


From here there is a lot of work and experimentation to do, since it is 
not enough to call python scripts to issue commands, but it is essential 
 to exchange data from FPC<->Python<->Office.


that's all by now, this is the idea. I'd like to hear some feedback 
about that...



bye
tiziano







_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] Code completion formatted code incorrectly

2007-01-17 Thread Graeme Geldenhuys

Hi,

Using Code Completion (pressing Ctrl-Space) in the interface section
of a class, so I can override a method, formats the code incorrectly.
I have Lazarus's "CodeTools Options -> Space tab" setup to not include
any spaces in front of elements. No checkboxes are checked in the
"Insert space in front of" groupbox.


Problem #1:
This is how the original class has it's method defined. Notice that
there is no spaces in front of the colons and semi-colons.

public
 functionIsValid(const AErrors: TtiObjectErrors): boolean;
overload; virtual;


And this is how code completion inserts that method into a new class
where I am trying to override the method.  Notice the formatting is
different, it has spaces in front of the identifiers, colons and
semi-colons.

public
   function IsValid ( const AErrors : TtiObjectErrors ) : boolean ;
overload ; virtual ;


Problem #2:
Another problems, is that it doesn't put the 'override' keyword at the end!


Problem #3:
This is more a nice-to-have feature.  When I use the code completion
in the new class as show above, it inserts the code at the cursor
location, even if I am in the "private" or "protected" section of the
class. I think it could be more intelligent and know that the
overridden method must go into the same section as it was originally
defined, in this case the "public" section.


--
Graeme Geldenhuys

There's no place like S34° 03.168'  E018° 49.342'

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives