Re: [lazarus] Form.Align without effect

2007-10-18 Thread Christian U.

Thomas Moritz schrieb:
This setting: 
Form1.Align:=alClient;  //or alTop 
was ignored.

You can help? Thanks.
  


If Form has an parent this works for me.

Linux/ FPC 2.2.0 / Lazarus 0.9.23 Beta

Regards Th. Moritz

_
 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] Custom editing of a TStringGrid cell (with PickList)

2007-10-18 Thread Adrian Maier
Hello,

I'm looking for ideas for making a TSringGrid behave exactly the way i like .
One of the columns ('Category') has a short list of pre-defined values , so
i've set the buttonStyle of that column to cbsPickList  and defined a
select editor event handler:

procedure TTrackTimeMainForm1.StringGrid1SelectEditor(Sender: TObject; aCol,
  aRow: Integer; var Editor: TWinControl);
begin
  case aCol of
   0: {category}
  begin
 Editor:=PickListCategories;
  end;
   1,2,3:
Editor:=StringGrid1.EditorByStyle(cbsAuto);
  end; {case}
end;


My problem with this approaches is that i need three clicks:
-  one for selecting the cell
-  one for getting into the editing mode
-  one for clicking the small button that opens the pickList
This is horrible for the user, even if it's an application for my own use.

How could I display the list of possible values with just one click ?
I realize that it must be possible to use the grid's OnClick , but maybe
there is some better/simpler solution that I'm not aware of .


PS:  i'm on Linux using the fpc 2.0.4 , latest svn Lazarus and the gtk
interface.

Cheers,
Adrian Maier

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


Re: [lazarus] Is there a way to comment-out lines in .lfm?

2007-10-18 Thread James Chandler Jr

Thanks, Mattias!

- Original Message - 
From: "Mattias Gaertner" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, October 17, 2007 4:03 AM
Subject: Re: [lazarus] Is there a way to comment-out lines in .lfm?



On Tue, 16 Oct 2007 23:13:21 -0400
James Chandler Jr <[EMAIL PROTECTED]> wrote:

Is there a valid way to comment-out a line in a .lfm file? I tried  
{...} and //..., which do not seem to work in Carbon LCL.


Perhaps the form compiler recognizes some other comment mechanism?


No comment.


If comments are not supported, it is not a big issue. When  
editing .lfm files as text in XCode, temporary comments would be  
convenient compared to completely deleting lines.


The .lfm file is a 1:1 mapping to the binary stream created by TWriter.
Anything stored in the lfm comes from the components and they don't
have comments. The .lfm is a text file to allow searching, repairing
or refactoring not provided by the IDE. It is not a normal source file.


Mattias

_
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] SQLdb : program crash using more than 9-10 fieldsets: bug...?

2007-10-18 Thread Joost van der Sluis
Op donderdag 18-10-2007 om 11:23 uur [tijdzone +0200], schreef Alvise
Nicoletti:
> This is a bug notification... I managed to re-create the "segmentation 
> fault" bug.
> 
> The service was crashing without giving any output and any reason, the 
> problem was in the NUMBER of the parameters in the result set fetched in 
> the select:
> 10.
> 
> Fetching less parameters (9), all works. You can add and remove any kind 
> of parameter, not one in particular to force the crash.

Oh, yes, I knew that. That's fixed in fpc 2.3.1. I'll merge the fix to
fpc 2.2.1.

> A strange thing is that if I set parseSQL to true, I get a mysql syntax 
> error before the crash of the application:
> Check the manual that corresponds to your MySQL server version for the 
> right syntax to use near 'GROUP BY i.pk_iscrizione, i.n_ingressi, 
> t.nome, a.nome, a.tipo_

Well, please first update to at least fpc 2.2.0.

Joost.

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


Re: [lazarus] SQLdb and 64 bits

2007-10-18 Thread Joost van der Sluis
Op donderdag 18-10-2007 om 11:32 uur [tijdzone +0200], schreef Alvise
Nicoletti:
> Joost van der Sluis ha scritto:
> > Op woensdag 17-10-2007 om 18:03 uur [tijdzone +0200], schreef Alvise
> > Nicoletti:
> >
> >   
> >> I tryed to compile my linux service for a server with ubuntu 64 bit and 
> >> mysql 5.
> >> So I changed in the code every mysql40 reference to mysql50.
> >> I tryed to change target, compile, and copy the binary to the another 
> >> server, when I try to connect to the database all I get is:
> >> Can not load MySQL library "libmysqlclient.so". Please check your 
> >> installation.
> >>
> >> The server configuration is ubuntu 64 bit, mysql 5.0 (client and server).
> >>
> >> I need an application that works on this kind of server, so if you 
> >> suspect that I can have any trouble with this in the future please 
> >> notify it to me. I'm a little scared about that.
> >> Is it just a misconfiguration problem?
> >>
> >> If I do a locate libmysqlclient.so I found:
> >> /usr/lib/libmysqlclient.so.15
> >> /usr/lib/libmysqlclient.so.15.0.0
> >> 
> >
> > You have to install the 64-bit version of the mysql-client. On most
> > distributions, that's located in /usr/lib64/ and not /usr/lib.
> >
> > So take a look in /usr/lib64 It's most probable that the correct link is
> > missing there. (The usual mysql-library-link-issues)
> >   
> I don't know if I'm wrong... but...:
> # ls -al /usr/
> drwxr-xr-x  88 root root 20480 2007-10-18 09:36 lib
> drwxr-xr-x   4 root root  4096 2007-07-18 12:13 lib32
> lrwxrwxrwx   1 root root 3 2007-07-17 16:37 lib64 -> lib
> 
> So, if lib64 is just a link to lib... it should work anyway, right?

Yes, but that's not how the distribution I use has solved it.

Joost

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


Re: [lazarus] SQLdb and 64 bits

2007-10-18 Thread Alvise Nicoletti

Joost van der Sluis ha scritto:

Op woensdag 17-10-2007 om 18:03 uur [tijdzone +0200], schreef Alvise
Nicoletti:

  
I tryed to compile my linux service for a server with ubuntu 64 bit and 
mysql 5.

So I changed in the code every mysql40 reference to mysql50.
I tryed to change target, compile, and copy the binary to the another 
server, when I try to connect to the database all I get is:
Can not load MySQL library "libmysqlclient.so". Please check your 
installation.


The server configuration is ubuntu 64 bit, mysql 5.0 (client and server).

I need an application that works on this kind of server, so if you 
suspect that I can have any trouble with this in the future please 
notify it to me. I'm a little scared about that.

Is it just a misconfiguration problem?

If I do a locate libmysqlclient.so I found:
/usr/lib/libmysqlclient.so.15
/usr/lib/libmysqlclient.so.15.0.0



You have to install the 64-bit version of the mysql-client. On most
distributions, that's located in /usr/lib64/ and not /usr/lib.

So take a look in /usr/lib64 It's most probable that the correct link is
missing there. (The usual mysql-library-link-issues)
  

I don't know if I'm wrong... but...:
# ls -al /usr/
drwxr-xr-x  88 root root 20480 2007-10-18 09:36 lib
drwxr-xr-x   4 root root  4096 2007-07-18 12:13 lib32
lrwxrwxrwx   1 root root 3 2007-07-17 16:37 lib64 -> lib

So, if lib64 is just a link to lib... it should work anyway, right?

I can also do a:
# ls -al /usr/lib64/libmysqlclient.so
lrwxrwxrwx 1 root root 20 2007-10-18 09:36 /usr/lib64/libmysqlclient.so 
-> libmysqlclient.so.12


Finding the correct library in the correct place...

Alvise

Joost.

_
 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] SQLdb : program crash using more than 9-10 fieldsets: bug...?

2007-10-18 Thread Alvise Nicoletti
This is a bug notification... I managed to re-create the "segmentation 
fault" bug.


The service was crashing without giving any output and any reason, the 
problem was in the NUMBER of the parameters in the result set fetched in 
the select:

10.

Fetching less parameters (9), all works. You can add and remove any kind 
of parameter, not one in particular to force the crash.


The query is perfectly working both via ssh and graphical clients, even 
on localhost.


A strange thing is that if I set parseSQL to true, I get a mysql syntax 
error before the crash of the application:
Check the manual that corresponds to your MySQL server version for the 
right syntax to use near 'GROUP BY i.pk_iscrizione, i.n_ingressi, 
t.nome, a.nome, a.tipo_


So I'm guessing who parses the sql... if the mysql (as it should be) or 
the component, cause there is no reason to have a sql syntax error from 
a query that works perfectly via shell and gui.


As you can see from the query, there are no strange (italian) characters 
in it.


I tryed also to concat two fields that I need concatenated in the code 
(first name and last name (nome e cognome)) to make 9 fields fit me, 
with no success.
So the problem seems to be not the number of parameters i fetch in the 
query, but the number of parameters i fetch in the code via 
"sqlquery.fieldbyname('field').asstring"


Also, a strange fact is that the crash happens the SECOND time I do the 
query and not the first one... but I can also do it one time and then 
crash the program with a second "whathever query", so I suppose that the 
first time I do the query the connection or the transaction are "bugged" 
and the problem appear the second time I use them.


This is the crashing query, commenting any of the fields of the first 
rows (so reducing the number (10) of the fetched fields) and commenting 
the fetching I do in the second part of the code makes it work perfectly:

   SqlQuery.SQL.Text := 'SELECT i.pk_iscrizione, i.n_ingressi, ' +
't.nome as nome_turno, '+
'a.nome as nome_attivita, 
a.tipo_gestione_ingressi, a.flag_permetti_ingressi_multipli, '+

'area.pk_area_impianto, '+
//'an.cognome as cognome_anagrafica, 
an.nome as nome_anagrafica, '+
//'concat(an.cognome, '' '', an.nome) as 
nome_anagrafica, '+

'an.nome as nome_anagrafica, '+
'MAX(ing.pk_ingresso) as last_ingresso '+
   'FROM ISCRIZIONI i '+
'INNER JOIN CORSI c ON ((i.pk_corso = 
c.pk_corso) and '+
   '(c.data_inizio <= 
CURDATE()) and '+
   '(c.data_fine >= 
CURDATE())) '+
'INNER JOIN TURNI t ON c.pk_turno = 
t.pk_turno '+
'INNER JOIN ORARI o ON ((o.pk_turno = 
t.pk_turno) and '+
   '(o.giorno = 
WEEKDAY(CURDATE()) + 1) and '+
   '( 
TIME_TO_SEC(o.dalle_ore) - 60 * GREATEST(a.anticipo_ingresso, 
an.anticipo_ingresso) <= TIME_TO_SEC(CURTIME()) ) and '+
   '( 
TIME_TO_SEC(o.alle_ore) >= TIME_TO_SEC(CURTIME()) )) '+
'INNER JOIN ATTIVITA a ON t.pk_attivita = 
a.pk_attivita '+
'INNER JOIN AREE_IMPIANTO area ON 
a.pk_area_impianto = area.pk_area_impianto '+
'INNER JOIN REL_DISP_AREE rda  ON 
area.pk_area_impianto '+
'INNER JOIN DISPOSITIVI disp ON 
((rda.pk_dispositivo = disp.pk_dispositivo) and '+

'(disp.id_dispositivo = '+inttostr(self.Dispositivo_Id)+')) '+
'INNER JOIN ANAGRAFICA an ON 
i.pk_anagrafica = an.pk_anagrafica '+
'LEFT  JOIN INGRESSI ing ON 
((i.pk_iscrizione = ing.pk_iscrizione) and '+

'(DAYOFYEAR(ing.data_e_ora) = DAYOFYEAR(CURDATE())) and '+

'(YEAR(ing.data_e_ora) = YEAR(CURDATE())) and '+
'(ing.verso = 
1) ) '+
 'WHERE  (an.codice_tessera = 
'''+self.passaggioGestito.id_tessera+''') '+

   'AND  (i.data_inizio <= CURDATE()) '+
   'AND  (i.data_scadenza >= CURDATE()) '+
   'AND  ((a.tipo_gestione_ingressi <> 2) OR 
(i.n_ingressi > 0)) '+

 'GROUP BY i.pk_iscrizione, i.n_ingressi, ' +
't.nome, '+
'a.nome, a.tipo_gestione_ingressi, 
a.flag_permetti_ingressi_multipli, '+

'area.pk_area_impianto, '+

Re: Min/Max Constraint handling in Win32 interface

2007-10-18 Thread Graeme Geldenhuys
Ah, I found my answer in the win32callback.inc unit.

Graeme.


On 18/10/2007, Graeme Geldenhuys <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Where in the Win32-LCL interface does the Min/Max size constraints get
> set for Forms?  I searched all the code and can only find information
> where it queries the size, but never sets the size.
>
> The Min/Max constraints do work for a TForm, but I can't seem to find
> out which Win32 API it calls to set those values.  Any hints?
>
>

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


Re: [lazarus] Object Inspector and non-default values

2007-10-18 Thread Graeme Geldenhuys
On 18/10/2007, Paul Ishenin <[EMAIL PROTECTED]> wrote:
> >
> > How does the Object Inspector detect non-default values of properties?
> >
>
> Look at TPropertyEditor.GetDefaultOrdValue (lazarus\ideintf\propedits.pp)
>


Thanks Paul.


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

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


Re: [lazarus] Object Inspector and non-default values

2007-10-18 Thread Paul Ishenin

Graeme Geldenhuys пишет:

Hi,

How does the Object Inspector detect non-default values of properties?



Look at TPropertyEditor.GetDefaultOrdValue (lazarus\ideintf\propedits.pp)

Best regards,
Paul Ishenin.


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


Re: [lazarus] SQLdb and 64 bits

2007-10-18 Thread Joost van der Sluis
Op woensdag 17-10-2007 om 18:03 uur [tijdzone +0200], schreef Alvise
Nicoletti:

> I tryed to compile my linux service for a server with ubuntu 64 bit and 
> mysql 5.
> So I changed in the code every mysql40 reference to mysql50.
> I tryed to change target, compile, and copy the binary to the another 
> server, when I try to connect to the database all I get is:
> Can not load MySQL library "libmysqlclient.so". Please check your 
> installation.
> 
> The server configuration is ubuntu 64 bit, mysql 5.0 (client and server).
> 
> I need an application that works on this kind of server, so if you 
> suspect that I can have any trouble with this in the future please 
> notify it to me. I'm a little scared about that.
> Is it just a misconfiguration problem?
> 
> If I do a locate libmysqlclient.so I found:
> /usr/lib/libmysqlclient.so.15
> /usr/lib/libmysqlclient.so.15.0.0

You have to install the 64-bit version of the mysql-client. On most
distributions, that's located in /usr/lib64/ and not /usr/lib.

So take a look in /usr/lib64 It's most probable that the correct link is
missing there. (The usual mysql-library-link-issues)

Joost.

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


Re: [lazarus] SQLdb and 64 bits

2007-10-18 Thread Alvise Nicoletti

Henry Vermaak ha scritto:

On 17/10/2007, Alvise Nicoletti <[EMAIL PROTECTED]> wrote:
  

Hi...

I tryed to compile my linux service for a server with ubuntu 64 bit and
mysql 5.
So I changed in the code every mysql40 reference to mysql50.
I tryed to change target, compile, and copy the binary to the another
server, when I try to connect to the database all I get is:
Can not load MySQL library "libmysqlclient.so". Please check your
installation.

The server configuration is ubuntu 64 bit, mysql 5.0 (client and server).

I need an application that works on this kind of server, so if you
suspect that I can have any trouble with this in the future please
notify it to me. I'm a little scared about that.
Is it just a misconfiguration problem?

If I do a locate libmysqlclient.so I found:
/usr/lib/libmysqlclient.so.15
/usr/lib/libmysqlclient.so.15.0.0




you will need to install the -dev package (which will make the
libmysqlclient.so link).

henry

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



  

Thank you for your support.

I installed the package on the machine I'm copyng the compiled binary 
and I have the same error: Can not load MySQL library 
"libmysqlclient.so". Please check your installation.

Really... I installed another package cause:
# apt-get install mysql-dev
The package mysql-dev don't have avaiable versions, but is nominated in 
another package, so it's obsolete or missing.

However, this package replaces it:
libmysqlclient12-dev libmysqlclient10-dev

So I choosed libmysqlclient12-dev and installed it.

But I still have the same error.

I also did a "updatedb" and "locate libmysqlclient.so" and I find:
/usr/lib/libmysqlclient.so
/usr/lib/libmysqlclient.so.12
/usr/lib/libmysqlclient.so.12.0.0
/usr/lib/libmysqlclient.so.15
/usr/lib/libmysqlclient.so.15.0.0

# ls -al /usr/lib/libmysqlclient.so
lrwxrwxrwx 1 root root 20 2007-10-18 09:36 /usr/lib/libmysqlclient.so -> 
libmysqlclient.so.12


Is there something else I have to do?

Does I need to do that also on the machine that is COMPILING the 
program? (in that 32 bit machine, the program, always worked... I'm only 
having problems to run the program on another (64 bits) machine).


Thank you in advance.

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


[lazarus] Object Inspector and non-default values

2007-10-18 Thread Graeme Geldenhuys
Hi,

How does the Object Inspector detect non-default values of properties?

For example:

I create a custom component which has a Integer property defaulting to
100.  The constructor also sets FMyProp = 100.

   TMyComponent = class(...)
   published
  property MyProp: Integer read FMyProp write SetMyProp default 100;
   end;


If the value is set to something other than 100, it gets written to
the .lfm file and the object inspector writes the value in Red.
How does Object Inspector know that? Can you use RTTI to query such a
property to detect a non-default value?


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

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


[lazarus] Min/Max Constraint handling in Win32 interface

2007-10-18 Thread Graeme Geldenhuys
Hi,

Where in the Win32-LCL interface does the Min/Max size constraints get
set for Forms?  I searched all the code and can only find information
where it queries the size, but never sets the size.

The Min/Max constraints do work for a TForm, but I can't seem to find
out which Win32 API it calls to set those values.  Any hints?


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

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


[lazarus] Custom editing of a TStringGrid cell (with PickList)

2007-10-18 Thread Adrian Maier
Hello,

I'm looking for ideas for making a TSringGrid behave exactly the way i like .
One of the columns ('Category') has a short like of pre-defined values , so
i've set the buttonStyle of that column to cbsPickList  and , defined a
select editor event handler:

procedure TTrackTimeMainForm1.StringGrid1SelectEditor(Sender: TObject; aCol,
  aRow: Integer; var Editor: TWinControl);
begin
  case aCol of
   0: {category}
  begin
 Editor:=PickListCategories;
  end;
   1,2,3:
Editor:=StringGrid1.EditorByStyle(cbsAuto);
  end; {case}
end;


My problem with this approaches is that i need three clicks:
-  one for selecting the cell
-  one for getting into the editing mode
-  one for clicking the small button that opens the pickList

How could I display the list of possible values with just one click ?
I realize that it must be possible to use the grid's OnClick , but maybe
there is some better/simpler solution that I'm not aware of .


PS:  i'm on Linux using the fpc 2.0.4 , latest svn Lazarus and the gtk
interface.

Cheers,
Adrian Maier

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


[lazarus] Form.Align without effect

2007-10-18 Thread Thomas Moritz
This setting: 
Form1.Align:=alClient;  //or alTop 
was ignored.
You can help? Thanks.

Linux/ FPC 2.2.0 / Lazarus 0.9.23 Beta

Regards Th. Moritz

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