Re: [Lazarus] Editor font disturbed after upgrading to r19705

2009-05-04 Thread Bart
@Paul:

Something else I noticed.
Can there be a relationship between this and bug
http://bugs.freepascal.org/view.php?id=13062 (IDE prints garbage on
screen)?

I ask this because I noticed that the broken version produced lots of
garbage on the screen, and after your fix, this has been reduced (not
gone though).
It seems to be a win9x issue only (so hardly anyone seems to bother).

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


Re: [Lazarus] Editor font disturbed after upgrading to r19705

2009-05-01 Thread Bart
On 5/1/09, Martin Friebe laza...@mfriebe.de wrote:
  I have attached a patch with a few debugln in it. I don't know if they will
 show anything useful, since I have no idea what is going on.
  If you apply it, you need to start lazarus with a logfile, to capture the
 output. (There is a command line switch, but I have to find it myself / I
 usually compile as none window app, which means my Lazarus runs with a
 console-window showing all the output)

  Also if you do this, test it with only one Synedit open. (You can compile a
 standalone app, with one SynEdit, and set the font from inside the app)

I applied the changes in sysnedit.pp and syneditextdrawer.pp
then did a make clean all

This happens when I build and start my test app.

In OI the font is set to Verdanana, size -12 (height 16), pitch fpFixed

F:\LazarusProjectentest
SetStyle created font for idx=0 name=default handle=596
SetBasefont name=default  basefont.name=default Handle=596
SetBasefont name=default  NO pinfo
SetStyle created font for idx=1 name=default handle=3364
RecalcCharExtend for font name=courier / courier mono=False Handle=2360
SetStyle created font for idx=0 name=courier handle=2360
SetBasefont name=courier  basefont.name=courier Handle=2360
SetStyle created font for idx=1 name=courier handle=2492
RecalcCharExtend for font name=courier / courier mono=False Handle=2360
SetBasefont name=courier  NO pinfo
RecalcCharExtend for font name=courier / courier mono=False Handle=1760
SetStyle created font for idx=0 name=courier handle=1760
SetBasefont name=courier  basefont.name=courier Handle=1760
RecalcCharExtend for font name=Verdana / Verdana mono=False Handle=1720
SetStyle created font for idx=0 name=Verdana handle=1720
SetBasefont name=Verdana  basefont.name=Verdana Handle=1720


When I set the font (in my app) to Courier New, Normal, 10 pt, this is
the output:

RecalcCharExtend for font name=Courier New / Courier New mono=False Handle=2308
SetStyle created font for idx=0 name=Courier New handle=2308
SetBasefont name=Courier New  basefont.name=Courier New Handle=2308


If I change the font in Lazarus IDE, I see no output on console, or on logfile
(startlazarus --debug --pcp=bla)




  If you use the same font, (and in normal, bold, italic) for Labels and/or
 StaticText, does it look correct there?

TLabel and TStaticText seems to work normally

  Note, the spacing will be ok there, because neither of them forces the
 mono-spacing. But does it actually look like the expected Courier New, and
 is it truly monospaced?
Take a look at my attachments in my previous mail, to see for yourself
The normal_couriernew is how Courier New should look on my system.

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


Re: [Lazarus] Editor font disturbed after upgrading to r19705

2009-05-01 Thread Bart
On 5/1/09, Bernd Mueller muelle...@gmx.net wrote:
 Bart wrote:

 
  Is this a bug, or is there something wrong with my system?
 

  I can confirm the described behavior on my Windows 98 machine.

What was your latest revision that seemed to be OK?
(My latest was 18956, I hope yours is later...)
That would help us finding where things went wrong.

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


Re: [Lazarus] Editor font disturbed after upgrading to r19705

2009-05-01 Thread Bart
On 5/1/09, Paul Ishenin webpi...@mail.ru wrote:
 Bernd Mueller wrote:
   Martin Friebe wrote:
  
   The best is probably to try and find the revision which broke it.
   Everything else is just blind search for a needle in a hay stack.
  
  
   r19131 is the breaking revision.
  

 Please test with r19746.

  Best regards,

 Paul Ishenin.


I updated to r19751: this looks OK again!
Thanks very much for the swift fix.
(The IDE was almost unusable ...)

Every now and then I'm forced to use D3, and I've gotten so used to
Lazarus I'd really rather not have to go back.

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


[Lazarus] Editor font disturbed after upgrading to r19705

2009-04-30 Thread Bart
Hi,

I just upgraded my Lazarus from r18956 to r19705  on Win9x.
When I started Lazarus the font in the code editor had become almost
unreadable (too small, appr. 5 pt.)

I tried to adjust the font in using the appropriate dialog, but I
could not get it as it was before.
I then copied the editoroptions.xml from what used to be my stable
version and applied it to r19705, so I was sure they both used the
same fonts.

However the r19705 renders the chosen font very differently.

The editor r18956.png show how the editor font used to be,
the editor r19705.png shows how it is rendered now.

Here's the editoroptions.xml that both Lazarus' use:

?xml version=1.0?
CONFIG
  EditorOptions Version=4
Display EditorFont=Courier New EditorFontHeight=-13 ExtraLineSpacing=0
 ShowLineNumbers=False ShowOnlyLineNumbersMultiplesOf=1/
Color
  LangObjectPascal Version=4/
/Color
KeyMapping
  default
Version Value=5/
printselection Value=80,1,0,0,0,0,0,0/
jcfcurrenteditorwindow Value=68,1,0,0,0,0,0,0/
  /default
/KeyMapping
CodeTools CodeTemplateFileName=H:\PROGRAMMAS\SVNLAZ\lazarus.dci/
  /EditorOptions
/CONFIG


The fontheight of -13 looks strange, but Lazarus puts this value in
when I choose the font directly from the font-dialog.
I've tried changing the font-size to diffrent values (10 to 18) but
nothing comes even close to what it used to be.
The font is either too big, or too small, or the kerning (the space
between individual characters) is too large.

B.t.w. Yesterday I upgraded my Lazarus on Linux (GTK2) to r19690 and I
noticed no fonts changes at all.

Is this a bug, or is there something wrong with my system?

Bart
attachment: editor_r18956.pngattachment: editor_r19705.png___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Editor font disturbed after upgrading to r19705

2009-04-30 Thread Bart
On 4/30/09, Martin Friebe laza...@mfriebe.de wrote:

 It looks to me like it uses a different font. certainly it looks like it
  believes the font was proportional (that is why you get the odd spacing,
  because SynEdit forces it into a grid).

  The last font-related changes in synedit where in revision 185xx (so
  before your last good revision).

  Maybe you could put some debugln into Synedit.SizeOrFontChanged and see
  which font is really used? Otherwise I have no idea.

I can certainly do so, but in which unit is this method?

I wrote a small test program that has a synmemo and a memo
It sets the fonts of  both the memo and synmemo the same
and then queries their names etc and writes them in the editcontrols
below (see attachments)

In r18956 when setting the font (via fontdialog) to Courier New 10
point normal you see that the fonts look exactly the same in synmemo
and memo (normal_couriernew.png).
In r19705 they look very different indeed (bug_couriernew.png).

So at least it looks like the synmemo thinks it's font is courier new...


  I haven't got  Win9x, so I can't test. On XP it looks fine.


I tested the compiled programs under XP and they behaved normally (and
absolutely the same): the courier new font looks OK and the same in
synmemo and memo.

So we have a win9x specific bug?
(Delphi with a tsynmemo and a tmemo behaves just fine on my win9x system)

Bart
Bart
attachment: normal_couriernew.pngattachment: bug_couriernew.png___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Cannot build Lazarus r19689

2009-04-29 Thread Bart
Hi,

Today I updated may Lazarus from svn revision 18956 to revision 19686.
When I tried to build the IDE I got the following

b...@simenon:~/svnroot/lazarus make clean
make -C ide cleanide
make[1]: Entering directory `/home/bart/svnroot/lazarus/ide'
/bin/rm -f
/bin/rm -f
[...]
/bin/rm -f fpcmade.i386-linux Package.fpc ppas.sh script.res link.res
/bin/rm -f *.s *_ppas.sh
make[1]: Leaving directory `/home/bart/svnroot/lazarus/ideintf'

Then

b...@simenon:~/svnroot/lazarus make all LCL_PLATFORM=gtk2
make -C lcl all
make[1]: Entering directory `/home/bart/svnroot/lazarus/lcl'
/bin/rm -f units/i386-linux/alllclunits.ppu
/usr/local/bin/ppc386 -gl -Fu. -Funonwin32 -Fuforms -Fuwidgetset
-Fu/usr/local/lib/fpc/2.2.2/units/i386-linux/rtl -Fiinclude -FE.
-FUunits/i386-linux -di386 alllclunits.pp
Free Pascal Compiler version 2.2.2 [2008/07/29] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Linux for i386
Compiling alllclunits.pp
Compiling lclversion.pas
Compiling lclstrconsts.pas
[...]
Compiling graphics.pp
Compiling intfgraphics.pas
Compiling icnstypes.pas
Compiling graphics.pp
canvas.inc(88,24) Error: identifier idents no member SetClipping
graphics.pp(2489) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[1]: *** [alllclunits.ppu] Fout 1
make[1]: Leaving directory `/home/bart/svnroot/lazarus/lcl'
make: *** [lcl] Fout 2
b...@simenon:~/svnroot/lazarus

Do I need a newer version of fpc (2.2.4 instead of 2.2.2) or is this a bug?

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


Re: [Lazarus] EXC_BAD_ACCESS, Could not access memory

2009-04-28 Thread Bart
On 4/28/09, Mattias Gaertner nc-gaert...@netcologne.de wrote:
Bart schrieb:
   
I'm not even sure that Extended has the same size on all platforms.
   
[...]
  And on some machine extended can be a double.

  Mattias

And so they probably do not have the same size ...?

Another thougth.
Are you gonna run int endian-ness problems when reading files on a Mac
that are created on a PC?

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


Re: [Lazarus] EXC_BAD_ACCESS, Could not access memory

2009-04-27 Thread Bart
I'm not even sure that Extended has the same size on all platforms.
I might of course be horribly wrong about this ;-)
But if not, it might complicate things.

If you need to read those records, created with Delphi/Kylix now on
MacOS and you cannot solve how to declare your record, you could as a
last resort read x bytes (where x is the size of the delphi record on
disk) and translate theis sequence of bytes to the values you want.

It's just one of those things with proprietary formats and cross-platform usage.

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


Re: [Lazarus] Making a auto-complete dropdown list

2009-04-25 Thread Bart
Hi,

If you try to do this cross-platform, you might run into this bug:
http://bugs.freepascal.org/view.php?id=7243

I have an app with autocompletion TEdit. When it finds a match it
appends the part that was not typed in yet, and selects that part in
the control.
This works perfectly well in win32, but in GTK the SelLength property
is not updated correctly in the TEdit.OnChage event.
I was never able to pinpoint where this goes wrong and no other
Lazarus users seem to need this specific behaviour it seems.

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


Re: [Lazarus] EXC_BAD_ACCESS, Could not access memory

2009-04-23 Thread Bart
This code works perfectly fine (at least it does not crash) with fpc 2.2.2

constructor TMyObject.Create;
begin
  DebugLn('Create');
  FItem := nil;
  DebugLn('nil');
  SetLength(FItem,3);
  DebugLn('SetLength');
  FItem[0].First:= 1.0;
  DebugLn('FItem[0].First = ',DbgS(FItem[0].First));
end;

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


Re: [Lazarus] Problem with TFloatSpinEdit component

2009-04-10 Thread Bart
Hi

On 4/10/09, Paul Parkyn zl3...@paradise.net.nz wrote:
 Hello all, I have converted a small Delphi project to Lazarus but I
 cannot get the TFloatSpinEdit decimal values to display correctly. The
 component shows the whole number part and no decimal part. I have set
 the decimal property to 6 decimal places. The value displayed by the
 component is either rounded up or down, however the real value is used
 by the program for calculations.

 Using FPC 2.2.0 and Lazarus 0.9.24 with Ubuntu 8.10

 Thanks Paul

 __

Try a recent version of Lazarus.
TFloatSoinEdit was patched severla times since Laz 0.9.24

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


Re: [Lazarus] TFloatSpinEdit and DecimalSeparator (GTK)

2009-03-18 Thread Bart
(On the subject of dependency on libc for locale formatsettings)
  Unless of course Graeme Geldenhuys works through his meanwhile astronomic 
 TODO
  list and implements the Locale checking himself in 100% Object Pascal :-)

Poor Graeme.
Done some digging into this aspect.
I'm not even sure this is at all possible without depending (directly
or indirectly) on libc.

In theory one could determine which LC_xxx file we should use, and
then parse the file.
However, the LC_xxx file structure is not the same in all libc
versions (I know that at least libc 2.2 changed it), so that may be a
problem (we would have to check libc versiion without linking libc?
and respond to all changes in LX_xxx with new libc versions).

One could also execute locale with the right options (locale -ck
LC_foo), pipe the output and process it to retrieve the values of
decimalseparator etc, but that seems like cheating to me (we don't
want to link libc but we execute locale which uses libc).

Back to the original subject.
Including clocale in the test program now makes sure
SysUtil.DecimlaSeparator and SysUtil.ThousandSeparator have correct
values: DS = , (comma), TS = #0 (not set).
However the TFloatSpinEdit control seems to use a hardcoded value for
the DecimalSeparator it displays.
On GTK2 it is a period (.), on GTK1 it is a comma (,),

I'll file a bugreport on the subject.

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


Re: [Lazarus] TFloatSpinEdit and DecimalSeparator (GTK)

2009-03-18 Thread Bart
 Yes it is. At least under Ubuntu Linux 7.10 the package in question is
  called 'locales' and it does NOT depend on the libc package (and least
  under Ubuntu Linux and FreeBSD). The 'locales' packages is independent
  and is just a bunch of text files (mostly) containing locale
  information.
  Files in question are:
  /usr/share/i18n/locales/aa_DJ
  [snip]

Yes, i see. I have those files on Suse too.
Not sure what package is responsible.
An rpm -q locale (or locales) reveals nothing.

I was under the impression that actually the LC_xxx files in
/usr/lib/locales/ determined the locale setting?

However the content of the files conflict with the info I get from locale

b...@simenon:~ locale
LANG=nl_NL.UTF-8
LC_CTYPE=nl_NL.UTF-8
LC_NUMERIC=nl_NL.UTF-8
[snip]
LC_ALL=

There is no /usr/share/118n/locales/nl_NL.utf8, only nl_NL and nl...@euro
The latter copies (almost) all from nl_NL
From that file:
LC_NUMERIC
decimal_point U002C
thousands_sep 
grouping  0;0
END LC_NUMERIC

from locale:
b...@simenon:~ locale -ck LC_NUMERIC
LC_NUMERIC
decimal_point=,
thousands_sep=
grouping=-1;-1

See that grouping differs.
(I have  not extensively checked other LC_xxx files)

Shouldn't we continue this discussion on fpc mailig list
(fpc-pas...@lists.freepascal.org)?
When I have time, I'll start playing with this.

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


Re: [Lazarus] TFloatSpinEdit and DecimalSeparator (GTK)

2009-03-14 Thread Bart
 Under windows SysUtils have correct locales, but under unix (linux  mac) it's
  a mess, so that's the reason of clocale unit usage.
  With clocale included you'll get correct locales.

  SysUtils are not multiplatform in that case, so you have to use clocale
  unit.

Shouldn't we then strive to make SysUtils use locale settings on all platforms?
As it is now, it's rather inconsistent.

Maybe I should ask on the pfc mailinglist?

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


Re: [Lazarus] Compiling for both GTK1 and GTK2 in Lazarus built from SVN

2009-03-13 Thread Bart
On 3/11/09, Vincent Snijders vsnijd...@vodafonevast.nl wrote:
 b...@simenon:~/svnroot/lazarus make lcl LCL_PLATFORM=gtk1

 make lcl LCL_PLATFORM=gtk

Aargh
I'm feeling rather stupid now...

Thanks,

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


Re: [Lazarus] TFloatSpinEdit and DecimalSeparator (GTK)

2009-03-13 Thread Bart

 You included clocale unit in your .dpr (UNIX targets only) ?
  DecimalSeparator at programstart: '.' (period) = DEFAULT , that means that
  clocale unit is missing.

I was under the impression that the value of SysUtils.DecimalSeparator
was determined/set at programstart using locale settings?
(At least in Windows it seems to be)
Are they hardcoded in Linux version of SysUtils?

I'll try inclusing clocale unit and see what it does.
Do I have to call some proc/function to make it set the value of
DecimalSeparator?

  DecimalSeparator visible in control: ',' (comma) = that means that gtk
  controls uses libc (right) locales, setted up by LANG variable.
And GTK1 differs form GTK2 with same locale setting?

What LANG variable should I look for?
(I'm not sure but I think I only saw one: it's value being nl_NL or
something the like)

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


[Lazarus] Compiling for both GTK1 and GTK2 in Lazarus built from SVN

2009-03-11 Thread Bart
Hi,

I have a problem trying to compile for both GTK2 and GTK1 when using
Lazarus from SVN.

I have my SVN Lazarus in ~/svnroot/lazarus
(revision 18956 a.t.m)

b...@simenon:~/svnroot/lazarus make clean all LCL_PLATFORM=gtk2

This nicely builds Lazarus with GTK2 as the widgetset.
Now Lazarus is built for GTK2 (a bit slow on my old machine) and I can
compile for GTK2 (default).

However, for tracking bugs I sometimes need to compile for GTK1, but
the LCL is built for GTK2. Trying to compile fro GTK1 gives the
(expected) error:
projectname.lpr(9,6) Fatal: Can't find unit Interfaces used by projectname


As suggested (some time ago) by Marc I did

b...@simenon:~/svnroot/lazarus make lcl LCL_PLATFORM=gtk1
make -C lcl all
make[1]: Entering directory `/home/bart/svnroot/lazarus/lcl'
/bin/rm -f units/i386-linux/alllclunits.ppu
/usr/local/bin/ppc386 -gl -Fu. -Funonwin32 -Fuforms -Fuwidgetset
-Fu/usr/local/lib/fpc/2.2.2/units/i386-linux/rtl -Fiinclude -FE.
-FUunits/i386-linux -di386 alllclunits.pp
Free Pascal Compiler version 2.2.2 [2008/07/29] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Linux for i386
Compiling alllclunits.pp
76 lines compiled, 2.3 sec
make -C interfaces all
make[2]: Entering directory `/home/bart/svnroot/lazarus/lcl/interfaces'
make[2]: *** Geen regel voor aanmaken doel `gtk1_all', nodig voor `all'.  Stop.
make[2]: Leaving directory `/home/bart/svnroot/lazarus/lcl/interfaces'
make[1]: *** [interfaces] Fout 2
make[1]: Leaving directory `/home/bart/svnroot/lazarus/lcl'
make: *** [lcl] Fout 2

And as you can see, this fails.
(*** Geen regel voor aanmaken doel `gtk1_all', nodig voor `all'.  Stop.
Translated (roughly to English:
No rule for making target 'gtk1_all', needed for 'all'.  Stop
)

Obviously I'm doing something wrong here.
So my question is:
- how do I set up my Lazarus so that it can still compile/build for
GTK2 (deafult) and GTK1?

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


[Lazarus] TFloatSpinEdit and DecimalSeparator (GTK)

2009-03-11 Thread Bart
In Windows TFloatSpinEdit responds to changes in DecimalSeparator (if
you update the control).
I noticed that in Linux GTK it does not.

(I use WinMe and Suse 10.0)

Observed behaviour GTK1
- DecimalSeparator at programstart: '.' (period)
- DecimalSeparator visible in control: ',' (comma)
- Changing DecimalSeparator and updating control: no effect

Observed behaviour GTK2
- DecimalSeparator at programstart: '.' (period)
- DecimalSeparator visible in control: '.' (period)
- Changing DecimalSeparator and updating control: no effect

Observed behaviour Windows
- DecimalSeparator at programstart: ',' (comma)
- DecimalSeparator visible in control: ',' (comma)
- Changing DecimalSeparator and updating control: Decimalseparator in
control changes accordingly

While this is not a big issue, currently at GTK (in my situation) the
Text of TFLoatSpinEdit possibly cannot be translate back to a Float
because of the mismatch in decimalsSeparators used by the control and
the one in SysUtils.

Does anyone know if GTK1/GTK2 even allows setting the character used
for the FloatSpinEdit control (without having to change systemwide
settings)?
If so, I consider it a bug and will post it in the bugtracker.
If not, well, tought luck, and I'll live with it ;-)

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


Re: [Lazarus] Inconsistent behavior of LabeledEdit boxes on different pages of a TabbedNotebook

2009-03-09 Thread Bart
Just zip the project (.pas .lfm .lpi .lrs) if you want us to take a
look at it. Only the .pas won't help us.

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


Re: [Lazarus] Problem using the SVN program: source files mutilated

2009-02-21 Thread Bart
Ok, thanks all for your advice.

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


Re: [Lazarus] Problem using the SVN program: source files mutilated

2009-02-20 Thread Bart
So I should now do
svn revert

this will undo all changes I made.
and after that

svn update
and I get my own patch back in the proper way?

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


[Lazarus] Problem using the SVN program: source files mutilated

2009-02-18 Thread Bart
Hi,

I'm experiencing a problem using SVN.
When I have written patches for Lazarus, then do an svn update (after
the patches have been committed), the sourcefiles that I have altered
are not updated correctly.

For instance. I recently made changes to lcl\include\dbedit.inc
These changes have been committed.
Today I did an svn update.

In lcl\include\dbedit.inc SVN has inserted lines like:

.mine
procedure TDBEdit.KeyPress(var Key: char);
  function CanAcceptKey: boolean;






(^^ this line above is also inserted)

(And yes, this is exactly the procedure I changed)

Now of course make fails on that line.

I'm using the commandline SVN (not the  tortoisesvn windows client) on Win9x.

F:\LazarusProjectensvn --version
svn, version 1.4.3 (r23084)
   compiled Jan 18 2007, 07:47:40

Copyright (C) 2000-2006 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

I have done a svn cleanup, but that made no difference.

Has anyone any idea why this happens, and how I can cure this?

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


Re: [Lazarus] Interact with M$ Word

2009-01-31 Thread Bart
Thanks all for your suggestions, I'll look int it.

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


Re: [Lazarus] TStringList.SaveToFile loses path deliminators - possible bug?

2009-01-30 Thread Bart
As I understood form another thread: the error is correct, but the
message is handled wrong (backspaces are removed). So it did actually
try to create
C:\Documents and Settings\dave\Local Settings\Application
Data\barbill\barbill.cfg
(I suppose you did not insert double quotes () around the filename (I
mean ConfiFile = 'bla' and not ConfigFile = 'bla').

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


Re: [Lazarus] Interact with M$ Word

2009-01-30 Thread Bart
On 1/30/09, Jesus Reyes jesus...@yahoo.com.mx wrote:
 StringGrid1.CopyToClipboard;

  Word-Paste and done.
No sorry, it will paste as text in Word.
For me personally that is good enough, I can convert text into table in Word.
The endusers will most probably not be able to remeber how to do this
and find the whole procedure to cumbersome.
The app is intended to make filling in the Word Table (creating and
calculating codes from timedifferences), so super ease of use is a
must.

(Also .CopyToClipBoard copies to much cells in my case, but that's trivial)

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


[Lazarus] Interact with M$ Word

2009-01-29 Thread Bart
Currently I'm working on an app that needs to interact with M$ Word.
The intended users are computer noobs, so I expect no knowledge from
them whatsoever.

Problem.
My app calculates/compose tabular data (in the order of  6 cols x 50 rows).
These data have to be inserted into a word document as a word table.
(Most users will not be able to convert text with tabs to a table in
Word, no matter how often explained).

Two different approaches come to mind.

First approach:
Paste the data (all strings) onto the clipboard in Word Table format.
(I can get the users to paste this in their document...)
Does anyone have a clue as to how to achieve this?


Second approach:
Use MS Office automation.
Create new document from template (how do I know where user's
templates (*.dot files)  are?).
Go to right place in document.
Create table
Insert data into table.

There is a basic wiki document on how to open a word doc in Word with
automation, but I never used office automation at all, so all steps I
have no clue as to how to achieve them.


If at all possible I'd prefer the first approach.

Anyone got some suggestions or knows a good place to start looking.
Mind you, I'm really just a basic-stuff programmer.

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


Re: [Lazarus] Starting default browser

2009-01-27 Thread Bart
Yes, I started the last one on that topic.

This culminated in my BrowserDetection unit, which you can find at:
http://home.tiscali.nl/~knmg0017/software/fpc_laz/browserdetection.tgz
(You have to take care to set the include paths in the IDE)

It works for Win, Linux and probably (but I cannot test, so feedback
is much apppreciated) Darwin.

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


Re: [Lazarus] is it me or a bug that i ve been fighting?

2009-01-19 Thread Bart
On 1/19/09, waldo kitty wkitt...@windstream.net wrote:

  and that might be another bug or something where one can't install laz 
 0.9.26
  to one directory and 0.9.27 to another and have each come out of the box 
 without
  sharing any config settings or something...

It can be done. Just start lazarus with --pcp=path where you want
lazarus to save settings
I have 0.9.26 and an SVN version up and running on Windows with that
--pcp thing.

AFAIK before 0.9.27 settings were saved in Lazarus directory, after
that in users config directory, which I guess is supplied by OS (on
Windows with GetSpecialFolder (?)).


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


Re: [Lazarus] lazarus 0.0.26

2009-01-17 Thread Bart
Hi faread_w,

On 1/17/09, faread_w farea...@yahoo.com wrote:

 any boady can help me?,i use fedora 4 as OS.before i installed lazarus i 
 haveto install fpc, when i installed fpc i get error unlocated 
 LIBC.SO.6(GLIB_24).so what must we do to solve this problem?


Take a look at this thread.
http://www.lazarus.freepascal.org/pipermail/lazarus/2008-November/020854.html

You can install Lazarus this way. The freepascal text IDE requires the
new glibc, the compiler (fpc, ppc-386) does not.
You will have to tell the packetmanager (rpm on fedora?) to install
Lazarus withouth checking dependencies.

Alternatively, it might (in the end) be easier to not use binaries for
Lazarus, but just intstall the compiler as described in the thread
above, and build lazarus from sources, using svn.
There is a good wiki page on how to do this (search getting lazarus
in the wiki).

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


Re: [Lazarus] Error when compiling for GTK2 (on Linux)

2009-01-09 Thread Bart
 Yes, gtk1 is the default for 0.9.26.
  If you want to build the gtk2 ppu with 0.9.26, then you need

  make LCL_PLATFORM=gtk2

That would build the IDE as GTK2 also (which might be a little slow on
 my old harware)?

And would I still be able to compile for both GTK1 and GTK2 (I need
that for checking my bugfixes), or would I have to rebuild then with
make LCL_PLATFORM=gtk1?
(That would be rather cumbersome, especially since
Lazarus-out-of-the-box, can compile for both without any problem)

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


Re: [Lazarus] Error when compiling for GTK2 (on Linux)

2009-01-09 Thread Bart
Thanks Mattias and Marc, I will try.

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


[Lazarus] Error when compiling for GTK2 (on Linux)

2009-01-08 Thread Bart
Hi,

Since today, when I want to compile any (even a new and empty project
(just 1 form, no controls on it)) I get the following error:

Free Pascal Compiler version 2.2.2 [2008/07/29] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Linux for i386
Compiling /tmp/project1.lpr
PPU Loading /usr/lib/lazarus/lcl/units/i386-linux/gtk2/gtkwsgrids.ppu
PPU Source: gtkwsgrids.pp not found
Recompiling GtkWSGrids, checksum changed for Grids
gtkwsgrids.pp(11,42) Fatal: Can't find unit GtkWSGrids used by GtkInt

The file gtkwsgrids.pp is actually there (the IDE opens it for me on the error).

What did I do before this happened?

I did a make clean all (because I altered maskedit.pp in lcl directory).
This seemed to go well, no error were issued.
(I have done this before (make clean all) and AFAIK after that I still
was able to swict between compiling for GTK1 and GTK2)

Any help?

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


Re: [Lazarus] TFileStream

2009-01-07 Thread Bart
On 1/7/09, Dave Coventry dgcoven...@gmail.com wrote:
 How about if you wanted to change the contents of the start of a file?
  Does it work if you seek to the start of the file and write a couple
  of bytes, say, or do you have to rewrite the entire file?

Yes it will work. You will overwrite the existing data that were in
that location (as you'ld probably know already).

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


Re: [Lazarus] Rebuild LCL from within IDE on Linux

2009-01-05 Thread Bart
On 1/5/09, Joost van der Sluis jo...@cnoc.nl wrote:

 After all these years I can still be amazed how even it-professionals
  describe problems. 'I expected it to work the same as on Win32', 'the
  patches you wrote are now working', 'I expect it to work', 'I did
  something and now it doesn't work - fix it'.
[snip]
  This way this can become a long thread

OK, then I will try to be more clear. (I'm in no way an IT-specialist
b.t.w.. I just do basic programming for fun..., and I'm not a native
English speaker)

  Well, if you expect the IDE to behave differently after your patch you
  have to recompile the IDE and restart.

On WinMe I did:
Menu - Tools - Configure Build Lazarus - click on the Build LCL
radiobutton - click on the Build button.
Now the LCL is re-built.

From the Messages window: LCL completed

If I re-build my program, it now uses the new (hopefully improved)
version of LCL, without need to restart the IDE.

  What did you change? Are you sure it is part of the lcl and thus
  recompiled? Did you check the recompile was succesfull? Maybe you did
  change something for another widgetset then you are really using? (Maybe
  it's usefull to tell us what you did change, and what you expect from
  that change. More then... well, the story above..)
I rewrote major parts of maskedit.pp (in lcl directory).

  A way to check if your change is really recompiled is to make a syntax
  error in the code, and recompile. If the compiler doesn't complain, you
  didn't recompiled the code. ;)
Good one !


 If you run the ide as root and then do your recompile of the LCL, does
  that work? If you plan to change the LCL often, you'd better install
  lazarus in your home-directory and work from there.
I run the Lazarus IDE on Linux as a normal user.

  But now I know you installed as root: did you check where the
  recompilation of the LCL placed it's files? And does your project uses
  this path to search for the LCL?
I did not see any other copies of maskedit.pp or maskedit.ppu, but
I'll check again.


   What make command should I apply to build the IDE with packages like
   they come in the binaries (rpm's or win32 executables)?
 You could try 'make bigide' but there's also a command to build the ide
  with the selected packages.
That would be the Build with packages option then in the Configure
Build Lazarus dialog?

  But maybe you'd better run the ide as root
  and build from there.
This will give me a Cannot find unit X used Y errormessage (I'm
currently on win, so I cannot reproduce).

  Joost.

Thanks for your patience.

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


Re: [Lazarus] Rebuild LCL from within IDE on Linux

2009-01-04 Thread Bart
 What effect did you expect?

  Joost.

I expected it to work the same as on Win32 (WinME in my case). You
patch something in the LCL, rebuild the LCL from within the IDE and
voila, the patches you wrote are now working (for better or worse).

I ended up doing a make clean all (as root), which then did what I expected.
(I was a bit afraid that that might somehow screw things up ( I'm
fairly new to Linux), so I first tried something I experienced to be
safe on Win32).

So now I've applied a patch to my LCL on linux and this works.
However doing make clean all built a slightly different IDE (some
component tabs missing that I normally do not use anyway).
What make command should I apply to build the IDE with packages like
they come in the binaries (rpm's or win32 executables)?

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


Re: [Lazarus] I've installed Lazarus 0.9.26 on M$ Windowz XP OS -- cannot find app file to run Lazarus!!!

2009-01-02 Thread Bart
You need lazarus-0.9.26-fpc-2.2.2-win32.exe, (the download link is
on this page: 
http://sourceforge.net/project/showfiles.php?group_id=89339package_id=105599release_id=631057)
the one you downloaded is the cros-compiler (win to linux, I think).

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


[Lazarus] Rebuild LCL from within IDE on Linux

2008-12-30 Thread Bart
Hi,

If I rebuild the LCL (and only the LCL) from within the IDE on Linux
(Tools - Configure Build - LCL - Build), then Lazaris says it
compiled the LCL fine, but it seems that changes take nof effect.
Obviously I'm doing something wrong here, probably its a RTFM question
;-) but I just cannot find the answer.

I'm running Lazarus 0.9.26, installed from rpm on Suse 10.0 (I do not
have Lazarus from svn on my Linux).

Any help appreciated.

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


Re: [Lazarus] MaskEdit: question on how it should behave

2008-12-28 Thread Bart
 Ok, I tested it -- D7 does the same. Actually, ValidateEdit only fires
  if the text was modified. (Or always at the design time).

Thanks for testing it for me.
I'll implement it that way then.

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


Re: [Lazarus] Intercept clipboard operations

2008-12-28 Thread Bart
On 12/28/08, Mattias Gaertner nc-gaert...@netcologne.de wrote:
 No.
  Unless you implement LM_BeforePaste messages for all widgetsets.

That's a pitty then.

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


[Lazarus] DoExit is called before form is shown, why?

2008-12-28 Thread Bart
Hi,

In the MaskEdit unit I'm working on, I' ve overriden the DoExit
procedure, because this is where the ValidateEdit occurs.


...
procedure DoExit; override;
...



procedure TCustomMaskEdit.DoExit;
begin
  //First give OnExit a change to prevent a EDBEditError
  inherited DoExit;
ValidateEdit;
end;


Now there is a problem.
If you drop a TMaskEdit on a form, set the mask and set the text to
something that will not validate (e.g leave text empty), then an
exception is raised as soon as you start the program en the program is
killed, you never get to see the form.
If you set the mask at runtime and then set an invalid text, no
exception is raised until the user (enters and) leaves the control
(this is as it should be).

From the backtrace I can see that DoExit is called.
This happens after the form's OnFromCreate, OnFormShow and OnActivate event.
It seems that the control somehow looses focus in the create --
actually show on the screen process

This (raising the exception at this stage) is unwanted behaviour, and
i'm not sure how to prevent it.
I tried checking for csLoading in ComponentState
( if not (csLoading in ComponentState) then ) , but it is not.

What check should I perform in oreder to not call ValidateEdit in this case?
I'm kind of stuck here.

Thanks,

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


Re: [Lazarus] MaskEdit: question on how it should behave

2008-12-27 Thread Bart
 I am not sure how modern Delphi behaves, but I'd say that Lazarus
  way is correct here -- this is clearly a programmes's error.
  OTOH, I think it would be useful to provide a separate function
  like 'TrySetText' which whould return false instead if saising an exception.

In D3, D4 and Kylix1 ValidateEdit is only called if either the user
presses Enter in the control, or the control looses focus.

I still would like someone to test this in D7 or higher.



   Question 3:
   In the EditMask you can specify if the mask will be saved as pasrt of
   the data (again: what data?). For instance, if your EditMask is
   '000;0;_' then maskdata is not saved (the first 0 after the colon ( ;
   ) sets this value).
   I cannot really figure out what it does. I see noe effect n Text or
   EditText at all.


 If you mask includes non-special characters, those are displayed in
  the editor as-is,
  e.g. if mask is 000-00-00 and the user enters 1234567, the editor
  would contain
  123-45-67. Depending on the value of the flag, the actual Text property
  will contain either 1234567 or 123-45-67.

Yeah, that should not be so hard to implement.

Thanks,

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


[Lazarus] Intercept clipboard operations

2008-12-27 Thread Bart
Hi,

I ran into a problem with the MaskEdit unit that I'm working on.

I want to intercept clipboard operations (like when the users presses
Ctrl-V, Ctrl-X or uses the mouse-equivalent) before the text in the
editcontrol gets changed.

Currently I have

TCustomMaskEdit = Class(TCustomEdit)

...
procedure LMPasteFromClip(var Message: TLMessage); message LM_PASTE;
procedure LMCutToClip(var Message: TLMessage); message LM_CUT;
procedure LMClearSel(var Message : TLMessage); message LM_CLEAR;
...

However, when these procedures are called, the text in the control has
already been overwritten. I especially want to validate the content of
the pasted text before it is pasted into the control.
Is this (in a cross-platform way) possible at all?

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


[Lazarus] MaskEdit: question on how it should behave

2008-12-26 Thread Bart
Hi,

I'm currently working on the MaskEdit unit, which is ATM not totally
Delphi compatible  ;)
Since I only have an ancient Delphi (D3) (on ancient hardware, so I
cannnot even run newer versions) I have some questions on the
behaviour of MaskEdit in current delphi versions.

Question 1:

If I set the text of a MaskEdit to some value that does not match the
mask (e.g. EditMask = '' and then MaskEdit.Text := 'ABCD'), in D3
no exception is raised and the text in the control is set. Is this
still the case in current Delphi's?
(In Lazarus ATM an Exception is raised if you try to do that)

Question 2:
What does an exclamationmark (!) in a mask actually do. The helptext
says it removes leading spaces from the data (what data?) and if no !
is in the mask it removes trailing spaces. In real live I see no
effect on either MaskEdit.Text or MaskEdit.EditText at all.

Question 3:
In the EditMask you can specify if the mask will be saved as pasrt of
the data (again: what data?). For instance, if your EditMask is
'000;0;_' then maskdata is not saved (the first 0 after the colon ( ;
) sets this value).
I cannot really figure out what it does. I see noe effect n Text or
EditText at all.

Regarding questions 2 and 3: I could, of course, try and understand
the VCL code, but that would probably increase the risk of writing
code that is almost identical to the copyrighted VCL code.

Thanks for now.

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


Re: [Lazarus] Different language of project than IDE has

2008-12-23 Thread Bart
  How can I set different language of resource files inside of my
  application than IDE has got.

  I use and I don't want to change EN language of IDE, but the result of
  my work should contain german resources in dialogs, ... Instead of
  Yes/No to show Ja/Nein in messageboxex, also exceptions in german.

Take a look at the translation unit.
You must provide the lclstrconst.de.po file with your app, so you can
ranslate all resourcestrings to german at runtime.

There is an example in the wiki:
http://wiki.freepascal.org/Getting_translation_strings_right#ResourceStrings_in_your_Application

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


[Lazarus] MaskEdit unit

2008-12-22 Thread Bart
Hi there,

The MaskEdit unit at the moment still misses quite some functionality
and is far from Delphi compatible.

Is there anybody out there working on the MaskEdit unit, or willing to
try and work on it with me?

Currently observed bugs:
- You cannot use numeric keyboard to enter numbers
- A colon (:) in the EditMask will be translated to DecimalSeparator
at the moment (uploaded a patch for that in the bugtracker)
- You cannot set BlankChar by setting the third field in the EditMask property
- Text and editText property are the same (when read), in Delphi the
BlankChar seems to be replaced by #32 if you read TMaskEdit.Text
- You can type more characters in the MaskEdit control than the
EditMask allows for. When you do this you cannot delete these
characters using only the keyboard, since you cannot reach them with
the arrow keys or VK_END
- No exception is raised if the text in the control does not match the
mask on exiting the control (although in Delphi (3) it really annoyed
me that it was impossible to catch that exception in the OnExit event,
so if we implement it we might improve on this??)

Missing features
- In Delphi if you type in the MaskEdit control it will select one
character at a time, in effect making user input overwrite the selecte
character.
- In Delphi whilst typing in the MaskEdit control, it will nicely
skipp any litteral in the mask, proceeding to the next character after
the literal (this also works for Backspace), Lazarus currently stops
at the literal, not allowing you to type anymore but forcing you to
use the arrow key to skip the literal yourself.
- In Delphi pasting garbage (as in not meeting the editMask) from
the clipboard simply results in not pasting characters that do not
meet the current EditMask, without raising an exception.


Some features/bug I have some notice on how to fix/implement, others I
don't know how.
And I guess there will be more bugs/missing features than I listed above.

So it would be nice to work with somebody else on this one.

Needless to say I really like MaskEdit for simple user input control.

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


Re: [Lazarus] Lazarus forum

2008-12-21 Thread Bart
On 12/19/08, Marc Weustink m...@dommelstein.net wrote:
 Hi,
  This week Paul and I have been busy setting up a new forum on a new
  server sponsored by firmos.at. All existing users and messages from the
  old forum are transfered to the new forum. We hope you will enjoy the
  new features and speed.

  Marc

Thanks!!!

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


Re: [Lazarus] flickering on statusbar panel

2008-12-18 Thread Bart
On 12/17/08, Andrea Mauri andrea.mauri...@gmail.com wrote:
 any suggestions?

Does TStatusBar have a DoubleBuffer property (I cannot test here at
this place: no Lazarus available)

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


Re: [Lazarus] Unit and includepaths and the IDE

2008-12-10 Thread Bart
Mattias,

Thanks for clearing that up to me.

I'll look into packages, probably at a later point.
At the curent stage, my library of tools for Laz tends to change
frequently, as I learn more to use Laz/fpc. So for the moment I'll not
package them.

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


Re: [Lazarus] Universal using of mailto:

2008-12-10 Thread Bart
 By the way.
 Is any similar method for opening HTML files without using application name
 eg. firefox.

As others pointed out xdg-open will do that.
You might take a look at my BrowserDetection unit, which uses xdg-open
if available, or tries some other options if it is not there. AFAICT
it should also run under Darwin (MacOSX).
It's at: http://home.tiscali.nl/~knmg0017/software/fpc_laz/browserdetection.tgz

Comments are welcome.

It should be easy to expand this for email use also.

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


Re: [Lazarus] TProcess oddity?

2008-12-10 Thread Bart
 I think you should ask in one of the Free Pascal mailling lists,
  because this is a problem with the Free Pascal RTL which only FPC
  developers could fix.

I'll look for that mailinglist then.

Anybody some suggestion for my workaround question?

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


Re: [Lazarus] Terminal window

2008-12-09 Thread Bart
  I have 0.9.26 on Ubuntu 7.10. I am writing a GUI program, since debugger
  has problems to check the values of variables, I want to output debug
  data with writeln but I  can't get a terminal with if it is not
  console application.

Did you try DebugLn() from LCLProc unit?
This works for me on Suse/KDE

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


[Lazarus] TProcess oddity?

2008-12-09 Thread Bart
Hi,

Just played with TProcess for the first time.
I observed some oddities (?, or maybe I'm just dumb ...).

If you try to execute a process that is non-executable (like for
example a word doc), then on Windows an exception is raised and
GetLastOSError returns 193.

If you try this on (my) linux, no exception is raised and a
non-functional childprocess is forked (you can see it with ps ax).
If you do this in a GTK 1 app, however, then the app gets killed.
No errormessage, it just disappears.
On the console you can se some errormessage:
Xlib: unexpected async reply (sequence 0x4cf)

In GTK 2 app, there is no crash.

So 2 questions:

1. shouldn't trying to execute a non-executable file raise some kind
of exception (like it does in Windows?
2. Why does the GTK 1 app crash? This might be a GTK bug and not fpc related.

As a way to work arond this (and at least preventing the crash): is
there a reliable way of cheking tha a file can be executed in the
first place? I know I can check for the execute permission of the file
in question, but that is not enough (on my system any file copied from
my windows partition to linux will have the x permission set).

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


[Lazarus] Unit and includepaths and the IDE

2008-12-09 Thread Bart
Hi,

Like most others (I guess), I have some units that I use frequently
(like about.pp etc.).
These units reside in a specific folder.
Now I've added this folder, and the incude subdirectories to fpc.cfg,
be4cause I got tired of adding this in Project-Compiler Options for
every projec.

In this case:
-FuF:\LazarusProjecten\MijnLib

and
-FiF:\LazarusProjecten\MijnLib\include
-FiF:\LazarusProjecten\MijnLib\include\win

This seems to work fine, at least my project will compile.
However, if I try to Ctrl-Click to the unit or includefile (or the
compiler finds an error in it), the IDE says it cannot find it.
So it seems my assumption thatthe IDE searchpath is determined by
fpc.cfg is not correct.

Is there any way to tell the IDE that it must extend its searchpath to
my units/includes, without having to specify it for each project (the
latter also is not very convenient if I copy the project to my linux,
becaus then the paths must be reset)?

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


Re: [Lazarus] Warning: Unreachable code. Why?

2008-12-06 Thread Bart
 Because if OS_HAS_DEFAULT_BROWSER = false then the compiler will optimise the 
 if call away (as it
  can never actually execute) and the Exit can never be reached.

Ah, now I see.

  You would be just as effective using

  {$IFDEF WINDOWS}
Exit;
  {$ENDIF}

Yep.

Thanks for the explanation!

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


[Lazarus] Warning: Unreachable code. Why?

2008-12-05 Thread Bart
In my browserdetection code I have this:

const
  OS_HAS_DEFAULT_BROWSER = {$IFDEF WINDOWS}True{$ELSE}False{$ENDIF};

When I compile my program I get this warning:
browserdetection.pp(187,34) Warning: unreachable code

line 187 -
  if OS_HAS_DEFAULT_BROWSER then Exit;
(the cursor then blinks on the E in Exit (position 34))

Why is this?

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


Re: [Lazarus] Open URL in default browser X-platform

2008-12-05 Thread Bart
Hi there,

Thank you all very much for your input.
I cooked up some code that kind of works AFAICS.
Only tested on my Suse for now, will test under Win9x some other time.

Some questions of a more general nature remain:

1) When I execute the browser, using TProcess.Execute, how do I know
if the process started OK (that is the executable started up at
least)?

2) I found out that if you try to execute a file which does not have
execute permission, the app gets killed, even if this a try..except
block.
Xlib: unexpected async reply (sequence 0x4cf)!
Is this normal linux behaviour (I'm a newbie)?

If someone wants to see what I came up with and even test it under
different operating systems and desktop environments, I'll put the
unit on my website.

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


[Lazarus] Open URL in default browser X-platform

2008-12-03 Thread Bart
Hi,

I come from Windows/Delphi (3.0) background and I'm gradually moving
towards Lazarus/fpc.

Opening an URL in Windows is a piece of cake, you just let the OS take
care of the assotiations with the http protocol to open it (using
shellexecute).
This of course will not do for other platforms.

So I set myself the task of launching an URL in an external browser on
other platforms.
Since I only have Linux (besides Win) I began with that.

I tried to find examples on the net, but had no luck.
I might well be re-inventing the wheel though...

Here's my approach:

- try to detect the windowmanger (for now I know how to do this for
KDE and GNOME, XFCE is on my whishlist)

On KDE
- lookup DESKTOK_LAUNCH environment variable
- if not there, look for kde-open
- if not there look for kfmclient
- if not there look for xdg-open
- if not there try fallback
(possibly using gnome-open might also work under KDE ???)

On GNOME
- look fo gnome-open
- if not there, look for xdg-open
- if not there try fallback

Fallback
- search for know browsers (firefox, iceweasel, mozilla, opera,
konqueror, ...(suggestions are welcome))

If browser (or URL handler like kde-open, xdg-open etc.) is found
launch it with the appropriate URL.

This approach (the finding mechanism) seems to work at least on my
Suse KDE desktop.

I would like your opinions on this approach, and better still, I would
like some suggestions how to achieve something similar on a Mac.
(I suppose on Mac OSX the linux approach should work also???)

And as a final rather dumb question: do all supported OS's have an
environmentvariable PATH (as this is used in the fallback mechanism)?

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


[Lazarus] Proposal for CreateMessageDialog() function

2008-11-03 Thread Bart
Hi,

Currently Lazarus has no CreateMessagedialog function, whereas Delphi has.

function CreateMessageDialog(const Msg: string; DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons): TForm;

This function returns the actual form of the messagedialog, and so
gives the programmer access to all the controls on this dialog form.
In Delphi 3 I used this to access the captions of the buttons and do
an on the fly translation.
Given that we Lazarus can use .po files to translae the
resourcestrings for the captions, this is not necessary anymore.

However, another use of this function is to add controls to the dialog
form, thus creating customized message dialog variants.
One example of this is adding a checkbox with a caption like Don't
show this dialog again, which is quit useful.
(See 
http://i25.photobucket.com/albums/c74/Talent111/devel/messagedlg_with_checkbox.png
for an example of this)

A long time ago I posted bugreport #0008186 on Mantis (Feature
request: make it possible to add controls to MessageDlg()).
At that time I was new to Lazarus, and saw no opportunity to
accomplish the task myself.

Lately however, browsing dialogs.pp (more specifically
promptdialog.inc), I noticed that most of the work was already done.

So my proposal is like this:

Declare CreateMessageDialog in the interface of  dialogs.pp.
Adjust promptdialog.inc more or less like this:

function CreateMessageDialog(const Msg: string; DlgType: TMsgDlgType;
 Buttons: TMsgDlgButtons): TForm;
var PDlg: TPromptDialog;
aCaption: String;
Btns: PLongInt;
CancelValue, DefaultIndex, ButtonCount: Longint;
UseDefButton: Boolean; DefButton: TMsgDlgBtn;
begin
  if DlgType  mtCustom then
aCaption := MsgDlgCaptions[DlgType]
  else
aCaption := Application.Title;
  UseDefButton := False;
  Btns := GetPromptUserButtons(Buttons, CancelValue, DefaultIndex, ButtonCount,
   UseDefButton, DefButton);
  DebugLn('CancelValue = ',ModalResToStr(CancelValue));
  PDlg := TPromptDialog.CreateMessageDialog(aCaption, Msg,
DialogIds[DlgType], Btns, ButtonCount, DefaultIndex);
  Result := TForm(PDlg);

  //??? Is this save to do
  ReallocMem(Btns, 0);
end;

A tipical use of this function would the be like:

procedure TForm1.ShowBtnClick(Sender: TObject);
var Dlg: TForm;
Res: TModalResult;
DT: TMsgDlgType;
Title,Msg: String;
Btns: TMsgDlgButtons;
i: Integer;
begin
  Title := TitleEdit.Text;
  Msg := MsgMemo.Text;
  case DTGroup.ItemIndex of
0: DT := mtCustom;
1: DT := mtError;
2: DT := mtWarning;
3: DT := mtInformation;
4: DT := mtConfirmation;
  end;
  Btns := [mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore,
   mbAll, mbNoToAll, mbYesToAll, mbHelp, mbClose];
  Dlg := CreateMessageDialog(Msg,DT, Btns);

  ...
  DoSomethingWithTheDialogForm; //Add a checkbox for example
  ...

  try
Res := Dlg.ShowModal;
  Finally
Dlg.Free;
  end;
end;

Users should be aware that a Modalresult of -1 means that the Escape
key was pressed.


I'd really appreciate your suggestions and ideas on this one,
especially on the Is this safe to do remark in my code.

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


Re: [Lazarus] Cannot install Lazarus-0.9.26/fpc-2.2.2 on Suse 10.0, help needed

2008-11-02 Thread Bart
On 10/30/08, Lord Satan [EMAIL PROTECTED] wrote:
  fpc-2.2.2.i386-linux.tar (30 MB) contains a standard tar archive, with an 
 install script
  After untarring the archive into a temporary location, you can run the 
 install script by issuing the command sh install.sh.

Thanks!!
I downloaded that one from SourceForge and ran the install script,
installing it in /usr/local
Then I took a shot at installing the rpm's for fpc-src and lazarus
(with --nodeps).
I had to tell Lazarus the directory for fpc-src and then it seems it runs fine.

Just one problem, I have a shortcut for the fp ide on my (KDE)
desktop, that now (of course) has lost it's icon/pixmap. I cannot find
it anymore. Anyone knows where it might be located?

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


Re: [Lazarus] Cannot install Lazarus-0.9.26/fpc-2.2.2 on Suse 10.0, help needed

2008-11-02 Thread Bart
On 11/2/08, Bart [EMAIL PROTECTED] wrote:
 On 10/30/08, Lord Satan [EMAIL PROTECTED] wrote:
fpc-2.2.2.i386-linux.tar (30 MB) contains a standard tar archive, with an 
 install script
After untarring the archive into a temporary location, you can run the 
 install script by issuing the command sh install.sh.


 Thanks!!
  I downloaded that one from SourceForge and ran the install script,
  installing it in /usr/local
  Then I took a shot at installing the rpm's for fpc-src and lazarus
  (with --nodeps).
  I had to tell Lazarus the directory for fpc-src and then it seems it runs 
 fine.

  Just one problem, I have a shortcut for the fp ide on my (KDE)
  desktop, that now (of course) has lost it's icon/pixmap. I cannot find
  it anymore. Anyone knows where it might be located?

Oops, I just found out that the fp ide depends on glibc-2.4, so I cannot use it.
That's not a big problem though, as I tend to use the Lazarus IDE to
write console programs anyway.
So for now, never mind the desktop icon for fp ...

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


Re: [Lazarus] Default caption in MessageDlg()

2008-11-01 Thread Bart
  I cannot find the exact reason for the change. I have no objection to
  revert it.

  Vincent

Since I had nothing better to do I submitted a patch in the bugtracker.

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


Re: [Lazarus] Cannot install Lazarus-0.9.26/fpc-2.2.2 on Suse 10.0, help needed

2008-10-30 Thread Bart
On 10/29/08, Lord Satan [EMAIL PROTECTED] wrote:
 Use fpc-2.2.2.i386-linux.tar from your preferred fpc download location.

As opposed to fpcbuild-2.2.2.tar.gz?
And how to proceed then?

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


[Lazarus] Default caption in MessageDlg()

2008-10-29 Thread Bart
I just noticed that if I do a

  MessageDlg('Some ErrorMessage', mtError, [mbOk], 0) ;

(so I do not specify a custom caption for the dialog) then the caption
of the dialog is the Application.Title, whereas in Delphi (at least in
D1 to D3) it depends on the DialogType, so in Delphi the caption of
the dialog in my example would be  Error

I just tested an existing executable, compiled with a previous version
of Lazarus, and this code:

MessageDlg(Format(msgSourceDirNotFound,
   [ExcludeTrailingPathDelimiter(SourceEdit.Text)]),
   mtError, [mbOk], 0);

will bring up a Dialog with Error as the caption.

I'm using Lazarus from SVN revision 16824.

Is this new behaviour by design (which would force me to rewrite
almost all my projects to use the MessageDlg(aMsg, aTitle, DlgType,
Buttons, HelpCtx) format instead), or is it a bug?

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


Re: [Lazarus] Cannot install Lazarus-0.9.26/fpc-2.2.2 on Suse 10.0, help needed

2008-10-29 Thread Bart
 Then I recommend you to stick with the releases.

But I cannot {:-(
As I described in  my first posting, the RPM for fpc 2.2.2 will not
install, because it wants glibc version 2.4, which is not available
for my Suse 10.0
That is why I wantend to work around it by building fpc from source...

  A simpler approach was
  tested before the buildfaq, but it failed since people always got in to
  trouble because of little changes and variantions and didn't have enough
  background info to solve them. This is described in the introduction of the
  FAQ btw, so you apparently didn't get far :-)

Well, I read the build-faq (from march 17, 2007) entirely at least
once (as you suggest in it). Maybe I'm just not up to it.
Mind you, I don't mind trying, and even failing, as long as I don't
screw up my current stable Laz/Fpc configuration.

(I can hardly expect the person who builds the rpms to downgrade his
Linux so he/she can do the buildprocess against glibc-2.3 now, can I?)

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


Re: [Lazarus] Cannot install Lazarus-0.9.26/fpc-2.2.2 on Suse 10.0, help needed

2008-10-28 Thread Bart
I'm not keen on upgrading my Suse to 11.0 (or 10.3), because I run it
on an old computer (Celeron 700 Mhz, 512 Mb), and getting X to
recognise and setting up my LCD monitor was a PITA.

Does anyone know if it is at all possible to build fpc 2.2.2 form
source with glibc 2.3?
If so, I could tarts trying to work my way around this.

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


[Lazarus] Cannot install Lazarus-0.9.26/fpc-2.2.2 on Suse 10.0, help needed

2008-10-27 Thread Bart
Hi,

On my rather old computer I run Suse 10.0 (as my second OS).
I tried to upgrade my existing Lazarus (0.9.24) to 0.9.26.
I downloaded the rpm's for fpc, fpc-src and lazarus, then tried:

simenon:/home/bart/downloads # rpm -Uvh fpc-2.2.2-0.i386.rpm
fpc-src-2.2.2-081004.i386.rpm lazarus-0.9.26-0.i386.rpm

which gave me
error: Failed dependencies: libc.so.6(GLIBC_2.4) is needed by fpc-2.2.2-0

I queried rpm for the version of glibc:
simenon:/home/bart/downloads # rpm -q glibc
glibc-2.3.5-40

As far as I can see, there is no glibc-2.4 available for Suse 10.0
Does this mean I have to upgrade Suse to 10.2 (10.3) in order to get
the latest Lazarus working again? That would be rather frustrating.
I still can run Lazarus on my WinME, but I really enjoy having it on linux too.
I even wrote one minor patch for fpc, which was also nice. I would
really miss it, if I could not even try to contribute to the project
anymore...

Anyone knows why 2.2.2 now needs glibc-2.4, when 2.2.0 was quite happy
with glibc-2.3? I found nothing in the release notes about this.

Is there a way to get around this problem?

Note, I'm rather new at Linux, but I'm not afraid of the console...

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


Re: [Lazarus] Laz 0.9.27 uses 0.9.26 settings (when it did not before)

2008-10-21 Thread Bart
 Use the --pcp=/path/to/settings/directory (--pcp is short for
 --primary-config-path) command line option. See also
 http://wiki.lazarus.freepascal.org/Multiple_Lazarus#The_config_directory


I'll give that a try.
I assume the default directory under win9x used to be the directory where
Lazarus.exe resided in? (what files am I looking for in that directory? They
should still be there...)

It is however not clear to me why the SVM version started using the other
config directory, after rebuilding the IDE with 2.2.2, did it change the
behaviour of GetConfigDir?

Maybe you can propose a text to add to the release notes.


The release notes of Lazarus or fpc 2.2.2? I'm not sure what caused this
problem .
Should I then post the proposed text here, or on the bugtracker?

Vincent


 Thanks, for the quick answer.
(I looked at the wiki, but obviously used the wrong keywords)

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


[Lazarus] Laz 0.9.27 uses 0.9.26 settings (when it did not before)

2008-10-20 Thread Bart
Sorry for the bit cryptic subject.

Here's my problem.

I use 2 Lazarus versions on my WinMe system.
- Lazarus stable in \Programmas\Lazarus\
- Lazarus from SVN in \Programmas\SvnLaz\
- each Lazarus version has it's own seperate fpc binaries and source

The two versions operated totally independant from each other.
This all worked like a charm until I did two things
- I upgraded my stable version to 0.9.26/fpc 2.2.2
- I recompiled my SVN version with fpc 2.2.2 (until now I used fpc 2.2.0, so
in order to use 2.2.2 I had to rebuild the IDE (took me some time to figure
that out))

After recompiling the SVN (mind you, i did not do an svn -update) version it
seems to use the config settings of the stable version.

I open a project in stable, then close the IDE andsave the project.
Now I start SVN version of Lazarus, and it will open the last project I used
in teh stable version.
Before it really did not do that. I could use SVN and stable version
separate,working on different projects.
Also, the IDE in my SVN version used to be English, now it changed to Dutch
(my IDE language setting for the stable one)

Although this is merely annoying, can I make it funcition like it did
before, that is the SVN and stable versions using their own and separate
config settings?

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


Re: [Lazarus] Gtk2 focus problem with shortcut keys

2008-10-18 Thread Bart
 Probably the Gtk2/TEdit implementation handles Ctrl+W specially. It
 usually means erase previous word before cursor.


 Micha


See my original report in the bugtracker
(0007306http://bugs.freepascal.org/view.php?id=7306):
I tested numerous key combinations...

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


Re: [Lazarus] Gtk2 focus problem with shortcut keys

2008-10-13 Thread Bart
Actually, you might post a note in this bugreport, nobody has confirmed this
bug since I posted it.
Once confirmed, changes may improve that the bug gets assigned to some
developer.

I tried to see where things go wrong, but I failed hopelessly ;-)

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


Re: [Lazarus] Gtk2 focus problem with shortcut keys

2008-10-13 Thread Bart
On 10/13/08, Brad Campbell [EMAIL PROTECTED] wrote:

 G'day all,
 [on non working menu-shortcut is TEdit has focus]


 I reported this as bug
0007306http://bugs.freepascal.org/view.php?id=7306in 2006...

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


Re: [Lazarus] XML and memory loss

2008-10-09 Thread Bart

 The memory leak is caused by using the ChildNodes property. Each time
 you use it, a new TDOMNodeList object is created, which must be
 eventually destroyed by calling Free. The FCL DOM implementation does
 not offer automatic memory management here, unlike other implementations.


Then how can I free those TDOMNodeList objects? I.o.w. how can I get access
to them?

Some time ago I updated the English page of Wiki tutorial to reflect
 this fact.


Yep, just re-read the article and saw the note...

In your case, ChildNodes.Item[0] can be replaced by FirstChild, which
 will return exactly the same node.


I tried that, and it wordk like a charm.
However can I use that approach if I want to create more complex XML files?

Eventually I want someting like this:
?xml version=1.0?
root
  versionfoo bar version 0.0.1/version
  children
child id=0001
  fooBart/foo
  barme, myself and I/bar
/child
child id=0002
  fooBob/foo
  barblah/bar
/child
 children/
/root

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


Re: [Lazarus] XML and memory loss

2008-10-09 Thread Bart
On 10/9/08, Sergei Gorelkin [EMAIL PROTECTED] wrote:

 Bart wrote:
 
  Then how can I free those TDOMNodeList objects? I.o.w. how can I get
  access to them?
 

 You just put them into a variable and later call Free:

 var
Nodes: TDOMNodeList;
 ...
 Nodes := MyNode.ChildNodes;
 writeln(Nodes[0].NodeName);
 ...
 Nodes.Free


How should I apply that to my code-example?

 In general, any tree can be built using only the AppendChild method.
 Just put necessary nodes in variables. Here is your example:

 [snip]



I tried the examplecode, I had to replace
  tmp['id'] := '0001';
with
  TDOMElement(tmp).SetAttribute('id', '001');
(it would not compile otherwise: the error said something about tmp not
having a default property)

This code creates the xml-file like I wanted it.
I'm going to study the code and try to understand it.

Thanks for the help!

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


Re: [Lazarus] About {$R *.res}...

2008-10-08 Thread Bart
On 10/8/08, John vd Waeter [EMAIL PROTECTED] wrote:

 Hi All,

 To polish my application (WinCE, KOL-CE) I wanted to add an icon to the
 executable.

 I was suggested to create a resource-file in Delphi, add a Mainicon to
 it and copy the res-file in my application source dir.

 After that, I inserted a {$R *.res} in the .lpr et voila, after
 compiling my app showed a beautiful icon.

 But... after quitting and restarting Lazarus and opening my projectfile,
 the IDE outcomments the resource-directive:

 {$R *.res} becomes
 //{$R *.res}

 It looks like using a resourcefile this way is allowed by the compiler
 (2.2.0) but not allowed by the IDE?

 I think you have to specify the filename (not *.res, but
myresourcewithicon.res), at least that works for me here (on win9x).

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


[Lazarus] XML and memory loss

2008-10-08 Thread Bart
Hi all,

I am totaly nes to this (XML), so I suppose i do something wrong.

I took the example from the Wiki XML Tutorial, and the simplified it.
(I use Lazarus svn revision 16824, with fpc 2.2.0 on Window ME)

Here's my code to write an XML file:

procedure TForm1.Button1Click(Sender: TObject);
var
  xdoc: TXMLDocument;  // variable to
document
  RootNode, parentNode, nofilho: TDOMNode;// variable to
nodes
  Fn: String;
begin
  Fn := 'F:\LazarusProjecten\XMLTest\test1.xml';
  //create a document
  xdoc := TXMLDocument.create;
  xdoc.Encoding := 'utf-8';

  //create a root node
  RootNode := xdoc.CreateElement('root');
  Xdoc.Appendchild(RootNode);   // save root node

  //create a parent node
  RootNode:= xdoc.DocumentElement;
  parentNode := xdoc.CreateElement('child');
  RootNode.Appendchild(parentNode);  // save parent
node

  //create a child node
  parentNode := xdoc.CreateElement('foo');// create a child
node
  //nofilho := xdoc.CreateTextNode('Bart'); // insert a value to
node
  //parentNode.Appendchild(nofilho); // save node
  RootNode.ChildNodes.Item[0].AppendChild(parentNode);   // insert child
node in respective parent node

  //create a second child node
  parentNode := xdoc.CreateElement('bar');   // create a child
node
  //nofilho := xdoc.CreateTextNode('me, myself and I');   //
insert a value to node
  //parentNode.Appendchild(nofilho); // save node
  RootNode.ChildNodes.Item[0].AppendChild(parentNode);   // insert a
childnode in respective parent node

  writeXMLFile(xDoc,Fn); // write to XML
  Xdoc.free;  // free memory

  Memo1.Lines.LoadFromFile(Fn);
end;

This creates the following XML file:
?xml version=1.0?
root
  child
foo/
bar/
  /child
/root

This file is more or less as I excpected it to be (i would think it would
include the encoding=utf-8).

The problem is, that for every child I create and append, I loose 4 blocks
of memory (60 bytes for these 4 blocks) (I used the heaptrace option with
compilation).
I commented out the CreateTetNode to try and see if it made any difference
in the (amount of) memory loss, but it seems to have no effect at all.

(I cannot include the total heaptrace report, since on win9x it's output
cannot be redirected, and the win9x console cannot be scrolled...)

What am I doing wrong here?

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


Re: [Lazarus] unknown property when changing platform

2008-07-31 Thread Bart

 Now I'm starting to port the project to win32, using exactly the same
 lazarus version (svn update from FreeBSD, copied over to win32, make
 clean all, project checked out from CVS).


I  think you have to update the Lazarus from within windows (svn update),
then do a make clean all.
It seems that your current lazarus for Windows is not a recent 0.9.25
version.

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


Re: [Lazarus] LGPL question

2008-07-07 Thread Bart

 It didn't exist at that time.
 Why do you miss the LGPL3?


I do not really care what LGPL (the differences between 2 and 3 are beyond
me), I just thought it might be easier just to refer to LGPL and not one
specific version, assuming the spirit of LGPL will remain intact.
(I gathered that some loopholes from LGPL 2 were repaired in LGPL 3, but
again this legal speak is beyond me)

As for now I'll just stick to Modified LGPL 2.
If at any time the FPC/Lazarus team decides to re-license, I'll adjust
accordingly.

I just did not want to give my code a license that was not compatible with
the code i derived it from.

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


Re: [Lazarus] LGPL question

2008-07-05 Thread Bart

 Maybe I misunderstood your intention.

 The IDE and the codetool are licensed under GPL2 or any later version,
 so it can be mixed with GPL3 code.

 The LCL and most components are licensed under the modified LGPL2, so
 you can link any GP license (and many more), but source patches must be
 LGPL2 too.
 If you mean with 'modifications' to publish source patches or forks of
 the LCL itself then they must be under the modified LGPL2, not LGPL3.



Thanks for clearing that up to me.
I wrote some patches and extensions for some fpc RTL functions, based on the
code in the RTL, which I intend to publish with my app.
I also wrote the MinimizeName function that was missing in Laz 0.9.24, and I
use that too in my published code.
The MinimizeName function (currently in FileCtlr.pas) I donated to Lazarus
via the bugtracker...
(I was not aware that by doing so, the code was autmatically licensed under
LGPL 2 and not a more recent version)

I guess I will publish my code under modified LGPL 2, since it now is part
of or derived from the RTL/LCL.

B.t.w. What is the reason not to use the LGPL 3 for the Lazarus LCL/
FreePascal RTL?

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


Re: [Lazarus] LGPL question

2008-07-04 Thread Bart
On 7/4/08, Mattias Gaertner [EMAIL PROTECTED] wrote:

Yes, afaik any later GP license is compatible.


Ok, thanks,

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


Re: [Lazarus] GetAppConfigDir problem

2008-05-07 Thread Bart
Hi,

On 5/6/08, Michael Van Canneyt [EMAIL PROTECTED] wrote:

 If you know a good Microsoft document describing where application
 files are meant to go, I'll be glad to have a look at it and maybe
 change the behaviour.


See for example: http://support.microsoft.com/kb/310294/en-us the
section Classify
Application Data.
This would suggest to me that CSIDL_COMMON_APPDATA would be the most logical
place to store global application data like /etc/ on Linux.
I'm not sure that this is Win9x compatible, will check that when I have
time.

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


Re: [Lazarus] GetAppConfigDir problem

2008-05-07 Thread Bart
On 5/7/08, Bart [EMAIL PROTECTED] wrote:


 See for example: http://support.microsoft.com/kb/310294/en-us the section 
 Classify
 Application Data.
 This would suggest to me that CSIDL_COMMON_APPDATA would be the most
 logical place to store global application data like /etc/ on Linux.
 I'm not sure that this is Win9x compatible, will check that when I have
 time.


Just wrote som etest code. On Win9x using CSIDL_COMMON_APPDATA returns:
  Global: C:\WINDOWS\All Users\Application Data\
  Local : C:\WINDOWS\Application Data\
(on my machine (WinME, not using profiles), so this would seem safe to use.

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