Re: [lazarus] Error: Invalid Free Pascal Source Directory

2008-02-08 Thread Luk Vandelaer
On Friday 08 February 2008 09:41, Peter Williams wrote:
 Hi all,

 I installed Lazarus and Free Pascal on my Linux Ubuntu pc
 using the Synaptic Package Manager. However, when I start Lazarus I
 get the following error message (see subject).

 The current Free Pascal source directory
 /usr/lib/fpc/2.0.4/units/i386-linux/
 does not look correct.
 Choose OK to choose the default .
 Otherwise check Environment - Environment Options - File

 [OK] [ignore]

   Note that the above listed directory (
 /usr/lib/fpc/2.0.4/units/i386-linux/ ) *does* exist.

   What am I doing wrong?!? Can someone please tell me the URL for
 downloading any files I'm missing and also what is the exact directory
 in which they should reside?

The correct path for you would be /usr/lib/fpc/2.0.4
Lazarus knows his way from there.

Luk

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


[lazarus] Problems with fpGui compilation

2008-01-29 Thread Luk Vandelaer
Greetings,

I tried to compile fpGui, but failed.

The problems I encountered where:

1)
The line 
Include(ComponentState, csLoading);
didn't compile, but it was indicated that it only works in fpc 2.2.0 or 
previous versions.

2)
The line 
propertyBackgroundColor: TfpgColor read FBackgroundColor write 
SetBackgroundColor default clWindowBackground;
in gui_form gives error: Range check errors while evaluating constants.
The definition of the constant is:
  clWindowBackground= $8001;

remark: I compile the gfx_package, and he tries to compile the gui_form, which 
is included in gui_package ? Strange interdependencies...

3)
In the method TWideStringList.ExchangeItems,
Illegal type conversion: Widestring to longint for the line 
Temp  := integer(Item1^.FString);
and the following lines.

All this happened on a Suse 86x64 machine, with a FPC 2.3.1 compiler from 21 
december 2007.

Luk

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


Re: [lazarus] button glyphs in IDE dialogs

2007-08-02 Thread Luk Vandelaer
On Thursday 02 August 2007 10:18, Vincent Snijders wrote:
 Graeme Geldenhuys schreef:
  On 02/08/07, Vincent Snijders [EMAIL PROTECTED] wrote:
  I think that is a lot of work.
 
  I can't check now, but doesn't the TBitBtn have a ShowGlyph property
  we can toggle?  If not, I see your point.

 It means you have to add that check to all the forms using bitbtns.
 You cannot just use the designer to make that change. So, it is a lot of
 work.

Can't you define a TIDEBitBtn  that checks the global variable, and change all 
the ocurances of TBitBtn in TIDEBitBtn ?

Luk


type
  TIDEBitBtn = class (TBitBtn)
  public
constructor create (AnOwner : TComponent); override;
  end;

constructor TIDEBitBtn.Create (AnOwner : TComponent);
begin
  inherited;
  ShowGlyph := GlobalShowGlyphs;
end;

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


Re: [lazarus] Gettext, what am I doing wrong ?

2007-07-13 Thread Luk Vandelaer
On Thursday 12 July 2007 23:40, A.J. Venter wrote:
 Moreover this is clearly not an ideal setup for them since the grammer
 would require the username to be elsewhere in the sentence sometimes
 (how do I handle that), and there is the even more complex part where
 I need to set a number of captions for a different form out of this
 unit later on:

 TrayIcon1.Hint := IntToStr(Units)+' Units remaining';
   Popup1.Caption := IntToStr(Units)+' Units remaining';
   Popup1.Panel1.Color := RGBToColor(227,108,42);
   Writeln(Units);
   Popup1.TextY.Caption := 'Welcome user '+LoggedInUser+LineEnding;
   Popup1.TextY.Caption := Popup1.TextY.Caption+'You have
 '+IntToStr(Units)+' time units left'+LineEnding;

 All of that should obviously ALSO be translated.

 How do I do that part please ?

By using the Format function. For example:

resourcestring
  rsWelcomeMsg = 
'Welcome user %s'+LineEnding+'You have %d time units left';
...
 Popup1.TextY.Caption :=  format(rsWelcomeMsg, [LoggedInUser, Units]);

A translation in Dutch could then be 
'Welkom, je hebt nog %1:d tijd eenheden over, %0:s.'
which has the order of the parameters switched.

Luk

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


Re: [lazarus] Reading Jpeg with FPimage

2007-02-26 Thread Luk Vandelaer

Sebastian Kraft wrote:


Hi,

I have the following code to load a jpeg from file test.jpg

var FImg: TFPMemoryImage;
FImgReader: TFPReaderJpeg;

FImg:=TFPMemoryImage.create(0, 0);
FImgReader:=TFPReaderJPEG.Create;
   
FImg.LoadFromFile('test.jpg', FImgReader);


But the program hangs at loading the jpeg from the file. There is no AV, it 
just hangs and does nothing

How do I have to load the jpeg correctly?
 

The problem here is the palette. A standard FPImage will use a palette 
to store its colors, jpeg does not.
It is still converting each pixel's color to an index in the palette it 
creates on the fly.


Place the following line before loading the jpeg:

FImg.UsePalette := false;

And the loading will be almost instant.

Luk

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


Re: [lazarus] Code completion features missing or not ?

2006-09-14 Thread Luk Vandelaer

Mattias Gaertner wrote:


On Thu, 14 Sep 2006 11:43:35 +0200
Graeme Geldenhuys [EMAIL PROTECTED] wrote:

 


On 14/09/06, Michael Van Canneyt [EMAIL PROTECTED] wrote:
   


Second:

if you add the 'Gexperts' to the Delphi IDE (highly recommended)
then 'ALT Gr'-Arrow Up
or
  'ALT Gr'-Arrow Down
('Alt Gr' is the right Alt key) moves to the previous/next
occurrence of the word/identifier you are standing on.

This is also something which I would like to see in the Lazarus
IDE, as I also use this quite a lot.
 


Now this I really miss in Lazarus!!  When I created the Procedure
List add-on (also from GExperts), I tried the Identifier Jumping,
but my knowledge of CodeTools was to limited to get it working.  This
will be a awesome feature in Lazarus.
   



Next word or next identifier?

 


In Delphi/GExperts it is next word.


Luk

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