Re: [Lazarus] ColotToRGB in GTK apps

2008-07-27 Thread Valdas Jankūnas
Hello,

   I found solution: in unit GtkProc is procedure UpdateSysColorMap that 
updates SysColorMap array (from where ColorToRGB gets RGB values of 
system colors), but functionality of this procedure is disabled 
(NewSysColors is not defined). So i writed own procedure that based on 
code of mentioned procedure. Now this procedure I call in OnCreate and 
then ColorToRGB returns correct values.

-- 
   Valdas Jankūnas
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] TStringGrid, One click, multiple events.

2008-07-27 Thread Dave Coventry
Hi,

I'm sure this has been covered often, but none of my searches seems to find it.

I have a routine to remove a row from a TStringGrid if the user selects it.

The problem is that the onSelection event seems to be trigered twice:


procedure TForm1.StringGrid1Selection(Sender: TObject; aCol, aRow: Integer);
var i:integer;
begin
  if messageDlg('Remove
'+StringGrid1.Cells[aCol,aRow]+'?',mtInformation,[mbYes,mbNo],0)=mrYes
then
  begin
for i:=arow to StringGrid1.RowCount-2 do
begin
  StringGrid1.Cells[0,i]:=StringGrid1.Cells[0,i+1];
  StringGrid1.Cells[1,i]:=StringGrid1.Cells[1,i+1];
end;
StringGrid1.RowCount:=StringGrid1.RowCount-1;
  end;
end;

The user will click the item to be removed, the dialog will appear
asking for confirmation to delete the row, but on clicking yes, while
the row is deleted as expected, the dialog pops up again, asking the
user if the next line should be deleted.
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] unable to rebuild lazarus

2008-07-27 Thread Bob K.
Mattais,

I deleted the exe file, then selected Run.  The project recompiled 
successfully, but now it says (debugging...) and is not doing anything else.

bob k.

--
From: Mattias Gaertner [EMAIL PROTECTED]
Sent: Saturday, July 26, 2008 1:46 PM
To: lazarus@lazarus.freepascal.org
Subject: Re: [Lazarus] unable to rebuild lazarus

 On Sat, 26 Jul 2008 13:21:55 -0400
 Bob K. [EMAIL PROTECTED] wrote:

 Compiled with -vu -vt options:

 rakphoto.pas(53,61) Hint: Parameter Field not used
 rakphoto.pas(54,7) Hint: Parameter AFont not used
 rakphoto.pas(54,25) Hint: Parameter Background not used
 rakphoto.pas(54,49) Hint: Parameter SortMarker not used
 rakphoto.pas(55,7) Hint: Parameter IsDown not used
 rakphoto.pas(10,11) Hint: Unit rxlookup not used in rakphoto
 rakphoto.pas(10,21) Hint: Unit rxdbcomb not used in rakphoto
 rakphoto.pas(10,30) Hint: Unit rxmemds not used in rakphoto
 rakphotography.lpr(17,1) Error: Can't create object file:
 rakphotography.exe
 rakphotography.lpr(17,1) Fatal: Can't create
 executable rakphotography.exe

 Sorry. You misunderstood me.
 To find the error 'unit interfaces not found' you should compile with
 -vt -vu.

 The can not create object files means for example: disk full, no write
 permissions, output directory does not exist or output file is locked.
 Delete the old exe before compiling.

 Mattias
 ___
 Lazarus mailing list
 Lazarus@lazarus.freepascal.org
 http://www.lazarus.freepascal.org/mailman/listinfo/lazarus 


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TCombobox major failure :(

2008-07-27 Thread Mattias Gaertner
On Sun, 27 Jul 2008 10:22:03 -0300
Luiz Americo Pereira Camara [EMAIL PROTECTED] wrote:

[...]
 Here it is.

 
 This patch does the following:
 
 - Avoid the creation of WidgetInfo to combox childs [gtk1]
 - Pass WidgetInfo as the data to the changed event handler [gtk1]
 - Update the ItemIndex cache when inserting items [gtk2]

Thanks. Applied.

 
 BTW: the file gtkobject.inc seems unused. Initially i got confused
 after searching for the places where the info is freed.

gtkobject.inc?
AFAIR it was removed 9 months ago.

Mattias
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] ColotToRGB in GTK apps

2008-07-27 Thread Mattias Gaertner
On Sun, 27 Jul 2008 15:26:34 +0300
Valdas Jankūnas [EMAIL PROTECTED] wrote:

 Hello,
 
I found solution: in unit GtkProc is procedure UpdateSysColorMap
 that updates SysColorMap array (from where ColorToRGB gets RGB values
 of system colors), but functionality of this procedure is disabled 
 (NewSysColors is not defined). So i writed own procedure that based
 on code of mentioned procedure. Now this procedure I call in OnCreate
 and then ColorToRGB returns correct values.

Thanks for the hint. I forgot that. I enabled it by default. 
This fixes the 'random' colors. 
But remember that the rest of my mail still holds true: These values
depend on theme and not every theme defines all values. So don't expect
that your program will work on every machine.

Mattias

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus