Re: [lazarus] procedure TObject.Free

2006-06-04 Thread Al Boldi
Bram Kuijvenhoven wrote:
> Al Boldi wrote:
> > Mattias Gaertner wrote:
> >> Al Boldi <[EMAIL PROTECTED]> wrote:
> >>> Mattias Gaertner wrote:
>  Al Boldi <[EMAIL PROTECTED]> wrote:
> > Flavio Etrusco wrote:
> >> On 6/3/06, Al Boldi wrote:
> >>> In the fpc-rtl there is something like this:
> >>>
> >>> procedure TObject.Free;
> >>> begin
> >>>   if self<>nil then self.destroy;
> >>> end;
> >>>
> >>> Does this make sense?  i.e. How is it possible for self to be
> >>> nil?
> >>
> >> 'Self' isn't a global variable associated with the method, it's
> >> simply a parameter passed implicitly to the method.
> >
> > This would imply, that we are executing the class method instead of
> > the object method.
> 
>  No. The 'Self' of a class method is the class.
>  The Self=nil test is useful for this case:
> 
>  var o: TObject;
> 
>    o:=TObject.Create;
>    ...
>    o.Free;
>    o:=nil;
>    ...
>    o.Free;
> 
>  The o is given to the method as hidden parameter, accessible via
>  Self.
> >>>
> >>> Only the constructor should be possible to be called w/o self. All
> >>> others should be dependent on a valid self, otherwise we get something
> >>> like this:
> >>>
> >>> var obj: TObject;
> >>>
> >>> TObject.Free;  // this won't compile, which is correct
> >>> obj.Free;  // this will compile, which is correct,
> >>>// and gets warned of not being initialized,
> >>>// but the error only gets detected inside
> >>>// the class method, which is incorrect,
> >>>// as it should have been detected in the
> >>>// calling routine during execution.
> >>>
> >>> This problem gets really bad, when you have large class hierarchies,
> >>> as the  error may only be detected in some deep object without
> >>> reference to the  causing routine.
> >>
> >> Yes, and no.
> >> Yes, because it happens frequently. And no, it is not a big problem,
> >> because the gdb backtrace shows it quite clear.
> >>
> >>> Michael Van Canneyt wrote:
>  Al Boldi wrote:
> > Does FPC have a switch to disallow executing class/definition
> > methods, and only allow executing object/instance methods?
> 
>  No. What on earth would be the use of that ?
> >>>
> >>> This would make it easier to detect the causing routine of a
> >>> non-initialized  self.
> >>
> >> I'm not sure, what you mean. It is calling the instance method, not a
> >> class method.
> >
> > You wish.  obj.Free calls the class method regardless of self's
> > validity.
> >
> > Calling the instance method could ensure a valid self always.
>
> A 'class method' is a method that doesn't need a class instance, i.e. no
> 'self'. It is declared with the 'class' keyword put before the 'function'
> or 'procedure' keyword. Other methods get an implicit 'self' parameter
> passed to them that points to the object it is called on.
>
> Methods in Pascal are not fields stored in objects! (in some scripting
> languages, like Lua, this is indeed the case) They are part of the /type/
> of the object (its class), and for virtual methods, the actual method
> called is determined at run time using the object's VMT (more details on
> that below).
>
> I also think you might forget that Free is not a virtual method. Only
> virtual methods can be overridden and use so called 'late binding' through
> the VMT (Virtual Method Table) associated with the object the call is made
> on.
>
> So calling a non-virtual method on a object pointer that is nil, results
> in a valid method call with self = nil, but a /virtual/ method call on a
> object pointer that is nil will result in an exception because your
> program will try to access the VMT of the object. (Note: in fact every
> object instance has a pointer to a class record, which in turn holds a
> pointer to the VMT. For every class, one such class record is kept in
> memory with the class name, the VMT, RTTI (if {$M+}), etc.)
>
> If a method is non-virtual, the compiler derives which classes method to
> call from the declared type of the object pointer at hand. (This is why it
> is a bad idea to redefine a non-virtual method in a descendant class; the
> compiler will complain about this saying you're 'hiding a non-virtual
> method'.)
>
> It is simply a feature of Object Pascal that non-virtual method calls can
> be done on a nil object pointer. You can add a check in such a method if
> you want.
>
> An example to clear things up:
>
> type
>   TA = class
> procedure Foo;
> procedure Bar; virtual;
>   end;
>
>   TB = class(TA)
> procedure Foo; // bad plan: hiding virtual method TA.Foo
> procedure Bar; override;
>   end;
>
>
> ...
>
> var
>   A: TA;
>   B: TB;
>
> ...
>
> A := TA.Create;
> B := TB.Create;
>
> A.Foo; // executes TA.Foo with self = A, because A is of declared type TA
> B.Foo; // executes TB.Foo with self = B, because B is of

Re: [lazarus] Laarus 0.9.16 e Suse

2006-06-04 Thread Lord Satan
On Mon, 5 Jun 2006 12:26:34 +1000
John E Briggs <[EMAIL PROTECTED]> wrote:

> On Sun, Jun 04, 2006 at 08:59:39PM +0200, Lord Satan wrote:
> > On Sun, 4 Jun 2006 21:10:02 +0200 (CEST)
> > Michael Van Canneyt <[EMAIL PROTECTED]> wrote:
> > 
> > > 
> > > 
> > > On Sun, 4 Jun 2006, Lord Satan wrote:
> > > 
> > > > > Also gtk1 appears to have gone away in this version.  I also read 
> > > > > that Fedora is dropping gtk1.
> > > > > 
> > > > According to this page 
> > > > http://www.novell.com/products/linuxpackages/suselinux/index_all.html 
> > > > gtk1 is still part of OpenSUSE 10.1. 
> > > > So you should be able to setup everything you need to run lazarus. 
> > > > At least on Fedora and Ubuntu it is really easy to install lazarus. To 
> > > > me it looks like SUSE messed some things up.
> > > 
> > > Installing lazarus is not the issue. Getting it to compile and link 
> > > programs is
> > > the problem; for that you need the -devel packages (unless you choose to 
> > > create 
> > > some symlinks yourself)
> > > 
> > > Michael.
> > 
> > But the -devel packages are there also.
> 
> No this is incorrect. The packages are for SuSE commercial version not
> OpenSuSE 10.1 two entirely separate distributions.
> 
> 
> John 
Now I see. My fault.
Although I must admit that I don't understand the reasoning behind keeping them 
in the commercial and removing them from the free version.

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


Re: [lazarus] Laarus 0.9.16 e Suse

2006-06-04 Thread John E Briggs
On Sun, Jun 04, 2006 at 08:59:39PM +0200, Lord Satan wrote:
> On Sun, 4 Jun 2006 21:10:02 +0200 (CEST)
> Michael Van Canneyt <[EMAIL PROTECTED]> wrote:
> 
> > 
> > 
> > On Sun, 4 Jun 2006, Lord Satan wrote:
> > 
> > > > Also gtk1 appears to have gone away in this version.  I also read 
> > > > that Fedora is dropping gtk1.
> > > > 
> > > According to this page 
> > > http://www.novell.com/products/linuxpackages/suselinux/index_all.html 
> > > gtk1 is still part of OpenSUSE 10.1. 
> > > So you should be able to setup everything you need to run lazarus. 
> > > At least on Fedora and Ubuntu it is really easy to install lazarus. To me 
> > > it looks like SUSE messed some things up.
> > 
> > Installing lazarus is not the issue. Getting it to compile and link 
> > programs is
> > the problem; for that you need the -devel packages (unless you choose to 
> > create 
> > some symlinks yourself)
> > 
> > Michael.
> 
> But the -devel packages are there also.

No this is incorrect. The packages are for SuSE commercial version not
OpenSuSE 10.1 two entirely separate distributions.


John 

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


Re: [lazarus] More generic RPM for SuSE and FedoraCore

2006-06-04 Thread Felipe Monteiro de Carvalho

On 6/4/06, Joost van der Sluis <[EMAIL PROTECTED]> wrote:

And did you just left the dependency out, or is it really not dependent
on those packages?

If it's the former, you can expect lots of troubles of users getting
problems when they try to compile on lazarus. Isn't it preferable that
they get those problems while installing-lazarus?


If it´s the former, I think we should have a rpm for Fedora, another
for Mandriva and another for SuSE. I know you guys think it´s a waste
of space, but it´s almost inevitable. Most open source projects do
that, like Gaim for example.

And the hosting space belongs to Source Forge not us =)

--
Felipe Monteiro de Carvalho

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


Re: [lazarus] More generic RPM for SuSE and FedoraCore

2006-06-04 Thread Joost van der Sluis
On Sun, 2006-06-04 at 20:32 +0200, Mattias Gaertner wrote:
> I created a new lazarus RPM, which does not depend on the gtk1 devel
> packages and therefore also works on SuSE, Fedora Core and probably even
> more.

Where can I find the .src.rpm? Or the .spec-file?

And did you just left the dependency out, or is it really not dependent
on those packages?

If it's the former, you can expect lots of troubles of users getting
problems when they try to compile on lazarus. Isn't it preferable that
they get those problems while installing-lazarus?

Joost.

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


Re: [lazarus] More generic RPM for SuSE and FedoraCore

2006-06-04 Thread Mattias Gaertner
On Sun, 4 Jun 2006 20:53:12 +0200
Lord Satan <[EMAIL PROTECTED]> wrote:

> On Sun, 4 Jun 2006 20:32:21 +0200
> Mattias Gaertner <[EMAIL PROTECTED]> wrote:
> 
> > I created a new lazarus RPM, which does not depend on the gtk1 devel
> > packages and therefore also works on SuSE, Fedora Core and probably even
> > more.
> > 
> > Please test the new RPM on the various distributions.
> > 
> > http://sourceforge.net/project/showfiles.php?group_id=89339&package_id=93599
> > 
> > 
> > Mattias
> Nice job, now where are the DEBS? ;)

They come next.


Mattias

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


Re: [lazarus] [patch] ChecklistBox.onClickCheck

2006-06-04 Thread darekm


repair patch
change typo
remove change in DestroyWIndow

Mattias Gaertner wrote:


On Fri, 02 Jun 2006 08:31:18 +0200
DarekM <[EMAIL PROTECTED]> wrote:

 


Vincent Snijders napisa__(a):
   


DarekM wrote:
 


Vincent Snijders napisa__(a):

   


darekm wrote:

 


Hi
attached patch added:
ChecklistBox.onClickCheck (for GTK and GTK2)
publish property  TCheckBox.font
remove tCustomLabel.FontChange(Sender: TObject); (default is  
fontchanged)



   


Thanks for the patch. I have the following questions:

Why is the following debugln commented out? Doesn't calling 
DestroyHandle, if the handle is not allocated, mean that there is a 
bug somewhere? Raising the exception is maybe too harsh, but 
silently ignoring it, doesn't seem a good idea to me.


 


@@ -3287,7 +3292,8 @@
  AWinControl: TWinControl;
begin
  if not HandleAllocated then begin
-DebugLn('Warning: TWinControl.DestroyHandle 
',Name,':',ClassName,' Handle not Allocated');
+//DebugLn('Warning: TWinControl.DestroyHandle 
',Name,':',ClassName,' Handle not Allocated');

+exit;
//RaiseGDBException('');
  end;

   


Delphi don't claim when handle =0
   


In that case, IMHO Delphi is too tolerant for component writers.

But maybe other developers see valid reasons for calling DestroyHandle 
when a handle is not allocated (anymore).
 

problem is with DestroyWindow. Under Delphi I call it many times  (to 
free resources). why testing if was painting before or not  (under 
Delphi i dont have to). And for me: its not problem try to destroy 
object second time (enough test), but when we try to create it twice or 
use not initialized
   



The debugln was there, because the LCL controls do free the Handle only for
good reason. If the handle is already freed, you found a bug. This helped to
find a lot of bugs and overhead in the last years.
Of course this 'only for good reason' rule is only valid for LCL controls.
Programmers using the LCL are of course free to release as often they want.
The debugln should give them only a clue, that they could reduce some
overhead.
 


Should then be
added {$IFDEF TRACE} (or something similar) ?


Darek
Index: interfaces/gtk2/gtk2wschecklst.pp
===
--- interfaces/gtk2/gtk2wschecklst.pp   (wersja 9382)
+++ interfaces/gtk2/gtk2wschecklst.pp   (kopia robocza)
@@ -35,7 +35,7 @@
 // To get as little as posible circles,
 // uncomment only when needed for registration
 
-  CheckLst, Controls, LCLType, Classes,
+  CheckLst, Controls, LCLType, Classes, LMessages,
 
   WSCheckLst, WSLCLClasses,
   Gtk2WSStdCtrls;
@@ -71,7 +71,11 @@
   aTreeModel : PGtkTreeModel;
   aTreeIter : TGtkTreeIter;
   value : pgValue;
+  Mess: TLMessage;
 begin
+  {$IFDEF EventTrace}
+  EventTrace('Gtk2WS_CheckListBoxToggle', WidgetInfo^.LCLObject);
+  {$ENDIF}
   aWidget := WidgetInfo^.CoreWidget;
   aTreeModel := gtk_tree_view_get_model (GTK_TREE_VIEW(aWidget));
   if (gtk_tree_model_get_iter_from_string (aTreeModel, @aTreeIter, arg1)) then 
begin
@@ -85,6 +89,9 @@
 g_value_unset(value);
 g_free(value);
   end;
+  Mess.Msg := LM_CHANGED;
+  Mess.Result := 0;
+  DeliverMessage(widgetInfo^.lclObject, Mess);
 end;
 
 procedure Gtk2WS_CheckListBoxRowActivate(treeview : PGtkTreeView; arg1 : 
PGtkTreePath;
Index: interfaces/gtk2/gtk2wsstdctrls.pp
===
--- interfaces/gtk2/gtk2wsstdctrls.pp   (wersja 9382)
+++ interfaces/gtk2/gtk2wsstdctrls.pp   (kopia robocza)
@@ -248,7 +248,9 @@
 var
   Mess: TLMessage;
 begin
+  {$IFDEF EventTrace}
   EventTrace('Gtk2WS_ListBoxChange', WidgetInfo^.LCLObject);
+  {$ENDIF}
   FillChar(Mess,SizeOf(Mess),0);
   Mess.msg := LM_SelChange;
   DeliverMessage(WidgetInfo^.LCLObject, Mess);
Index: include/wincontrol.inc
===
--- include/wincontrol.inc  (wersja 9382)
+++ include/wincontrol.inc  (kopia robocza)
@@ -2527,7 +2532,7 @@
 
   if not HandleAllocated then Exit;
 
-  //DebugLn('TWinControl.UpdateShowing A ',Name,':',ClassName,' 
FShowing=',FShowing,' bShow=',bShow);
+  //DebugLn('TWinControl.UpdateShowing A ',Name,':',ClassName,' 
FShowing=',dbgs(FShowing),' bShow=',dbgs(bShow));
   if FShowing = bShow then Exit;
   
   FShowing := bShow;
@@ -2896,7 +2901,7 @@
   function ControlMustBeClipped(AControl: TControl): boolean;
   begin
 with AControl do
-  Result:=IsVisible and (csOpaque in ControlStyle);
+  Result:=(csOpaque in ControlStyle) and IsVisible;
   end;
 
 var
@@ -5158,7 +5164,7 @@
   Assert(False, Format('Trace:[TWinControl.InitializeWnd]  %s', [ClassName]));
   // set all cached properties
 
-  //DebugLn('[TWinControl.InitializeWnd] ',Name,':',ClassName,':', FCaption,' 
',Left,',',Top,',',Width,',',Height);
+  //DebugLn('[TWinControl.Initi

Re: [lazarus] SQLDB & postgres

2006-06-04 Thread Bram Kuijvenhoven

Alex du Plessis wrote:
Would anybody know why a sqldb query (TSQLQuery) has a problem reading 
an aggregate field?  I cannot get the query to read an aggregate field 
for love or money.  It complanis that it cannot find the fieldname 
(query.FieldbyName('sum').asInteger) or that the 
index(query.Fields[i].asInteger) is out of range.


The query syntax is correct and i can read the result when running it in 
PGAdmin.


Still, I recommend you copy & paste the relevant parts of the code here! 
(Relevant is the code that assigns/builds the query up to the part that tries to 
read the Field.)

I haven't had any problems accessing aggregate fields with TSQLQuery (using 
TODBCConnection), and I consider it unlikely the PostGres component has a 
problem with this.

A few shots in the dark:
- does the code work with query.ParseSQL := false ?
- can it read the other fields from the query ?
- what is the content of the query just before the call to Execute (or what is 
in the logs of PostGres?)

Bram

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


Re: [lazarus] procedure TObject.Free

2006-06-04 Thread Bram Kuijvenhoven

Al Boldi wrote:

Mattias Gaertner wrote:

Al Boldi <[EMAIL PROTECTED]> wrote:

Mattias Gaertner wrote:

Al Boldi <[EMAIL PROTECTED]> wrote:

Flavio Etrusco wrote:

On 6/3/06, Al Boldi wrote:

In the fpc-rtl there is something like this:

procedure TObject.Free;
begin
  if self<>nil then self.destroy;
end;

Does this make sense?  i.e. How is it possible for self to be
nil?

'Self' isn't a global variable associated with the method, it's
simply a parameter passed implicitly to the method.

This would imply, that we are executing the class method instead of
the object method.

No. The 'Self' of a class method is the class.
The Self=nil test is useful for this case:

var o: TObject;

  o:=TObject.Create;
  ...
  o.Free;
  o:=nil;
  ...
  o.Free;

The o is given to the method as hidden parameter, accessible via Self.

Only the constructor should be possible to be called w/o self. All
others should be dependent on a valid self, otherwise we get something
like this:

var obj: TObject;

TObject.Free;  // this won't compile, which is correct
obj.Free;  // this will compile, which is correct,
   // and gets warned of not being initialized,
   // but the error only gets detected inside
   // the class method, which is incorrect,
   // as it should have been detected in the
   // calling routine during execution.

This problem gets really bad, when you have large class hierarchies, as
the  error may only be detected in some deep object without reference to
the  causing routine.

Yes, and no.
Yes, because it happens frequently. And no, it is not a big problem,
because the gdb backtrace shows it quite clear.


Michael Van Canneyt wrote:

Al Boldi wrote:

Does FPC have a switch to disallow executing class/definition
methods, and only allow executing object/instance methods?

No. What on earth would be the use of that ?

This would make it easier to detect the causing routine of a
non-initialized  self.

I'm not sure, what you mean. It is calling the instance method, not a
class method.


You wish.  obj.Free calls the class method regardless of self's validity.

Calling the instance method could ensure a valid self always.


A 'class method' is a method that doesn't need a class instance, i.e. no 
'self'. It is declared with the 'class' keyword put before the 'function' or 
'procedure' keyword. Other methods get an implicit 'self' parameter passed to 
them that points to the object it is called on.

Methods in Pascal are not fields stored in objects! (in some scripting languages, like Lua, this is indeed the case) They are part of the /type/ of the object (its class), and for virtual methods, the actual method called is determined at run time using the object's VMT (more details on that below). 


I also think you might forget that Free is not a virtual method. Only virtual 
methods can be overridden and use so called 'late binding' through the VMT 
(Virtual Method Table) associated with the object the call is made on.

So calling a non-virtual method on a object pointer that is nil, results in a 
valid method call with self = nil, but a /virtual/ method call on a object 
pointer that is nil will result in an exception because your program will try 
to access the VMT of the object. (Note: in fact every object instance has a 
pointer to a class record, which in turn holds a pointer to the VMT. For every 
class, one such class record is kept in memory with the class name, the VMT, 
RTTI (if {$M+}), etc.)

If a method is non-virtual, the compiler derives which classes method to call 
from the declared type of the object pointer at hand. (This is why it is a bad 
idea to redefine a non-virtual method in a descendant class; the compiler will 
complain about this saying you're 'hiding a non-virtual method'.)

It is simply a feature of Object Pascal that non-virtual method calls can be 
done on a nil object pointer. You can add a check in such a method if you want.

An example to clear things up:

type
 TA = class
   procedure Foo;
   procedure Bar; virtual;
 end;

 TB = class(TA)
   procedure Foo; // bad plan: hiding virtual method TA.Foo
   procedure Bar; override;
 end;


...

var
 A: TA;
 B: TB;

...

A := TA.Create;
B := TB.Create;

A.Foo; // executes TA.Foo with self = A, because A is of declared type TA
B.Foo; // executes TB.Foo with self = B, because B is of declared type TB
A.Bar; // executes TA.Bar with self = A, because A is of actual type TA
B.Bar; // executes TB.Bar with self = B, because B is of actual type TB

A := B;

A.Foo; // still executes TA.Foo with self = A = B, because A is of declared 
type TA
B.Foo; // still executes TB.Foo with self = B, because B is of declared type TB
A.Bar; // executes TB.Bar with self = A = B, because A is of actual type TB now!
B.Bar; // executes TB.Bar with self = B, because B is of actual type TB

B.Destroy;
B := nil;

B.Foo; // still executes TB.Foo, now with self = B = nil, because B is of 
declared type TB
B.Bar;

Re: [lazarus] Debug Lazarus: Part 2

2006-06-04 Thread Alain Michaud
Hi,


> >I never saw this kind of messages. What gives 'ld -v'?
> >
> >Mattias
> >

I am sorry to ask such a basic question, but where should aply this:

fpc.cfg, or makefile.fpc or else?


2 -- In ./lazarus :

  make clean 

and then 

  make all

just like Graeme suggested does not seem to make much difference.

Again I always get the 'error while linking' message, but the
'relocation truncated to fit' is issued on different files each time!!

3 -- To make everything clear:

- I use the fpc-2.0.x-i386-linux.tar.gz and  lazarus-0.9.x.tgz modules  

- The computer has 2 pentium pro processors 256 MB and 2 GB swap file

- I have succesfully installed it on identical computers before!  
 

Thank you 

Alain


On Sun, 2006-06-04 at 10:21 +0200, Mattias Gaertner wrote:
> On Sun, 04 Jun 2006 01:23:00 -0400
> Alain Michaud <[EMAIL PROTECTED]> wrote:
> 
> > Hi,
> > 
> >   I am still trying to install Lazarus. This time I installed Lazarus
> > 0.9.16 and FPC 2.0.2 . I get the same error message !
> > 
> > Help please! 
> > 
> > Here is the complete error message. Compare with the one I got when
> > trying to compile Lazarus 0.9.8. given in my previous message. Same
> > problem!
> 
> I never saw this kind of messages. What gives 'ld -v'?
> 
> Mattias
> 
> 
> > 
> > 
> > Linking ../lazarus
> > ../units/i386-linux/main.o: In function `TMAINIDE__SETUPSPEEDBUTTONS':
> > main.pp:1416: relocation truncated to fit: R_386_32 against symbol
> > `MAIN_TMAINIDE_$__MNUSTEPOVERPROJECTCLICKED$TOBJECT' defined in .text
> > section in ../units/i386-linux/main.o ../units/i386-linux/main.o: In
> > function `TMAINIDE__SETUPRUNMENU': main.pp:2036: relocation truncated to
> > fit: R_386_32 against symbol
> > `MAIN_TMAINIDE_$__MNUSTEPOVERPROJECTCLICKED$TOBJECT' defined in .text
> > section in ../units/i386-linux/main.o ../units/i386-linux/main.o: In
> > function `defINSTANTANEOUS': main.pp:(.data+0x320): relocation truncated
> > to fit: R_386_32 against symbol
> > `MAIN_TMAINIDE_$__MNUSTEPOVERPROJECTCLICKED$TOBJECT' defined in .text
> > section in ../units/i386-linux/main.o
> > /usr/local/lib/fpc/2.0.2/units/i386-linux/x11/xlib.o:(.data+0x1d8d):
> > relocation truncated to fit: R_386_32 against symbol
> > `RTTI__XLIB_TXMAPPINGEVENT' defined in .data section in
> > /usr/local/lib/fpc/2.0.2/units/i386-linux/x11/xlib.o
> > ../units/i386-linux/lazconf.o: In function `FINDDEFAULTCOMPILERPATH':
> > lazbaseconf.inc:132: relocation truncated to fit: R_386_32 against symbol
> > `_$LAZCONF$_L338' defined in .data section in
> > ../units/i386-linux/lazconf.o
> > /home/microwave/lazarus/components/codetools/units/i386-linux/keywordfunc
> > lists.o: In function `INTERNALINIT': keywordfunclists.pas:1279: relocation
> > truncated to fit: R_386_PC32 against symbol
> > `KEYWORDFUNCLISTS_TKEYWORDFUNCTIONLIST_$__ADD$TKEYWORDFUNCTIONLIST'
> > defined in .text section in
> > /home/microwave/lazarus/components/codetools/units/i386-linux/keywordfunc
> > lists.o /home/microwave/lazarus/lcl/units/i386-linux/dbactns.o: In
> > function `TDATASETREFRESH__EXECUTETARGET': dbactns.pp:261: relocation
> > truncated to fit: R_386_32 against symbol
> > `DBACTNS_TDATASETNEXT_$__UPDATETARGET$TOBJECT' defined in .text section in
> > /home/microwave/lazarus/lcl/units/i386-linux/dbactns.o
> > /home/microwave/lazarus/lcl/units/i386-linux/stdactns.o: In function
> > `TFILEACTION__SETFILENAME': stdactns.pas:698: relocation truncated to fit:
> > R_386_32 against symbol `_$STDACTNS$_L23' defined in .data section in
> > /home/microwave/lazarus/lcl/units/i386-linux/stdactns.o
> > /home/microwave/lazarus/lcl/units/i386-linux/editbtn.o: In function
> > `TDATEEDIT__DATEFORMATCHANGED': editbtn.pas:842: relocation truncated to
> > fit: R_386_32 against symbol
> > `EDITBTN_TCALCEDIT_$__CREATECALCBITMAP$$TBITMAP' defined in .text section
> > in /home/microwave/lazarus/lcl/units/i386-linux/editbtn.o
> > /usr/local/lib/fpc/2.0.2/units/i386-linux/fcl/db.o:(.data+0x3a7c):
> > relocation truncated to fit: R_386_32 against symbol `_$DB$_L6369' defined
> > in .data section in /usr/local/lib/fpc/2.0.2/units/i386-linux/fcl/db.o
> > /home/microwave/lazarus/components/synedit/units/i386-linux/synedithighli
> > ghter.o: In function `TSYNHIGHLIGHTERLIST__FINDBYCLASS':
> > synedithighlighter.pp:397: additional relocation overflows omitted from
> > the output lazarus.pp(113,1) Error: Error while linking
> > make[2]: *** [lazarus] Error 1
> > make[2]: Leaving directory `/home/microwave/lazarus/ide'
> > make[1]: *** [ide] Error 2
> > make[1]: Leaving directory `/home/microwave/lazarus/ide'
> > make: *** [ide] Error 2
> > [EMAIL PROTECTED] lazarus]$ 
> >  
> > 
> > _
> >  To unsubscribe: mail [EMAIL PROTECTED] with
> > "unsubscribe" as the Subject
> >archives at http://www.lazarus.freepascal.org/mailarchives
> 
> _
>  To unsubscribe: mail [EMAIL PROTECTE

Re: [lazarus] Laarus 0.9.16 e Suse

2006-06-04 Thread Lord Satan
On Sun, 4 Jun 2006 21:10:02 +0200 (CEST)
Michael Van Canneyt <[EMAIL PROTECTED]> wrote:

> 
> 
> On Sun, 4 Jun 2006, Lord Satan wrote:
> 
> > > Also gtk1 appears to have gone away in this version.  I also read 
> > > that Fedora is dropping gtk1.
> > > 
> > According to this page 
> > http://www.novell.com/products/linuxpackages/suselinux/index_all.html gtk1 
> > is still part of OpenSUSE 10.1. 
> > So you should be able to setup everything you need to run lazarus. 
> > At least on Fedora and Ubuntu it is really easy to install lazarus. To me 
> > it looks like SUSE messed some things up.
> 
> Installing lazarus is not the issue. Getting it to compile and link programs 
> is
> the problem; for that you need the -devel packages (unless you choose to 
> create 
> some symlinks yourself)
> 
> Michael.

But the -devel packages are there also.

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


Re: [lazarus] More generic RPM for SuSE and FedoraCore

2006-06-04 Thread Lord Satan
On Sun, 4 Jun 2006 20:32:21 +0200
Mattias Gaertner <[EMAIL PROTECTED]> wrote:

> I created a new lazarus RPM, which does not depend on the gtk1 devel
> packages and therefore also works on SuSE, Fedora Core and probably even
> more.
> 
> Please test the new RPM on the various distributions.
> 
> http://sourceforge.net/project/showfiles.php?group_id=89339&package_id=93599
> 
> 
> Mattias
Nice job, now where are the DEBS? ;)

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


Re: [lazarus] Laarus 0.9.16 e Suse

2006-06-04 Thread Michael Van Canneyt


On Sun, 4 Jun 2006, Lord Satan wrote:

> > Also gtk1 appears to have gone away in this version.  I also read 
> > that Fedora is dropping gtk1.
> > 
> According to this page 
> http://www.novell.com/products/linuxpackages/suselinux/index_all.html gtk1 is 
> still part of OpenSUSE 10.1. 
> So you should be able to setup everything you need to run lazarus. 
> At least on Fedora and Ubuntu it is really easy to install lazarus. To me it 
> looks like SUSE messed some things up.

Installing lazarus is not the issue. Getting it to compile and link programs is
the problem; for that you need the -devel packages (unless you choose to create 
some symlinks yourself)

Michael.

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


Re: [lazarus] Laarus 0.9.16 e Suse

2006-06-04 Thread Lord Satan
> Also gtk1 appears to have gone away in this version.  I also read 
> that Fedora is dropping gtk1.
> 
According to this page 
http://www.novell.com/products/linuxpackages/suselinux/index_all.html gtk1 is 
still part of OpenSUSE 10.1. So you should be able to setup everything you need 
to run lazarus. At least on Fedora and Ubuntu it is really easy to install 
lazarus. To me it looks like SUSE messed some things up.

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


Re: [lazarus] Laarus 0.9.16 Suse

2006-06-04 Thread Mattias Gaertner
On Sun, 4 Jun 2006 07:30:54 -0700
johnf <[EMAIL PROTECTED]> wrote:

> On Sunday 04 June 2006 04:34, Mattias Gaertner wrote:
> > On Sun, 04 Jun 2006 12:48:41 +0200
> >
> > franzato <[EMAIL PROTECTED]> wrote:
> > > Hello to all,
> > >
> > >  in the road map page
> > > (http://wiki.lazarus.freepascal.org/index.php/Road_To_1.0)I read
> > > that Mattias will prepare a Suse version of Lazarus 0.9.16. As I
> > > have an  Open Suse 10,0 installed I wonder when this version of
> > > Lazarus for Suse will be ready for download.
> >
> > I planned to install a SuSE system today and try to create a package.
> >
> > > At present I managed to install a 0.9.15 (if I remember well) and it
> > > works badly. I have got the impression that there are no longer
> > > the gtk 1.x  in the Suse distro; in fact it seems to work at best if I
> > > set the compiler options to GTK2.
> > > Once I had Mandriva 2006 installed and even with it  some
> > > indispensable libraries to install Lazarus were (and are) missing! how
> > > may it be??
> >
> > Mattias
> Please install openSUSE 10.1. 

Yes.


> It did not set any of the required
> lib???.so  etc...  Also gtk1 appears to have gone away in this version. 

The gtk1 packages are still there. Only the gtk1 devel packages are missing.
But we don't need them anyway. We only need 4 links. I added a script to
create the links.

See the other mail.


> I
> also read  that Fedora is dropping gtk1.


Mattias

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


[lazarus] More generic RPM for SuSE and FedoraCore

2006-06-04 Thread Mattias Gaertner
I created a new lazarus RPM, which does not depend on the gtk1 devel
packages and therefore also works on SuSE, Fedora Core and probably even
more.

Please test the new RPM on the various distributions.

http://sourceforge.net/project/showfiles.php?group_id=89339&package_id=93599


Mattias

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


Re: [lazarus] SourceEditor improvements

2006-06-04 Thread Al Boldi
Michael Van Canneyt wrote:
> On Sun, 4 Jun 2006, Mattias Gaertner wrote:
> > Al Boldi <[EMAIL PROTECTED]> wrote:
> > > Mattias Gaertner wrote:
> > > > Al Boldi wrote:
> > > > > The SourceEditor currently has the ability to search in files by
> > > > > searching a  complete directory hierarchy.  This may result in
> > > > > prolonged searches if the  hierarchy is large.
> > > > >
> > > > > By pre-Indexing the sources, this could be reduced dramatically.
> > > > >
> > > > > Would this be difficult to implement?
> > > >
> > > > Can you give an example how this pre-Indexing should work?
> > >
> > > On the search in files dialog, there could be a button to create a
> > > word index  of the sources, and a checkbox to use this index instead
> > > of grepping the  files each time.
> >
> > Implementing should be simple. But making it fast, can be a lot more
> > work. If you want to implement it and have any questions, don't hesitate
> > to ask.
>
> I suggest that if this is implemented, it should be done as an external
> program, so it can be run in the background, or immediatly after
> installation.

Sure. Do you know of any external mini-crossindexing engine? Jedi?

Thanks!

--
Al

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


Re: [lazarus] procedure TObject.Free

2006-06-04 Thread Al Boldi
Mattias Gaertner wrote:
> Al Boldi <[EMAIL PROTECTED]> wrote:
> > Mattias Gaertner wrote:
> > > Al Boldi <[EMAIL PROTECTED]> wrote:
> > > > Flavio Etrusco wrote:
> > > > > On 6/3/06, Al Boldi wrote:
> > > > >> In the fpc-rtl there is something like this:
> > > > >>
> > > > >> procedure TObject.Free;
> > > > >> begin
> > > > >>   if self<>nil then self.destroy;
> > > > >> end;
> > > > >>
> > > > >> Does this make sense?  i.e. How is it possible for self to be
> > > > >> nil?
> > > > >
> > > > > 'Self' isn't a global variable associated with the method, it's
> > > > > simply a parameter passed implicitly to the method.
> > > >
> > > > This would imply, that we are executing the class method instead of
> > > > the object method.
> > >
> > > No. The 'Self' of a class method is the class.
> > > The Self=nil test is useful for this case:
> > >
> > > var o: TObject;
> > >
> > >   o:=TObject.Create;
> > >   ...
> > >   o.Free;
> > >   o:=nil;
> > >   ...
> > >   o.Free;
> > >
> > > The o is given to the method as hidden parameter, accessible via Self.
> >
> > Only the constructor should be possible to be called w/o self. All
> > others should be dependent on a valid self, otherwise we get something
> > like this:
> >
> > var obj: TObject;
> >
> > TObject.Free;  // this won't compile, which is correct
> > obj.Free;  // this will compile, which is correct,
> >// and gets warned of not being initialized,
> >// but the error only gets detected inside
> >// the class method, which is incorrect,
> >// as it should have been detected in the
> >// calling routine during execution.
> >
> > This problem gets really bad, when you have large class hierarchies, as
> > the  error may only be detected in some deep object without reference to
> > the  causing routine.
>
> Yes, and no.
> Yes, because it happens frequently. And no, it is not a big problem,
> because the gdb backtrace shows it quite clear.
>
> > Michael Van Canneyt wrote:
> > > Al Boldi wrote:
> > > > Does FPC have a switch to disallow executing class/definition
> > > > methods, and only allow executing object/instance methods?
> > >
> > > No. What on earth would be the use of that ?
> >
> > This would make it easier to detect the causing routine of a
> > non-initialized  self.
>
> I'm not sure, what you mean. It is calling the instance method, not a
> class method.

You wish.  obj.Free calls the class method regardless of self's validity.

Calling the instance method could ensure a valid self always.

Thanks!

--
Al

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


Re: [lazarus] Laarus 0.9.16 e Suse

2006-06-04 Thread johnf
On Sunday 04 June 2006 04:34, Mattias Gaertner wrote:
> On Sun, 04 Jun 2006 12:48:41 +0200
>
> franzato <[EMAIL PROTECTED]> wrote:
> > Hello to all,
> >
> >  in the road map page
> > (http://wiki.lazarus.freepascal.org/index.php/Road_To_1.0)I read
> > that Mattias will prepare a Suse version of Lazarus 0.9.16. As I
> > have an  Open Suse 10,0 installed I wonder when this version of
> > Lazarus for Suse will be ready for download.
>
> I planned to install a SuSE system today and try to create a package.
>
> > At present I managed to install a 0.9.15 (if I remember well) and it
> > works badly. I have got the impression that there are no longer
> > the gtk 1.x  in the Suse distro; in fact it seems to work at best if I
> > set the compiler options to GTK2.
> > Once I had Mandriva 2006 installed and even with it  some
> > indispensable libraries to install Lazarus were (and are) missing! how
> > may it be??
>
> Mattias
Please install openSUSE 10.1.  It did not set any of the required lib???.so 
etc...  Also gtk1 appears to have gone away in this version.  I also read 
that Fedora is dropping gtk1.

John

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


Re: [lazarus] SynEdit

2006-06-04 Thread Mattias Gaertner
On Thu, 1 Jun 2006 19:38:29 -0300
"Flávio Etrusco" <[EMAIL PROTECTED]> wrote:

> On 6/1/06, Graeme Geldenhuys <[EMAIL PROTECTED]> wrote:
> > On 3/31/06, Mattias Gaertner <[EMAIL PROTECTED]> wrote:
> > > > Indeed, had forgotten that it seems Lazarus uses SynEdit for the
> > > > source-code editor
> > > > Is the Lazarus SynEdit version available at synedit.sf.net or some
> > > > private Lazarus modification of it? If it's the 2nd, where can I get
> > > > it and on which SynEdit version was it based?
> > >
> > > 1.3
> > > with hundreds of additions.
> > >
> > > Mattias
> 
> Just being picky, there wasn't a version 1.3, we jumped from 1.1 to

Right. I guess, I confused it with a number of a single file. AFAIR it is
from 2001 jan.


> 2.0 (ot: contrary to my opinion, which was for a 1.2 release...).
> So - and guessing from the code - it must be 1.1.
> 
> > Like what was added to SynEdit?
> 
> Major change AFAICS: code folding.

Should be one day work to complete.


> All the other changes I can remeber are either really minors
> (one-liners-like) or are supported in newest SynEdit with some other
> form.
> 
> > Could we give them a patch of what
> > we have added to get the two in sync.  Surely it would benefit us if
> > we were in sync with the latest SynEdit.  That way we can always grab
> > the lastest version for SF and compile it into Lazarus (or would that
> > be a impossibility).

No. Only a lot of work.

 
> Right now I have it "basically" working, but in the mean time I'm
> playing with inheriting it from TScrollingWinControl to avoid that
> dang Windows API calls. I'll discuss the patch soon.
> 
> > I just think it is silly for us to fix bugs in SynEdit, when they
> > already fixed them in v2. Referring to Tabs as an example and I am
> > sure there are lots of others.
> >
> > Anybody know if SynEdit v2 is just a continuation of SynEdit v1, or
> > was it a complete rewrite.  Could we try any apply some of the SynEdit
> > v2 changes to the Lazarus synedit.pp to get them on par.
> 
> No, it's not a complete rewrite.
> But I sure always wanted and am always wanting to do it ;-)
> 
> > NOTE: I am not familiar with synedit code, so if all this sounds like
> > rubbish, just tell me so. ;-)


Mattias

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


Re: [lazarus] [patch] ChecklistBox.onClickCheck

2006-06-04 Thread Mattias Gaertner
On Fri, 02 Jun 2006 08:31:18 +0200
DarekM <[EMAIL PROTECTED]> wrote:

> Vincent Snijders napisa__(a):
> > DarekM wrote:
> >> Vincent Snijders napisa__(a):
> >>
> >>> darekm wrote:
> >>>
>  Hi
>  attached patch added:
>   ChecklistBox.onClickCheck (for GTK and GTK2)
>  publish property  TCheckBox.font
>  remove tCustomLabel.FontChange(Sender: TObject); (default is  
>  fontchanged)
> 
> 
> >>>
> >>> Thanks for the patch. I have the following questions:
> >>>
> >>> Why is the following debugln commented out? Doesn't calling 
> >>> DestroyHandle, if the handle is not allocated, mean that there is a 
> >>> bug somewhere? Raising the exception is maybe too harsh, but 
> >>> silently ignoring it, doesn't seem a good idea to me.
> >>>
>  @@ -3287,7 +3292,8 @@
> AWinControl: TWinControl;
>   begin
> if not HandleAllocated then begin
>  -DebugLn('Warning: TWinControl.DestroyHandle 
>  ',Name,':',ClassName,' Handle not Allocated');
>  +//DebugLn('Warning: TWinControl.DestroyHandle 
>  ',Name,':',ClassName,' Handle not Allocated');
>  +exit;
>   //RaiseGDBException('');
> end;
>   
> >>
> >> Delphi don't claim when handle =0
> >
> > In that case, IMHO Delphi is too tolerant for component writers.
> >
> > But maybe other developers see valid reasons for calling DestroyHandle 
> > when a handle is not allocated (anymore).
> problem is with DestroyWindow. Under Delphi I call it many times  (to 
> free resources). why testing if was painting before or not  (under 
> Delphi i dont have to). And for me: its not problem try to destroy 
> object second time (enough test), but when we try to create it twice or 
> use not initialized

The debugln was there, because the LCL controls do free the Handle only for
good reason. If the handle is already freed, you found a bug. This helped to
find a lot of bugs and overhead in the last years.
Of course this 'only for good reason' rule is only valid for LCL controls.
Programmers using the LCL are of course free to release as often they want.
The debugln should give them only a clue, that they could reduce some
overhead.


Mattias


 
> >
> >>
> >>>
> >>> 
> >>>
>  @@ -132,6 +139,12 @@
> FItemDataOffset := inherited GetCachedDataSize;
>   end;
>   
>  +
>  +procedure tCustomCheckListBox.DoChange(var Msg);
> >>>
> >>>
> >>> 
> >>>
>  +procedure tCustomCheckListBox.ClickChecked;
> >>>
> >>>
> >>> Why not TCustomCheckListBox.DoChange and 
> >>> TCustomCheckListBox.ClickChecked?
> >>
> >> I'm not undestand.
> >> ClickChecked - name the same like in Delphi
> >> DoChange - Lazarus use LM_Change message (the same like in 
> >> tCheckBox), Delphi don't use messages
> >
> > Sorry, this maybe a bit nitpicking:
> > Your patch:
> > tCustomCheckListBox.ClickChecked
> > My proposal:
> > TCustomCheckListBox.ClickChecked
> >
> > Note the capitalized first letter.
> Of course. Have I send patch once more.
> >
> > Vincent
> >
> > _
> > 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] The TDockMgr Component

2006-06-04 Thread Mattias Gaertner
On Sun, 4 Jun 2006 07:09:54 +0300
Al Boldi <[EMAIL PROTECTED]> wrote:

> Mattias Gaertner wrote:
> > Al Boldi wrote:
> > > TDockMgr is a component wrapper for TLazDockingMananger.
> > >
> > > An application can now be easily extended to support docking, by
> > > merely placing TDockMgr on any one form, and capturing others by
> > > calling this:
> > >
> > >   DockMgr1.Capture;
> > >
> > > and then clicking/selecting the form to be captured, or like this:
> > >
> > >   DockMgr1.Capture(Form2);
> > >
> > > to capture form2 specifically, or like this:
> > >
> > >   DockMgr1.Capture(Self);
> > >
> > > to capture self only.
> > >
> > > The captured form then gets an extended PopUpMenu item 'Docking',
> > > which displays the TLazControlDocker form for docking options.
> > >
> > > Many Bugs like:
> > >
> > >   Forms with menus are not handled correctly.
> > >   Layout alClient is not implemented.
> >
> > TLazControlDocker uses anchor docking. That means, it does not use Align
> > like the Delphi docking, but the AnchorSide properties. This makes it
> > more flexible and does not use a tree structure, which the user can't
> > see.
> 
> Do you mean the pairsplitter thing?  It crashes on my system.

No.
I meant, that TLazControlDocker does not use the Align property, and
therefore not alClient.
It uses the Anchors and AnchorSide properties.


> 
> > > Todo:
> > >   Fix bugs.
> > >   Convince non-application forms to be docked.
> > >
> > > Your comments/fixes/improvements are most welcome!
> >
> > The missing part is the saving and restoring of the dock layout. For
> > example when the user hides some window and shows one again, it should
> > restore the position (or at least something similar).
> 
> Doesn't TLazDockingMananger implement this?

It's not yet complete.

Mattias

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


Re: [lazarus] Laarus 0.9.16 e Suse

2006-06-04 Thread Mattias Gaertner
On Sun, 04 Jun 2006 12:48:41 +0200
franzato <[EMAIL PROTECTED]> wrote:

> Hello to all,
> 
>  in the road map page
> (http://wiki.lazarus.freepascal.org/index.php/Road_To_1.0)I read
> that Mattias will prepare a Suse version of Lazarus 0.9.16. As I
> have an  Open Suse 10,0 installed I wonder when this version of
> Lazarus for Suse will be ready for download.

I planned to install a SuSE system today and try to create a package.


> At present I managed to install a 0.9.15 (if I remember well) and it
> works badly. I have got the impression that there are no longer
> the gtk 1.x  in the Suse distro; in fact it seems to work at best if I
> set the compiler options to GTK2.
> Once I had Mandriva 2006 installed and even with it  some
> indispensable libraries to install Lazarus were (and are) missing! how 
> may it be??


Mattias

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


Re: [lazarus] Patch for bug 1965 (horizontal splitter doesn't work)

2006-06-04 Thread Mattias Gaertner
On Wed, 31 May 2006 13:55:25 +0300
"Ere Maijala" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> attached is a fix for the splitter problem described in bug 1965. The
> routine that finds the nearest control actually found the one furthest
> below the splitter.

The bug was the wrong <. Fixed.

Mattias

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


Re: [lazarus] Editor always on top and sticky?

2006-06-04 Thread Mattias Gaertner
On Tue, 30 May 2006 15:59:59 -0700
Jon Foster <[EMAIL PROTECTED]> wrote:

> What is up with the editor window staying always on top and sticky? Its 
> been that way for the last few updates I've grabbed from svn. Its making 
> things very difficult when the silly thing follows me from desktop to 
> desktop.

It is not sticky, on any window manager I tried. Is this only with the IDE
or any LCL application?


> How can I turn this settings off? I've tried to control it 
> through my window manager and it just ignores the settings. I also 
> didn't see anything obvious in the preference settings.


Mattias

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


Re: [lazarus] SegFault in Lazarus

2006-06-04 Thread Mattias Gaertner
On Thu, 1 Jun 2006 10:36:32 +0200
Burkhard Carstens <[EMAIL PROTECTED]> wrote:

> Am Donnerstag, 1. Juni 2006 09:27 schrieb Jens Arm:
> > Hi
> >
> > Since some days I get many "unhandled exception occured at pos "
> > right after starting lazarus. I see the splash while this error run
> > through the console. Then after many of these lines I get SegFault.
> >
> > I use Lazarus from svn and fpc from svn (fpc/trunk).
> >
> > Whats wrong? Is the fpc in trunk not working with Lazarus at the
> > moment?
> 
> I get the same error, if no lazaraus configuration is available 
> (removed / renamed "~/.lazarus"). 
> How do you start lazaraus?
> On my system, I use "( export [EMAIL PROTECTED] ; ./lazarus )" to avoid 
> the UTF-8 warnings.

The UTF-8 warning is about key combinations for special letters (e.g.
french).
If you don't use that, i.e. only use german, you can ignore the warning. 


> When there is no config, it says something like 
> "Note: environment config file not found - using defaults", then it 
> gives me some "Exception while translating .." + an loong list of 
> unhandled exceptions. (see attached log for exact wordings).
> 
> To get around this, I have to "./lazarus" without the LANG export, so it 
> uses the default (de_DE.UTF-8 here).
> Now comes the second problem: I can't change environment settings. Well, 
> I can change them, click OK, but when I reopen the settings dialog 
> immediately, everything is reset to the defaults. 

This was a bug in TComboBox.DestroyWnd. Fixed.


> I have to   
> "environment settings / Desktop / change language to "english [en]" / 
> save to file / ok" (without giving a filename), then everything is back 
> to normal. Now I can change setting, and they will stay. Also I can 
> start lazarus with the [EMAIL PROTECTED] again.
> 
> funny ..

Thanks for the hint.

Mattias

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


Re: [lazarus] SourceEditor improvements

2006-06-04 Thread Michael Van Canneyt


On Sun, 4 Jun 2006, Mattias Gaertner wrote:

> On Sun, 4 Jun 2006 07:09:43 +0300
> Al Boldi <[EMAIL PROTECTED]> wrote:
> 
> > Mattias Gaertner wrote:
> > > Al Boldi wrote:
> > > > The SourceEditor currently has the ability to search in files by
> > > > searching a  complete directory hierarchy.  This may result in
> > > > prolonged searches if the  hierarchy is large.
> > > >
> > > > By pre-Indexing the sources, this could be reduced dramatically.
> > > >
> > > > Would this be difficult to implement?
> > >
> > > Can you give an example how this pre-Indexing should work?
> > 
> > On the search in files dialog, there could be a button to create a word
> > index  of the sources, and a checkbox to use this index instead of
> > grepping the  files each time.
> 
> Implementing should be simple. But making it fast, can be a lot more work.
> If you want to implement it and have any questions, don't hesitate to ask.

I suggest that if this is implemented, it should be done as an external 
program, so it can be run in the background, or immediatly after installation.

Michael.

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


Re: [lazarus] SourceEditor improvements

2006-06-04 Thread Mattias Gaertner
On Sun, 4 Jun 2006 07:09:43 +0300
Al Boldi <[EMAIL PROTECTED]> wrote:

> Mattias Gaertner wrote:
> > Al Boldi wrote:
> > > The SourceEditor currently has the ability to search in files by
> > > searching a  complete directory hierarchy.  This may result in
> > > prolonged searches if the  hierarchy is large.
> > >
> > > By pre-Indexing the sources, this could be reduced dramatically.
> > >
> > > Would this be difficult to implement?
> >
> > Can you give an example how this pre-Indexing should work?
> 
> On the search in files dialog, there could be a button to create a word
> index  of the sources, and a checkbox to use this index instead of
> grepping the  files each time.

Implementing should be simple. But making it fast, can be a lot more work.
If you want to implement it and have any questions, don't hesitate to ask.

Mattias

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


Re: [lazarus] procedure TObject.Free

2006-06-04 Thread Mattias Gaertner
On Sun, 4 Jun 2006 13:47:24 +0300
Al Boldi <[EMAIL PROTECTED]> wrote:

> Mattias Gaertner wrote:
> > Al Boldi <[EMAIL PROTECTED]> wrote:
> > > Flavio Etrusco wrote:
> > > > On 6/3/06, Al Boldi wrote:
> > > >> In the fpc-rtl there is something like this:
> > > >>
> > > >> procedure TObject.Free;
> > > >> begin
> > > >>   if self<>nil then self.destroy;
> > > >> end;
> > > >>
> > > >> Does this make sense?  i.e. How is it possible for self to be nil?
> > > >
> > > > 'Self' isn't a global variable associated with the method, it's
> > > > simply a parameter passed implicitly to the method.
> > >
> > > This would imply, that we are executing the class method instead of
> > > the object method.
> >
> > No. The 'Self' of a class method is the class.
> > The Self=nil test is useful for this case:
> >
> > var o: TObject;
> >
> >   o:=TObject.Create;
> >   ...
> >   o.Free;
> >   o:=nil;
> >   ...
> >   o.Free;
> >
> > The o is given to the method as hidden parameter, accessible via Self.
> 
> Only the constructor should be possible to be called w/o self. All others 
> should be dependent on a valid self, otherwise we get something like this:
> 
> var obj: TObject;
> 
> TObject.Free;  // this won't compile, which is correct
> obj.Free;  // this will compile, which is correct,
>// and gets warned of not being initialized,
>// but the error only gets detected inside
>// the class method, which is incorrect,
>// as it should have been detected in the
>// calling routine during execution.
> 
> This problem gets really bad, when you have large class hierarchies, as
> the  error may only be detected in some deep object without reference to
> the  causing routine.

Yes, and no.
Yes, because it happens frequently. And no, it is not a big problem, because
the gdb backtrace shows it quite clear.

 
> Michael Van Canneyt wrote:
> > Al Boldi wrote:
> > > Does FPC have a switch to disallow executing class/definition methods,
> > > and only allow executing object/instance methods?
> >
> > No. What on earth would be the use of that ?
> 
> This would make it easier to detect the causing routine of a
> non-initialized  self.

I'm not sure, what you mean. It is calling the instance method, not a class
method.


Mattias

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


Re: [lazarus] procedure TObject.Free

2006-06-04 Thread Al Boldi
Mattias Gaertner wrote:
> Al Boldi <[EMAIL PROTECTED]> wrote:
> > Flavio Etrusco wrote:
> > > On 6/3/06, Al Boldi wrote:
> > >> In the fpc-rtl there is something like this:
> > >>
> > >> procedure TObject.Free;
> > >> begin
> > >>   if self<>nil then self.destroy;
> > >> end;
> > >>
> > >> Does this make sense?  i.e. How is it possible for self to be nil?
> > >
> > > 'Self' isn't a global variable associated with the method, it's simply
> > > a parameter passed implicitly to the method.
> >
> > This would imply, that we are executing the class method instead of the
> > object method.
>
> No. The 'Self' of a class method is the class.
> The Self=nil test is useful for this case:
>
> var o: TObject;
>
>   o:=TObject.Create;
>   ...
>   o.Free;
>   o:=nil;
>   ...
>   o.Free;
>
> The o is given to the method as hidden parameter, accessible via Self.

Only the constructor should be possible to be called w/o self. All others 
should be dependent on a valid self, otherwise we get something like this:

var obj: TObject;

TObject.Free;  // this won't compile, which is correct
obj.Free;  // this will compile, which is correct,
   // and gets warned of not being initialized,
   // but the error only gets detected inside
   // the class method, which is incorrect,
   // as it should have been detected in the
   // calling routine during execution.

This problem gets really bad, when you have large class hierarchies, as the 
error may only be detected in some deep object without reference to the 
causing routine.

Michael Van Canneyt wrote:
> Al Boldi wrote:
> > Does FPC have a switch to disallow executing class/definition methods,
> > and only allow executing object/instance methods?
>
> No. What on earth would be the use of that ?

This would make it easier to detect the causing routine of a non-initialized 
self.

Thanks!

--
Al

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


[lazarus] Laarus 0.9.16 e Suse

2006-06-04 Thread franzato

Hello to all,

in the road map page
(http://wiki.lazarus.freepascal.org/index.php/Road_To_1.0)I read
that Mattias will prepare a Suse version of Lazarus 0.9.16. As I
have an  Open Suse 10,0 installed I wonder when this version of
Lazarus for Suse will be ready for download.
At present I managed to install a 0.9.15 (if I remember well) and it
works badly. I have got the impression that there are no longer
the gtk 1.x  in the Suse distro; in fact it seems to work at best if I
set the compiler options to GTK2.
Once I had Mandriva 2006 installed and even with it  some
indispensable libraries to install Lazarus were (and are) missing! how 
may it be??


TIA
Bye to all

Stefano


___
Quipo Free Internet - 2 email, 150 Mb di spazio web e molto di più.
ADSL, Hardware & Software Online Store

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


Re: [lazarus] procedure TObject.Free

2006-06-04 Thread Michael Van Canneyt


On Sun, 4 Jun 2006, Al Boldi wrote:

> Flavio Etrusco wrote:
> > On 6/3/06, Al Boldi wrote:
> >> In the fpc-rtl there is something like this:
> >>
> >> procedure TObject.Free;
> >> begin
> >>   if self<>nil then self.destroy;
> >> end;
> >>
> >> Does this make sense?  i.e. How is it possible for self to be nil?
> >
> > 'Self' isn't a global variable associated with the method, it's simply
> > a parameter passed implicitly to the method.
>
> This would imply, that we are executing the class method instead of the
> object method.
>
> Does FPC have a switch to disallow executing class/definition methods, and
> only allow executing object/instance methods?

No. What on earth would be the use of that ?

Michael.

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


Re: [lazarus] procedure TObject.Free

2006-06-04 Thread Mattias Gaertner
On Sun, 4 Jun 2006 07:09:48 +0300
Al Boldi <[EMAIL PROTECTED]> wrote:

> Flavio Etrusco wrote:
> > On 6/3/06, Al Boldi wrote:
> >> In the fpc-rtl there is something like this:
> >>
> >> procedure TObject.Free;
> >> begin
> >>   if self<>nil then self.destroy;
> >> end;
> >>
> >> Does this make sense?  i.e. How is it possible for self to be nil?
> >
> > 'Self' isn't a global variable associated with the method, it's simply
> > a parameter passed implicitly to the method.
> 
> This would imply, that we are executing the class method instead of the 
> object method.

No. The 'Self' of a class method is the class.
The Self=nil test is useful for this case:

var o: TObject;

  o:=TObject.Create;
  ...
  o.Free;
  o:=nil;
  ...
  o.Free;

The o is given to the method as hidden parameter, accessible via Self.


Mattias

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


Re: [lazarus] Debug Lazarus: Part 2

2006-06-04 Thread Mattias Gaertner
On Sun, 04 Jun 2006 01:23:00 -0400
Alain Michaud <[EMAIL PROTECTED]> wrote:

> Hi,
> 
>   I am still trying to install Lazarus. This time I installed Lazarus
> 0.9.16 and FPC 2.0.2 . I get the same error message !
> 
> Help please! 
> 
> Here is the complete error message. Compare with the one I got when
> trying to compile Lazarus 0.9.8. given in my previous message. Same
> problem!

I never saw this kind of messages. What gives 'ld -v'?

Mattias


> 
> 
> Linking ../lazarus
> ../units/i386-linux/main.o: In function `TMAINIDE__SETUPSPEEDBUTTONS':
> main.pp:1416: relocation truncated to fit: R_386_32 against symbol
> `MAIN_TMAINIDE_$__MNUSTEPOVERPROJECTCLICKED$TOBJECT' defined in .text
> section in ../units/i386-linux/main.o ../units/i386-linux/main.o: In
> function `TMAINIDE__SETUPRUNMENU': main.pp:2036: relocation truncated to
> fit: R_386_32 against symbol
> `MAIN_TMAINIDE_$__MNUSTEPOVERPROJECTCLICKED$TOBJECT' defined in .text
> section in ../units/i386-linux/main.o ../units/i386-linux/main.o: In
> function `defINSTANTANEOUS': main.pp:(.data+0x320): relocation truncated
> to fit: R_386_32 against symbol
> `MAIN_TMAINIDE_$__MNUSTEPOVERPROJECTCLICKED$TOBJECT' defined in .text
> section in ../units/i386-linux/main.o
> /usr/local/lib/fpc/2.0.2/units/i386-linux/x11/xlib.o:(.data+0x1d8d):
> relocation truncated to fit: R_386_32 against symbol
> `RTTI__XLIB_TXMAPPINGEVENT' defined in .data section in
> /usr/local/lib/fpc/2.0.2/units/i386-linux/x11/xlib.o
> ../units/i386-linux/lazconf.o: In function `FINDDEFAULTCOMPILERPATH':
> lazbaseconf.inc:132: relocation truncated to fit: R_386_32 against symbol
> `_$LAZCONF$_L338' defined in .data section in
> ../units/i386-linux/lazconf.o
> /home/microwave/lazarus/components/codetools/units/i386-linux/keywordfunc
> lists.o: In function `INTERNALINIT': keywordfunclists.pas:1279: relocation
> truncated to fit: R_386_PC32 against symbol
> `KEYWORDFUNCLISTS_TKEYWORDFUNCTIONLIST_$__ADD$TKEYWORDFUNCTIONLIST'
> defined in .text section in
> /home/microwave/lazarus/components/codetools/units/i386-linux/keywordfunc
> lists.o /home/microwave/lazarus/lcl/units/i386-linux/dbactns.o: In
> function `TDATASETREFRESH__EXECUTETARGET': dbactns.pp:261: relocation
> truncated to fit: R_386_32 against symbol
> `DBACTNS_TDATASETNEXT_$__UPDATETARGET$TOBJECT' defined in .text section in
> /home/microwave/lazarus/lcl/units/i386-linux/dbactns.o
> /home/microwave/lazarus/lcl/units/i386-linux/stdactns.o: In function
> `TFILEACTION__SETFILENAME': stdactns.pas:698: relocation truncated to fit:
> R_386_32 against symbol `_$STDACTNS$_L23' defined in .data section in
> /home/microwave/lazarus/lcl/units/i386-linux/stdactns.o
> /home/microwave/lazarus/lcl/units/i386-linux/editbtn.o: In function
> `TDATEEDIT__DATEFORMATCHANGED': editbtn.pas:842: relocation truncated to
> fit: R_386_32 against symbol
> `EDITBTN_TCALCEDIT_$__CREATECALCBITMAP$$TBITMAP' defined in .text section
> in /home/microwave/lazarus/lcl/units/i386-linux/editbtn.o
> /usr/local/lib/fpc/2.0.2/units/i386-linux/fcl/db.o:(.data+0x3a7c):
> relocation truncated to fit: R_386_32 against symbol `_$DB$_L6369' defined
> in .data section in /usr/local/lib/fpc/2.0.2/units/i386-linux/fcl/db.o
> /home/microwave/lazarus/components/synedit/units/i386-linux/synedithighli
> ghter.o: In function `TSYNHIGHLIGHTERLIST__FINDBYCLASS':
> synedithighlighter.pp:397: additional relocation overflows omitted from
> the output lazarus.pp(113,1) Error: Error while linking
> make[2]: *** [lazarus] Error 1
> make[2]: Leaving directory `/home/microwave/lazarus/ide'
> make[1]: *** [ide] Error 2
> make[1]: Leaving directory `/home/microwave/lazarus/ide'
> make: *** [ide] Error 2
> [EMAIL PROTECTED] lazarus]$ 
>  
> 
> _
>  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


[lazarus] Debug Lazarus Part 3

2006-06-04 Thread Alain Michaud
Hi,

  In my previous message  I should have mentionned that I have 256 MB of
memory. My swap file is 1.7 GB.

Also I have found that it crashes at different places each time I try to
compile. It could be related related with the amount of memory that is
free. usually the command:

free

tells me that about 70 MB of memory is free.


 My next step will to change the motherboard...


Thanks you any way!

Alain


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