[Lazarus] Possible bug in TEdit, can somebody reproduce this?

2011-04-23 Thread Peter E Williams
Hi,

On 24 April 2011 09:33, Mattias Gaertner  wrote:

> On Sat, 23 Apr 2011 20:20:22 -0300
> Luiz Americo Pereira Camara  wrote:
>
> > On 23/4/2011 20:01, Bernd wrote:
> > > Linux GTK2
> > >
> > > Before I file a bug, please somebody try and confirm:
> > >
> > > Steps to reproduce:
> > > 1: put a TEdit onto a form and compile and run the application
> > > (or alternatively just open one of the IDE's dialogs which contains a
> > > TEdit like for example refactor ->  rename)
> > >
> > > 2. write some text into it and then select a few characters in the
> > > middle of the word. For example I will write the text
> > > "TFooBar" into the TEdit and then select the three letters "Foo".
> > > Then press any (printable) key.
> > >
> > > 3: I expect it to look like this (I have pressed X and the | marks the
> > > position of the caret), this is what I expect:
> > > TX|Bar
> > >
> > > 4. And this is what happens:
> > > TBX|ar
> > >
> > > It removes the "Foo" as expected but then jumps over the B and inserts
> after it.
> > >
> > > This is very annoying, its already slowly starting to influence the
> > > way I edit text in all other applications. Can somebody confirm this
> >
> > I can confirm
>
> Can you find the svn revision number that introduced this regression?
> That would help fixing the bug.
>
>
This bug does NOT occur in my Linux installation of Lazarus 0.9.31 with FPC
2.4.2 SVN rvn 30099.



>  Mattias
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Possible bug in TEdit, can somebody reproduce this?

2011-04-23 Thread Peter E Williams
Hi,

On 24 April 2011 09:33, Mattias Gaertner  wrote:

> On Sat, 23 Apr 2011 20:20:22 -0300
> Luiz Americo Pereira Camara  wrote:
>
> > On 23/4/2011 20:01, Bernd wrote:
> > > Linux GTK2
> > >
> > > Before I file a bug, please somebody try and confirm:
> > >
> > > Steps to reproduce:
> > > 1: put a TEdit onto a form and compile and run the application
> > > (or alternatively just open one of the IDE's dialogs which contains a
> > > TEdit like for example refactor ->  rename)
> > >
> > > 2. write some text into it and then select a few characters in the
> > > middle of the word. For example I will write the text
> > > "TFooBar" into the TEdit and then select the three letters "Foo".
> > > Then press any (printable) key.
> > >
> > > 3: I expect it to look like this (I have pressed X and the | marks the
> > > position of the caret), this is what I expect:
> > > TX|Bar
> > >
> > > 4. And this is what happens:
> > > TBX|ar
> > >
> > > It removes the "Foo" as expected but then jumps over the B and inserts
> after it.
> > >
> > > This is very annoying, its already slowly starting to influence the
> > > way I edit text in all other applications. Can somebody confirm this
> >
> > I can confirm
>
> Can you find the svn revision number that introduced this regression?
> That would help fixing the bug.
>
>
This bug does NOT occur in my Linux installation of Lazarus 0.9.31 with FPC
2.4.2 SVN rvn 30099.



>  Mattias
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] AV exception error on "lower1 := left" (integer variable assignment)... Can anyone explain this???

2011-04-23 Thread Peter E Williams
Hi Mattias,

On 24 April 2011 09:31, Mattias Gaertner  wrote:

> On Sun, 24 Apr 2011 08:58:07 +1000
> Peter E Williams  wrote:
>
> > Hi All,
> >
> > I am having a problem with a strange run-time AV error. See the link to
> the
> > Lazarus project.
> >
> > Download link:
> > http://hotfile.com/dl/115480488/6b7a8ed/dtm_maker_001.zip.html
> >
> > The problem is in the QSort procedure:
> >
> >[...]
> > pivot := island_single_array[left].location_number;
>
> "pivot" is the key of the pivot element at position "left".
>
> >[...]
> > pivot := island_single_array[left].location_number;
> > left := lower1;
> > right := upper1;
> > if left < pivot then
>  
> Comparing a position and a key makes no sense.
>
> You have to keep track of the position of the pivot element. See the
> quicksort implementation in TFPList.Sort.
>
>
Could you please give me a link to the TFPList.Sort code so that I can use
that code (via cut and paste) in my unit ?

Thanks and best regards,
Peter / pew


> Mattias
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Fwd: AV exception error on "lower1 := left" (integer variable assignment)... Can anyone explain this???

2011-04-23 Thread Peter E Williams
Hi All,

I am having a problem with a strange run-time AV error. See the link to the
Lazarus project.

Download link:
http://hotfile.com/dl/115480488/6b7a8ed/dtm_maker_001.zip.html

The problem is in the QSort procedure:

Procedure QSort( Var island_single_array : island_single_type;
  left, right : integer);
  Var
d   : island_single_type;
pivot,
lower1,
upper1 :integer;

  begin
lower1 := left;
// ^^ AV run-time exception on above line.
upper1 := right;
pivot := island_single_array[left].location_number;
While (left < right) do
Begin
  Case SortType of
ascending : begin
  While (island_single_array[right].location_number >=
pivot) and (left < right) do
dec(right);
  if (left <> right) then
  begin

 swap(island_single_array[left],island_single_array[right]);
inc(left);
  end;
 While (island_single_array[left].location_number <=
pivot) and (left < right) do
   inc(left);
  if (left <> right) then
  begin

 swap(island_single_array[left],island_single_array[right]);
dec(right);
  end;
   end;
   end; // case
end; // while
pivot := island_single_array[left].location_number;
left := lower1;
right := upper1;
if left < pivot then
  QSort(island_single_array,left,pivot-1);
if right > pivot then
  QSort(island_single_array,pivot+1,right);
  end;  { QSort }
{}

procedure QuickSort( Var island_single_array : island_single_type;
  Size : integer);
begin
  QSort( island_single_array, 1, Size );
end;
{}

The AV exception error occurs after the project is run then the user selects
File / Save and the QuickSort procedure is called which then calls Qsort.
 The error is occurring on:

lower1 := left;

which are both integers. Lower1 (which was renamed just in case of a name
conflict with the 'lower' string function) is ??? (unassigned) and left is
1. I see no problem with this statement and it is a mystery to me why I am
getting an AV exception error.

Maybe someone here with better debugging skills can tell me why is this
happening and how to fix it.

Best Regards,
Peter / pew
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] AV exception error on "lower1 := left" (integer variable assignment)... Can anyone explain this???

2011-04-23 Thread Peter E Williams
Hi All,

I am having a problem with a strange run-time AV error. See the link to the
Lazarus project.

Download link:
http://hotfile.com/dl/115480488/6b7a8ed/dtm_maker_001.zip.html

The problem is in the QSort procedure:

Procedure QSort( Var island_single_array : island_single_type;
  left, right : integer);
  Var
d   : island_single_type;
pivot,
lower1,
upper1 :integer;

  begin
lower1 := left;
// ^^ AV run-time exception on above line.
upper1 := right;
pivot := island_single_array[left].location_number;
While (left < right) do
Begin
  Case SortType of
ascending : begin
  While (island_single_array[right].location_number >=
pivot) and (left < right) do
dec(right);
  if (left <> right) then
  begin

 swap(island_single_array[left],island_single_array[right]);
inc(left);
  end;
 While (island_single_array[left].location_number <=
pivot) and (left < right) do
   inc(left);
  if (left <> right) then
  begin

 swap(island_single_array[left],island_single_array[right]);
dec(right);
  end;
   end;
   end; // case
end; // while
pivot := island_single_array[left].location_number;
left := lower1;
right := upper1;
if left < pivot then
  QSort(island_single_array,left,pivot-1);
if right > pivot then
  QSort(island_single_array,pivot+1,right);
  end;  { QSort }
{}

procedure QuickSort( Var island_single_array : island_single_type;
  Size : integer);
begin
  QSort( island_single_array, 1, Size );
end;
{}

The AV exception error occurs after the project is run then the user selects
File / Save and the QuickSort procedure is called which then calls Qsort.
 The error is occurring on:

lower1 := left;

which are both integers. Lower1 (which was renamed just in case of a name
conflict with the 'lower' string function) is ??? (unassigned) and left is
1. I see no problem with this statement and it is a mystery to me why I am
getting an AV exception error.

Maybe someone here with better debugging skills can tell me why is this
happening and how to fix it.

Best Regards,
Peter / pew
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TortoiseSVN help.... error in Installing Lazarus wiki --- there is no download the source option

2011-02-10 Thread Peter E Williams
Hi Bo,

I would love to do myself a favour :-)

Where do I find the SVN Client. Do you know the url ?

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com


On 10 February 2011 09:58, Bo Berglund  wrote:

> On Wed, 9 Feb 2011 05:15:18 +1100, Peter E Williams
>  wrote:
>
> >TortoiseSVN_options.png // it shows all of the options and there is not a
> >"download" nor "download the source" option nothing like it what
> the
> >F@CK are you talking about.
> >
> >Before you say read the manual... I have looked at the online help and
> there
> >are 8 million 900 and 65 screens to read... okay minor exaggeration for
> >humour.
> >
> >Fond Regards, Peter Eric WILLIAMS
> >--- Hobart, Tasmania, Australia
> >--- Phone: +61 (03) 6236-9675
>
> Do yourself a favor and download the command line SVN client instead.
> Then just enter the checkout command at a command prompt in the
> directory where you want the checkout to happen.
> Simple as that and nothing to learn either, just use the posted
> commands...
>
>
> --
> Bo Berglund
> Developer in Sweden
>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] TortoiseSVN help.... error in Installing Lazarus wiki --- there is no download the source option

2011-02-08 Thread Peter E Williams
http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29

[...]

After installing TortoiseSVN, download the sources from SVN using a URL for
each directory, see:
Dir: c:\freepascal\binutils\i386-win32\
URL:
http://svn.freepascal.org/svn/fpcbuild/branches/fixes_2_4/install/binw32
Dir: c:\freepascal\fpc\2.4.3
URL: http://svn.freepascal.org/svn/fpc/branches/fixes_2_4/
Dir: c:\freepascal\laz
URL: http://svn.freepascal.org/svn/lazarus/trunk

Please see http://postimage.org/image/ypppd8kk/

TortoiseSVN_options.png // it shows all of the options and there is not a
"download" nor "download the source" option nothing like it what the
F@CK are you talking about.

Before you say read the manual... I have looked at the online help and there
are 8 million 900 and 65 screens to read... okay minor exaggeration for
humour.

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Commands with Linux and subversion to install Lazarus 0.9.30

2011-01-11 Thread Peter E Williams
Correction.

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com


On 12 January 2011 15:54, Peter E Williams  wrote:

Unnecessary steps omitted. There earlier mv command WAS REQUIRED the first
time I logged out the fixes_0_9_30 and I got some compiler error which were
removed with the mv (rename) command previously.

$ svn co http://svn.freepascal.org/svn/lazarus/branches/fixes_0_9_30/
 lazarus_0_9_30


> // change directory
>
> $ cd lazarus_0_9_30
>
> // and this step creates the binary file "lazarus"
>  $ make clean all
>
> // this step runs the binary file create with the last step
> $ ./lazarus &
>
> works fine.
>

Where exactly is this documented?

>
> Fond Regards, Peter Eric WILLIAMS
> --- Hobart, Tasmania, Australia
> --- Phone: +61 (03) 6236-9675
> My free websites are:  http://pewink.info   (&)
>http://pewslinuxvault.googlepages.com
>
>
>
> On 12 January 2011 07:36, Hans-Peter Diettrich wrote:
>
>> Vincent Snijders schrieb:
>>
>>
>>  The requested URL /svn/lazarus/branches/fixes_0_9_30/lazarus was not
>>> found on this server.
>>>
>>
>> The repo browser does not list that directory, that's why you cannot check
>> it out - and why it cannot be renamed as well.
>>
>> Use /svn/lazarus/branches/fixes_0_9_30 instead.
>>
>> DoDi
>>
>>
>>
>> --
>> ___
>> Lazarus mailing list
>> Lazarus@lists.lazarus.freepascal.org
>> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>>
>
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Commands with Linux and subversion to install Lazarus 0.9.30

2011-01-11 Thread Peter E Williams
// typo corrected below
$ mkdir lazarus_0_9_30

// typo corrected below
$ svn co http://svn.freepascal.org/svn/lazarus/branches/fixes_0_9_30/
 lazarus_0_9_30

// change directory
$ cd lazarus_0_9_30

// the next step is required because there exists a directory called lazarus
$ mv lazarus lazarus.old

// and this step creates the binary file "lazarus"
$ make clean all

// this step runs the binary file create with the last step
$ ./lazarus &

works fine.

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com


On 12 January 2011 07:36, Hans-Peter Diettrich  wrote:

> Vincent Snijders schrieb:
>
>
>  The requested URL /svn/lazarus/branches/fixes_0_9_30/lazarus was not
>> found on this server.
>>
>
> The repo browser does not list that directory, that's why you cannot check
> it out - and why it cannot be renamed as well.
>
> Use /svn/lazarus/branches/fixes_0_9_30 instead.
>
> DoDi
>
>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] SVN user

2010-12-29 Thread Peter E Williams
Hi All,

see below.

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com


On 29 December 2010 20:59, Peter E Williams wrote:

> Hi,
>
> see comments below.
> [snip]



> Basically just:
>
>> $ svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
>>
>> $ cd lazarus
>>
>> $ make all
>>
>> $ ./lazarus &
>>
>>
>
>> > > use the normal diff format for your patch.
>>
>
> This is the step I don't understand.
>
> How do I use the normal diff format for my patch?
>

I am still waiting for an answer for how the diff command works.



> I know nothing of how the diff command works. We all learn somewhere [sic
> sometime]. :-)
>

[snip]

PEW
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] SVN user

2010-12-29 Thread Peter E Williams
Vincent,

Thanks for the info.

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com


On 29 December 2010 21:21, Vincent Snijders wrote:

> 2010/12/29 Peter E Williams :
> > /usr/bin/ld: warning: ../link.res contains output sections; did you
> forget
> > -T?
> >
> > I get the above warning a number of times. I think that the make file
> needs
> > amending to add the -T option.
>
> http://www.freepascal.org/faq.var#unix-ld219
>
> Vincent
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] SVN user

2010-12-29 Thread Peter E Williams
Hi All,

see below

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com


2010/12/29 Juha Manninen 

>  Peter E Williams kirjoitti tiistai 28 joulukuu 2010 21:34:03:
> http://wiki.lazarus.freepascal.org/Getting_Lazarus
>
> Basically just:
>
> $ svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
>
> $ cd lazarus
>
> $ make all
>
>
/usr/bin/ld: warning: ../link.res contains output sections; did you forget
-T?

I get the above warning a number of times. I think that the make file needs
amending to add the -T option.

Warning exist for a reason and it is good programming practise to remove all
of them :-)

I don't know anything about make files.


> $ ./lazarus &
>
>  > > use the normal diff format for your patch.
>
> >
>
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] SVN user

2010-12-29 Thread Peter E Williams
Hi,

see comments below.

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com


2010/12/29 Juha Manninen 

>  Peter E Williams kirjoitti tiistai 28 joulukuu 2010 21:34:03:
>
> > > I think you should write a bug report
>
> >
>
> > Okay... please see my earlier message about my not being able to install
>
> > the deb files for the latest snapshot.
>
> >
>
> > I want someone to tell me the linux command to install all deb files in
> the
>
> > current folder. I am still a linux newbie with deb files as I use the
>
> > Software Manager. This installs Lazarus 0.9.28,2 not the latest beta
>
> > version.
>
> >
>
> > I am not a SVN user.
>
>

> Then you must become one...
>
>
Agreed.


> I mean, if you want to get involved in the project so much that you make
> bug reports with suggested code changes, then using the revision control
> system is the only way to go.
>

I have not experience with SVN as I am a lone developer.


> The bugs should be tested against the latest versions anyway and updating
> from the SVN server is the easiest and fastest way.
>
> http://wiki.lazarus.freepascal.org/Getting_Lazarus
>


> Basically just:
>
> $ svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
>
> $ cd lazarus
>
> $ make all
>
> $ ./lazarus &
>
>

> > > use the normal diff format for your patch.
>

This is the step I don't understand.

How do I use the normal diff format for my patch?

I know nothing of how the diff command works. We all learn somewhere. :-)


> >
>
> > Please give details. I have never done this before! :)
>
> Explained here:
>
> http://wiki.lazarus.freepascal.org/Creating_A_Patch
>
>
*Instructions For Linux/BSD etc:*

We'll assume that you have your SVN checkout of Lazarus in $HOME/lazarus

   1. Open your favorite Terminal program
   2. cd $HOME {press enter}
   3. cd lazarus {press enter}
   4. svn diff > mypatch.diff {press enter}


Basically:
>
> $ svn diff > mypatch.patch
>
> > >It makes things easier for everybody.
>
> >
>
> > I am all in favour of making things easier for everybody :-)))
>
> :-)
>
> Juha
>
> PEW :)


> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Where is fp ide located on my Mint 10 Linux system (ubuntu based)?

2010-12-29 Thread Peter E Williams
Hi Vincent,

Thanks for the info. I am already subscribed to the fpc-pascal list... but I
didn't realise that my message was off topic.

I agree that the fpc-pascal list is more appropriate for my questions. :-)

pew

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com


On 29 December 2010 19:37, Vincent Snijders wrote:

> 2010/12/29 Peter E Williams :
> > I will study your reply. At the moment I am have problems actually
> finding
> > fp and fpc binaries on my Mint 10 system (Linux).
>
> Please, ask question about the fp binary on the fpc-pascal mailing
> list[1], since it is off topic for this list. While you are at it, you
> can ask the question about the fpc binaries there too.
>
> Vincent
> [1] http://lists.freepascal.org/mailman/listinfo/fpc-pascal/
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Directory separator character / or \ for file path differences between Linux, Mac and Windows, etc

2010-12-28 Thread Peter E Williams
Hi

This is really 4 questions:

One: Since Windows users the '\' (backslash) character and Linux uses the
'/' (foreslash) character in file paths, have I got those the right way
around?

Two: What do Macs use for directory path separator character?

Three: Is the a cross-platform function (or procedure) for correcting the
file path separator character? I believe that there is one.

e.g. c:\Program Files\Fred's software\data (folder) >>> c:/Program
Files/Fred's software/data (folder)

Yes, I am well aware the c:\Program Files\ does usually exist on Linux
systems. Actually, if it does exist it will be:

~/Home/.wine/drive_c/ (folder) with Wine installed.

So, it would become ~/Home/.wine/drive_c/Program Files/Fred's
software/data/  (folder)

Four: Is the a compiler directive (cross-platform) or other way of detecting
the OS of the user's system?

pew

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Christmas present for Windows lazarus developers : Memproof instaler 2.2MB

2010-12-28 Thread Peter E Williams
Hi Joshua

It should work for Delphi but probably not for Lazarus.

PEW

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com


On 26 December 2010 04:28, Joshua Lim  wrote:

> Hi Peter, thanks, what I mean is if it works for NT services.
>
> Peter E Williams wrote:
>
>> Hi Joshua,
>>
>> Fond Regards, Peter Eric WILLIAMS
>> --- Hobart, Tasmania, Australia
>> --- Phone: +61 (03) 6236-9675
>> My free websites are:  http://pewink.info   (&)
>>   http://pewslinuxvault.googlepages.com
>>
>>
>> On 26 December 2010 03:26, Joshua Lim > joshua__...@hotmail.com>> wrote:
>>
>>Hi Peter, thanks, I tried again a couple hours later, it now
>>works.  Do you think this method can work for services?
>>
>>Rgds,
>>Joshua
>>
>>
>>Joshua Lim wrote:
>>
>>Hi Peter, thanks, this downloader site keeps returning me to
>>the wait page -
>>http://hotfile.com/dl/91609295/6358c68/memproof_installer.zip.html
>>
>>
>> Yes, this should work like any Internet url.
>>
>> Please visit http://hotfile.com and sign up as a new user. Then each time
>> you visit hotfile.com <http://hotfile.com> you will be taken to the page
>> where you can click on 'upload file'. It transfers files at standard upload
>> speeds and there is a paid premium option if you want fast downloads, which
>> I don't use because I don't upload large files normally.
>>
>>
>>Rgds,
>>Joshua
>>
>>
>> Pew :)))
>>
>>
>>Peter E Williams wrote:
>>
>>Hi all,
>>
>>Here is a link to Memproof_installer.zip (2.2MB).
>>
>>
>> http://hotfile.com/dl/91609295/6358c68/memproof_installer.zip.html
>>
>>This is what I originally used many years ago with Delphi
>>5 Enterprise to write my shareware (which never really
>>sold) and later became mostly public domain freeware now
>>found on http://pewink.info in the Delphi source code page.
>>
>>Memproof is a stand alone application.
>>
>>Instructions:
>>
>>click here
>>
>>
>> http://hotfile.com/dl/91609295/6358c68/memproof_installer.zip.html
>>
>>and save the 2.2 MB fie to disk.
>>
>>Unzip it with whatever you like and save the exe file.
>>Then run it. It is a standard installation exe file by the
>>same company that wrote Memproof (not me).
>>
>>Then open the memproof folder and run memproof and read
>>the instructions in the help file. You will need to set
>>certain Optimization options off and other Delphi 5
>>compilation options. They have a red circle and arrows in
>>the help file.
>>
>>Don't ask me as it has been years since I did this.
>>
>>An interesting note is that later versions of memproof did
>>NOT include the help file... so save it if you install a
>>later version of memproof.
>>
>>Then open Delphi or Lazarus and compile your project (say,
>>"hello_fred" project) with the correct settings as
>>described in the Memproof help file.
>>
>>Close Delphi or Lazarus.
>>
>>Open Memproof and the open your project (hello_fred.exe).
>>
>>Run it (hello_fred.exe) within Memproof (not as a Windows
>>exe file).
>>
>>Memproof will show all memory assignments and memory
>>leaks. It will also jump to the line in your source code
>>where the memory leak variable was created. You then need
>>to decide where to call Free or FreeAndNil for the
>>object(s) which you created and forgot to free, causing
>>the memory leak(s).
>>
>>This is then a process of recompiling it with Delphi or
>>Lazarus and reopening it with Memproof and running it
>>until there are no memory leaks.
>>
>>Happy Debugging and Merry Christmas 2010
>>
>>Fond Regards, Peter Eric WILLIAMS
>>--- Hobart, Tasmania, Australia
>>  

Re: [Lazarus] (no subject)

2010-12-28 Thread Peter E Williams
Hi Juha,


Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com


On 26 December 2010 23:12, Juha Manninen  wrote:

> > Hi Mattias,
> > see below changes to writeln statement.
>
> Hi Peter
>

> I think you should write a bug report

Okay... please see my earlier message about my not being able to install the
deb files for the latest snapshot.

I want someone to tell me the linux command to install all deb files in the
current folder. I am still a linux newbie with deb files as I use the
Software Manager. This installs Lazarus 0.9.28,2 not the latest beta
version.

I am not a SVN user.

Are there some instructions for how I can

> use the normal diff format for your patch.

Please give details. I have never done this before! :)

>It makes things easier for everybody.

I am all in favour of making things easier for everybody :-)))

>
> Regards,
> Juha
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] This is how you can fix that annoying bug with Build All asking to reset the debugger then aborting.

2010-12-28 Thread Peter E Williams
Juha,

see comments below

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com


On 26 December 2010 23:28, Juha Manninen  wrote:

> Peter Williams kirjoitti sunnuntai 26 joulukuu 2010 05:14:20:
> > Mattias,
> > This is how you can fix that annoying bug with Build All asking to reset
> > the debugger then aborting. When you do a Build All
> > you will get:
> > ConfirmationDo you want to rebuild lazarus with profile: Build All[yes]
> > [no] Selecting yes gives
> > Some message that I cannot find about the debugger needs to be reset.
> > Please change your code so that
> > if DebugProcessRunning then   Reset;BuildAll;
> > I cannot find this in your code and obviously you know your way around
> the
> > code better than I. Regards,PEWPeter Eric Williams
>
> You should make a bug report with steps to reproduce.
> In my opinion it is ok to have a confirmation while debugging and then
> clicking
> "Build All".
>
> I am currently unable to install the latest snapshot of Lazarus 0.9,31,x
--- as of 2 days ago I got as far as uncompressing all the Lazarus .deb
files (for Linux) and I do not know the command to enter to install all the
deb files. I am still a bit of a linux newbie in this regard :(

What is the linux terminal command to install the lazarus latest snapshot
from all the deb files? Assuming that they are all in:

Home\Downloads\Lazarus  <<< (contains all the .deb files)

Once you tell me the command I will investigate this bug further and report
it if I think it is required.

Are the Lazarus.lpi, Lazarus.lpr and Lazarus.lfm files included in the
latest snapshot ?

I would suggest that they need to be in the Lazarus root folder.


> Regards
> Juha
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Christmas present for Windows lazarus developers : Memproof instaler 2.2MB

2010-12-25 Thread Peter E Williams
Hi Joshua,

I think it does work on Windows NT. I know quite well a Delphi programmer
named Michael Phillips and he still uses Delphi 7 as well as Turbo Pascal
and he was a Windows NT communications Delphi and Pascal programmer up until
about 3 years ago.

Michael's Home Page
*Last Updated: 18 August 2009*
http://members.pcug.org.au/~mphillip/

Delphi TIPS and Pascal TIPS
http://members.pcug.org.au/~mphillip/T_INDEX.HTM

It is worth looking at, if only to read about how simple it is to read comma
separated value (CSV) files, and creating log files, etc

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com


On 26 December 2010 04:28, Joshua Lim  wrote:

> Hi Peter, thanks, what I mean is if it works for NT services.
>
> Peter E Williams wrote:
>
>> Hi Joshua,
>>
>> Fond Regards, Peter Eric WILLIAMS
>> --- Hobart, Tasmania, Australia
>> --- Phone: +61 (03) 6236-9675
>> My free websites are:  http://pewink.info   (&)
>>   http://pewslinuxvault.googlepages.com
>>
>>
>> On 26 December 2010 03:26, Joshua Lim > joshua__...@hotmail.com>> wrote:
>>
>>Hi Peter, thanks, I tried again a couple hours later, it now
>>works.  Do you think this method can work for services?
>>
>>Rgds,
>>Joshua
>>
>>
>>Joshua Lim wrote:
>>
>>Hi Peter, thanks, this downloader site keeps returning me to
>>the wait page -
>>http://hotfile.com/dl/91609295/6358c68/memproof_installer.zip.html
>>
>>
>> Yes, this should work like any Internet url.
>>
>> Please visit http://hotfile.com and sign up as a new user. Then each time
>> you visit hotfile.com <http://hotfile.com> you will be taken to the page
>> where you can click on 'upload file'. It transfers files at standard upload
>> speeds and there is a paid premium option if you want fast downloads, which
>> I don't use because I don't upload large files normally.
>>
>>
>>Rgds,
>>Joshua
>>
>>
>> Pew :)))
>>
>>
>>Peter E Williams wrote:
>>
>>Hi all,
>>
>>Here is a link to Memproof_installer.zip (2.2MB).
>>
>>
>> http://hotfile.com/dl/91609295/6358c68/memproof_installer.zip.html
>>
>>This is what I originally used many years ago with Delphi
>>5 Enterprise to write my shareware (which never really
>>sold) and later became mostly public domain freeware now
>>found on http://pewink.info in the Delphi source code page.
>>
>>Memproof is a stand alone application.
>>
>>Instructions:
>>
>>click here
>>
>>
>> http://hotfile.com/dl/91609295/6358c68/memproof_installer.zip.html
>>
>>and save the 2.2 MB fie to disk.
>>
>>Unzip it with whatever you like and save the exe file.
>>Then run it. It is a standard installation exe file by the
>>same company that wrote Memproof (not me).
>>
>>Then open the memproof folder and run memproof and read
>>the instructions in the help file. You will need to set
>>certain Optimization options off and other Delphi 5
>>compilation options. They have a red circle and arrows in
>>the help file.
>>
>>Don't ask me as it has been years since I did this.
>>
>>An interesting note is that later versions of memproof did
>>NOT include the help file... so save it if you install a
>>later version of memproof.
>>
>>Then open Delphi or Lazarus and compile your project (say,
>>"hello_fred" project) with the correct settings as
>>described in the Memproof help file.
>>
>>Close Delphi or Lazarus.
>>
>>Open Memproof and the open your project (hello_fred.exe).
>>
>>Run it (hello_fred.exe) within Memproof (not as a Windows
>>exe file).
>>
>>Memproof will show all memory assignments and memory
>>leaks. It will also jump to the line in your source code
>>where the memory leak variable was created. You then need
>>to decide where to call Free or FreeAndNil for the
>>object(s) which you created and forgot to free, causing
>> 

Re: [Lazarus] Christmas present for Windows lazarus developers : Memproof instaler 2.2MB

2010-12-25 Thread Peter E Williams
Hi Joshua,

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com


On 26 December 2010 03:26, Joshua Lim  wrote:

> Hi Peter, thanks, I tried again a couple hours later, it now works.  Do you
> think this method can work for services?
>
> Rgds,
> Joshua
>
>
> Joshua Lim wrote:
>
>> Hi Peter, thanks, this downloader site keeps returning me to the wait page
>> - http://hotfile.com/dl/91609295/6358c68/memproof_installer.zip.html
>>
>>
Yes, this should work like any Internet url.

Please visit http://hotfile.com and sign up as a new user. Then each time
you visit hotfile.com you will be taken to the page where you can click on
'upload file'. It transfers files at standard upload speeds and there is a
paid premium option if you want fast downloads, which I don't use because I
don't upload large files normally.

Rgds,
>> Joshua
>>
>
Pew :)))


>
>
> Peter E Williams wrote:
>>
>>> Hi all,
>>>
>>> Here is a link to Memproof_installer.zip (2.2MB).
>>>
>>> http://hotfile.com/dl/91609295/6358c68/memproof_installer.zip.html
>>>
>>> This is what I originally used many years ago with Delphi 5 Enterprise to
>>> write my shareware (which never really sold) and later became mostly public
>>> domain freeware now found on http://pewink.info in the Delphi source
>>> code page.
>>>
>>> Memproof is a stand alone application.
>>>
>>> Instructions:
>>>
>>> click here
>>>
>>> http://hotfile.com/dl/91609295/6358c68/memproof_installer.zip.html
>>>
>>> and save the 2.2 MB fie to disk.
>>>
>>> Unzip it with whatever you like and save the exe file. Then run it. It is
>>> a standard installation exe file by the same company that wrote Memproof
>>> (not me).
>>>
>>> Then open the memproof folder and run memproof and read the instructions
>>> in the help file. You will need to set certain Optimization options off and
>>> other Delphi 5 compilation options. They have a red circle and arrows in the
>>> help file.
>>>
>>> Don't ask me as it has been years since I did this.
>>>
>>> An interesting note is that later versions of memproof did NOT include
>>> the help file... so save it if you install a later version of memproof.
>>>
>>> Then open Delphi or Lazarus and compile your project (say, "hello_fred"
>>> project) with the correct settings as described in the Memproof help file.
>>>
>>> Close Delphi or Lazarus.
>>>
>>> Open Memproof and the open your project (hello_fred.exe).
>>>
>>> Run it (hello_fred.exe) within Memproof (not as a Windows exe file).
>>>
>>> Memproof will show all memory assignments and memory leaks. It will also
>>> jump to the line in your source code where the memory leak variable was
>>> created. You then need to decide where to call Free or FreeAndNil for the
>>> object(s) which you created and forgot to free, causing the memory leak(s).
>>>
>>> This is then a process of recompiling it with Delphi or Lazarus and
>>> reopening it with Memproof and running it until there are no memory leaks.
>>>
>>> Happy Debugging and Merry Christmas 2010
>>>
>>> Fond Regards, Peter Eric WILLIAMS
>>> --- Hobart, Tasmania, Australia
>>> --- Phone: +61 (03) 6236-9675
>>> My free websites are:  http://pewink.info   (&)
>>>   http://pewslinuxvault.googlepages.com
>>> My free blog is: patientxmarksthespot.wordpress.com <
>>> http://patientxmarksthespot.wordpress.com>
>>>
>>> 
>>>
>>> --
>>> ___
>>> Lazarus mailing list
>>> Lazarus@lists.lazarus.freepascal.org
>>> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>>>
>>>
>>
>>
>> --
>> ___
>> Lazarus mailing list
>> Lazarus@lists.lazarus.freepascal.org
>> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>>
>>
>>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Convert standard Lazarus application (Tforms and TButtons etc) into >>> a web application

2010-12-25 Thread Peter E Williams
Hi All,

see comments inline.

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com
My free blog is: patientxmarksthespot.wordpress.com



2010/12/24 ik 

>  Hi,
>
> Please see my answers inline.
>
> 2010/12/24 Peter E Williams 
>
> Hi all,
>>
>> Please excuse me if this is an obvious question.
>>
>> I have an application called Adv_Player which I programmed in Delphi 7
>> Enterprise project and I have since converted it to a Lazarus 0.9.28.2
>> project. (It is a very stable and fully test application available for
>> Windows XP from my download page in a setup exe file).
>>
>> Yes, I still have all the fully working original source code.
>>
>> Now I want to convert it into a web based application. I know that Delphi
>> 7 Enterprise can do this but I never got around to investigating HOW to go
>> about doing this.
>>
>> The application has a Adv_Main : TForm and lots of TEdit's, TButton's and
>> TCheckbox'es and TRadioButton's and a few TGroupBox'es (or do I mean
>> TRadioGroup ?) and TFrame's and maybe a TSplitter.
>>
>> The rest of the work is all done with my own code and reads and write some
>> text files with readln and writeln statements. These can be thought of as
>> comma separated value files.
>>
>
> First tip: HTTP is a stateless protocol. And you can get many requests at
> the same time, so handling text files by yourself is not recommended.
>
> Thanks for pointing that out but I already know this. I used to write
websites for the Royal Australian Navy up until 8 years ago with Dreamweaver
3 and html (also a little bit with Dreamweaver MX Studio). I have legal
copies of these from my Defence job.


> There are databases such as Redis <http://redis.io/> (it's non SQL based
> database) that know how to work with key-value data, but know how to handle
> multiple requests. And can save you a lot of issues with it.
>

Does Redis come with sample databases and websites? Where can I view these?


>  Questions:
>> What do I need to do in order for my application (currently about 5-6
>> TForms) into a web based application? Another application has about 10-12
>> TForms in it.
>>
>
> Translate your forms into HTML 
> Forms<http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html>.
> One of the things I want to do but lack the time to do is to write a Lazarus
> Widget that is actually translating normal GUI forms into HTML Forms, but
> that's just a dream for now.
>
> I think this is called Webification, correct? Are there any software tools
to do this or is all done by hand?

>
>
>> How many of those components do I keep and what needs to be replaced and
>> with what equivalent components. E.g. what is the web based version of
>> TButton or TEdit etc?
>>
>
> Everything should be in HTML regarding what the client see. The logic is in
> the Server side.
>

Okay. Perhaps you misinterpreted my question. What is the HTML version of a
TButton, TEdit, TRadioButton, TCheckBox, etc. I know the basics of form
design with Dreamweaver 3 and I also have Dreamweaver MX Studio. It has been
a few years since I used them.

>
>> How do I tell Lazarus that my binary file will be launched from within my
>> html code?
>>
>
> You do not :) You have a web server. It tells regarding your route how the
> request will be handled, and send it to your application (CGI -> Common
> Gateway Interface) to work with it if configured properly.
>
>
Okay. So then my question is HOW do I write Java or JavaScript based on my
existing Lazarus 0.9.28.2 OO Pascal code which is fully working and
debugged?

Are there any software tools for conversion of Pascal to Java or JavaScript
[ called the CGI ]? I think that there are some but in a half hour google
for it I could not find them. If they are Windows-based then I can run them
with Wine. If they are Linux based then that's better.

I thought that I needed to use Lazarus and fpWeb to create some kind of
binary file which I upload to my Hosting24.com server so that I can use my
html code to use Java or JavaScript in my html file to call the binary
generated with Lazarus (which I would ftp to my server). Is this correct?


>> Can Lazarus do this?
>>
>
> Yes, I'm writing a commercial app just now using fpWeb and Lazarus.
>

Are there any Open Source examples of fpWeb and Lazarus.

I am thinking about either learning Java or NetBeans. My gut tells me to go
with Lazarus if I can find a sample O.S. fpWeb application I can study and
learn from.


>
>>
>>

Re: [Lazarus] fpc-2.4.2-1.src.rpm (25 MB) contains the sources. -- the url link is dead.

2010-12-25 Thread Peter E Williams
Hi,

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com


On 24 December 2010 22:36, Marco van de Voort  wrote:

> On Fri, Dec 24, 2010 at 04:40:29PM +1100, Peter E Williams wrote:
>
>
>
> >- *Source Packages*
> >- fpc-2.4.2-1.src.rpm<
> ftp://ftp.freepascal.org/pub/fpc/dist/2.4.2/i386-linux/rpm/fpc-2.4.2-1.src.rpm
> >(25
> > MB) contains the sources.
>
> > fpc-2.4.2-1-src.rpm is a dead link ! (opens a blank page).
>
>
> ftp://ftp.freepascal.org/pub/fpc/dist/2.4.2/i386-linux/rpm/fpc-2.4.2-1.src.rpm
>
> downloads fine for me, so I don't understand the problem!?!?!?
>
>
It is a ftp:// url not a http:// url and it simply opens a blank page and
downloads nothing for me.


>  --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Fwd: Installation of Lazarus 0.9.29 works fine and no problems (very long message!)

2010-12-25 Thread Peter E Williams
Hi All,

ooppps!!! send from wrong gmail account again. Sorry folks.

download a screenshot of the debug info window here:

http://hotfile.com/dl/91837658/93055e8/Screenshot-1.png.html

then click on [ Regular Download ] button for the .png image.

-- Forwarded message --
From: Peter E Williams 
Date: 24 December 2010 18:56
Subject: Installation of Lazarus 0.9.29 works fine and no problems (very
long message!)
To: Lazarus email list 


Merry Christmas 2010 !!!

Let's hope that this nails down this bug.

Summary:

Installation of Lazarus 0.9.29 works fine and no problems.

Wine / Programs / Lazarus menu item is broken

Open browse to drive c and then open the lazarus folder and right click the
StartLazarus.exe file.

Build all with examples gives errors but without the examples does not give
errors.

Important Note to developers:

Please change the Build All menu option so that BEFORE the build all the
menu item Run / Program Reset Debugger.OnClick is called then the Build All
is called.

e.g.

Note: I have NOT looked at the code as that is not my job.

procedure NewBuildAll.OnClick(Sender: TObject);
begin
  ProgramResetDebugger.OnClick(sender);
  BuildAll.OnClick(sender);
end;

file:

Lazarus-0.9.29-28808-fpc-2.4.3-20101223-win32.exe

(warning: if I try to say this file to a cdrom then the filename is
truncated for Windows compatibility).

Open Location Downloads:

then select the above file and right mouse click and select properties and
permissions tab. Then tick the checkbox

[x] Allow executing file as program and click the [Close] button.

This is a trick you'll need to do for EVERY Windows(tm) .exe file... So take
note. After a while it will be second nature to do this.

I have WINE 1.3 installed which is the unstable new version. The stable
version is 1.3.

Now right mouse click on the file and click on:

Open With Wine Window Program Loader and click on it.

Wait about 3 seconds on my system and the install program opens with an
option for me to select my language and I picked English

'Next >' x 4 times

Additional icons
[x] Create a desktop icon and 'Next >'

Click on 'Install' and the installation proceeds.

(takes about 20 seconds)

then click on 'Finish' and the setup dialog closes.

Close the Downloads window (Linux Mint 10)

Desktop icon DOES correctly work and opens Lazarus for Windows

Menu 'Wine' > 'Lazarus' gives Error 'File not found'.

Menu 'Wine' > 'Browse C: drive' now shows 4 folders:

lazarus, Program Files, users, windows

lazarus folder contains 16 folders and 18 files.

It appears to be a good installation at initial inspection.

Select 'StartLazarus.exe' and Now right mouse click on the file and click
on:

Open With Wine Window Program Loader and click on it.

Lazarus now opens.

Help / About reports

Version #: 0.9.29
Date: 2010-12-23
FPC Version: 2.4.3
SVN Revision: 28808
i386-win32-win32/win64

Compile and run gives error:

Project1 project1 raised exception class 'External: SIGSEGV'
[OK]

Run / Reset Debugger

Tools / Configure "Build Lazarus"

Defines
[x] Debug
[x] Verbose

[Save Settings]

Tools / Build Lazarus with Profile Build All

Do you want to rebuld Lazarus with profile: Build All

[Yes]

Compiles and Builds without errors

Running the default empty project gives the same error

Project "project1" successfully built.

runtime error

Project1 project1 raised exception class 'External: SIGSEGV'
[OK]

Try again with [x] Examples ON

Error
Heap dump by heaptrc unit
1025279 memory blocks allocated : 134018729/136853672
1025279 memory blocks freed : 134018729/136853672
0 unfreed memory blocks : 0
True heap size : 1081344 (144 used in System startup)
True free heap : 1827632
Should be : 1081200

[OK]

Lazarus restarts

File > Close all editor files

open location > My computer and find my existing and tested lazarus projects
on my external NexStar Lite 250GB drive then I copied and pasted then into
my Computer / Home / Public / lazarus_source_code folder

Tools / Configure [ ] Examples (unchecked)

same error now

as earier. Memory heap error as above.


Code from win32object.inc

function TWin32WidgetSet.WinRegister: Boolean;
var
  WindowClass: WndClass;
  WindowClassW: WndClassW;
begin
  Assert(False, 'Trace:WinRegister - Start');
  if UnicodeEnabledOS then
  begin
with WindowClassW do
begin
  Style := CS_DBLCLKS;
  LPFnWndProc := @WindowProc;
  CbClsExtra := 0;
  CbWndExtra := 0;
  hInstance := System.HInstance;
  hIcon := Windows.LoadIcon(MainInstance, 'MAINICON');
  if hIcon = 0 then
   hIcon := Windows.LoadIcon(0, IDI_APPLICATION);
  hCursor := Windows.LoadCursor(0, IDC_ARROW);
  hbrBackground := 0;
  LPSzMenuName := nil;
  LPSzClassName := @ClsNameW;
end;
Result := Windows.RegisterClassW(@Windo

Re: [Lazarus] Installation of Lazarus 0.9.29 works fine and no problems (very long message!)

2010-12-25 Thread Peter E Williams
>
>
> I have WINE 1.3 installed which is the unstable new version. The stable
> version is 1.3.
>

[ should read stable version is Wine 1.2 ]
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Christmas present for Windows lazarus developers : Memproof instaler 2.2MB

2010-12-25 Thread Peter E Williams
Hi Joshua and all,

Just click on [ Regular Download ] and your download will proceed. The [
Premium Download ] is for those folk who are downloading iso images and need
very fast connections.

As it is a 2.2MB .zip file it will only take less than 1 minute to download.
Then unzip it with your favourite unarchiver and run the .exe installer.

Any more questions?

Please note the previous reply that it will only work with Delphi 6 and
below and not with current Lazarus as Memproof needs TD32 Debug info which
Lazarus IIRC does NOT provide. I am a little ignorant of all the debugging
terminology for Lazarus versus Delphi.

PEW

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com


On 25 December 2010 15:51, Joshua Lim  wrote:

> Hi Peter, thanks, this downloader site keeps returning me to the wait page
> - http://hotfile.com/dl/91609295/6358c68/memproof_installer.zip.html
>
> Rgds,
> Joshua
>
>
> Peter E Williams wrote:
>
>> Hi all,
>>
>> Here is a link to Memproof_installer.zip (2.2MB).
>>
>> http://hotfile.com/dl/91609295/6358c68/memproof_installer.zip.html
>>
>> This is what I originally used many years ago with Delphi 5 Enterprise to
>> write my shareware (which never really sold) and later became mostly public
>> domain freeware now found on http://pewink.info in the Delphi source code
>> page.
>>
>> Memproof is a stand alone application.
>>
>> Instructions:
>>
>> click here
>>
>> http://hotfile.com/dl/91609295/6358c68/memproof_installer.zip.html
>>
>> and save the 2.2 MB fie to disk.
>>
>> Unzip it with whatever you like and save the exe file. Then run it. It is
>> a standard installation exe file by the same company that wrote Memproof
>> (not me).
>>
>> Then open the memproof folder and run memproof and read the instructions
>> in the help file. You will need to set certain Optimization options off and
>> other Delphi 5 compilation options. They have a red circle and arrows in the
>> help file.
>>
>> Don't ask me as it has been years since I did this.
>>
>> An interesting note is that later versions of memproof did NOT include the
>> help file... so save it if you install a later version of memproof.
>>
>> Then open Delphi or Lazarus and compile your project (say, "hello_fred"
>> project) with the correct settings as described in the Memproof help file.
>>
>> Close Delphi or Lazarus.
>>
>> Open Memproof and the open your project (hello_fred.exe).
>>
>> Run it (hello_fred.exe) within Memproof (not as a Windows exe file).
>>
>> Memproof will show all memory assignments and memory leaks. It will also
>> jump to the line in your source code where the memory leak variable was
>> created. You then need to decide where to call Free or FreeAndNil for the
>> object(s) which you created and forgot to free, causing the memory leak(s).
>>
>> This is then a process of recompiling it with Delphi or Lazarus and
>> reopening it with Memproof and running it until there are no memory leaks.
>>
>> Happy Debugging and Merry Christmas 2010
>>
>> Fond Regards, Peter Eric WILLIAMS
>> --- Hobart, Tasmania, Australia
>> --- Phone: +61 (03) 6236-9675
>> My free websites are:  http://pewink.info   (&)
>>   http://pewslinuxvault.googlepages.com
>> My free blog is: patientxmarksthespot.wordpress.com <
>> http://patientxmarksthespot.wordpress.com>
>>
>> 
>>
>>
>> --
>> ___
>> Lazarus mailing list
>> Lazarus@lists.lazarus.freepascal.org
>> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>>
>>
>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Christmas present for Windows lazarus developers : Memproof instaler 2.2MB

2010-12-24 Thread Peter E Williams
Hi Marco and all,

see comments below

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com
My free blog is: patientxmarksthespot.wordpress.com



On 24 December 2010 22:39, Marco van de Voort  wrote:

> On Fri, Dec 24, 2010 at 12:11:20PM +0100, Michael Van Canneyt wrote:
> > > Here is a link to Memproof_installer.zip (2.2MB).
> > >
> > [snip]
> > > Memproof will show all memory assignments and memory leaks. It will
> also jump to the line in your source code where the memory leak variable was
> created.
>

Yes, this is an excellent feature of it. You can watch all the variable and
constant allocations AS your program is being run from within memproof.


> > > You then need to decide where to call Free or FreeAndNil for the
> object(s) which you created and forgot to free, causing the memory leak(s).
> >
> > While it is a nice gesture to give presents, I don't see the practical
> use.
> > FPC contains this feature out of the box, you can just compile with -gl.
>

Is there a tutorial on how to use this? My application which I am currently
developing are for Lazarus not Free Pascal so I would need something which
has a GUI interface ?!? Or am I wrong?

>
> Afaik memproof (which is like AQTime-lite) needs explicitely debug format
> support, and that's why it doesn't work after D7. For decent traces it also
> required the TD32 debuginfo to be turned on, and I doubt it understands
> stabs or dwarf.
>

Yes, correct. You need to [ ] Optimization (uncheck) and [x] TD32 debug info
(check it) and there is probably another option also. Please install it and
read the help file.

stabs or dwarf are new technologies to me. I know nothing about these
things.
:(

I think that I will reinstall Delphi 5 Enterprise and Memproof on my Mint 10
computer with WINE 1.3 and see if it works.

PEW



> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Christmas present for Windows lazarus developers : Memproof instaler 2.2MB

2010-12-24 Thread Peter E Williams
Hi all,

Here is a link to Memproof_installer.zip (2.2MB).

http://hotfile.com/dl/91609295/6358c68/memproof_installer.zip.html

This is what I originally used many years ago with Delphi 5 Enterprise to
write my shareware (which never really sold) and later became mostly public
domain freeware now found on http://pewink.info in the Delphi source code
page.

Memproof is a stand alone application.

Instructions:

click here

http://hotfile.com/dl/91609295/6358c68/memproof_installer.zip.html

and save the 2.2 MB fie to disk.

Unzip it with whatever you like and save the exe file. Then run it. It is a
standard installation exe file by the same company that wrote Memproof (not
me).

Then open the memproof folder and run memproof and read the instructions in
the help file. You will need to set certain Optimization options off and
other Delphi 5 compilation options. They have a red circle and arrows in the
help file.

Don't ask me as it has been years since I did this.

An interesting note is that later versions of memproof did NOT include the
help file... so save it if you install a later version of memproof.

Then open Delphi or Lazarus and compile your project (say, "hello_fred"
project) with the correct settings as described in the Memproof help file.

Close Delphi or Lazarus.

Open Memproof and the open your project (hello_fred.exe).

Run it (hello_fred.exe) within Memproof (not as a Windows exe file).

Memproof will show all memory assignments and memory leaks. It will also
jump to the line in your source code where the memory leak variable was
created. You then need to decide where to call Free or FreeAndNil for the
object(s) which you created and forgot to free, causing the memory leak(s).

This is then a process of recompiling it with Delphi or Lazarus and
reopening it with Memproof and running it until there are no memory leaks.

Happy Debugging and Merry Christmas 2010

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com
My free blog is: patientxmarksthespot.wordpress.com
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Fwd: Installation of Lazarus 0.9.29 works fine and no problems (very long message!)

2010-12-23 Thread Peter E Williams
ooppps!!! send from wrong gmail account again. Sorry folks.

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com
My free blog is: patientxmarksthespot.wordpress.com



-- Forwarded message --
From: Peter E Williams 
Date: 24 December 2010 18:56
Subject: Installation of Lazarus 0.9.29 works fine and no problems (very
long message!)
To: Lazarus email list 


Merry Christmas 2010 !!!

Let's hope that this nails down this bug.

Summary:

Installation of Lazarus 0.9.29 works fine and no problems.

Wine / Programs / Lazarus menu item is broken

Open browse to drive c and then open the lazarus folder and right click the
StartLazarus.exe file.

Build all with examples gives errors but without the examples does not give
errors.

Important Note to developers:

Please change the Build All menu option so that BEFORE the build all the
menu item Run / Program Reset Debugger.OnClick is called then the Build All
is called.

e.g.

Note: I have NOT looked at the code as that is not my job.

procedure NewBuildAll.OnClick(Sender: TObject);
begin
  ProgramResetDebugger.OnClick(sender);
  BuildAll.OnClick(sender);
end;

file:

Lazarus-0.9.29-28808-fpc-2.4.3-20101223-win32.exe

(warning: if I try to say this file to a cdrom then the filename is
truncated for Windows compatibility).

Open Location Downloads:

then select the above file and right mouse click and select properties and
permissions tab. Then tick the checkbox

[x] Allow executing file as program and click the [Close] button.

This is a trick you'll need to do for EVERY Windows(tm) .exe file... So take
note. After a while it will be second nature to do this.

I have WINE 1.3 installed which is the unstable new version. The stable
version is 1.3.

Now right mouse click on the file and click on:

Open With Wine Window Program Loader and click on it.

Wait about 3 seconds on my system and the install program opens with an
option for me to select my language and I picked English

'Next >' x 4 times

Additional icons
[x] Create a desktop icon and 'Next >'

Click on 'Install' and the installation proceeds.

(takes about 20 seconds)

then click on 'Finish' and the setup dialog closes.

Close the Downloads window (Linux Mint 10)

Desktop icon DOES correctly work and opens Lazarus for Windows

Menu 'Wine' > 'Lazarus' gives Error 'File not found'.

Menu 'Wine' > 'Browse C: drive' now shows 4 folders:

lazarus, Program Files, users, windows

lazarus folder contains 16 folders and 18 files.

It appears to be a good installation at initial inspection.

Select 'StartLazarus.exe' and Now right mouse click on the file and click
on:

Open With Wine Window Program Loader and click on it.

Lazarus now opens.

Help / About reports

Version #: 0.9.29
Date: 2010-12-23
FPC Version: 2.4.3
SVN Revision: 28808
i386-win32-win32/win64

Compile and run gives error:

Project1 project1 raised exception class 'External: SIGSEGV'
[OK]

Run / Reset Debugger

Tools / Configure "Build Lazarus"

Defines
[x] Debug
[x] Verbose

[Save Settings]

Tools / Build Lazarus with Profile Build All

Do you want to rebuld Lazarus with profile: Build All

[Yes]

Compiles and Builds without errors

Running the default empty project gives the same error

Project "project1" successfully built.

runtime error

Project1 project1 raised exception class 'External: SIGSEGV'
[OK]

Try again with [x] Examples ON

Error
Heap dump by heaptrc unit
1025279 memory blocks allocated : 134018729/136853672
1025279 memory blocks freed : 134018729/136853672
0 unfreed memory blocks : 0
True heap size : 1081344 (144 used in System startup)
True free heap : 1827632
Should be : 1081200

[OK]

Lazarus restarts

File > Close all editor files

open location > My computer and find my existing and tested lazarus projects
on my external NexStar Lite 250GB drive then I copied and pasted then into
my Computer / Home / Public / lazarus_source_code folder

Tools / Configure [ ] Examples (unchecked)

same error now

as earier. Memory heap error as above.


Code from win32object.inc

function TWin32WidgetSet.WinRegister: Boolean;
var
  WindowClass: WndClass;
  WindowClassW: WndClassW;
begin
  Assert(False, 'Trace:WinRegister - Start');
  if UnicodeEnabledOS then
  begin
with WindowClassW do
begin
  Style := CS_DBLCLKS;
  LPFnWndProc := @WindowProc;
  CbClsExtra := 0;
  CbWndExtra := 0;
  hInstance := System.HInstance;
  hIcon := Windows.LoadIcon(MainInstance, 'MAINICON');
  if hIcon = 0 then
   hIcon := Windows.LoadIcon(0, IDI_APPLICATION);
  hCursor := Windows.LoadCursor(0, IDC_ARROW);
  hbrBackground := 0;
  LPSzMenuName := nil;
  LPSzClassName := @Cl

[Lazarus] Installation of Lazarus 0.9.29 works fine and no problems (very long message!)

2010-12-23 Thread Peter E Williams
Merry Christmas 2010 !!!

Let's hope that this nails down this bug.

Summary:

Installation of Lazarus 0.9.29 works fine and no problems.

Wine / Programs / Lazarus menu item is broken

Open browse to drive c and then open the lazarus folder and right click the
StartLazarus.exe file.

Build all with examples gives errors but without the examples does not give
errors.

Important Note to developers:

Please change the Build All menu option so that BEFORE the build all the
menu item Run / Program Reset Debugger.OnClick is called then the Build All
is called.

e.g.

Note: I have NOT looked at the code as that is not my job.

procedure NewBuildAll.OnClick(Sender: TObject);
begin
  ProgramResetDebugger.OnClick(sender);
  BuildAll.OnClick(sender);
end;

file:

Lazarus-0.9.29-28808-fpc-2.4.3-20101223-win32.exe

(warning: if I try to say this file to a cdrom then the filename is
truncated for Windows compatibility).

Open Location Downloads:

then select the above file and right mouse click and select properties and
permissions tab. Then tick the checkbox

[x] Allow executing file as program and click the [Close] button.

This is a trick you'll need to do for EVERY Windows(tm) .exe file... So take
note. After a while it will be second nature to do this.

I have WINE 1.3 installed which is the unstable new version. The stable
version is 1.3.

Now right mouse click on the file and click on:

Open With Wine Window Program Loader and click on it.

Wait about 3 seconds on my system and the install program opens with an
option for me to select my language and I picked English

'Next >' x 4 times

Additional icons
[x] Create a desktop icon and 'Next >'

Click on 'Install' and the installation proceeds.

(takes about 20 seconds)

then click on 'Finish' and the setup dialog closes.

Close the Downloads window (Linux Mint 10)

Desktop icon DOES correctly work and opens Lazarus for Windows

Menu 'Wine' > 'Lazarus' gives Error 'File not found'.

Menu 'Wine' > 'Browse C: drive' now shows 4 folders:

lazarus, Program Files, users, windows

lazarus folder contains 16 folders and 18 files.

It appears to be a good installation at initial inspection.

Select 'StartLazarus.exe' and Now right mouse click on the file and click
on:

Open With Wine Window Program Loader and click on it.

Lazarus now opens.

Help / About reports

Version #: 0.9.29
Date: 2010-12-23
FPC Version: 2.4.3
SVN Revision: 28808
i386-win32-win32/win64

Compile and run gives error:

Project1 project1 raised exception class 'External: SIGSEGV'
[OK]

Run / Reset Debugger

Tools / Configure "Build Lazarus"

Defines
[x] Debug
[x] Verbose

[Save Settings]

Tools / Build Lazarus with Profile Build All

Do you want to rebuld Lazarus with profile: Build All

[Yes]

Compiles and Builds without errors

Running the default empty project gives the same error

Project "project1" successfully built.

runtime error

Project1 project1 raised exception class 'External: SIGSEGV'
[OK]

Try again with [x] Examples ON

Error
Heap dump by heaptrc unit
1025279 memory blocks allocated : 134018729/136853672
1025279 memory blocks freed : 134018729/136853672
0 unfreed memory blocks : 0
True heap size : 1081344 (144 used in System startup)
True free heap : 1827632
Should be : 1081200

[OK]

Lazarus restarts

File > Close all editor files

open location > My computer and find my existing and tested lazarus projects
on my external NexStar Lite 250GB drive then I copied and pasted then into
my Computer / Home / Public / lazarus_source_code folder

Tools / Configure [ ] Examples (unchecked)

same error now

as earier. Memory heap error as above.


Code from win32object.inc

function TWin32WidgetSet.WinRegister: Boolean;
var
  WindowClass: WndClass;
  WindowClassW: WndClassW;
begin
  Assert(False, 'Trace:WinRegister - Start');
  if UnicodeEnabledOS then
  begin
with WindowClassW do
begin
  Style := CS_DBLCLKS;
  LPFnWndProc := @WindowProc;
  CbClsExtra := 0;
  CbWndExtra := 0;
  hInstance := System.HInstance;
  hIcon := Windows.LoadIcon(MainInstance, 'MAINICON');
  if hIcon = 0 then
   hIcon := Windows.LoadIcon(0, IDI_APPLICATION);
  hCursor := Windows.LoadCursor(0, IDC_ARROW);
  hbrBackground := 0;
  LPSzMenuName := nil;
  LPSzClassName := @ClsNameW;
end;
Result := Windows.RegisterClassW(@WindowClassW) <> 0;
if Result then
begin
  with WindowClassW do
  begin
style := style or CS_SAVEBITS;
if WindowsVersion >= wvXP then
  style := style or CS_DROPSHADOW;
hIcon := 0;
hbrBackground := 0;
LPSzClassName := @ClsHintNameW;
  end;
  Result := Windows.RegisterClassW(@WindowClassW) <> 0;
end;
  end
  else begin
with WindowClass do
begin
  Style := CS_DBLCLKS{CS_HRedraw or CS_VRedraw};
  LPFnWndProc := @WindowProc;
  CbClsExtra := 0;
  CbWndExtra := 0;
  hInstance := System.HInstance;
  hIcon := Windows.LoadIcon(MainInstance, 'MAINICON')

Re: [Lazarus] Source Forge copy of lazarus is 0.9.28.0 not 0.9.28.2

2010-12-23 Thread Peter E Williams
ps - I sent this from my wrong gmail account.

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com
My free blog is: patientxmarksthespot.wordpress.com



On 19 December 2010 02:58, Peter E Williams wrote:

> Hi Graeme and All,
>
> see bottom post.
>
> On 19 December 2010 01:02, Graeme Geldenhuys wrote:
>
>> On 18 December 2010 14:18, Sven Barth 
>> wrote:
>> > With the new release of FPC out in the wild I now hope that the
>> developers
>> > will do a new release (0.9.30) in the near future :)
>>
>> For all intense purposes, that is only possible once Lazarus 0.9.29
>> actually becomes stable - currently it is far from that.
>>
>>
> I think that it would benefit everyone IF you could please define HOW and
> WHEN is a new trunk of lazarus deemed to be stable?
>
> What is the criteria for whether or not it is stable and a new stable
> release will be made?
>
> How far into the future does this look?
>
> Is the process of finding bugs and adding new features iterative and
> sometimes can be exponential?
>
> How far down this process does the team proceed before they attempt to
> freeze development for a new stable release?
>
> PEW
>
>
>>
>> --
>>
>> Regards,
>>   - Graeme -
>>
>>
>> ___
>> fpGUI - a cross-platform Free Pascal GUI toolkit
>> http://opensoft.homeip.net:8080/fpgui/
>>
>> --
>> ___
>> Lazarus mailing list
>> Lazarus@lists.lazarus.freepascal.org
>> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>>
>
> Fond Regards, Peter Eric WILLIAMS
> --- Hobart, Tasmania, Australia
> --- Phone: +61 (03) 6236-9675
> My free websites are:  http://pewink.info   (&)
>http://pewslinuxvault.googlepages.com
>
>
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How can I (or can this be done) cros s compiling a Lazarus project to other target OS´ s?

2010-12-23 Thread Peter E Williams
ps - I sent this from my wrong gmail account.

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com
My free blog is: patientxmarksthespot.wordpress.com



On 19 December 2010 20:53, Peter E Williams wrote:

> Hi All,
>
> Let's assume, for the sake of argument that I am using Lazarus 0.9.28.2
> with Linux Mandriva 2010.
>
> Now say also that I have a fully working Mandriva (2010 Spring edition OS
> with GNOME) application project in Lazarus.
>
> What is the step-by-step procedure for me to cross-compile to MS Windows XP
> or Macintosh or Mobile phones? Can this be done?
>
> If not, then I could always install the Lazarus 0.9.28.2 for Windows under
> Wine for Mandriva. I assume that that will work.
>
> PEW
>
> Fond Regards, Peter Eric WILLIAMS
> --- Hobart, Tasmania, Australia
> --- Phone: +61 (03) 6236-9675
> My free websites are:  http://pewink.info   (&)
>http://pewslinuxvault.googlepages.com
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Generating a RPM installation file for my lazarus binary file (Linux)

2010-12-23 Thread Peter E Williams
ps - I sent this from my wrong gmail account.

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com
My free blog is: patientxmarksthespot.wordpress.com



On 19 December 2010 20:56, Peter E Williams wrote:

> Hi All,
>
> How can I use a binary linux application created by lazarus and generate an
> RPM installation package for the file?
>
> I am using Mandriva 2010 Spring Edition (w. GNOME) and Lazarus 0.9.28.2
>
> PEW
>
> Fond Regards, Peter Eric WILLIAMS
> --- Hobart, Tasmania, Australia
> --- Phone: +61 (03) 6236-9675
> My free websites are:  http://pewink.info   (&)
>http://pewslinuxvault.googlepages.com
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Fwd: [OT] Merry Christmas and Happy New Year.

2010-12-23 Thread Peter E Williams
ps - I sent this from my wrong gmail account.


Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com
My free blog is: patientxmarksthespot.wordpress.com



-- Forwarded message --
From: Peter E Williams 
Date: 24 December 2010 11:57
Subject: Re: [Lazarus] [OT] Merry Christmas and Happy New Year.
To: Lazarus mailing list 


Hi Marcelo and all,

I would like to second that sentiment of Very Merry Christmas wishes and a
Happy New Year for 2010.

Most of you will probably remember me from my old email address of
foss.pascal.game.develo...@iinet.net.au (which I no longer check).

I currently subscribe to this lazarus and pascal list with
pew...@gmail.comand the lazarus only list with
piffle.the@iinet.net.au (which reflects the name I gave to my computer
installation at the time of testing Mandriva Linux 2010 Spring OS)

I have now settled with Mint Linux 10 (codename Julia). The site claims that
it is the 4th most popular OS behind Windows, Mac and Ubuntu Linux, in that
order.

I have currently installed Lazarus 0.9.28.2 0.ubuntu build (I think, because
in the about window the version string is truncated at the bu of the word
'build')

I am running Gnome (IIRC) and I would say that it is GTK2 widget set to
guess. How do I check this?

A blank project compiles ok without errors and runs fine.

Excellent work team!

Merry Christmas  :)))


Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com



On 24 December 2010 12:39, Marcelo B de Paula  wrote:

> Hi list,
>
> After a year of a lot of work to this wonder called Lazarus/FPC, i wish to
> send to all of you who supported and contributed to the project and, of
> course, to the Lazarus and FPC Team guys, who fighted bravely behind the
> frontline, a Very Merry Christmas and a Happy New year.
> In the hope that the year that come, be as productive that this one, and
> that the Team achive all its goals, and give us a more and more fantastic
> tool.
>
> Sincerely,
>
> Marcelo.
>
> PS: Forgive me by the bad accent :)
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Convert standard Lazarus application (Tforms and TButtons etc) into >>> a web application

2010-12-23 Thread Peter E Williams
Subject: Convert standard Lazarus application (Tforms and TButtons etc) into
>>> a web application

To: Lazarus email list 

Hi all,

Please excuse me if this is an obvious question.

I have an application called Adv_Player which I programmed in Delphi 7
Enterprise project and I have since converted it to a Lazarus 0.9.28.2
project. (It is a very stable and fully test application available for
Windows XP from my download page in a setup exe file).

Yes, I still have all the fully working original source code.

Now I want to convert it into a web based application. I know that Delphi 7
Enterprise can do this but I never got around to investigating HOW to go
about doing this.

The application has a Adv_Main : TForm and lots of TEdit's, TButton's and
TCheckbox'es and TRadioButton's and a few TGroupBox'es (or do I mean
TRadioGroup ?) and TFrame's and maybe a TSplitter.

The rest of the work is all done with my own code and reads and write some
text files with readln and writeln statements. These can be thought of as
comma separated value files.

Questions:
What do I need to do in order for my application (currently about 5-6
TForms) into a web based application? Another application has about 10-12
TForms in it.

How many of those components do I keep and what needs to be replaced and
with what equivalent components. E.g. what is the web based version of
TButton or TEdit etc?

How do I tell Lazarus that my binary file will be launched from within my
html code?

Can Lazarus do this?

Would I be correct in assuming that ShowMessage() would not work it was
hosted on a website?

I want to how it on my own website which is hosted by Hosted24.com with my
Silver membership payment plan.

I also have Dreamweaver 3, Studio MX (including Dreamweaver MX) and KompoZer
for Mint 10 and Wine 1.3.

Regards,
PEW

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] fpc-2.4.2-1.src.rpm (25 MB) contains the sources. -- the url link is dead.

2010-12-23 Thread Peter E Williams
Hi All,

I am still installing FPC then lazarus on my new Mandriva 2010 Spring
system.

I am not currently on the Free Pascal Compiler list. Could someone please
forward it on my behalf.

Thanks in advance.

On this page:

http://www.freepascal.org/down/i386/linux-ftp.freepascal.org.var#linuxbig
RPM (Redhat Package Manager) Packages: *Our RPM packages are compatible with
all RPM based distributions, including Red Hat, Fedora, SuSE, Mandriva.*

   - *Binary Packages*
   - 
fpc-2.4.2-1.i686.rpm(26
MB) contains the compiler, utils, RTL and all units.
   - 
fpc-docs-2.4.2-1.i686.rpm(6.7
MB) contains the documentation.
   - *Source Packages*
   - 
fpc-2.4.2-1.src.rpm(25
MB) contains the sources.

fpc-2.4.2-1-src.rpm is a dead link ! (opens a blank page).

PEW

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.org   (&)
   http://pewslinuxvault.googlepages.com
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Convert standard Lazarus application (Tforms and TButtons etc) into >>> a web application

2010-12-23 Thread Peter E Williams
Hi all,

Please excuse me if this is an obvious question.

I have an application called Adv_Player which I programmed in Delphi 7
Enterprise project and I have since converted it to a Lazarus 0.9.28.2
project. (It is a very stable and fully test application available for
Windows XP from my download page in a setup exe file).

Yes, I still have all the fully working original source code.

Now I want to convert it into a web based application. I know that Delphi 7
Enterprise can do this but I never got around to investigating HOW to go
about doing this.

The application has a Adv_Main : TForm and lots of TEdit's, TButton's and
TCheckbox'es and TRadioButton's and a few TGroupBox'es (or do I mean
TRadioGroup ?) and TFrame's and maybe a TSplitter.

The rest of the work is all done with my own code and reads and write some
text files with readln and writeln statements. These can be thought of as
comma separated value files.

Questions:
What do I need to do in order for my application (currently about 5-6
TForms) into a web based application? Another application has about 10-12
TForms in it.

How many of those components do I keep and what needs to be replaced and
with what equivalent components. E.g. what is the web based version of
TButton or TEdit etc?

How do I tell Lazarus that my binary file will be launched from within my
html code?

Can Lazarus do this?

Would I be correct in assuming that ShowMessage() would not work it was
hosted on a website?

I want to how it on my own website which is hosted by Hosted24.com with my
Silver membership payment plan.

I also have Dreamweaver 3, Studio MX (including Dreamweaver MX) and KompoZer
for Mint 10 and Wine 1.3.

Regards,
PEW

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Generating a RPM installation file for my lazarus binary file (Linux)

2010-12-19 Thread Peter E Williams
Hi All,

How can I use a binary linux application created by lazarus and generate an
RPM installation package for the file?

I am using Mandriva 2010 Spring Edition (w. GNOME) and Lazarus 0.9.28.2

PEW

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] How can I (or can this be done) cros s compiling a Lazarus project to other target OS´ s?

2010-12-19 Thread Peter E Williams
Hi All,

Let's assume, for the sake of argument that I am using Lazarus 0.9.28.2 with
Linux Mandriva 2010.

Now say also that I have a fully working Mandriva (2010 Spring edition OS
with GNOME) application project in Lazarus.

What is the step-by-step procedure for me to cross-compile to MS Windows XP
or Macintosh or Mobile phones? Can this be done?

If not, then I could always install the Lazarus 0.9.28.2 for Windows under
Wine for Mandriva. I assume that that will work.

PEW

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Source Forge copy of lazarus is 0.9.28.0 not 0.9.28.2

2010-12-18 Thread Peter E Williams
Hi Graeme and All,

see bottom post.

On 19 December 2010 01:02, Graeme Geldenhuys wrote:

> On 18 December 2010 14:18, Sven Barth  wrote:
> > With the new release of FPC out in the wild I now hope that the
> developers
> > will do a new release (0.9.30) in the near future :)
>
> For all intense purposes, that is only possible once Lazarus 0.9.29
> actually becomes stable - currently it is far from that.
>
>
I think that it would benefit everyone IF you could please define HOW and
WHEN is a new trunk of lazarus deemed to be stable?

What is the criteria for whether or not it is stable and a new stable
release will be made?

How far into the future does this look?

Is the process of finding bugs and adding new features iterative and
sometimes can be exponential?

How far down this process does the team proceed before they attempt to
freeze development for a new stable release?

PEW


>
> --
> Regards,
>   - Graeme -
>
>
> ___
> fpGUI - a cross-platform Free Pascal GUI toolkit
> http://opensoft.homeip.net:8080/fpgui/
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] An untested version of TRichmemo 1.1.2.pew is available -- I have lost interest in it.

2010-09-11 Thread Peter E Williams
Hi,

(sorry, this message is very long) WITH THANKS TO DMITRY and Team!!!

-- unfortunately I have not much of a sense of humour today. I think I
have too many women on my mind ?!?:) :(. I am a single man looking for
love and sex... At the moment I am crying and I have my stereo playing
my favourite music ["Garbage : Beautiful Garbage" -- Australian
Rock'N'Roll ]. (I wrote this paragraph AFTER the following). 

TRichmemo 1.1.2.pew compiles okay with Lazarus 0.9.28 (Linux Ubuntu
10.04) but has an error when you place it on a new form. Something about
error creating image when placing it on the form. Not working!!! I
installed 0.9.29.2 a week ago and I have not updated it since. 

I am NOT a full time developer. Yes, I do know some Pascal, Delphi and
Lazarus... and some other languages. You could say Pascal is my
favourite language.

dmitry contacted me last week by email about the version of TRichMemo
component I was working on. The progress I have made so far is:

I worked on it a week ago. I have not worked on it since. dmitry asked
me how I was going with and I said that I would try to have it ready by
last Friday (2 days ago). Friday has come and gone and I will be honest
am say that I have not been really interested in it. 

(from http://pewink.info )
Lazarus page
(currently one TRichMemo 1.1.2.pew -- a work-in-progress)
Here you will find a few Lazarus unofficial components which I am
working on
on the Lazarus page
(there is a dragon on the page for no other reason than because he is
cute!)

Apologies to dmitry. I love the lazarus team and admire your dedication.
It is also difficult for me to grasp the concepts of why 0.9.28 is
stable and there exists a much more developed 0.9.29.??? version
available which is popular but unstable. I have only the rudimentary and
basic understanding of subversion... well actually let me rephrase
that... I think I know *how* it works but I have not learnt the commands
etc. 

My email addy is foss.game.pascal.develo...@iinet.net.au -- and this is
somewhat misleading :-))) I am actually a part-time hobby developer with
a dozen or so programs written several years back in Delphi 3 and 5. I
am very proud of my skills ... such as they are.

I am created some simple games with Delphi 5 years ago and I wanted to
port them over to Lazarus (whatever is the best version)... My issues
are these:

a) I am honestly not fully committed to being a full time programmer. My
training is as a technical draftsman with CAD experience and basic web
design, html and some database work (but not a lot of SQL). Delphi was
one of my hobbies.

b) I would be much happier if I could form some kind of casual network
of friends to help me develop, test and release my lazarus projects. I
actually don't really know many people who have volunteered their time
to help me test my ported programs (mainly games). This leads to (a) --
even less interest in being a one-man-show.

c) There are far too many licence 'agreements' or whatever... I am very
confused about which one I would release my code with. I want to release
my source code for the public to use to show my appreciation for the
help I have received.

Those interested in my web design skills will find my main personal
website here:

http://pewink.info (It use to be pewink.org but I mixed up the
redirection settings so I purchased a new domain.)

Scroll down to Lazarus, Delphi and Kylix page. Lazarus code is NOT
present ... it is PLANNED for the future... when I cannot tell you. I
have dozens of working Lazarus projects and I still cogitating
(=thinking) about how I will go about this.

In case you are wondering... my pewink.info page is very big and
contains almost everything I could think of which I can include. I have
poetry by myself and other poets, lots of personal images and some free
true type fonts and programs by me without source code.

Most people who visit my website congratulate me on a job well done.
That is rewarding... but I need some fellow users and coders who are
willing to help me develop open source games. I can do most of it myself
but I am losing interest at times. See (a) -- it can be disheartening at
times.

One final note: I have Schizophrenia and I regularly take medication.
This works well. It is Spring time here in Hobart, Australia and I
trying to meet some ladies via the Internet. Women are confusing at the
best of times and exciting at the rest of times. :-)))

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM

(I may cancel www.pews-freeware-games.org -- lost interest.


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


[Lazarus] How do I get the default path and filename for the user's HTML browser???

2010-09-07 Thread Peter E Williams
Hi All, 

I am writing a procedure called OpenHTMLFile. It works fine with
HTML_Browser_file (which is the command to run) set to 'firefox' on my
Linux Ubuntu 10.04 system.

My question is this... what do I need to change to make
HTML_Browser_file default to the default application (path and filename)
to open a html file e.g. I want it to be the path and application
filename of ANY computer's HTML browser. I assume that in this day of
modern computing that it would be safe to assume that the user has some
kind of html browsing software whether it be: Firefox, Chrome, Internet
Explorer, or whatever it is that Macs use ... sorry for my ignorance,
but I am not a Mac user, so I am no up with the latest browser for Macs.

I want to do this: 
Proc.CommandLine := HTML_Browser_file;
// e.g. it will now be 'firefox'
if Proc.CommandLine is a valid application then
  Proc.CommandLine := Whatever_is_the_default_HTML_Browser;

>From Memo1 after run of project1 and call to Button1Click:
File HTML_2_Open "test1.html" does not exists. Opening browser with
blank filename.
Process.CommandLine is: "firefox"

uses Process;
[...]

procedure TForm1.OpenHTMLFile(HTML_Browser_file, HTML_2_Open : String);
var
  x : integer;
  Proc : TProcess;
  S : String;
  I : integer;
begin
  { // this code not used!!!
  S := Application.ExeName;
  // hack for Mac
  I := Pos('.app/Contents/MacOS/', S);
  if (I > 0) then
S := Copy(S,1, I+3);
  }

  Proc := TProcess.Create(nil);
  try
// Proc.CommandLine := '/Applications/MyApp.app';
Proc.CommandLine := HTML_Browser_file;
if not fileExists( HTML_2_Open ) then
begin
  memo1.lines.add( 'File HTML_2_Open "' + HTML_2_Open + '" does not
exists. Opening browser with blank filename.' );
  HTML_2_Open := '';
end
else
  Proc.CommandLine := Proc.CommandLine + ' ' + HTML_2_Open;
memo1.lines.add( 'Process.CommandLine is: "' + Proc.CommandLine +
'"');
PRoc.Options := Proc.Options + [poWaitOnExit];
Proc.CommandLine := Proc.CommandLine;
PRoc.Execute;
  finally
Proc.free;
  end;
end; { OpenHTMLFile }
{-}

procedure TForm1.Button1Click(Sender: TObject);
const
  Default_HTML_Browser_file = 'firefox';
var
  HTML_Browser_file, HTML_2_Open : String;
begin
  HTML_Browser_file := Default_HTML_Browser_file;
  HTML_2_Open := 'test1.html';
  OpenHTMLFile(HTML_Browser_file, HTML_2_Open);
end;

Best Regards,
PEW
Hobart, Tasmania, Australia

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


Re: [Lazarus] Subversion newbie questions. How to create repositories for my alpha and beta versions of my projects?

2010-09-06 Thread Peter E Williams
Hi Felipe and All,

On Mon, 2010-09-06 at 10:54 +0200, Felipe Monteiro de Carvalho wrote:
> On Mon, Sep 6, 2010 at 10:23 AM, Peter E Williams
>  wrote:
> > How can I use subversion to create an Internet repository for my code,
> > which is public domain but still copyright to me?
> 
> you probably meant "publicly available" and not "public domain". See
> http://en.wikipedia.org/wiki/Public_Domain
> 

Yes. And also my program projects are now Open Source [and have been for
a good number of years!!!]. However, I have not yet included a licence
agreement but I would pick the same one which Lazarus uses. Before the
term 'open source' became popular I wrote my programs as freeware with
the source code as public domain freeware (I am probably mixing my terms
here, but you get the idea).

http://en.wikipedia.org/wiki/Open_source_software

> I generally use assembla for getting a SVN for proprietary code:
> https://www.assembla.com/
> 
> It is free for publicly available code and payed for closed
> repositories, but very cheap.

I have a very small budget and I am tight with it [money]. :-))) At
least I am being honest about this. *SMILE*

> Source forge is very good, but accepts only free software.

I *may* decide to use Source forge since my projects are all free.
Currently I simply have a download page on my website where people can
download either the source code or the compiled apps as a zip file. In
the case of the compiled apps, I provide them currently as a setup.exe
(in a zip file) for Windows (only) and this was created by the setup
creator with either Delphi 5 or 7. I will need to investigate an
equivalent cross-platform utility for my Lazarus apps which I want to
make available in multiple OS platforms. Testing this, of course, is a
lot of work and I don't have the resources nor desire to purchase
Windows computers or Macs simply to test my software.

> I don't know the terms of google code.

Google pages is a free website creator which allows for the creation of
google websites. At the moment that's all I need. I have not
investigated google code... although I am aware of it's existence. :-)))
That's something else I will need to look into. I wonder what licensing
agreements they support. Probably all of them ... but then again maybe
they support some kind of google code license. Does anyone know???

The great thing about google pages is that they give you massive amounts
of storage ... so that is almost never a problem. Certainly it has never
been a problem for me, but then my websites don't store media which
requires much storage e.g. no digitised media like video or sound or 3D
graphics etc. My games are very simple as use very little graphics and
sounds. What sound effects there are are normally very low-tech. :-)))
I'm a pretty low-tech kind of guy! :-)))

Best Regards,
PEW
Hobart, Tasmania, Australia

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


[Lazarus] Subversion newbie questions. How to create repositories for my alpha and beta versions of my projects?

2010-09-06 Thread Peter E Williams
Hi All,

I am a newbie subversion user and yesterday I install subversion and
installed Lazarus 0.9.29.2 into ~/laztrunk on both my desktop and laptop
computers (both linux Ubuntu 10.04).

The latest version of all my source code is on my desktop in this
folder:

~/Public/My_code/lazarus_source/pewink/

(currently 614 MB !!! ... including many compiled exe files)

... but not on my laptop. I can connect my laptop to my desktop via an
ethernet cable to my ADSL modem but I have not done this before to
transfer files. The modem is also my wireless modem for my laptop.

How can I use subversion to create an Internet repository for my code,
which is public domain but still copyright to me? I want to release
official public versions of my alpha code for testing as beta versions
and then zip them up as official beta versions on my website. I have no
problems zipping the code and publishing it on my website. My questions
are:

(1) What is the process for me to create a repository for my code (alpha
versions) for my own use and also people who I allow to collaborate with
me on my lazarus projects?

(2) How do I migrate from my alpha versions to tested beta versions?

(3) How do I then make the stable beta versions available on my website?
It is a googlepages website. http://pewink.info I assume that I would
need to create a directory for the base of my projects, but this is
simple IIRC.

(4) Someone please suggest suitable commands in subversion to use and
directory structure suitable for my alpha and beta versions of my
project, which are currently in the following folders:

~/Public/My_code/lazarus_source/pewink/project_name/version_number

where project_name = xyz_program etc and there are lots of folders for
each of my apps.

where version_number = 0.1 etc and there are lots of version_number
folders with latest copies of all project files.

Best Regards,
PEW
Hobart, Tasmania, Australia
-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


Re: [Lazarus] Something is wrong with Lazarus-other list ... does NOT link to Thread, Author, Subject & Date pages nor send digest.

2010-09-05 Thread Peter E Williams
Hi Vincent,

On Sun, 2010-09-05 at 22:26 +0200, Vincent Snijders wrote:
> 2010/9/5 Peter E Williams :
> > Hi All,
> >
> > I posted the follow email to lazarus-ot...@lists.lazarus.freepascal.org
> > about 5 hours ago and list seems to not be working! Lazarus-other list
> > URL does NOT link to Thread, Author, Subject, Date pages.
> >

This page:

> > [1] http://lists.lazarus.freepascal.org/pipermail/lazarus-other/
> >
> I cannot see anything wrong with these pages.
> 

Has this content:
The Lazarus-other Archives 
You can get more information about this list. 

Archive
View by:
Downloadable version
July 2010:
[ Thread ] [ Subject ]
[ Author ] [ Date ] 
[ Gzip'd Text 3 KB ]

As you can see there are no archives for August or September 2010. In
September there is one message by myself. See these pages:

http://lists.lazarus.freepascal.org/pipermail/lazarus-other/2010-September/thread.html

http://lists.lazarus.freepascal.org/pipermail/lazarus-other/2010-September/subject.html

http://lists.lazarus.freepascal.org/pipermail/lazarus-other/2010-September/author.html

http://lists.lazarus.freepascal.org/pipermail/lazarus-other/2010-September/date.html

[...]

> > Also, I never received my digest for the Lazarus-other list. Something
> > is broken!
> 
> A digest is not sent immediately, so you may have to wait 24 hours for it.
> 
> Vincent

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


[Lazarus] Something is wrong with Lazarus-other list ... does NOT link to Thread, Author, Subject & Date pages nor send digest.

2010-09-05 Thread Peter E Williams
Hi All,

I posted the follow email to lazarus-ot...@lists.lazarus.freepascal.org
about 5 hours ago and list seems to not be working! Lazarus-other list
URL does NOT link to Thread, Author, Subject, Date pages.

[1] http://lists.lazarus.freepascal.org/pipermail/lazarus-other/

points me to:

http://lists.lazarus.freepascal.org/pipermail/lazarus-other/2010-July/thread.html

but 
http://lists.lazarus.freepascal.org/pipermail/lazarus-other/2010-September/thread.html
and the Author, Date and Subject page links are missing from the above
URL [1].

Also, I never received my digest for the Lazarus-other list. Something
is broken!

Best Regards,
PEW
Hobart, Tasmania, Australia

Subject: Subversion newbie questions. How to create repositories for my
 alpha and beta versions of my projects?
From: Peter E Williams 
Reply-To: foss.game.pascal.develo...@iinet.net.au
To: "Mailing List lazarus-other Lists.lazarus.freepascal.org"

Content-Type: text/plain; charset="UTF-8"
Organization: pewink.info HQ
Message-ID: <1283688108.3058.73.ca...@pewink-desktop>
Mime-Version: 1.0
X-Mailer: Evolution 2.28.3 
Content-Transfer-Encoding: 7bit
Date: Sun, 05 Sep 2010 22:01:49 +1000

[...]
-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)
-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


Re: [Lazarus] Sample code needed to create form at runtime only (see mock up below).

2010-09-05 Thread Peter E Williams
Hi Alberto and All,

On Sun, 2010-09-05 at 22:24 +0300, Alberto Narduzzi wrote:
> > I would guess something like:
> > { this code is all untested and typed straight into my email client }
> > 
> > procedure create_formA( 
> >   Image_filename : string; StringList1 : TStringList );
> > var
> >   FormA : TForm;
> > (...)
> 
> wouldn't it be better to define the form within the IDE, with all of its 
> components; then exclude it from the autocreate forms list (remove also 
> the Var Form1: TForm1 from the unit if you like...) and finally 
> create/free an instance of it whenever needed, like:

Yes, it would be easier IFF (= IF and only IF) I understood how
TSplitter, and 2 x TPanels worked when designing forms at design time
(e.g. with the IDE). I don't understand and I find it confusing!!!
That's why I want to add it using code at runtime instead.

Can't I just create my form on the fly and not use autocreate???

> you'll have already:
> Type TFormA: Class(TForm)
> blablabla
> 
> 
> then you do
> 
> procedure create_formA(Image_filename :string; StringList1: TStringList);
> var
>FormA : TFormA;
>success_modal_result : boolean;
> begin
>try
>  FormA := TFormA.Create; // Are there any parameters here
>  FormA.Memo1.Strings := StringList1.Strings;
>  if FileExists ( Image_filename ) then
>  begin
>FormA.Image1.Filename := Image_filename;
>FormA.Image1.LoadFromFile( Image_filename );
>success_modal_result := (formA.showmodal = mrOK);
>  end
>  else
>showmessage(format('Error: Image filename %s Cannot be loaded 
> because it does not exist.', [Image_filename]);
>finally
>  FreeAndNil(FormA);
>end;
> end;
> 
> 
> Just my 2c, I would do so...
> 
> Cheers, A.
> 

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


Re: [Lazarus] Sample code needed to create form at runtime only (see mock up below).

2010-09-05 Thread Peter E Williams
Hi Felipe and All,

On Sun, 2010-09-05 at 07:01 +0200, Felipe Monteiro de Carvalho wrote:
> On Sun, Sep 5, 2010 at 6:39 AM, Peter E Williams
>  wrote:
> > Questions:
> > 1) Does the Memo1, OK_Button and Cancel TButton need to be in a
> > TGroupBox???
> > 2) Also, should the TImage be in a TGroupBox???
> 
> I think that to use the splitter you need to group the elements using
> a panel. I vaguely remember that if you have something like:
> 
> Panel 1 - Splitter - Panel 2

My question is:
How do I create a TForm and TSplitter and 2 x TPanel's at runtime?!?

I would guess something like:
{ this code is all untested and typed straight into my email client }

procedure create_formA( 
  Image_filename : string; StringList1 : TStringList );
var
  FormA : TForm;
  Splitter1 : TSplitter;
  Panel1, Panel2 : TPanel;
  success_modal_result : boolean;
  OK_button, Cancel_button : TButton;
  Image1 : TImage;
begin
  FormA := TForm.Create; // Are there any parameters here

  try
FormA.caption := 'Image and Comments for ' + Image_filename;

Splitter1 := TSplitter.Create( FormA );
Splitter1.Parent := FormA;
Splitter1.Visible := True;
Splitter1.Align := alRight;
// do I need to set any other properties like Height, Width, Top,
Left ???

Panel1 := TPanel.Create( FormA );
Panel1.Parent := FormA;
Panel1.Visible := True;
Panel1.Align := alClient;

Memo1 := TMemo.Create( FormA );
Memo1.Parent := Panel1;
Memo1.Visible := True; 

Memo1.Align := ?
// do I need to set any other properties like Height, Width, Top,
Left ???

// will this work 

Memo1.Strings := StringList1.Strings;

OK_Button := TButton.Create( FormA );
OK_Button.Parent := FormA;
OK_Button.Visible := True;
OK_Button.ModalResult := mrOK;

OK_Button.Align := 
// do I need to set any other properties like Height, Width, Top,
Left ???

Cancel_Button := TButton.Create( FormA );
Cancel_Button.Parent := FormA;
Cancel_Button.Visible := True;
Cancel_Button.ModalResult := mrCancel;

Cancel_Button.Align := ??
// do I need to set any other properties like Height, Width, Top,
Left ???

Panel2 := TPanel.Create( FormA );
Panel2.Parent := FormA;
Panel2.Visible := True;
Panel2.Align := alRight;

Image1 := TImage.Create( FormA );
Image1.Parent := Panel2;
Image1.Visible := True;

Image1.Align := ??
// do I need to set any other properties like Height, Width, Top,
Left ???

// will this work 

if FileExists ( Image_filename ) then
begin
  Image1.Filename := Image_filename;
  Image1.LoadFromFile( Image_filename );
end
else
  showmessage( 'Error: Image filename "+ Image_filename + '" Cannot
be loaded because it does not exist.'); 

// Showmodal the form!!!
success_modal_result := (formA.showmodal = mrOK);
  finally
FormA.free; // free the form
// all the other components will automatically be freed because 
// they were created with FormA as their create parameter.
  end;
end;

I would appreciate it if anyone could be fill in the Align statement
question marks and comment on the code below the comments "will this
work ".

> Then Panel 1 should have Align=alClient, Splitter.Align = alRight,
> Panel2.Align = alRight
> 
> Yes, a group box would probably do it as well, but the panel is just
> as good and can be configured to have no borders and the user won't
> note he is in the form.

Best Regards,
PEW
Hobart, Tasmania, Australia

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


[Lazarus] Sample code needed to create form at runtime only (see mock up below).

2010-09-04 Thread Peter E Williams
Hi All,

This is a rough mock-up of a TForm that I need to create at runtime
only.

+--+
| Form caption |
+--+
|+--+S+---+|
||  |P|   ||
||  |L|   ||
||   Memo1  |I|   ||
||   (TMemo)|T|Image1 ||
||  |T|(TImage)   ||
||  |E|   ||
||  |R|   ||
||  |||   ||
|+--+||   ||
|++++||   ||
||  OK|| Cancel |||   ||
|++++|+---+|
++-+

It contains a TSplitter (??? I have never used one of these before)
vertically down the middle of the form.

On the left of the TSplitter there is a TMemo and below it 2 TButtons:
OK_button (with modal result of mrOK), and Cancel_button (with a modal
result of mrCancel). To the right of the the TSplitter I want a TImage.

I need some sample code to create this at runtime only. 

Questions: 
1) Does the Memo1, OK_Button and Cancel TButton need to be in a
TGroupBox??? 
2) Also, should the TImage be in a TGroupBox???

Note: The Image1 will be loaded with an image passed as Image_filename
(string). It may be: JPEG, GIF or PNG and the size (width and height)
will vary... so you will need to read that from the file. Is this
possible and are these image formats supported by Timage?

The idea of this form is that the user can resize the form and the TMemo
and TImage will dynamically resize as the user adjusts the form's size
properties.

Best Regards,
PEW
Hobart, Tasmania, Australia

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


Re: [Lazarus] RichMemo 1.0.0 is broken. "Error moving component" error when creating component at design time.

2010-09-04 Thread Peter E Williams
Hi Dmitry,

On Sat, 2010-09-04 at 17:59 +, dmitry boyarintsev wrote: 
> On Sat, Sep 4, 2010 at 5:26 PM, Peter E Williams
>  wrote:
> > Okay... I tried that version and it did not even compile. I have made
> > all the changes necessary to make it compile and it is not much of an
> > improvement. I have made my version (not working) available here:
> >
> > https://sites.google.com/site/pewtas/lazarus_code
> >
> > as RichMemo.1.1.2.pew.zip (not sure of what version number the one I
> > worked on was) 406 KB.
> >
> > I will be interested if someone can make some changes to get it working.
> >
> > I hope that it is not too much work for someone. I am not very used to
> > creating components! :-)))
> 
> What exactly doesn't work you?

The error is almost exactly as I described before.

> If I attempt to add a new RichMemo to a form (at design time) then I
> get
> an "Error moving component" error and the code for the RichMemo is NOT
> created inside the form's unit. Note that the RichMemo does appear on
> the form but it cannot be selected (except with the Object Inspector).
> 
> Error moving component
> Error moving component RichMemo1:TRichMemo

The only different is that this time if I try to add a new RichMemo at
design time, this time it will generate the above error then NOT place
the component on the form. Before it placed the component on the form
but not the code in the unit.

> 
> thanks,
> dmitry

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)



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


Re: [Lazarus] RichMemo 1.0.0 is broken. "Error moving component" error when creating component at design time.

2010-09-04 Thread Peter E Williams
Hi Juha and All,

On Sat, 4 Sep 2010 15:36:32 +0300 "Juha Manninen (gmail)"
 wrote:

> Hi
> 
> If you are using the "official" 0.9.28 version of Lazarus then I recommend 
> the 
> trunk version, 0.9.29. It has many improvements.
> 
> Juha
> 

Okay... I tried that version and it did not even compile. I have made
all the changes necessary to make it compile and it is not much of an
improvement. I have made my version (not working) available here:

https://sites.google.com/site/pewtas/lazarus_code

as RichMemo.1.1.2.pew.zip (not sure of what version number the one I
worked on was) 406 KB.

I will be interested if someone can make some changes to get it working.

I hope that it is not too much work for someone. I am not very used to
creating components! :-)))

I would love to test a new version of this component!!! :-)))

Best Regards,
PEW
Hobart, Tasmania, Australia

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


[Lazarus] RichMemo 1.0.0 is broken. "Error moving component" error when creating component at design time.

2010-09-04 Thread Peter E Williams
Hi All,

I am trying to use RichMemo 1.0.0 from Lazarus Code and Component
Repository [1]. It installs in the "Common Controls" component tab and
it is badly broken!!!

If I attempt to add a new RichMemo to a form (at design time) then I get
an "Error moving component" error and the code for the RichMemo is NOT
created inside the form's unit. Note that the RichMemo does appear on
the form but it cannot be selected (except with the Object Inspector).

Error moving component
Error moving component RichMemo1:TRichMemo

Has anyone had any luck with this component?!? I assume that since it is
at version 1.0.0 and there is a sample project that someone must had
some success at some point with it.

The form1.lfm in the samples folder contains the follow field:

  LCLVersion = '0.9.27'

So that would indicate that version 1.0.0 of TRichMemo was developed
with this version of Lazarus. Does anyone know who worked/s on this
component??? (Dated 22 June 2009)

Would someone please have a look at it and see it they can make it
work??? ... as a new version, obviously. I would be happy to test the
next version of it. :-)))

[1] http://sourceforge.net/projects/lazarus-ccr/files/

Sample new tform with TRichMemo added. Unit1.pas does NOT contain the
code for the creation of the TRichMemo nor the uses RichMemo statement.

object Form1: TForm1
  Left = 290
  Height = 300
  Top = 215
  Width = 400
  Caption = 'Form1'
  ClientHeight = 300
  ClientWidth = 400
  LCLVersion = '0.9.28.2'
  object RichMemo1: TRichMemo
Left = 240
Height = 90
Top = 62
Width = 150
HideSelection = False
Lines.Strings = (
  'RichMemo1'
)
TabOrder = 0
  end
end

Best Regards,
PEW
Hobart, Tasmania, Australia

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


Re: [Lazarus] How do I do a Perform(EM_LINESCROLL, ?, ?) to scroll to the bottom of a Tmemo.

2010-09-03 Thread Peter E Williams
Hi All,

On Fri, 2010-09-03 at 06:57 +1000, Peter E Williams wrote:
> Hi All,
> 
> I am porting some code from Delphi to lazarus and I needed to change a
> Trichedit to a Tmemo. Now the code 
> 

This microsoft page:
http://msdn.microsoft.com/en-us/library/bb761615%28VS.85%29.aspx

gives the details of how it works for TRichEdits under MS Windows. All I
am trying to do is add this functionality to TMemo under Lazarus. Can
someone please help me with some code to do this?!?

// originally with RichEdit1 do
>   with Memo2 do
> Perform(EM_LINESCROLL, 0, Memo_lines_added);
> 
> does not work. It is supposed to scroll the TMemo to the bottom of the
> window. I tried to use TRichView but it won't even display lines e.g.
> Richview1.lines.add( 'hello' ) does not work!!!
> 
> var 
>   Memo_lines.added : integer;
> 
> procedure Tform2.SnipMemoText(var Memo2 : tMemo; MaxSize : integer);
// originally var RichEdit2 : TRichEdit   
> var
>   i : integer;
> begin
>   // make it faster with BeginUpdate / EndUpdate {delete excess lines}
>   Memo2.Lines.BeginUpdate;
>   for i := 0 to Memo2.Lines.Count - MaxSize - 1 do
> Memo2.Lines.Delete(0);
>   Memo2.Lines.EndUpDate;
> 
>   with Memo2 do
> Perform(EM_LINESCROLL, 0, Memo_lines_added);
> 
>   Memo_lines_added := 0;
> end; { SnipMemoText }
> 

Best Regards,
PEW
Hobart, Tasmania, Australia

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


Re: [Lazarus] Errors installing ACS 2.2 Sound component (ACS_Classes.pas)

2010-09-03 Thread Peter E Williams
Hi,

On Fri, 2010-09-03 at 13:16 -0700, Bihar Anwar wrote:
> Try ACS v2.4 svn version. I'd done it before with a success. Yes, it cannot 
> be 
> compiled before my trivial fixes to the ACS source, but I forgot what fixes 
> I'd 
> done at the time. Just to tell you my experience, ACS preloading and stopping 
> time is very slow.
> 
> However, I've ever saw Graeme start a discussion with a topic "playsound..." 
> or 
> "play music ..." or something like that, maybe that helps.
> 

I went to this page:
http://wiki.lazarus.freepascal.org/ACS#Download

but all I could find was links to individual files. Isn't there
somewhere where I can download the ENTIRE archive of it, instead of each
bloody individual file!?!?!?!? I would appreciate a link to it.

Best Regards,
PEW
Hobart, Tasmania, Australia

- Original Message 
> From: Peter E Williams 
> To: "lazarus Mailing List lists.lazarus.freepascal.org 
> lazarus@lists.lazarus.freepascal.org" 
> Sent: Sat, September 4, 2010 2:35:06 AM
> Subject: [Lazarus] Errors installing ACS 2.2 Sound component (ACS_Classes.pas)
> 
> Hi All,
> 
> I am trying to port ACS 2.2 component [1] and I am not able to install
> it. See errors_installing.txt. I am using Linux Ubuntu 10.04.
> 
> [1] http://www.mtu-net.ru/aborovsky/acs/downloads.htm
> 
> Note that I basically want to do something like:
> 
> uses
>   ACS_Classes;
> 
> var
>   user_wants_sounds : boolean;
>   ACSOutput1 : TACSOutput;
>   Tone, Msec : integer;
> [...]
> if user_wants_sounds then
> begin
>   ACSOutput1 := TACSOutput.create( self );
>   try
> // generate Tone Sound frequency (Hertz) for Msec milliseconds 
> // how do I do this ???
> ACSOutput1.Run;
>   finally
> ACSOutput1.Destroy;
>   end;
> end;
> 
> Best Regards,
> Peter E Williams
> Hobart, Tasmania, Australia

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


[Lazarus] Errors installing ACS 2.2 Sound component (ACS_Classes.pas)

2010-09-03 Thread Peter E Williams
Hi All,

I am trying to port ACS 2.2 component [1] and I am not able to install
it. See errors_installing.txt. I am using Linux Ubuntu 10.04.

[1] http://www.mtu-net.ru/aborovsky/acs/downloads.htm

Note that I basically want to do something like:

uses
  ACS_Classes;

var
  user_wants_sounds : boolean;
  ACSOutput1 : TACSOutput;
  Tone, Msec : integer;
[...]
if user_wants_sounds then
begin
  ACSOutput1 := TACSOutput.create( self );
  try
// generate Tone Sound frequency (Hertz) for Msec milliseconds 
// how do I do this ???
ACSOutput1.Run;
  finally
ACSOutput1.Destroy;
  end;
end;

Best Regards,
Peter E Williams
Hobart, Tasmania, Australia
-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)

(*
  This file is a part of Audio Components Suite v 2.2,
  Copyright (c) 2002, 2003 Andrei Borovsky. All rights reserved.
  See the LICENSE file for more details.
  You can contact me at aborov...@mtu-net.ru
*)

unit ACS_Classes;

interface

uses

{$IFDEF WIN32}
  Windows,
{$ENDIF}
  Classes, SysUtils;

type

  TOutputStatus = (tosPlaying, tosPaused, tosIdle);

  TFileOutputMode = (foRewrite = 0, foAppend);

  TOutputFunc = function(Abort : Boolean):Boolean of object;

  TThreadDoneEvent = procedure of object;

  TThreadExceptionEvent = procedure(Sender : TComponent; E : Exception) of object;

  THandleThreadException = procedure(E : Exception) of object;

  TOutputDoneEvent = procedure(Sender : TComponent) of object;

  TOutputProgressEvent = procedure(Sender : TComponent) of object;

{$IFDEF LINUX}
// File access mask constants
const

  famUserRead = 64;
  famUserWrite = 128;
  famGroupRead = 8;
  famGroupWrite = 16;
  famOthersRead = 1;
  famOthersWrite = 2;

{$ENDIF}

type

  EACSException = class(Exception)
  end;

  TACSThread = class(TThread)
  public
bSuspend, Terminating : Boolean;
DoOutput : TOutputFunc;
Stop : Boolean;
FOnDone : TThreadDoneEvent;
HandleException : THandleThreadException;
Delay : Integer;
{$IFDEF WIN32}
CS : TRTLCriticalSection;
{$ENDIF}
procedure Execute; override;
  end;

  TACSInput = class(TComponent)
  protected
FPosition : Integer;
FSize : Integer;
Buisy : Boolean;
BufStart, BufEnd : Integer;
(* We don't declare the buffer variable here
 because different descendants may need different buffer sizes *)
function GetBPS : Integer; virtual; abstract;
function GetCh : Integer; virtual; abstract;
function GetSR : Integer; virtual; abstract;
function GetTotalTime : Integer; virtual;
  public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetData(Buffer : Pointer; BufferSize : Integer): Integer; virtual; abstract;
procedure Reset; virtual;
procedure Init; virtual; abstract;
procedure Flush; virtual; abstract;
property BitsPerSample : Integer read GetBPS;
property Position : Integer read FPosition;
property SampleRate : Integer read GetSR;
property Channels : Integer read GetCh;
property Size : Integer read FSize;
property TotalTime : Integer read GetTotalTime;
  end;

  TACSOutput = class(TComponent)
  protected
CanOutput : Boolean;
CurProgr : Integer;
Thread : TACSThread;
FInput : TACSInput;
FOnDone : TOutputDoneEvent;
FOnProgress : TOutputProgressEvent;
Buisy : Boolean;  // Set to true by Run and to False by WhenDone.
FOnThreadException : TThreadExceptionEvent;
InputLock : Boolean;
function GetPriority : {$IFDEF LINUX} Integer; {$ENDIF} {$IFDEF WIN32} TThreadPriority; {$ENDIF}
function GetSuspend : Boolean;
function GetProgress : Integer;
procedure SetInput(vInput : TACSInput); virtual;
procedure SetPriority(Priority : {$IFDEF LINUX} Integer {$ENDIF} {$IFDEF WIN32} TThreadPriority {$ENDIF});
procedure SetSuspend(v : Boolean);
procedure WhenDone;
function GetTE : Integer;
function GetStatus : TOutputStatus;
function DoOutput(Abort : Boolean):Boolean; virtual; abstract;
procedure Done; virtual; abstract; // Calls FInput.Flush
procedure Prepare; virtual; abstract; // Calls FInput.init
function GetDelay : Integer;
procedure SetDelay(Value : Integer);
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure HandleThreadException(E : Exception);
  public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Pause;
procedure Resume;
procedure Run;
procedure Stop;
property Delay : Integer read GetDelay write SetDelay;
property ThreadPriority : {$IFDEF LINUX} Integer {$ENDIF} {$IFDEF WIN32} TThreadPriority {$ENDIF} read GetPriority write SetPriority;
property Progress : Integer read GetProgress;
property Status : TOutputStatus read GetStatus;
property TimeElapsed : Integer re

[Lazarus] How do I do a Perform(EM_LINESCROLL, ?, ?) to scroll to the bottom of a Tmemo.

2010-09-02 Thread Peter E Williams
Hi All,

I am porting some code from Delphi to lazarus and I needed to change a
Trichedit to a Tmemo. Now the code 

  with Memo2 do
Perform(EM_LINESCROLL, 0, Memo_lines_added);

does not work. It is supposed to scroll the TMemo to the bottom of the
window. I tried to use TRichView but it won't even display lines e.g.
Richview1.lines.add( 'hello' ) does not work!!!

var 
  Memo_lines.added : integer;

procedure Tform2.SnipMemoText(var Memo2 : tMemo; MaxSize : integer);
var
  i : integer;
begin
  // make it faster with BeginUpdate / EndUpdate {delete excess lines}
  Memo2.Lines.BeginUpdate;
  for i := 0 to Memo2.Lines.Count - MaxSize - 1 do
Memo2.Lines.Delete(0);
  Memo2.Lines.EndUpDate;

  with Memo2 do
Perform(EM_LINESCROLL, 0, Memo_lines_added);

  Memo_lines_added := 0;
end; { SnipMemoText }

Best Regards,
PEW
Hobart, Tasmania, Australia
-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


Re: [Lazarus] How to produce a tone at Tone frequency for duration, MSecs (milliseconds)

2010-09-02 Thread Peter E Williams
Ho Benito,

On Thu, 02 Sep 2010 16:41:41 +0200 (Benito van der Zander) wrote:
> Hi,
> are you using Windows or Linux?
> I will assume Windows, because you want to replace the Delphi component.
> 
> Then you can Windows.Beep, (which I'm pretty sure exists in Lazarus),
> or directly talk to the device driver like I described it here:
> http://bugs.freepascal.org/view.php?id=12437

Sorry, but I am using Linux Ubuntu. As someone else made the point, it
apparently can only be done if I have root access to write
to /dev/console. I didn't want a component that I need root privileges
to run.

> Benito van der Zander

Best Regards,
Peter
Hobart, Tasmania, Australia
-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


[Lazarus] Software needed to resize .ico file from Delphi (32x32) to 128x128 pixels.

2010-09-02 Thread Peter E Williams
Hi All,

I have an old icon (.ico) created with Delphi which is 32x32 pixels at
72 dpi. I would like to resize it to 128x128 pixels. What is the
simplest way for me to do this? I am using Linux Ubuntu but I can also
use most Windows software with WINE. Can someone please recommend some
software which I can use to resize the .ico file ???

Best Regards,
PEW
Hobart, Tasmania, Australia

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


Re: [Lazarus] How to produce a tone at Tone frequency for duration MSecs (milliseconds)

2010-09-02 Thread Peter E Williams
On Wed, 01 Sep 2010 15:38:13 +0200 John vd Waeter  wrote:

> Lol, I wrote something like that years ago... but in these days it was 
> allowed to address the speaker hardware...
> 
> Windows.Beep(freq,duration) does about the same, but afaik it is not 
> implemented in Lazarus.

At the risk of asking a silly question. Why has no-one ported the
Windows.Beep procedure to Lazarus. Surely it is not too hard ?!?

Personally, I like this simple method of basic speaker sounds and I use
it with a boolean variable called 'want_sounds' which I let the user
toggle via a Tmenuitem (part of a Tmainmenu of the form). I find that
this works well and keeps happy users who don't want sound effects. I
also write & read this setting to an .ini file, which is simple and
saves the user's choice.

Would someone please investigate porting the Windows.Beep procedure to
lazarus. I can convert the remainder of the TBeeper.pas unit to
Lazarus ... and I think that it would be popular (in limited circles).

Best Regards,
PEW
Hobart, Tasmania, Australia

> sri,
> John
> 
> 
> Peter E Williams wrote:
> > Hi Michael and All,
> > 
> > Actually I don't need a resolution of single milliseconds. I really only
> > need tens or even hundreds of milliseconds. Typical MSecs parameter is
> > 100ms. Also, exact Tone frequency is not required... only the approx
> > frequency tone. Obviously, since I want to create a range of tones then
> > creating custom wave files would be overkill.
> > 
> > The original TBeeper component for Delphi simply beeped the pc speaker
> > and used some assembler code, but it was only 26KB of code. It also had
> > the ability to play simple tone 'songs' by beeping a range of tone
> > frequencies at different durations. These 'songs' were simply ASCII text
> > data files. I still have it if you are interested.
> > 
> > Best Regards,
> > PEW
> > Hobart, Tasmania, Australia
> > 
> > On Wed, 2010-09-01 at 14:21 +0200, Michael Schnell wrote:
> >> You cant get a resolution of milliseconds in a user program.
> >>
> >> So I would create a wave file that contains the correct "bleep".
> >>
> >> With Delphi I once used this wave player component: 
> >> http://www.un4seen.com/. I don't know if it's been tested with Lazarus 
> >> and if something similar can be done on Linux.
> >>
> >> I used some free tool to create sine and similar waves in wav-files.
> >>
> >> -Michael
> > 
> 
> 
> -- 
> John vd Waeter
> www.jvdw.nl
> www.gps-carpool.net
> www.shotinthedark.nl
> www.pdaforms.nl
> www.dbapocket.nl
> 
> j...@jvdw.nl

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


Re: [Lazarus] TDBF File is NOT created!!! FieldDefs.add( field, param, param ) does NOT create fields.

2010-09-01 Thread Peter E Williams
SOLVED !!!

On Wed, 01 Sep 2010 13:00:50 -0400 waldo kitty wrote:
> On 9/1/2010 08:45, Peter E Williams wrote:
> > Hi all,
> >
> > This one is really puzzling. I thought that I was doing everything okay
> > to generate a new TDBF file... but I cannot create the file. The
> > following is tracetestUnit1.pas which is a test unit to create a dBase
> > format TDbf database file.
> >
> > Output to memo1 follows:
> >
> > FilePath
> > = 
> > /home/pewink/Public/My_code/Lazarus_source/pewink/Hexxpawn/lazarus/0.5.alpha/
> > TableName = hex8_log.dbf
> > Trace File does not exist.
> > closing Trace file.
> 
> ummm the file doesn't exist yet you close it anyway without it having 
> been 
> opened?
> 
> > Starting to add fields with .FieldDefs
> > finished adding fields.
> > closing trace file.
> > Opening Trace File.
> > Exception opening trace file.

After to procedure changes (see below). First time procedure is called (file 
does not exist):

FilePath = 
/home/pewink/Public/My_code/Lazarus_source/pewink/Hexxpawn/lazarus/0.5.alpha/
TableName = hex8_log.dbf
Starting to add fields with .FieldDefs
finished adding fields.
2.closing trace file.
Opening Trace File.
FindLast record.
3.closing trace file.

2nd time, file exists.

FilePath = 
/home/pewink/Public/My_code/Lazarus_source/pewink/Hexxpawn/lazarus/0.5.alpha/
TableName = hex8_log.dbf
Opening Trace File.
FindLast record.
3.closing trace file.

procedure TForm1.open_trace_file;
var
  S : String;
  I : integer;
begin
  S := Application.ExeName;
  // hack for Mac
  I := Pos('.app/Contents/MacOS/', S);
  if (I > 0) then
S := Copy(S,1, I+3);
  try
begin
  Trace_File_DBF := TDbf.Create(nil);
  Trace_File_DBF.TableLevel := Longint(TXBaseConst);
  Trace_File_DBF.FilePath := ExtractFilePath(S);
  Trace_File_DBF.TableName := filename_Trace_File_DBF;
  memo1.lines.add( 'FilePath = ' + Trace_File_DBF.FilePath );
  memo1.lines.add( 'TableName = ' + Trace_File_DBF.TableName );
  Trace_File_DBF.TableLevel := Longint(TXBaseConst);
  if not FileExists( filename_Trace_File_DBF ) then
  begin
   With Trace_File_DBF do
   begin
TableLevel := Longint(TXBaseConst);
FilePath := ExtractFilePath(S);
with Trace_File_DBF.FieldDefs do
begin
 memo1.lines.add( 'Starting to add fields with .FieldDefs' 
);
 // Trace_File_DBF.FilePathFull := 
 with Trace_File_DBF.FieldDefs do
  begin
   Add( 'game_count', ftinteger, 0, True );
[... etc more Add fields here ]
  end; // with
 memo1.lines.add( 'finished adding fields.' );
end; // with
showmessage( 'Creating Table: Trace File.' );
Trace_File_DBF.CreateTable;
memo1.lines.add( '2.closing trace file.' );
Trace_File_DBF.Close;
   end; // with
  end; // then
  memo1.lines.add( 'Opening Trace File.' );
  Trace_File_DBF.Exclusive := true;
  Trace_File_DBF.Open;
  Trace_File_DBF_open := true;
  memo1.lines.add( 'FindLast record.' );
  Trace_File_DBF.FindLast;
end; // try
  except
  memo1.lines.add( 'Exception opening trace file.' );
  end;
end; { open_trace_file }

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


Re: [Lazarus] How to produce a tone at Tone frequency for duration MSecs (milliseconds)

2010-09-01 Thread Peter E Williams
Hi Michael and All,

Actually I don't need a resolution of single milliseconds. I really only
need tens or even hundreds of milliseconds. Typical MSecs parameter is
100ms. Also, exact Tone frequency is not required... only the approx
frequency tone. Obviously, since I want to create a range of tones then
creating custom wave files would be overkill.

The original TBeeper component for Delphi simply beeped the pc speaker
and used some assembler code, but it was only 26KB of code. It also had
the ability to play simple tone 'songs' by beeping a range of tone
frequencies at different durations. These 'songs' were simply ASCII text
data files. I still have it if you are interested.

Best Regards,
PEW
Hobart, Tasmania, Australia

On Wed, 2010-09-01 at 14:21 +0200, Michael Schnell wrote:
> You cant get a resolution of milliseconds in a user program.
> 
> So I would create a wave file that contains the correct "bleep".
> 
> With Delphi I once used this wave player component: 
> http://www.un4seen.com/. I don't know if it's been tested with Lazarus 
> and if something similar can be done on Linux.
> 
> I used some free tool to create sine and similar waves in wav-files.
> 
> -Michael

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


[Lazarus] TDBF File is NOT created!!! FieldDefs.add( field, param, param ) does NOT create fields.

2010-09-01 Thread Peter E Williams
Hi all,

This one is really puzzling. I thought that I was doing everything okay
to generate a new TDBF file... but I cannot create the file. The
following is tracetestUnit1.pas which is a test unit to create a dBase
format TDbf database file.

Output to memo1 follows:

FilePath
= /home/pewink/Public/My_code/Lazarus_source/pewink/Hexxpawn/lazarus/0.5.alpha/
TableName = hex8_log.dbf
Trace File does not exist.
closing Trace file.
Starting to add fields with .FieldDefs
finished adding fields.
closing trace file.
Opening Trace File.
Exception opening trace file.
-
Note : the FilePath is confirmed to exist.

As you can see, I add the fields with the .FieldDefs field. I then
close the file and the TDbf file is NOT created. What am I doing
wrong???

unit tracetestUnit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, dbf, FileUtil, LResources, Forms, Controls,
Graphics,
  Dialogs, StdCtrls, DB, dbf_common;

const
  filename_Trace_File_DBF = 'hex8_log.dbf';
  TXBaseConst = xBaseVII;

type

  { TForm1 }

  TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
Trace_File_DBF: TDbf;
procedure Button1Click(Sender: TObject);
  private
{ private declarations }
  public
{ public declarations }
procedure open_trace_file;
  end;

var
  Form1: TForm1; 
  Trace_File_DBF_open : boolean;

implementation

procedure TForm1.Button1Click(Sender: TObject);
begin
  open_trace_file;
end;

procedure TForm1.open_trace_file;
var
  S : String;
  I : integer;
begin
  S := Application.ExeName;
  // hack for Mac
  I := Pos('.app/Contents/MacOS/', S);
  if (I > 0) then
S := Copy(S,1, I+3);
  try
begin
  Trace_File_DBF.TableLevel := Longint(TXBaseConst);
  Trace_File_DBF.FilePath := ExtractFilePath(S);
  Trace_File_DBF.TableName := filename_Trace_File_DBF;
  memo1.lines.add( 'FilePath = ' + Trace_File_DBF.FilePath );
  memo1.lines.add( 'TableName = ' + Trace_File_DBF.TableName );
  Trace_File_DBF.TableLevel := Longint(TXBaseConst);
  if not FileExists( filename_Trace_File_DBF ) then
  begin
   memo1.lines.add( 'Trace File does not exist.' );
   Trace_File_DBF.TableLevel := Longint(xBaseVII);
   memo1.lines.add( 'closing Trace file.' );
   Trace_File_DBF.Close;
   with Trace_File_DBF.FieldDefs do
begin
 memo1.lines.add( 'Starting to add fields
with .FieldDefs' );
 // Trace_File_DBF.FilePathFull := 
 with Trace_File_DBF.FieldDefs do
  begin
   //Clear;
   Add( 'game_counter', ftinteger, 0,
True );
   Add( 'turn_counter', ftInteger, 0,
True  );
   Add( 'player_o_move_from_row', ftInteger,
0, True  );
   Add( 'player_o_move_from_col', ftInteger,
0, True  );
   Add( 'player_o_move_to_row', ftInteger,
0, True  );
   Add( 'player_o_move_to_col', ftInteger,
0, True  );
   Add( 'player_x_move_from_row', ftInteger,
0, True  );
   Add( 'player_x_move_from_col', ftInteger,
0, True  );
   Add( 'player_x_move_to_row', ftInteger,
0, True  );
   Add( 'player_x_move_to_col', ftInteger,
0, True  );
   Add( 'record_no', ftInteger, 0, True  );
   Add( 'winner', ftString, 12, True  );
   Add( 'move_options', ftString, 25,
True  );
   Add( 'pawn_move_rating', ftString, 25,
True  );
   Add( 'successful_move', ftBoolean, 0,
True  );
   Add( 'pawn_no', ftInteger, 0, True  );
   Add( 'direction', ftInteger, 0, True  );
   Add( 'option_was', ftString, 25, True  );
  end; // with
 memo1.lines.add( 'finished adding fields.' );
end; // with
   memo1.lines.add( 'closing trace file.' );
   Trace_File_DBF.Close;
  end; // then
  memo1.lines.add( 'Opening Trace File.' );
  Trace_File_DBF.Open;
  Trace_File_DBF_open := true;
  memo1.lines.add( 'FindLast record.' );
  Trace_File_DBF.FindLast;
end; // try
  except
//showmessage( 'Exception opening trace file.' );
memo1.lines.add( 'Exception opening trace file.' );
  end;
end; { open_trace_file }
{-}

initialization
  {$I tracetestunit1.lrs}

end.



-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


--
___
Lazarus mailing list
Lazarus@lists.lazar

Re: [Lazarus] Error: overloaded identifier "MyButtonsClickHandler" isn't a function

2010-09-01 Thread Peter E Williams
Hi Ido, Henry and all,

On Wed, 2010-09-01 at 11:37 +0100, Henry Vermaak wrote:
> On 1 September 2010 09:39, Peter E Williams
>  wrote:
> > Hi Ido,
> >
> > On Wed, 2010-09-01 at 10:38 +0300, ik wrote:
> >> Please see fixes inline.
> >>
> >> http://ik.homelinux.org/
> >>
> >
> > I went to the above URL and I cannot find any "fixes inline". Please
> > provide an exact URL for the new version.
> 
> He made the changes in the quoted email, just compare them (gmail
> highlights the changes for me, which is quite useful).
> 

I missed those changes, but I have already worked them out for
myself :-)))

ps - I don't use gmail so I don't get the changes highlighted.

> Henry

Best Regards,
PEW

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


[Lazarus] How to produce a tone at Tone frequency for duration MSecs (milliseconds)

2010-09-01 Thread Peter E Williams
Hi All,

I am looking for a simple sound beeping component which will produce a
tone through the default sound system e.g. a Tone at frequency (in
Hertz) for duration MSecs (milliseconds).

It will replace the TbtBeeper (Delphi 5) component which mainly consists
of the following procedure:

procedure TbtBeeper.BeepFor(Tone: Word; MSecs: DWORD);  

e.g. BeepFor( 100, 500 );
// beep at 100 Hertz for half a second.

Best Regards,
PEW
Hobart, Tasmania, Australia

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


Re: [Lazarus] Error: overloaded identifier "MyButtonsClickHandler" isn't a function

2010-09-01 Thread Peter E Williams
Hi Ido,

On Wed, 2010-09-01 at 10:38 +0300, ik wrote:
> Please see fixes inline.
> 
> http://ik.homelinux.org/
> 

I went to the above URL and I cannot find any "fixes inline". Please
provide an exact URL for the new version.

I have a few bug fixes for it to send to you.

Best Regards,
PEW
Hobart, Tasmania, Australia

[...]


-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


[Lazarus] Error: overloaded identifier "MyButtonsClickHandler" isn't a function

2010-08-31 Thread Peter E Williams
Hi Lazarus List and Alvaro,

I am trying to write a short test project for buttonlist.pas which is a
modified version of Ido's untbuttonlist.pas ... but with some extra
procedures and functions. The problem I am now having is that there is
no sample project showing how to write a ButtonClick Handler. Lazarus
complains that it is not a function, although it is declared as a
procedure.

from buttonlist.pas, type declaration:
  TButtonClick = procedure (Index : Word) of object;

//line 33
procedure TForm1.MyButtonsClickHandler(index: word); 

testunit1.pas(33,39) Error: overloaded identifier
"MyButtonsClickHandler" isn't a function
testunit1.pas(33,18) Error: function header doesn't match any method of
this class "TForm1.MyButtonsClickHandler$33(Word);"

//line 58
  MyButtons.SetLayoutDirection := ldHorizontal;

testunit1.pas(58,13) Error: identifier idents no member
"SetLayoutDirection"
testunit1.pas(74) Fatal: There were 3 errors compiling module, stopping

unit testunit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics,
Dialogs,
  StdCtrls, ButtonList;

type

  { TForm1 }

  TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
  private
{ private declarations }
  public
{ public declarations }
MyButtons: TButtonList;

{ from buttonlist.pas
type
  TLayoutDirection = (ldHorizontal, ldVertical);
[...]
  TButtonClick = procedure (Index : Word) of object;
}

MyButtonsClickHandler: TButtonClick;
constructor Create(aOwner: TComponent); override;
  end;

var
  Form1: TForm1; 

implementation

{ TForm1 }

procedure TForm1.MyButtonsClickHandler(index: word);
begin
  showmessage( 'You clicked button number ' + inttostr(index) );
end;

constructor TForm1.Create(aOwner: TComponent);
begin
  inherited;
  MyButtons.OnButtonClick := MyButtonsClickHandler;
end;

procedure TForm1.FormCreate(Sender: TObject);
var
  b: integer;

const
  max_level = 8;
  max_byte = 255;
  demo = false;
  X_str = 'X';
  O_str = 'O';
  empty_cell = '';

begin
//  MyButtons := TButtonList.Create(self);
  MyButtons.SetLayoutDirection := ldHorizontal;
  MyButtons.Count := max_level;
  MyButtons.parent := self;
  MyButtons.visible := True;

  for b := 1 to max_level do
  begin
MyButtons.SetSpecificCaption( b, X_str + inttostr(b) );
  end;
end;

initialization
  {$I testunit1.lrs}

end.

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)
{ A Lazarus component for button list

Copyright (C) 2010 Ido Kanner ido...@gmail.com

This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
for more details.

You should have received a copy of the GNU Library General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
}

unit buttonlist;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, Buttons, Controls, Forms, LMessages, Graphics,
  Dialogs;

type
  TLayoutDirection = (ldHorizontal, ldVertical);

Const
  DEFAULT_BREAK_ON = 5;
  DEFAULT_BUTTON_COUNT = 10;
  DEFAULT_LAYOUT_DIRECTION = ldVertical;
  DEFAULT_SHOW_BUTTON_HINTS = true;

type
  EButtonCount = class(Exception);

  TButtonClick = procedure (Index : Word) of object;

  { TCustomButtonList }

  TCustomButtonList = class(TScrollingWinControl)
  private
procedure SetBreakOn ( const AValue : Word ) ;
procedure SetButtonCount ( const AValue : Word ) ;
procedure SetLayoutDirection ( const AValue : TLayoutDirection ) ;
procedure SetCaptions ( const AValue : TStringList ) ;
procedure SetHints ( const AValue : TStringList ) ;
procedure SetButtonHints ( const AValue : Boolean ) ;
  protected
FBreakOn : Word;
FButtons : array of TBitBtn;
FButtonCount : Word;
FCaptions : TStringList;
FHints : TStringList;
FLayoutDirection : TLayoutDirection;
FShowButtonHints : Boolean;
FButtonClick : TButtonClick;

procedure CreateButtons(const aFrom, aTo : Word); virtual;
procedure CreateButtons; virtual;

procedure WMSize(var Message: TLMSize); message LM_SIZE;

function CalcHeight : Integer; virtual;
function LayoutDirectionToChildLayout(const aDirection : TLayoutDirection) : TControlChildrenLayout; virtual;

procedure UpdateCaptions; virtual;
procedure UpdateHints; virtual;
procedure CaptionChanged(Sender : TObject); virtual;
procedure HintChanged(Sender : TObject); virtual;

procedure ButtonClicked(Sender : TObject); v

Re: [Lazarus] Changing Dataset.RecNo to use safer technique of bookmarks (TDbf database files)]]

2010-08-30 Thread Peter E Williams
Hi Lazarus List and Alvaro,

Below is the reply to this message from my friend Alvaro in Spain, who
is a part-time Delphi programmer.
 
> On Tue, Aug 31, 2010 at 6:03 AM, Peter E Williams 
wrote:
> Hi Alvaro,
> 
> forwarded below is another yet to be answered post to the
Lazarus
> programmers list. I would appreciate your thoughts on it. The
techniques
> for solving this problem are identical in Lazarus and Delphi.
> 
> Best Regards,
>PEW
> Hobart, Tasmania, Australia
> 
> 
> Hi All,
> 
> A few months ago I posted some messages about converting my
dBase code
> (in Delphi) to lazarus. I was advised that I should NOT use
> Dataset.RecNo but instead I should use bookmarks. Can someone
please
> advise me how to rewrite:
> 
> with Hexx_Data_DBF.FieldDefs do
>  Hexx_Data_DBF_RecNo := Dataset.RecNo;
> 
> to use the safer method of using bookmarks???
> 
> type
> 
>  { Thxboard }
> 
>  Thxboard = class(TForm)
>Hexx_Data_DBF: TDbf;
> 
> var
>  TraceFile_DBF_RecNo, Hexx_Data_DBF_RecNo : integer;
>
[...]
 // here I have the Hexx_Data_DBF file open and begin to loop
through it in a while loop.
>while (not Hexx_Data_DBF.EOF) and not found do
>  begin
>if (pattern_is_db_current(pattern1)) then
>  begin
>save_options(pattern1);
>found := true;
 // here I save the RecNo in a variable
>with Hexx_Data_DBF.FieldDefs do
>  Hexx_Data_DBF_RecNo := Dataset.RecNo;
 // the close the database
>close_db;
>if trace_moves then
>  begin
 // open a different TDbf file (Trace_File)
>open_trace_file;
>With Trace_File_DBF do
>try
   // go to the RecNo of the saved Trace_File's
variable
>  with Trace_File_DBF.FieldDefs do
>   Dataset.RecNo := (TraceFile_DBF_RecNo);
   // save the Hexx_Data_DBF's RecNo into the
Trace_File
>  FieldByName('record_no' ).AsInteger :=
> Hexx_Data_DBF_RecNo;

 // hmmm not sure whether I should be using
finally or except here.

>//finally
>except
>  showmessage( 'An exception occured in
> write_updated_pattern - writing to trace file.');
>  close_trace_file;
>end;
>  end;
 // reopen the Hexx_Data_DBF file
>open_db;
 // and the go back to the RecNo saved in the variable
>with Hexx_Data_DBF.FieldDefs do
>  Dataset.RecNo := (Hexx_Data_DBF_RecNo);
>  end;
 // then use the Next procedure to continue looping through
the DBF datafile
>Hexx_Data_DBF.Next;
>  end;
> [...]

> Alvaro GP wrote:
> 
> Hi Peter 
> 
> I never used bookmarks when I programmed in Delphi. Some people say
> that you shouldn't use RecNo because if you ever upscale your
> application to a SQL database, in the world of SQL servers there isn't
> the concept of "record number" but instead you browse the found
> records using a "Next" method repeatedly until there isn't any new
> records to read. 
> 
> If you have no intention to use SQL databases, you can safely continue
> using RecNo. 
> --
> Alvaro GP
> Lite Applications
> www.liteapplications.com

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


[Lazarus] Changing Dataset.RecNo to use safer technique of bookmarks (TDbf database files)

2010-08-30 Thread Peter E Williams
Hi All,

A few months ago I posted some messages about converting my dBase code
(in Delphi) to lazarus. I was advised that I should NOT use
Dataset.RecNo but instead I should use bookmarks. Can someone please
advise me how to rewrite:

with Hexx_Data_DBF.FieldDefs do
  Hexx_Data_DBF_RecNo := Dataset.RecNo;

to use the safer method of using bookmarks???

type

  { Thxboard }

  Thxboard = class(TForm)
Hexx_Data_DBF: TDbf;

var
  TraceFile_DBF_RecNo, Hexx_Data_DBF_RecNo : integer;

[...]
while (not Hexx_Data_DBF.EOF) and not found do
  begin
if (pattern_is_db_current(pattern1)) then
  begin
save_options(pattern1);
found := true;
//Hexx_Data_DBF_RecNo := Hexx_Data_DBF.RecNo;
with Hexx_Data_DBF.FieldDefs do
  Hexx_Data_DBF_RecNo := Dataset.RecNo;
close_db;
if trace_moves then
  begin
open_trace_file;
With Trace_File_DBF do
try
  // ### needs changing
  with Trace_File_DBF.FieldDefs do
   Dataset.RecNo := (TraceFile_DBF_RecNo);
  FieldByName('record_no' ).AsInteger :=
Hexx_Data_DBF_RecNo;
//finally
except
  showmessage( 'An exception occured in
write_updated_pattern - writing to trace file.');
  close_trace_file;
end;
  end;
open_db;
// ### needs changing
with Hexx_Data_DBF.FieldDefs do
  Dataset.RecNo := (Hexx_Data_DBF_RecNo);
  end;
// ### needs changing
Hexx_Data_DBF.Next;
  end;
[...]
-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)
procedure Thxboard.write_updated_pattern(var pattern1: pattern_type);
var
  found: boolean;
begin
  found := false;
  if pattern_is_db_current(pattern1) then
{ save pattern options to db }
begin
  save_options(pattern1);

  //  how do I do this
  //Hexx_Data_DBF_RecNo := Hexx_Data_DBF.RecNo;
  With Hexx_Data_DBF.FieldDefs do
Hexx_Data_DBF_RecNo := Dataset.RecNo;

  close_db;
  if trace_moves then
begin
  open_trace_file;
  With Trace_File_DBF.FieldDefs do
  try
//  needs changing
Dataset.RecNo := (TraceFile_DBF_RecNo);
Trace_File_DBF.FieldByName('record_no').AsInteger := Hexx_Data_DBF_RecNo;
  //finally
  except
showmessage( 'Exception occured in write_updated_pattern. Writing to trace file.' );
close_trace_file;
  end;
end;
  open_db;
  //  how do I do this
  with Hexx_Data_DBF.FieldDefs do
Dataset.RecNo := (Hexx_Data_DBF_RecNo);
end
  else
  { save entire pattern to db };
  begin

while (not Hexx_Data_DBF.EOF) and not found do
  begin
if (pattern_is_db_current(pattern1)) then
  begin
save_options(pattern1);
found := true;
//Hexx_Data_DBF_RecNo := Hexx_Data_DBF.RecNo;
with Hexx_Data_DBF.FieldDefs do
  Hexx_Data_DBF_RecNo := Dataset.RecNo;
close_db;
if trace_moves then
  begin
open_trace_file;
With Trace_File_DBF do
try
  // ### needs changing
  with Trace_File_DBF.FieldDefs do
   Dataset.RecNo := (TraceFile_DBF_RecNo);
  FieldByName('record_no' ).AsInteger := Hexx_Data_DBF_RecNo;
//finally
except
  showmessage( 'An exception occured in write_updated_pattern - writing to trace file.');
  close_trace_file;
end;
  end;
open_db;
// ### needs changing
with Hexx_Data_DBF.FieldDefs do
  Dataset.RecNo := (Hexx_Data_DBF_RecNo);
  end;
// ### needs changing
Hexx_Data_DBF.Next;
  end;
if not found then
  begin
with Hexx_Data_DBF do
try
  With Hexx_Data_DBF.FieldDefs do
  begin
   Dataset.Append;
   { --- add a new record --- }
   save_options(pattern1);
   FieldByName( 'this_game' ).AsInteger := pattern.this_game;

   FieldByName('x1_pos' ).AsString := inttostr(pattern1.x_piece[1]);
   FieldByName('x2_pos' ).AsString := inttostr(pattern1.x_piece[2]);
   FieldByName('x3_pos' ).AsString := inttostr(pattern1.x_piece[3]);
   FieldByName('x4_pos' ).AsString := inttostr(pattern1.x_piece[4]);
   FieldByName('x5_pos' ).AsString := inttostr(pattern1.x_piece[5]);
   FieldByName('x6_pos' ).AsString := inttostr(pattern1.x_piece[6]);
   

[Lazarus] Error: identifier idents no member "SetSpecificCaption" (buttonlist.pas)

2010-08-30 Thread Peter E Williams
Hi Lazarus list,

I am making public a private message between myself and Ido, re some
changes to ButtonList.pas.

Please find attached buttonlist.pas and testunit1.pas which contains the
relevant code.

> testunit1.pas(65,9) Error: identifier idents no member
> "SetSpecificCaption"
> testunit1.pas(66,20) Error: Incompatible types: got "untyped" expected
> ""
> testunit1.pas(75) Fatal: There were 2 errors compiling module,
> stopping
> 
> lines 65 & 66 follow:
> sg1.SetSpecificCaption( b, X_str + inttostr(b) );
> sg1.OnClick := Button1Click(self);
> 

>From buttonlist.pas
> procedure TCustomButtonList.SetSpecificCaption(num : integer; Str :
> String);
> begin
>   if (num > High(FButtons)) or (num < Low(FButtons)) then
> raise Exception.Create('Set Caption Out of range');
> 
>   FButtons[num].Caption := Str;
> end;
> 

I would appreciate your help debugging these errors. :-)))

Best Regards,
PEW (Peter)
Hobart, Tasmania, Australia

> 
> On Mon, 2010-08-30 at 22:45 +0300, ik wrote:
> > Hi Peter,
> > 
> > Your requests are not supported by the component, but it can be
> > rewritten like so:
> > 
> > TAdvancedCustomButtonList = class(TCustomButtonList)
> > 
> > Note that you have access to FButtons (it's the actual array of the
> > buttons).
> > 
> > so a procedure like so can be written:
> > 
> > procedure TAdvancedCustomButtonList.SetSpecificCaption(num :
> integer;
> > Caption : String);
> > begin
> >   if num > High(FButtons) or num < Low(FButtons) then
> > raise Exception.Create('Out of range');
> > 
> >   FButtons[num].Caption := Caption;
> > end;
> > 
> > and also:
> > 
> > procedure TAdvancedCustomButtonList.SetFont(num : integer; Font :
> > TFont);
> > begin
> >   if num >Hi Lazarus list,

I am making public a private message between myself and Ido, re some
changes to ButtonList.pas.

Please find attached buttonlist.pas and testunit1.pas which contains the
relevant code.

> testunit1.pas(65,9) Error: identifier idents no member
> "SetSpecificCaption"
> testunit1.pas(66,20) Error: Incompatible types: got "untyped" expected
> ""
> testunit1.pas(75) Fatal: There were 2 errors compiling module,
> stopping
> 
> lines 65 & 66 follow:
> sg1.SetSpecificCaption( b, X_str + inttostr(b) );
> sg1.OnClick := Button1Click(self);
> 

>From buttonlist.pas
> procedure TCustomButtonList.SetSpecificCaption(num : integer; Str :
> String);
> begin
>   if (num > High(FButtons)) or (num < Low(FButtons)) then
> raise Exception.Create('Set Caption Out of range');
> 
>   FButtons[num].Caption := Str;
> end;
> 

I would appreciate your help debugging these errors. :-)))

Best Regards,
PEW (Peter)
Hobart, Tasmania, Australia

> 
> On Mon, 2010-08-30 at 22:45 +0300, ik wrote:
> > Hi Peter,
> > 
> > Your requests are not supported by the component, but it can be
> > rewritten like so:
> > 
> > TAdvancedCustomButtonList = class(TCustomButtonList)
> > 
> > Note that you have access to FButtons (it's the actual array of the
> > buttons).
> > 
> > so a procedure like so can be written:
> > 
> > procedure TAdvancedCustomButtonList.SetSpecificCaption(num :
> integer;
> > Caption : String);
> > begin
> >   if num > High(FButtons) or num < Low(FButtons) then
> > raise Exception.Create('Out of range');
> > 
> >   FButtons[num].Caption := Caption;
> > end;
> > 
> > and also:
> > 
> > procedure TAdvancedCustomButtonList.SetFont(num : integer; Font :
> > TFont);
> > begin
> >   if num > High(FButtons) or num < Low(FButtons) then
> > raise Exception.Create('Out of range');
> > 
> >   FButtons[num].Font.Assign(Font);
> > end;
> > 
> > Please note that I have not tried it myself, but that's the idea of
> > how to do it.
> > 
> > I hope that helps, and feel free to ask more questions, or to be
> > pointed for additional information.
> > 
> > Ido
> > 
> > http://ik.homelinux.org/
> > 
> > 
> > On Mon, Aug 30, 2010 at 22:06, Peter E Williams
> >  wrote:
> > Hi Ido,
> > 
> > I am using your component, ButtonList, and creating it at
> > runtime. I am
> > having some problems doing the following:
> > 
> > Assigning a caption to the x'th button:
> > 
>

[Lazarus] Files have wrong owner, root... making build lazarus impossible.

2010-08-29 Thread Peter E Williams
Hi All,

I am using Linux Ubuntu 10.04 LTS with latest lazarus (as installed via
the Ubuntu Software Centre). Today I removed Lazarus and did a clean
reinstall. I am now unable to do a clean build. See below:

"LCL" completed
"Package Registration" completed
"IDE Interface" completed
"SynEdit" completed
"CodeTools" completed
/usr/lib/lazarus/0.9.28.2/examples/hello.pp(31,1) Error: Can't create
object file: units/i386-linux/hello.o
/usr/lib/lazarus/0.9.28.2/examples/hello.pp(31,1) Fatal: Can't create
object units/i386-linux/hello.o

The problem is with the properties of the files such as hello.pp being
owned by 'root' owner. What is the correct way for me to correct this. I
would assume that either I need to copy the files or change the owner.

Without doing this I am unable to build lazarus ... making it not very
useful. 

Best Regards,
PEW
Hobart, Tasmania, Australia

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)
<>--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to create: TButtonGrid descendant of TCustomDrawGrid ? (ik)

2010-08-29 Thread Peter E Williams
On Sun, 29 Aug 2010 10:41:53 +0300, Ido wrote:
> From: ik 
>
> Hi,
> 
> I've created this component. You can find it at:
> http://github.com/ik5/linesip-components/blob/master/buttons/untbuttonlist.pas
> 
> Ido
> http://ik.homelinux.org/
> 

Thanks, Ido, I will use your unit. It saves me from reinventing
it. :-)))

Regards,
PEW  ;-)))
Hobart, Tasmania, Australia

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


Re: [Lazarus] How to create: TButtonGrid descendant of TCustomDrawGrid ?

2010-08-28 Thread Peter E Williams
Hi Howard and All,

I copied your code (below) into a new application's unit1.pas but I
could not get it to compile.

unit1.pas(15,20) Warning: An inherited method is hidden by "constructor
TButtonGrid.Create(TComponent,LongWord,LongWord);"

// this would indicate to me that the parameters you have as cardinals
are supposed to be LongWords. Also, do we have to do something to tell
Lazarus that this is an inherited constructor???

unit1.pas(35,1) Error: Illegal expression
unit1.pas(35,13) Fatal: Syntax error, ";" expected but "identifier
TBUTTONGRID" found

type
   { TButtonGrid }

   TButtonGrid = class(TStringGrid)
 public
//line 15
   constructor Create(AOwner: TComponent; rowws, colls: cardinal);
   end;

{ TButtonGrid }

//line 35
constructor TButtonGrid.Create(AOwner: TComponent; rowws, colls:
cardinal);
var i, j, k: cardinal;
begin

Was I meant to save it as TButtonGrid.pas instead ???

> On 28/8/10 10:31, Peter E Williams wrote:
> > Hi,
> >
> > This email is related to my previous post.
> >
> > I want to create a new component called a TButtonGrid which would be
> a
> > descendant of TCustomDrawGrid. Problem is that I don't know how to
> do
> > that. Obviously, I would need to make the CustomDraw (???) draw a
> > TButton.
> >
> > Does anyone have some example(s) of how to do this, please???
> 
> Is this the sort of thing you want?
> 
> unit Unit1;
> 
> {$mode objfpc}{$H+}
> 
> interface
> 
> uses
>Classes, Grids, SysUtils, FileUtil, Forms, Controls, Graphics,
> Dialogs;
> 
> type
>{ TButtonGrid }
> 
>TButtonGrid = class(TStringGrid)
>  public
>constructor Create(AOwner: TComponent; rowws, colls: cardinal);
>end;
> 
>{ TForm1 }
> 
>TForm1 = class(TForm)
>  procedure FormCreate(Sender: TObject);
>private
>  btnGrid: TButtonGrid;
>end;
> 
> var
>Form1: TForm1;
> 
> implementation
> 
> {$R *.lfm}
> 
> { TButtonGrid }
> 
> constructor TButtonGrid.Create(AOwner: TComponent; rowws, colls:
> cardinal);
> var i, j, k: cardinal;
> begin
>   inherited Create(AOwner);
>   Parent := TWinControl(AOwner);
>   Left := 10;
>   Top := 10;
>   Width := colls*DefaultColWidth;
>   Height := rowws*DefaultRowHeight;
>   ExtendedSelect := False;
>   FixedCols := 0;
>   FixedRows := 0;
>   GridLineWidth := 0;
>   AutoEdit := False;
>   BorderStyle := bsNone;
>   RowCount := rowws;
>   ColCount := colls;
>   for j := 0 to colls - 1 do
> with Columns.Add do
>   ButtonStyle := cbsButtonColumn;
>   k := 1;
>   for i := 0 to rowws-1 do
> for j := 0 to colls-1 do
>   begin
> Cells[j, i] := Format('Btn %d',[k]);
> inc(k);
>   end;
> end;
> 
> { TForm1 }
> 
> procedure TForm1.FormCreate(Sender: TObject);
> begin
>btnGrid := TButtonGrid.Create(self, 6, 4);
> end;
> 
> end.
> 
> Howard

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


[Lazarus] How to create: TButtonGrid descendant of TCustomDrawGrid ?

2010-08-28 Thread Peter E Williams
Hi,

This email is related to my previous post.

I want to create a new component called a TButtonGrid which would be a
descendant of TCustomDrawGrid. Problem is that I don't know how to do
that. Obviously, I would need to make the CustomDraw (???) draw a
TButton.

Does anyone have some example(s) of how to do this, please???

http://wiki.lazarus.freepascal.org/Grids_Reference_Page

   Inheritence Tree
   

   [TCustomControl]   
  |
  |
 TCustomGrid   
  |
+-++   
|  |   
  TCustomDrawGrid TCustomDbGrid
|  |   
   +++ |   
   | |  TDbGrid
   TDrawGrid  TCustomStringGrid
 | 
 | 
TStringGrid   

Best Regards,
PEW
Hobart, Tasmania, Australia
 
-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


[Lazarus] RowCount and ColCount properties do NOT affect the display of the number of rows and columns in my component.

2010-08-28 Thread Peter E Williams
Hi All,

I have a new component called Tarraybutton which is meant to display a
grid-like array of tbuttons (actually TGridButtons -- but you could
change it to tbutton for debugging). It compiles fine but when I use it
at design time and change the number of RowCount and ColCount these do
NOT affect the displayed number of rows and columns. This is supposed to
work like a TStringGrid, except with Buttons.

I think that I have forgotten to include the code which tells it how to
display the component. Can someone please help me to debug this
component???

Best Regards,
PEW
Hobart, Tasmania, Australia

unit arraybutton;

//{$MODE Delphi}
{$mode objfpc}{$H+}

{ 
  Author: Unknown +
  --  modifications by Peter E. Williams +
  suggestions from alt.comp.lang.borland-delphi newsgroup +
  suggestions from Mark Meyer in
delphiprogramm...@yahoogroups.com.

  This code is freeware and is placed into the Public Domain by Peter E.
Williams
  ( foss.game.pascal.develo...@iinet.net.au ).

  Version 0.1a - for Lazarus by PEW
Date: 17 June 2010

Added :
FRowCount, FColCount: integer;
procedure SetRowCount(r: integer);
procedure SetColCount(c: integer);

  Version: 0.04a - by PEW. 'col' changed to 'column'. Setcol changed to
 setcolumn.

interface

uses
  {Windows,}{ Messages,} SysUtils, Classes, Graphics, Controls, Forms,
Dialogs,
  {StdCtrls,}
  LcLType, lresources,

  ugradbtn;

type

  TOnArrowKeyEvent = procedure( Sender: TObject; 
Key: Word;
Row: integer;
Column: integer;
RowCount : integer; // new
ColCount : integer; // new
var handled: boolean) of object;

  TArrayButton = class(TGradButton) { class(TButton) }
  private
IsFocused: Boolean;
FCanvas: TCanvas;
FRow,FColumn, FRowCount, FColCount: integer;
FUseDefaultKeyHandler : boolean;
FOnArrowKey : TOnArrowKeyEvent;
procedure SetRow(r: integer);
procedure SetColumn(c: integer);
procedure SetRowCount(r: integer);
procedure SetColCount(c: integer);

procedure TArrayButton.SetRowCount(r: integer);
begin
  if r>-1 then
FRowCount:= r;
end;

{}

procedure TArrayButton.SetColCount(c: integer);
begin
  if c>-1 then
FColCount:= c;
end;

{}

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)
unit arraybutton;

//{$MODE Delphi}
{$mode objfpc}{$H+}

{ 
  Author: Unknown +
  ------  modifications by Peter E. Williams +
  suggestions from alt.comp.lang.borland-delphi newsgroup +
  suggestions from Mark Meyer in delphiprogramm...@yahoogroups.com.

  This code is freeware and is placed into the Public Domain by Peter E. Williams
  ( foss.game.pascal.develo...@iinet.net.au ).

  Version 0.1a - for Lazarus by PEW
Date: 17 June 2010

Added :
FRowCount, FColCount: integer;
procedure SetRowCount(r: integer);
procedure SetColCount(c: integer);

  Version: 0.04a - by PEW. 'col' changed to 'column'. Setcol changed to
 setcolumn.

  Previous versions:
  -
  Versions: 0.03a to 0.03f - trial versions to declare component based
on tcustomcontrol instead of on tbutton. Unsuccessful.
  Version: 0.02b - mods by Mark Meyer + PEW.
  Version: 0.02 - Dated: 15 February 2001
  Version: 0.01 - Dated: 14 April 2000

  Modified to form new unit based on AColorBtn & arraybtn,
  based entirely on Acolorbtn with Row & Column properties of arraybtn added.

  Note: The only difference between this component and AColorBtn is
*  essentially that this component has additional 'row' & 'Column' published
  properties.

  Thanks and Acknowledgements:
  ---
  Thanks to the unknown person who originally sent me version 0.01 of this code,
  and to Bruce Roberts (b...@bounceitattcanada.xnet) who posted up v0.02 modifications
  to the ng. Thanks also to all those in the alt.comp.lang.borland-delphi newsgroup
  for their discussion of it and support.

  Last modified by: Peter E. Williams

  Known bugs:
  --

   (#1 is now fixed!!!)
#1 - Captions containing #13 characters are displayed as
 as single line of text.

#2 - There is no visual difference between Enabled true or false. The
 Enabled property works otherwise as normal. Workaround is to use
 the Font.Style settings to show when a button is Enabled, e.g.
 for Enabled = true set to [fsbold], false set to [fsitalic] (this
 is NOT done automatically).

#3 - Color property is assigned an invalid value of clCream.
 Reported by "Mark Meyer" 
  

Re: [Lazarus] Some information please

2010-07-05 Thread Peter E Williams
Hi J?rgen and All,

On Mon, 2010-07-05 at 08:16 +0200,
lazarus-requ...@lists.lazarus.freepascal.org wrote:
> Message: 4
> Date: Sun, 04 Jul 2010 18:59:16 +0200
> From: J?rgen Hestermann 
> Subject: Re: [Lazarus] Some information please
> To: Lazarus mailing list 
> Message-ID: <4c30bde4.8000...@gmx.de>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> > jjb schrieb:
> > @Hans-Peter, maybe my son will one day be a great programmer but as
> for 
> > me making a "game-makers library for Lazarus", I wouldn't
> > know where to start! 
> 
> My son wrote (for his own education) a kind of snake clone which he
> started on Delphi (7). Since a year or so he is using Lazarus/Free
> Pascal. I am quite impressed by the graphics (the "snake" is not
> restricted to lines and columns but can be directed in a arbitrary
> direction and all the chain links follow the head as if it was a real
> snake, accelleration and direction changes may lead to a coiled snake
> etc.). Textures are applied to the chain links and so on... He got it
> running quite fast (well, age *does* a difference ;-)). He used opengl
> for the graphics.

Yes, snake games are fun. I found one on www.planet-source-code.com many
years ago and updated it.


My version is for Delphi 5 and I think that the graphics are done with
buttons on a form. Colour is used and it does not need as much memory as
graphics. IIRC I added sound to it. It was a third party component which
simply beeps the speaker (frequency and time of a tone)... simple to
use. Just disable it if it doesn't work in lazarus (which I suspect it
won't).

Actually the version number probably should be later. I debugged and
enhanced the original version. I tried to contact the author to get him
to post an updated version but could not so I called my version v0.01
and put it on my page... crediting the author.

The main improvements were to debug it. Nothing drastic. And rewrote a
few things in minor ways. The main improvement was to make the walls of
the snake area be able to be turn on or off. This meant that if the
walls were off then the play area was infinite with the up movement from
the top going to the bottom and vice versa, and left going to right etc.
This is not hard and it meant the the snake could become very long and
it is fun to move it around and see how to move it around until it
collides with itself -- death and end of game. Of course with the walls
off you also need to check that you don't switch them on again with the
snake half way between the walls as that would be silly. IIRC a simple
boolean variable does the job of keeping track of if the snake is moving
through the open wall/s (a long snake may be going thru' more than one
wall).


Snake Game v0.01

(Version #??) original by "//hIDRA_5" with modifications by PEW 

The original snake game for Delphi was by //hIDRA_5, and can be
downloaded from http://www.planet-source-code.com/ (until he updates it
with this new version).

I am one of many people who have visited the above site and downloaded
the source to the original game. The attached files form the new version
of the snake game, as modified, enhanced and debugged by myself. I am
sending this new version (0.01) including this file, to //hIDRA_5, in
the hope that it will become the "official" next version, replacing the
original.

Firstly, I would like to thank "//hIDRA_5" for sharing his source code
and cool little game with the rest of the world. I hope that the new
version will be accepted as an improvement to it. :-)))

It seem that "//hIDRA_5" after my many attempts to contact him, has
decided to ignore my new version, so I am making it available here. 

> 
> > From what I read on the web a lot of Delphi stuff is now being 
> > rewritten in other
> > languages especially C# which would make you wonder about the future
> (for
> > Delphi at least)
> 
> That's the problem: Those who give a ruling often don't know about the
> things they decide. So they follow the masses and what they hear from
> others. At least noone can blame them later if it was a bad decision.
> 
> BTW: As far as I know C# is something for Windows only. 

No comment about C#. I don't know.

Regards,
Peter W. aka pew 


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


Re: [Lazarus] Some information please

2010-07-04 Thread Peter E Williams
Hi Hans-Peter,

You forgot to reply to the list :-))). You simply needed to click on
reply-all. I would prefer that this discussion be kept on the list
instead of private.

On Sun, 2010-07-04 at 18:58 +0200, Hans-Peter Diettrich wrote:
> Peter E Williams schrieb:
> 
> > can recommend learning how to draw Nassi/Schniderman Charts for your
> > procedures and making friends with computer lecturers and programmers.
> 
> +1
> 
> 
> > I would like to see this book translated also. I have about 15-20 books
> > on Delphi but none on Lazarus. Is there a good English lazarus textbook
> > that we can buy???
> 
> AFAIK the German book is the very first one, written about Lazarus. For 
> many purposes it's sufficient to use the available Delphi literature, 
> tutorials etc.

Just wondering if there are any copyright issues with sending html or
PDF files to a photocopy shop instead of printing them ourselves.

> > See my comment about about languages taught at Uni of Canberra. I loved
> > Pascal because it was structured and typed in contrast to BASIC (in
> > 1989) which I had a high skill level in. Also Pascal was standardised
> > whereas BASIC was not.
> 
> At that time a couple of well structured BASIC versions existed, 
> HP-Basic (Rocky Mountain Basic) in the first place. I used GfA-Basic up 
> from 1986 on my Atari ST, to develop my C decompilers, because the 
> available C compilers sucked at that time, and a Pascal system became 
> available only later (I assisted a bit in its development). The bad 
> quality of the C-subset compilers lead me to the idea of C decompilers 
> at all, because I wanted to decompile the C libraries, for which (then) 
> no source code was available.
> 
> 
> > Remember that Delphi 5 Standard was AUD$99 and it did not come with the
> > source code for many units. If you wanted to get all the source code
> > then you needed to buy Delphi 5 Enterprise for about AUD$2500-3000.
> 
> The Professional version (D4 ~$400) already came with full VCL source code.
> 
> 
> > Look at this page.
> > https://sites.google.com/site/pewtas/home/delphi_source_code
> > 
> > It is my Delphi Source code page on my personal website and contains
> > about 11 Delphi open source games. None of them use graphic libraries.
> 
> I remember "101 Basic Games" (for the pdp-11, or PET?), that included 
> such classics like Wumpus :-)

PDP-11 I think. The biggest hassle with these books is that the BASIC's
were all slightly different. So you needed to do a little translating of
the syntax as you entered them. The BASIC manual was essential. :-)))

I have that book and a few other too. I typed in many of the programs. I
eventually rewrote many of the programs in pascal (Turbo Pascal then
Delphi). See the above website for "Hunt the Wumpuz" which is a Delphi 5
version of Hunt the Wumpus rewritten in Delphi / Pascal. I tried to be
as true to the original game but also use Windows instead of crt print
statements. I also got a friend who was a graphic designer to draw the
map for the caverns as a GIF image and IIRC you can press "M"ap and it
will display the GIF image of the caves in a separate window then you
just study it and close the windows. I needed to use a GIF display
component, since Delphi didn't have one. I think it's standard now for
lazarus. I did not want to use it as a JPEG because as you probably
know, if you have a JPEG then edit it a few times the quality of the
JPEG will degrade because as you save it each time the palette colour
info is reduced and the image quality degrades in a minor way with each
save. Other formats don't do this but BMP (M$ Windows) is a memory hog
as it is not compressed. At the time PNG wasn't invented, or if it was
it was not well supported at the time.

You can find Hunt the Wumpuz and all files on the above page. Anyone
feel like doing a quick port of it to lazarus and emailing it to me as a
zip so that I can put up a link to the lazarus version of it??? If not,
I may do it in a few weeks or maybe sooner.

> It nearly broke a party in 1983, when I offered the guests to play with 
> my new LSI-11, because half of them couldn't stop playing any more. At 
> that time I was the only one who had an computer at all...

You'd probably enjoy the "Guess the Animal" game (same web page). Based
on a BASIC game and there are also versions of it in prolog. This one is
a direct port of the BASIC to Delphi 5 game (or possibly originally
Delphi 3). I original was just text based but mine used a form with an
edit box and some buttons. I thought this was an improvement. :-)))
Also, I wanted to make a MS Windows version of it instead of a console
app.

The animal questions and answers are stored as strings. The structures
were

Re: [Lazarus] Some information please

2010-07-04 Thread Peter E Williams
Hi jjb,

On Sat, 2010-07-03 at 21:19 +0200,
lazarus-requ...@lists.lazarus.freepascal.org wrote:
> Message: 1
> Date: Sat, 3 Jul 2010 13:58:56 +0100
> From: jjb 
> Subject: [Lazarus] Some information please
> To: Lazarus mailing list 
> Message-ID:
> 
> Content-Type: text/plain; charset="iso-8859-1"
> 
> I am an interested observer of Lazarus but I know very little about
> it.
> I am interested partly because Pascal was the first language I ever
> used (it
> formed a very small part of a non-CS degree.)

I first used Pascal in about 1989 when I started a Degree in Computing
Studies at the Canberra College of Advanced Education (CCAE)... now the
University of Canberra. I had a sound knowledge of BASIC and database
design. I loved Pascal because I could use my BASIC skills with the
structure of a strongly typed language and enumerated types and if...
then... else and while... do loops (and repeat... until) etc. Remember
that in those days I was used to using Commodore BASIC 4 which didn't
even have an 'else' statement. The only way you could implement an
'else' was with goto. This taught me the evils of spaghetti-code by well
intentioned programmers (amateur and professional) who over-used the
goto statement and wrote code which was impossible to maintain without
rewriting large chunks of code. It also taught me how to write code in
BASIC without needing to use GOTO statements. 

> I understand that this is an open source project so I guess that those
> who
> develop it do so because they love it.
> Are these people users of Lazarus in their day jobs or is Lazarus just
> a
> hobby that they don't ever expect to use professionally?

At the Uni of Canberra (which the CCAE became when I studied there) we
wrote code in Pascal (Apollo Domain Pascal), Turbo Pascal 3, 5, and 5.5,
also C and C++, Assembler, Cobol, Prolog and various databases as well
as lots of theory. Most of the students already knew Pascal from college
so they skipped the lectures and formed groups of 3-5 and developed the
assignments in groups. I was a bit of a loner so I wrote all of my
assignments by myself. That's why I got 9+/10 for all my assignments
(although I did not do well in exams). Those students who bludged on the
group assignments failed the exams. The ones who actually wrote the
code, usually only 1-2 of the groups did well in the exams, because the
exam questions were based on the assignments. That's why I passed the
exams.

I had a good work ethic and wrote my assignments weeks in advance,
living on campus and often computing late into the night. Other students
left it all to 1-2 days before the assignments were due then panicked. I
can recommend learning how to draw Nassi/Schniderman Charts for your
procedures and making friends with computer lecturers and programmers. 

I wrote a NS chart for EVERY procedure of ALL my program code... and
handed it in with a complete listing on 132 column paper. This was a
requirement for the assignments. I don't draw NS charts any more but it
is worth learning HOW to draw them. I prefer NS charts to flowcharts
because with flowcharts it is too easy to write spaghetti-code. We were
taught NS charts in the lectures but many students skipped the lectures.

> I only found Lazarus by accident it seems to have a much lower profile
> than
> other open source stuff (eg python, php, java etc).
> Is there a reason for this?
> Where in the world is Lazarus popular/not so popular. I see that there
> is a
> german language textbook that may be translated to english sometime.

I would like to see this book translated also. I have about 15-20 books
on Delphi but none on Lazarus. Is there a good English lazarus textbook
that we can buy??? Alternatively, is there a PDF version that I can
download and send it to a photocopy shop for printing without infringing
copyright laws??? URLs please???

> The level of skill in this mail group seems quite high. Do people come
> to
> Lazarus as already skilled programmers in other
> languages as I don't see many newbies asking simple questions.
> Or is it the case that people here are older on average and cut their
> teeth
> when Pascal was more popular?

See my comment about about languages taught at Uni of Canberra. I loved
Pascal because it was structured and typed in contrast to BASIC (in
1989) which I had a high skill level in. Also Pascal was standardised
whereas BASIC was not.

> I guess I'm asking in a roundabout way if this community is growing.
> 
> I have read in Delphi discussions many times people talking about how
> to
> make the language more popular.
> One of the issues always brought up is price. Lazarus doesn't have
> this
> problem so I wonder
> if price is a factor in Delphi's relative unpopularity.

Remember that Delphi 5 Standard was AUD$99 and it did not come with the
source code for many units. If you wanted to get all the source code
then you needed to buy Delphi 5 Enterprise for about AUD$2500-3000. Yes,
cost was prohibitive to a hobby deve

Re: [Lazarus] Parser

2010-07-02 Thread Peter E Williams
On Thu, 2010-07-01 at 11:45
+0200,lazarus-requ...@lists.lazarus.freepascal.org wrote:

Hi,

> Message: 6
> Date: Thu, 01 Jul 2010 19:30:26 +0200
> From: Hans-Peter Diettrich 
> Subject: Re: [Lazarus] Parser
> To: Lazarus mailing list 
> Message-ID: <4c2cd0b2.7060...@aol.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Florian Klaempfl schrieb:
> 
> >> A FP-propriety interface part would be added to the C units to make them
> >> create an FP compatible compiled unit, usable in the normal way by
> >> Pascal units and by the linker.
> > 
> > 
> > ... and not fully automatable, so not better than current solutions.
> > Even worse, it does not cover the cases which are really a problem like
> > 
> > #define CONFIGURE_THE_HEADER_IN_A_CERTAIN_WAY // simple example are the
> > UNICODE define in windows headers
> > #include 
> > 
> > Things like this are the really nasty corner cases which make h2pas only
> > semi automatic.
> 
> This is correct, and also is the most important reason for a tighter 
> integration of C source code into FPC projects.
> 
> > Show me a tool which translates C headers fully automatic in *usable*
> > pascal units (test case e.g. glibc and mysql), then we can continue this
> > discussion.
> 
> Just an idea:
> 
> The compiler can create the required (ppu?) files, when compiling a C 
> module. That file then perfectly reflects all the settings, that 
> affected the code generation of that module. Only this "header" version 
> is important for the use of that module, not any other 
> (mis-configurable) header files.
> 
> Likewise the compiler can use the information in the ppu file, instead 
> of those found in any #include file. There may exist some technical 
> problems with this solution, because C enforces no correspondence 
> between header and implementation files, neither by name nor content, 
> but I think that solutions can be found on a package base.
> 
> When a package contains a couple of C files, then a common package 
> header/ppu file could contain the descriptions of *all* items in that 
> package, and a list of related header files. Then the compiler can skip 
> over the listed #include files, and use the precise information in the 
> ppu file instead. This model only requires the construction of packages 
> for all used C files, and a one-time compilation of these packages, for 
> the construction of their ppu files. The compiler or a related tool can 
> create an dummy Pascal library unit for every such package, for easy 
> (human readable) use of the C packages in Pascal code.
> 
> DoDi

I have been trying to follow this discussion but didn't know what part
to quote.

I was under the possibly mistaken impression that Delphi allowed the
user to link in C/C++ code to a Delphi project. I have never done this.
I assumed that Lazarus could link in GNU C/C++ code. Is this, or ever
will it, be possible. What is stopping us from doing this?

I for one would like to open some of the Linux AisleRoit Solitaire C/C++
applications and try to run one or two of it's functions thru' a C/C++
converter then open the original C/C++ project and patch in Lazarus
code. I don't want to convert the entire C/C++ code to Lazarus cos this
would cause waves with the AisleRoit development team which are very pro
C/C++ but it would be nice to say "Hey, guys, have a look at this. It's
your own code with a Pascal/Lazarus patch which improves and enhances
the original game. How about making it your next version. See, you don't
even need to change your original C/C++ to Lazarus. All you need do is
install Lazarus and Bob's your Aunt Fanny... you've got Lazarus code
patched into C/C++ code and the best of both worlds."

You never know, this might open a whole new team of Linux developers
using and improving the Lazarus compiler.

My C/C++ skills are okay but very rusty. There is a good reason why I
don't like C/C++ and choose Pascal over it. I have done a few C/C++ to
Pascal/Delphi ports of Games; completely rewriting the code. 

I think that Pascal is more readable than C/C++ but also that the Linux
world is full of die-hard C/C++ programmers and it is our duty to show
that we can patch in Pascal code elegantly without needing to rewrite
all of their work.

Peter

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new -- still under development)


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


[Lazarus] New component arraybutton Fatal: Can't find unit Graphics used by arraybutton AND Multiple lazarus installations

2010-06-28 Thread Peter E Williams
Hi All,

Well, it's been over a week since I looked at this and I thought that it
was working okay. Now I get Fatal: Can't find unit Graphics used by
arraybutton. It is derived from 

  TArrayButton = class(TGradButton) { class(TButton) }

@name GradButton
@author Eugen Bolz
@lastchange 21.07.2008

I would like advice on whether it is best to use TGradButton or TButton
and how to get rid of these Fatal errors due to not finding the units.

The file is saved here:

/home/pewink/Public/My_code/lazarus/0.9.28.2/pewink/Hexxpawn/ArrayButton/

but for reasons which defy me, whenever I try to open or save any file I
am directed to this folder:

/home/pewink/Public/My_code/lazarus/0.9.28.2/pewink/test1/

I have Multiple lazarus installations on
both /home/pewink/Public/My_code/lazarus/0.9.28.2/lazarus/ (system
default executable) and my own custom lazarus
on /home/pewink/.lazarus/bin/lazarus/ 

and I think that this is causing all the problems. How do I get back to
a single installation of lazarus and not need to worry about the wrong
permissions for files??? Both lazarus installations are the SAME
version, so I only need one not two!!!

unit arraybutton;

//{$MODE Delphi}
{$mode objfpc}{$H+}

{ 
  Author: Unknown +
  --  modifications by Peter E. Williams +
  suggestions from alt.comp.lang.borland-delphi newsgroup +
  suggestions from Mark Meyer in
delphiprogramm...@yahoogroups.com.

  This code is freeware and is placed into the Public Domain by Peter E.
Williams
  ( foss.game.pascal.develo...@iinet.net.au ).

  Version 0.1a - for Lazarus by PEW
Date: 17 June 2010

Added :
FRowCount, FColCount: integer;
procedure SetRowCount(r: integer);
procedure SetColCount(c: integer);

  Version: 0.04a - by PEW. 'col' changed to 'column'. Setcol changed to
 setcolumn.

  Previous versions:
  -
  Versions: 0.03a to 0.03f - trial versions to declare component based
on tcustomcontrol instead of on tbutton. Unsuccessful.
  Version: 0.02b - mods by Mark Meyer + PEW.
  Version: 0.02 - Dated: 15 February 2001
  Version: 0.01 - Dated: 14 April 2000

  Modified to form new unit based on AColorBtn & arraybtn,
  based entirely on Acolorbtn with Row & Column properties of arraybtn
added.

  Note: The only difference between this component and AColorBtn is
*  essentially that this component has additional 'row' & 'Column'
published
  properties.

  Thanks and Acknowledgements:
  ---
  Thanks to the unknown person who originally sent me version 0.01 of
this code,
  and to Bruce Roberts (b...@bounceitattcanada.xnet) who posted up v0.02
modifications
  to the ng. Thanks also to all those in the
alt.comp.lang.borland-delphi newsgroup
  for their discussion of it and support.

  Last modified by: Peter E. Williams

  Known bugs:
  --

   (#1 is now fixed!!!)
#1 - Captions containing #13 characters are displayed as
 as single line of text.

#2 - There is no visual difference between Enabled true or false.
The
 Enabled property works otherwise as normal. Workaround is to
use
 the Font.Style settings to show when a button is Enabled, e.g.
 for Enabled = true set to [fsbold], false set to [fsitalic]
(this
 is NOT done automatically).

#3 - Color property is assigned an invalid value of clCream.
 Reported by "Mark Meyer" 
 (via delphiprogramm...@yahoogroups.com)

   Available from:
 ??
http://www.angelfire.com/biz6/pwillcomputing/peter_delphi_page.html
   as filename:
 arraycolorbtn_src.zip

 
}

interface

uses
  {Windows,}{ Messages,} SysUtils, Classes, Graphics, Controls, Forms,
Dialogs,

../Hexxpawn/ArrayButton/arraybutton.pas(1,1) Fatal: Can't find unit
Graphics used by arraybutton
this error is actually on line 78, column 45 !!!

  {StdCtrls,}
  LcLType, lresources,

  ugradbtn;


type

  TOnArrowKeyEvent = procedure( Sender: TObject;
Key: Word;
Row: integer;
Column: integer;
RowCount : integer; // new
ColCount : integer; // new
var handled: boolean) of object;

  TArrayButton = class(TGradButton) { class(TButton) }
  private
IsFocused: Boolean;
FCanvas: TCanvas;
FRow,FColumn, FRowCount, FColCount: integer;
FUseDefaultKeyHandler : boolean;
FOnArrowKey : TOnArrowKeyEvent;
procedure SetRow(r: integer);
procedure SetColumn(c: integer);
procedure SetRowCount(r: integer);
procedure SetColCount(c: integer);

{
procedure CNDrawItem(var Msg: MDrawItemStruct); message CN_DRAWITEM;
//procedure CNDrawItem(var Msg: TWMDrawItem); message CN_DRAWITEM;
procedure CMFontChanged(var Msg: TMessage); message CM_FONTCHANGED;
procedure CMEnabledChanged(var Msg: TMessage); message
CM_ENABLEDCHANGED

[Lazarus] dBase TIP - how to "append from array records reindex" (example)

2010-06-20 Thread Peter E Williams
Hi Lazarus Folk,

I hope that this is not too off topic but in view of the discussions
about embedded databases I thought I would share a tip from many years
ago about using the XBASE "append from array aRec reindex" command with
the REINDEX parameter:

  * Rebuilds open indexes after all records have been changed.
Without REINDEX, dBASE Plus updates all open indexes   
  * after appending each record from . When the current table
has multiple open indexes or contains many
  * records, APPEND FROM ARRAY executes faster with the REINDEX
option.

This is a tip which I passed onto an IT pro would was appending millions
or billions of records across a WAN and found that appending WITH the
index was far too slow.

http://www.dbase.com/help/2_61_5/Xbase/IDH_XBASE_COPY_TO_ARRAY_EX.htm

COPY TO ARRAY example

"The following example uses COPY TO ARRAY and APPEND FROM ARRAY to copy
records between tables where the fields are the same data type, but may
not have the same field names. (If the field names were the same, the
APPEND FROM command would be easier.) To minimize disk access, records
are read in blocks of 100.

Apologies for this being dBase code instead of PASCAL, but you'll get
the idea (PEW)

PROCEDURE AppendByPosition( cSource )

   #define BLOCK_SIZE 100 
   local cTarget, aRec, nRecs, nCopied 
   *-- Get alias for current table 
   cTarget = alias( ) 
   use ( cSource ) in select( ) alias SOURCE 
   if reccount( "SOURCE" ) == 0 
  *-- If source table is empty, do nothing 
  return 0 
   endif 

   *-- Create array with default block size 
   aRec = new Array( BLOCK_SIZE, FLDCOUNT( "SOURCE" ) ) 
   nCopied = 0 

   do while .not. eof( "SOURCE" ) 
  *-- Calculate number of records to copy, the smaller of 
  *-- the block size and the number of records left 
  nRecs = min( BLOCK_SIZE, reccount( "SOURCE" ) - nCopied ) 
  if nRecs < BLOCK_SIZE 
 *-- Resize array for last block to copy 
 aRec.resize( nRecs, FLDCOUNT( "SOURCE" ) ) 
  endif 
  select SOURCE 

  *-- Copy next block 
  copy to array aRec rest 

  *-- Move from last record copied to first record in next block 
  skip 

  select ( cTarget ) 

  * --- note by PEW 
  * we could have used the reindex parameter with the append 
  * statement or use the CREATE INDEX command after the enddo

  * http://www.dbase.com/help/Xbase/IDH_XBASE_APPEND_FROM_ARRAY.htm

  * (old code)
  * append from array aRec 

  append from array aRec reindex

  * Rebuilds open indexes after all records have been changed.
Without REINDEX, dBASE Plus updates all open indexes   
  * after appending each record from . When the current table
has multiple open indexes or contains many
  * records, APPEND FROM ARRAY executes faster with the REINDEX
option.

  nCopied = nCopied + nRecs 
   enddo 

   * --- MY CODE BELOW 
   * --- if your database does not support reindex paramater 
   * --- with the append from array command 
   * http://www.dbase.com/help/Xbase/IDH_XBASE_INDEX_EX.htm

   * --- Syntax
   * --- CREATE INDEX  ON  ( [,
...])
   * --- The following statement creates an index on a DBF table:

   CREATE INDEX NAMEX ON employee.dbf (LAST_NAME)

   * --- The following statement adds an index called ZIP on the
ZIP_POSTAL column of the CUSTOMER table:

   * --- another example
   CREATE INDEX ZIP ON CUSTOMER (ZIP_POSTAL)

   use in SOURCE 

return nCopied 

"The COPY TO ARRAY command uses the REST scope to copy the next block of
records. Because the number of records to copy is known (it’s calculated
for the nRec variable), NEXT nRec would also work, but it’s redundant,
because the array has been sized to copy the right number of records.
The array sizing is important because that determines the number of
records that get appended with APPEND FROM ARRAY.

Peter (PEW)

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


Re: [Lazarus] Component installs without icon on component toolbar - tarraybutton.lrs(1, 17) Error: Identifier not found "LazarusResources" (Mattias Gaertner)

2010-06-19 Thread Peter E Williams
Hi Mattias & All,

On Fri, 2010-06-18 at 00:17 +0200, 
Mattias wrote:

> On Fri, 18 Jun 2010 03:38:59 +1000
> Peter E Williams  wrote:
> 
> > Hi dmitry & All,
> > 
> > On Thu, 2010-06-17 at 12:21 +0400, dmitry boyarintsev wrote:
> > > On Thu, Jun 17, 2010 at 12:14 PM, Peter E Williams
> > > > Any ideas???
> > > 
> > > try to clean up manually "lib" directory at the package dir
> (remove
> > > any .o file located there).
> > > 
> > > If ugradbtn is located in stand-alone package (not
> arraycolorbtn.pkg),
> > > you must add the  ugradbtn package to arraycolorbtn requirement's,
> > > instead of using the file directly!
> > > 
> > 
> > I managed to get both the ugradbtn and arraybutton (based on
> > arraycolorbtn) compiled... but with one problem: there was not icon
> for
> > it on the Misc component toolbar. The tarraybutton.lrs file was
> missing.
> > This happens even when I created a new component based on
> TGradButton
> > (ugradbtn.pas).
> 
> Yes, the IDE does not create icons.

> > This seems to be a bug in lazarus. When you create a new component
based
> > on a existing component the .lrs file is missing.

Surely it would not be hard to write a small program which loads a PNG/s
and then calls the 

~/lazarus/tools/lazres yourunit.lrs TMyComponent.png TMyOtherCom.png ...

I think that a GUI interface like this would be a great improvement &
should be simple to write.

> See the fine manual
> 
> http://wiki.lazarus.freepascal.org/Lazarus_Packages#Add_a_component_icon

Thanks, I had a read of it. It told me what I was doing wrong.

> > Also I could not save
> > the lpk file with the default name because it told me that it
> already
> > existed even tho' it didn't.
> 
> Please create a bug report and steps to reproduce.

The problem I had was that I was trying to "Add a File" instead of "Add
a Unit" ... the distinction is unclear. After all isn't a unit just a
file???

The other problem I had is the when I manually changed the text of the
Register procedure I kept losing my edits. Somewhere there is a [x]
Register procedure checkbox but I could not find it Arrgh!!! It is
frustrating to know that I needed to [x] the Register checkbox but could
not find it.

The dialog window for comparing the differences between the 2 files is
VERY CONFUSING !!!... I must have used it a dozen times before I could
understand what it was trying to tell me. I clicked the filename to view
the changes then on both of the buttons and still lost my edits (at
different times)... eventually I need to click on the checkbox below.
Why don't the lost changes get saved in the BACKUP folder???
 
> > After copying tgradbutton.lrs to tarraybutton.lrs I get these 2
> errors:
> > 
> > /home/pewink/Public/My_code/lazarus/0.9.28.2/pewink/Hexxpawn/ArrayButton/tarraybutton.lrs(1,17)
> >  Error: Identifier not found "LazarusResources"
> 
> Your forgot to use the the unit lresources.

Fixed. Component now installed on Misc component tab. Success!!!

> 
> 
> >[...]
> 
> Mattias
> 

Peter

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


Re: [Lazarus] Adding File to Package -> Fatal: Can't find unit Controls used by ugradbtn

2010-06-17 Thread Peter E Williams
Hi dmitry,

On Thu, 2010-06-17 at 08:49 +0400, dmitry boyarintsev wrote:
> You need to LCL add to the packege's dependency!
> 
> Open the package dialog (the one opened with " Package / New
> Package"), press "Add" button (on the top panel of the dialog). "New
> Requirement"->Package Name, select LCL. Press OK.
> 
> This will add LCL to the package requirements. You don't need to add
> any directories for the LCL (if you've added you must remove them).
> 

I managed to successfully install the 

ugradbtn.pas component to the Misc component tab however I have not been
able to install my arraycolorbtn_pkg which uses it. I have tried
uninstalling the ugradbtn.pas component and installing just
arraycolourbtn_pkg but without any joy.

Package arraycolorbtn_pkg

Files
 - arraycolorbutton.pas
 - ugradbtn.pas
Required Packages
  - LCL
  - FCL (>=1.0)

Recompiling Graphics, checksum changed for FPCAdds
graphics.pp(81,12) Fatal: Can't find unit Graphics used by
arraycolorbutton

I am using the default installation of Lazarus not the home folder
version. My component is in the home folder which I mentioned in my
original post.

Any ideas???

Peter

> thanks,
> dmitry

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


arraycolorbtn_pkg.lpk
Description: XML document
{ This file was automatically created by Lazarus. do not edit!
  This source is only used to compile and install the package.
 }

unit arraycolorbtn_pkg; 

interface

uses
  arraycolorbutton, ugradbtn, LazarusPackageIntf;

implementation

procedure Register; 
begin
  RegisterUnit('ugradbtn', @ugradbtn.Register); 
end; 

initialization
  RegisterPackage('arraycolorbtn_pkg', @Register); 
end.
unit arraycolorbutton;

{$MODE Delphi}

{ --------
  Author: Unknown +
  --  modifications by Peter E. Williams +
  suggestions from alt.comp.lang.borland-delphi newsgroup +
  suggestions from Mark Meyer in delphiprogramm...@yahoogroups.com.

  This code is freeware and is placed into the Public Domain by Peter E. Williams
  ( foss.game.pascal.develo...@iinet.net.au ).

  Version 0.1a - for Lazarus by PEW
Date: 17 June 2010

Added :
FRowCount, FColCount: integer;
procedure SetRowCount(r: integer);
procedure SetColCount(c: integer);

  Version: 0.04a - by PEW. 'col' changed to 'column'. Setcol changed to
 setcolumn.

  Previous versions:
  -
  Versions: 0.03a to 0.03f - trial versions to declare component based
on tcustomcontrol instead of on tbutton. Unsuccessful.
  Version: 0.02b - mods by Mark Meyer + PEW.
  Version: 0.02 - Dated: 15 February 2001
  Version: 0.01 - Dated: 14 April 2000

  Modified to form new unit based on AColorBtn & arraybtn,
  based entirely on Acolorbtn with Row & Column properties of arraybtn added.

  Note: The only difference between this component and AColorBtn is
*  essentially that this component has additional 'row' & 'Column' published
  properties.

  Thanks and Acknowledgements:
  ---
  Thanks to the unknown person who originally sent me version 0.01 of this code,
  and to Bruce Roberts (b...@bounceitattcanada.xnet) who posted up v0.02 modifications
  to the ng. Thanks also to all those in the alt.comp.lang.borland-delphi newsgroup
  for their discussion of it and support.

  Last modified by: Peter E. Williams

  Known bugs:
  --

   (#1 is now fixed!!!)
#1 - Captions containing #13 characters are displayed as
 as single line of text.

#2 - There is no visual difference between Enabled true or false. The
 Enabled property works otherwise as normal. Workaround is to use
 the Font.Style settings to show when a button is Enabled, e.g.
 for Enabled = true set to [fsbold], false set to [fsitalic] (this
 is NOT done automatically).

#3 - Color property is assigned an invalid value of clCream.
 Reported by "Mark Meyer" 
 (via delphiprogramm...@yahoogroups.com)

   Available from:
 ?? http://www.angelfire.com/biz6/pwillcomputing/peter_delphi_page.html
   as filename:
 arraycolorbtn_src.zip

 
}

interface

uses
  {Windows, Messages,} SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  {StdCtrls,}
  LcLType,

  ugradbtn;

type

  TOnArrowKeyEvent = procedure( Sender: TObject; 
Key: Word;
Row: integer;
Column: integer;
RowCount : integer; // new
ColCount : integer; // new
var handled: boolean) of object;

  TArrayColorButton = class(TGradButton) { class(TButton) }
  private
IsFocused: Boolean;
FCanvas: TCanvas;
FRo

[Lazarus] Adding File to Package -> Fatal: Can't find unit Controls used by ugradbtn

2010-06-16 Thread Peter E Williams
Hi All,

I am using Package / New Package / Add File... to create a component
descended from GradButton (@wiki
http://wiki.lazarus.freepascal.org/TGradButton )

I am getting this error
//ugradbtn.pas(18,22) Fatal: Can't find unit Controls used by ugradbtn

Path it the component is:

/pewink/Public/My_code/lazarus/0.9.28.2/pewink/Hexxpawn/arraycolorbtn

Path to lazarus is
/pewink/Public/My_code/lazarus/0.9.28.2/

and fpc is on /usr/bin/fpc

lazarus is also on /usr/lib/lazarus however I am using the version
in /pewink/Public/My_code/lazarus/ because I needed to change some of
the permissions from read-only and the only way was to copy the whole
folder.

{
@name GradButton
@author Eugen Bolz
@lastchange 21.07.2008
@version 1.4
@thx to http://www.delphipraxis.net/topic67805_farbverlauf
+berechnen.html
@license http://creativecommons.org/licenses/LGPL/2.1/
@wiki http://wiki.lazarus.freepascal.org/TGradButton
}

unit ugradbtn;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, Controls, graphics, LCLType,LResources,
//ugradbtn.pas(18,22) Fatal: Can't find unit Controls used by ugradbtn
  LCLIntf ,Buttons, urotatebitmap, types;

---
{ This file was automatically created by Lazarus. do not edit!
  This source is only used to compile and install the package.
 }

unit arraycolorbtn_pkg;

interface

uses
  regarraycolorbutton, LazarusPackageIntf;

implementation

procedure Register;
begin
end;

initialization
  RegisterPackage('arraycolorbtn_pkg', @Register);
end.



-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


[Lazarus] hexxpawn8_0.50.alpha filename_Trace_File_DBF = {const filename_Trace_File_DBF = 'hex8_log.dbf'; }

2010-06-16 Thread Peter E Williams
Hi All,

I have finally gotten my project compiling without errors. I do however
get a Debugger exception with the const filename_Trace_File_DBF =
'hex8_log.dbf'; ... which I find very odd.

>From hexboard3.pas (see procedure THxboard.open_trace_file; below)

  Trace_File_DBF.Name := filename_Trace_File_DBF;

  // ^^^ Error occurs at the
above line
  // filename_Trace_File_DBF = 

Debugger hexxpawn8 raised exception class 'EComponentError' with
message:
"hex8_log.dbf" is not a valid component name

[Break] [Continue]
[ ] Ignore this exception type

I then click on [Continue] and get the following error:

Error
Project hexxpawn8 raised exception class 'External: SIGSEGV'.
[OK]

Note: "hex8_log.dbf" is NOT created. I don't know what code is raising
the External: SIGSEGV code.

The zip of hexxpawn_0.50.alpha.zip (including all backup files) is here:

http://8938743253203581429-a-1802744773732722657-s-sites.googlegroups.com/site/pewtas/hexxpawn_0.50.alpha.zip

it is 6.9 Megabytes in size (25.4 Megabytes unzipped)

All code is 100% freeware open source copyright to myself and License:
GPL/LGPL (although not stated but implied). Note that the about Window
still states the version at 0.14a for Windows -- the last stable Delphi
5 Enterprise version.

unit hexboard3;

interface

uses
  SysUtils, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls, Buttons, {Windows,}
  inifiles,
  Menus, dbf, LMessages,
  ActnList, DB, dbf_common,
  Grids, ExtCtrls, {shellapi,} TypInfo,
  LclType,

  h_decs, // hexxpawn global declarations
  general // hexxpawn general routines

  //BTOdeum, // used for sound beeping.
  ;

const
  //WM_USER_APPLICATION_MINIMIZE = WM_USER + 1;
  WM_USER_APPLICATION_MINIMIZE = LM_USER + 1;
  default_game_over_song = 'Entertainer';
  filename_Hexx_Data_DBF = 'hex8.dbf';
  filename_Trace_File_DBF = 'hex8_log.dbf';
  filename_Moves_DBF = 'moves.dbf';

  TXBaseConst = xBaseVII;



procedure THxboard.open_trace_file;
var
  S : String;
  I : integer;
begin
  S := Application.ExeName;
  // hack for Mac
  I := Pos('.app/Contents/MacOS/', S);
  if (I > 0) then
S := Copy(S,1, I+3);
  try
begin
  Trace_File_DBF.TableLevel := Longint(TXBaseConst);
  Trace_File_DBF.FilePath := ExtractFilePath(S) + 'data' +
PathDelim;
  Trace_File_DBF.Name := filename_Trace_File_DBF;

  // ^^^ Error occurs at the
above line
  // filename_Trace_File_DBF = 

  //if FileExists( filename_Trace_File_DBF ) then
  showmessage( 'FilePath = ' + Trace_File_DBF.FilePath + ' : Name =
' + Trace_File_DBF.Name );
  With Trace_File_DBF do
  if Exclusive then
exit
  else
  begin
Open;
With Trace_File_DBF do
begin
  Close;
  // Trace_File_DBF.FilePathFull := 
  Trace_File_DBF.TableLevel := Longint(TXBaseConst);
  //  Trace_File_DBF.FileName := 'hex8_log.dbf';
  Trace_File_DBF.TableName := filename_Trace_File_DBF;
  with Trace_File_DBF.FieldDefs do
  begin
Clear;
Add( 'game_counter', ftinteger, 0, True );
Add( 'turn_counter', ftInteger, 0, True  );
Add( 'player_o_move_from_row', ftInteger, 0, True  );
Add( 'player_o_move_from_col', ftInteger, 0, True  );
Add( 'player_o_move_to_row', ftInteger, 0, True  );
Add( 'player_o_move_to_col', ftInteger, 0, True  );
Add( 'player_x_move_from_row', ftInteger, 0, True  );
Add( 'player_x_move_from_col', ftInteger, 0, True  );
Add( 'player_x_move_to_row', ftInteger, 0, True  );
Add( 'player_x_move_to_col', ftInteger, 0, True  );
Add( 'record_no', ftInteger, 0, True  );
Add( 'winner', ftString, 12, True  );
Add( 'move_options', ftString, 25, True  );
Add( 'pawn_move_rating', ftString, 25, True  );
Add( 'successful_move', ftBoolean, 0, True  );
Add( 'pawn_no', ftInteger, 0, True  );
Add( 'direction', ftInteger, 0, True  );
Add( 'option_was', ftString, 25, True  );
  end; // with
  Open;
  Trace_File_DBF_open := true;
  //Exclusive := True;
  //Trace_File_DBF.GotoEOF; // needs changing
  Trace_File_DBF.FindLast; // needs changing
end; // with
  end; // else
end; // try
  except
  //finally
  end;
end; { open_trace_file }
{-}


-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)



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


Re: [Lazarus] Functions, procedures etc for using Dbase3/4 files ... what are they in Lazarus? (I used XBase1 in Delphi 5)

2010-06-15 Thread Peter E Williams
Hi Joost & All,

On Tue, 2010-06-15 at 11:40 +0200, Joost van der Sluis wrote:
> On Tue, 2010-06-15 at 14:54 +1000, Peter E Williams wrote:
> > 
> > On Mon Jun 14 18:00:51 CEST 2010, Howard Page-Clark wrote:
> > > For a general introduction have a look at
> > > http://wiki.lazarus.freepascal.org/Lazarus_Database_Tutorial
> > 
> > I have looked at this document
> > 
> > > For using Tdbf have a look at
> > > http://wiki.lazarus.freepascal.org/Lazarus_Tdbf_Tutorial
> > 
> Dataset.FieldByName('fieldname').AsString;
> Dataset.FieldByName('FieldName').AsString := NewValue;
> Dataset.Append;  Dataset.Post;
> Dataset.RecNo := Rec_No;

I have spent all morning making those changes. Thank you,
Joost !!! :-)))

> 
> 
> But you shouldn't use that. Use bookmarks instead.

Do you have a url for a tutorial about bookmarks or some sample code? I
would really appreciate it.

> Joost.
> 

Peter 

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


Re: [Lazarus] Functions, procedures etc for using Dbase3/4 files ... what are they in Lazarus? (I used XBase1 in Delphi 5)

2010-06-14 Thread Peter E Williams
ves then
  begin
open_trace_file;
with TraceFile_DBF
try
  With TraceFile_DBF.FieldDefs do
  begin
// ### needs changing
    TraceFile_DBF.GotoRecord(trace_rec_no);
TraceFile_DBF.UpdFieldStr('record_no',
inttostr(HexxData_DBF_rec_no));
  end;
//finally
except
  close_trace_file;
end;
  end;
open_db;
// ### needs changing
HexxData_DBF.GotoRecord(HexxData_DBF_rec_no);
  end; // if found

  end; // else
end; { write_updated_pattern  }
{-}

Best Regards,
Peter

> 
> On Tue, 15 Jun 2010, Peter E Williams wrote:
> 
> > Hi All,
> >
> > I really need to know what is the Dbase3/4 unit for Lazarus/Free
> Pascal
> > and where is the sample project for manipulating them. I found it
> > somewhere on the lazarus website but don't know where. I hope that
> it is
> > okay for me to post some of my code which uses the XBase1 unit in
> Delphi
> > 5 Enterprise which I am porting to my Hexxpawn8 game (which is cross
> > platform open source).
> >
> > I use Dbase3/4+ files to store board patterns for my game which is
> sort
> > of a cross between the pawns in Chess and checkers, using AI logic
> > against the computer. (I chose Dbase format because it was the
> single
> > most common database file format at the time.)
> >
> > What is the replacement unit for XBase1 for using Dbase3/4 files,
> and
> > the functions/procedures etc to replace these calls to XBase1 ?
> >
> > How do I do the following:
> >
> > // declaring a Dbase file -- TXBase (what is the equivalent in
> Lazarus?)
> > // how do I copy a blank.dfg file to hex8.bdf (Copyfile) ???
> > // I need to Goto to the Bottom of File (HexxData.GotoBOF;)
> > // I need to call a function GetFieldByName passing a string as the
> > field name and comparing it with a character
> > // I need to Goto the Next record (HexxData.GotoNext;)
> > // I need to Get the Record # (HexxData.RecNo;)
> > // and test the Dbase.EOF (not HexxData.EOF)
> > // and Append a Blank record (HexxData.AppendBlank;)
> > // save an integer to a Field (HexxData.UpdFieldStr('this_game',
> > inttostr(pattern.this_game)); )
> > // and Goto to the Record number
> (HexxData.GotoRecord(hexxdata_rec_no);)
> >

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


[Lazarus] Functions, procedures etc for using Dbase3/4 files ... what are they in Lazarus? (I used XBase1 in Delphi 5)

2010-06-14 Thread Peter E Williams
Hi All,

I really need to know what is the Dbase3/4 unit for Lazarus/Free Pascal
and where is the sample project for manipulating them. I found it
somewhere on the lazarus website but don't know where. I hope that it is
okay for me to post some of my code which uses the XBase1 unit in Delphi
5 Enterprise which I am porting to my Hexxpawn8 game (which is cross
platform open source).

I use Dbase3/4+ files to store board patterns for my game which is sort
of a cross between the pawns in Chess and checkers, using AI logic
against the computer. (I chose Dbase format because it was the single
most common database file format at the time.)

What is the replacement unit for XBase1 for using Dbase3/4 files, and
the functions/procedures etc to replace these calls to XBase1 ?

How do I do the following:

// declaring a Dbase file -- TXBase (what is the equivalent in Lazarus?)
// how do I copy a blank.dfg file to hex8.bdf (Copyfile) ???
// I need to Goto to the Bottom of File (HexxData.GotoBOF;)
// I need to call a function GetFieldByName passing a string as the
field name and comparing it with a character
// I need to Goto the Next record (HexxData.GotoNext;)
// I need to Get the Record # (HexxData.RecNo;)
// and test the Dbase.EOF (not HexxData.EOF)
// and Append a Blank record (HexxData.AppendBlank;)
// save an integer to a Field (HexxData.UpdFieldStr('this_game',
inttostr(pattern.this_game)); )
// and Goto to the Record number (HexxData.GotoRecord(hexxdata_rec_no);)

See examples of my code below

Unit hexboard2.pas

// declaring a Dbase file -- TXBase
var
  HexxData, TraceFile: TXBase;

procedure Thxboard.Open_db;
begin
  if not fileExists('hex8.dbf') then
CopyFile('blank.dbf', 'hex8.dbf', false);
// how do I copy a blank.dfg file to hex8.bdf ???

  HexxData := TXBase.create(nil);
// I assume that this is how to create a replacement for a Dbase file
  HexxData.FileName := 'hex8.dbf';
  HexxData.Active := true;
  HexxData.GotoBOF;
// I need to Goto to the Bottom of File
end; { Open_db }

function Thxboard.pattern_is_db_current(pattern1: pattern_type):
boolean;
var
  str_x, str_o: array[1..8] of string;
begin
  pattern_is_db_current := false;
  str(pattern1.x_piece[1], str_x[1]);
 // ..
  if (HexxData.GetFieldByName('x1_pos') = str_x[1]) and

// I need to call a function GetFieldByName passing a string as the
field name and comparing it with a character

//..
(HexxData.GetFieldByName('x8_pos') = str_x[8]) then
if (HexxData.GetFieldByName('o1_pos') = str_o[1]) and
//..
  (HexxData.GetFieldByName('o8_pos') = str_o[8]) then
  pattern_is_db_current := true;
end; { pattern_is_db_current }
{-}

procedure Thxboard.Find_pattern(var pattern1: pattern_type;
  var found: boolean);
begin
//,,
HexxData.GotoNext;

// I need to Goto the Next record

end; { Find_pattern }
{-}

procedure Thxboard.write_updated_pattern(var pattern1: pattern_type);
var
  found: boolean;
begin
  found := false;
  if pattern_is_db_current(pattern1) then
{ save pattern options to db }
begin
  save_options(pattern1);

  hexxdata_rec_no := HexxData.RecNo;
// I need to Get the Record #
  close_db;
  if trace_moves then
//..
  open_db;
  HexxData.GotoRecord(hexxdata_rec_no);
// then I need to Goto to record #
end
  else
  { save entire pattern to db };
  begin
while (not HexxData.EOF) and not found do

// and test the Dbase.EOF (end of file)
  begin
//..
  end;
if not found then
  begin
  { --- add a new record --- }
HexxData.AppendBlank;

// and Append a Blank record

save_options(pattern1);
HexxData.UpdFieldStr('this_game', inttostr(pattern.this_game));

// save an integer to a Field 

//..
hexxdata_rec_no := HexxData.RecNo;
close_db;
if trace_moves then
//..  
open_db;
HexxData.GotoRecord(hexxdata_rec_no);
// and Goto to the Record number
  end; // if found
  end; // else
end; { write_updated_pattern  }
{-}
-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


[Lazarus] hexboard2.pas(837, 42) Error: Error in type definition (board2 : TStringGrid)

2010-06-14 Thread Peter E Williams
Hi All,

I am porting my general.pas unit from my Delphi 5 Enterprise game. I use
TStringGrid (previously TStringAlignGrid) and this worked fine in my
project.

In procedure Thxboard.flip_boards; the var board2: TStringGrid; gives a
type definition (board2: TStringGrid) error. The unit uses Grid unit.

general.pas is a unit which accept sg1 (a TStringGrid -- previously a
TStringAlignGrid) passed as a parameter from hxboard2.pas which has a
form and StringGrid1 on it's form (a TStringGrid).

>From unit general.pas
unit general;

interface
   
procedure encode_board(sg1: TStringGrid;
  var x_piece, o_piece: board_data_type;
  var x_count: integer);

implementation

// line 55 below
procedure encode_board(sg1: TStringGrid;
  var x_piece, o_piece: board_data_type;
  var x_count: integer);
//general.pas(55,11) Hint: Found declaration:
encode_board(TStringGrid,var board_data_type,var board_data_type,var
LongInt);

//..
end; { encode_board }
{-}

procedure Thxboard.flip_boards;

{ flip known boards for new patterns }
var
  pc, LastRecord, same: integer;
//line 837 -- board1 renamed board1A to avoid 
//name conflict with TStringGrid on TForm
  board1A { board1 }, board2: TStringGrid;
//hexboard2.pas(837,42) Error: Error in type definition
//..
{.}

  procedure flip_options_symmetrical_board;
//..
  end; { flip_options_symmetrical_board }
{.}

  procedure add_amend_flipped_pattern;
  var
b, c: integer;
  begin
with temp2_pattern do
  begin
//line 868 below
encode_board(board2, x_piece, o_piece, pc);
//hexboard2.pas(868,28) Error: Incompatible type for arg no. 1: Got
"", expected "TStringGrid"
{ flip the pawn options }
if pc > 0 then
  for b := 1 to pc do
for c := 1 to 3 do
  option[abs(b - pc - 1), abs(c - 4)] :=
temp1_pattern.option[b, c];
if pc <> level then
  for b := pc + 1 to level do
for c := 1 to 3 do
  option[b, abs(c - 4)] := temp1_pattern.option[b, c];
  end; { with }
inc(this_game_counter);
temp2_pattern.this_game := 0;
write_updated_pattern(temp2_pattern);
  end; { add_amend_flipped_pattern }
{.}

  function board_is_symmetrical: boolean;
//..
  end; { board_is_symmetrical }
{.}

begin { flip_boards }
  {board1} board1A := TStringGrid.create(nil);
  board2 := TStringGrid.create(nil);
  {board1} board1A.ColCount := 8;
  {board1} board1A.RowCount := 8;
  board2.ColCount := 8;
  board2.RowCount := 8;

  { more code commented out }

  {board1} board1A.Free;
  {board1} board1A := nil;
  board2.Free;
  board2 := nil;
end; { flip_boards }
{-}

Best Regards,
Peter

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


[Lazarus] hexboard2.pas(22, 42) Error: Identifier not found "WM_USER"

2010-06-14 Thread Peter E Williams
Hi All,

I have been porting a game written in Delphi 5 Enterprise. 

I am getting an Identifier not found for WM_USER when assigning it to
the WM_USER_APPLICATION_MINIMIZE const. What do I do to correct this
error? I am implementing procedure OnUserAppMin(var M: TMessage);

from unit hexboard2.pas

const
  WM_USER_APPLICATION_MINIMIZE = WM_USER + 1;
 ^^^  
hexboard2.pas(22,42) Error: Identifier not found "WM_USER"

type
  { Thxboard }

  Thxboard = class(TForm)
//...
  private
{ Private declarations }
procedure OnUserAppMin(var M: TMessage);
  message WM_USER_APPLICATION_MINIMIZE;

procedure Thxboard.OnUserAppMin(var M: TMessage);
begin
  Application.Minimize;
end; { OnUserAppMin }

Peter

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


[Lazarus] Should I Convert TStringAlignGrid 2.1 or use TStringGrid ??? http://www.hoerstemeier.com/

2010-06-10 Thread Peter E Williams
subject: Should I Convert TStringAlignGrid 2.1 or use TStringGrid ???
http://www.hoerstemeier.com/ (based on Delphi 6)

Hi All,

Should I convert the .pas and .dfm files into lazarus .pas and .lfm
files ??? Or should I use the standard lazarus TStringGrid component ???

I used Andy's TStringAlignGrid components for my Delphi 5 Enterprise
games (freeware open source)... In particular I loved the TAlgrid. These
days I use Linux Ubuntu 10.04 LTS and Lazarus for cross platform open
source game development.

I need to port some delphi code to lazarus... which turns out to be very
easy once I have lazarus installed. I simply use the Tools / Convert DFM
to LFM ... menu option.

I use Andy's TStringAlignGrid v2.1 (TAlgrid) in about 4-5 of my games
instead of the standard TStringGrid. ( I have a link to Andy's component
on my website's Delphi Source Code page ... have done for 11 years or
more!!! ) http://www.hoerstemeier.com/

The features I use are:

* changing cell fonts and by grid and by row and column
* changing cell and grid cell colours individually and by row and
column.
* cell, column & row alignment
* probably some other stuff which does not come to mind.

Andy's units are too complicated for my needs but I remember them as
being very powerful and excellently written :-))) I have not looked at
you code in years.

Thank you for reading this... and I look forward to hearing from you.

Peter

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-games.org (<--- brand new)


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


Re: [Lazarus] The default local HTML Help path is blank --> what should it be?

2010-06-08 Thread Peter E Williams
Hi Mattias and all,

> Date: Tue, 01 Jun 2010 23:10:07 +1000
> From: Peter E Williams 
> Subject: Re: [Lazarus] The default local HTML Help path is blank --
> what should it be?
> Mattias Gaertner nc-gaertnma at netcologne.de 
> Sun May 23 09:49:42 CEST 2010 
> 
> 
> On Sun, 23 May 2010 09:25:55 +1000
> Peter E Williams  wrote:
> 
> > Hi All,
> > 
> > I asked this question in my previous post but in hindsight I should
> have
> > posted it as a separate question. 
> > 
> > > Selecting Help from the message window gives this error. The path
> to
> > > the Help Help was blank even tho' it has apparently been
> installed.
> I
> > > don't know where to set the path to (default location). I tried
> the
> > > online help but got lost :-(((
> > > 
> > > Help not found
> > > No help found for "main_island.pas(270,41) Error: Incompatible
> type
> > > for arg no.
> > > 1: Got "TranslateString", expected "QWord""
> > > [Cancel]
> 
> > The help for fpc messages is not installed. They are tricky.
> 
> Okay Mattias and all, I have just two days ago got my Linux Ubuntu
> 10.04
> LTS system stable with all the updates and latest Lazarus.
> 
> Tested it with a blank project and it works great !!! :-)))
> 
> How do I install the help for fpc. What is the trick???

The only reply I ever got was Mattias telling me that it is tricky and
pointing me to 6 dozen documents on the website.

> > I printed out Lazarus IDE Tools (16 pages) and Lazarus Tutorial (16
> > pages) but I cannot find it.
> 

I did go to the documentation part of the site but could not find the
appropriate document to read.

> > Can I please suggest that when a user right clicks to open the
> context
> > menu that a menu option 'Look up Help' be added (defaulting to local
> > help if present, then internet help if not)

This is a good suggestion!!! Please investigate if it can be done.

> > 
> > >Mattias
> > 
> > Peter
> > 
> -- 
> Proudly developing Quality Cross Platform Open Source Games
> Since 1970 with a Commodore PET 4016 with 16 KRAM
> http://pews-freeware-gaems.org (<--- brand new)
> 
> 



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


[Lazarus] Vortex unit for Turbo Pascal -- looking for volunteers to convert this excellent unit and others to Free Pascal and Lazarus.

2010-06-07 Thread Peter E Williams
Hi,

Michael John Phillips is a friend of mine for over 3 decades and he is
an unemployed Delphi communications programmer living in Canberra,
Australia. He writes excellent and well documented code and below is a
link to his Vortex unit. It is a mix of pascal and assembler for
Windows. 

I am keen to use as much of it as practical for Lazarus cross platform
work. The reason why I don't want to port it myself is cos my assembler
knowledge is terrible and I don't want to cock-up Michael's excellent
work.

The vortex unit and other Delphi and pascal units found on the link at
the bottom of this email are truly worthy of conversion... with one
caveat -- we need to use compiler switches to exclude functions &
procedures with assembler code from non-Windows systems.


Vortex

This unit contains various routines that I use regularly in the software
I write.

This includes routines to UpperCase, LowerCase, and Capitalise strings;
reading / writing disk sectors; searching a drive for a particular file;
copying a file; to name a few.



UnitVortex;
{---}
{  Author  : Michael John Phillips  }
{  Address : Unit 53 / 3 Waddell Place  }
{Curtin ACT 2605}
{  Tel : +61 (2) 6281-1980  }
{  Fax : +61 (2) 6281-1980  }
{  Mob : 0417 264319}
{  Email   : mphil...@pcug.org.au   }
{---}
{  17 Mar 2002  MJP  Added TV_StopWatch routine.}
{  13 Apr 2002  MJP  Added StringReplace routine.   }
{  04 May 2002  MJP  Added IncludeTrailingBackslash,}
{ExcludeTrailingBackslash and GetTempFileName   }
{routines.  }
{  28 May 2002  MJP  Added V_GetComputerName routine.   }
{  11 Jun 2002  MJP  Renamed GetTempFileName to V_GetTempFileName to match  }
{the equivalent routine I have in my Delphi version of  }
{the Vortex routines.   }
{---}

http://members.pcug.org.au/~mphillip/T_INDEX.HTM

Peter

-- 
Love and Friendship, Peter Eric Williams 
+61 3 6236-9675 (home or leave a message) Mobile 044-99-256-50
Proudly created in Australia. Quality Cross-Platform Games since 1970
with a Commodore PET 4016 with 16 Kilobytes of RAM (not Megabytes). 




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


[Lazarus] Clean Up and Build / Fatal Error: Can't Create object file: units/i386-linux/hello.o

2010-06-07 Thread Peter E Williams
Hi Ingo & All,

> 
> Am 04.06.2010 02:21, schrieb Peter E Williams:
> > File: hello.pp [Read-Only] (/usr/lib/lazarus/0.9.28.2/examples)
> >
> Hello,
> 
> if you have installed Lazarus by packagemanager you have no permission
> Hi Ingo & All,
> 
> I tried to add a menu item "Superuser Lazarus" -- "sudo lazarus" with
> a parameter I forget. I am using Ubuntu 9.04 karmic koala and I did it
> on Ubuntu 10.04 LTS.
> 
I tried too add a menu item "Superuser Lazarus" -- "sudo lazarus" with a
parameter I forget. I am using Ubuntu 9.04 karmic koala and I did it on
Ubuntu 10.04 LTS.

I am obviously not running Lazarus as a superuser in the correct manner.
What is the command to run lazarus in superuser mode??? I want 2 menu
items - one for regular use and one for superuser. Please tell me the
command to use.

Note: the guys at the computer shop advised me to run Lazarus with it's
default config and NOT move the examples to the Home folder. My code is
in:

Home/Public/lazarus_source_code

with folders for each project.

> 
> 
> > Am 04.06.2010 02:21, schrieb Peter E Williams:
> > > File: hello.pp [Read-Only] (/usr/lib/lazarus/0.9.28.2/examples)
> > >
> > Hello,
> > 
> > if you have installed Lazarus by packagemanager you have no
> permission 
> > to write by default. It's because the package manager uses 
> > superuser-rights to install it.
> > You'll have to start Lazarus with superuser-rights to rebuild it or 
> > change permission of Lazarus-path.
> > 
> > You could also checkout Lazarus from svn to your $HOME and build it
> there.
> > 
> > Regards,
> > Ingo
> > 
> > 
> -- 
> Love and Friendship, Peter Eric Williams 
> +61 3 6236-9675 (home or leave a message) Mobile 044-99-256-50
> Proudly created in Australia. Quality Cross-Platform Games since 1970
> with a Commodore PET 4016 with 16 Kilobytes of RAM (not Megabytes). 
> 
> to write by default. It's because the package manager uses 
> superuser-rights to install it.
> You'll have to start Lazarus with superuser-rights to rebuild it or 
> change permission of Lazarus-path.
> 
> You could also checkout Lazarus from svn to your $HOME and build it
> there.
> 
> Regards,
> Ingo
> 

-- 
Love and Friendship, Peter Eric Williams 
+61 3 6236-9675 (home or leave a message) Mobile 044-99-256-50
Proudly created in Australia. Quality Cross-Platform Games since 1970
with a Commodore PET 4016 with 16 Kilobytes of RAM (not Megabytes). 




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


[Lazarus] Clean Up and Build / Fatal Error: Can't Create object file: units/i386-linux/hello.o

2010-06-03 Thread Peter E Williams
Hi All,

I am wondering if the default installation paths for 0.9.28.2 on Ubuntu
10.04 LTS require tweaking.

I know that the HTML Help is NOT installed and this is really pissing me
off.

Error:
/usr/lib/lazarus/0.9.28.2/examples/hello.pp(31,1) Error: Can't create
object file: units/i386-linux/hello.o
/usr/lib/lazarus/0.9.28.2/examples/hello.pp(31,1) Fatal: Can't create
object units/i386-linux/hello.o

Lazaurus Tools / Configure "Build Lazarus" Quick Build Options

Clean Up + Build

LCL interface
Target gkt 2 (beta) IDE gtk 2 (beta)

File: hello.pp [Read-Only] (/usr/lib/lazarus/0.9.28.2/examples)
{

***
 *
*
 *   This source is free software; you can redistribute it and/or modify
*
 *   it under the terms of the GNU General Public License as published
by  *
 *   the Free Software Foundation; either version 2 of the License, or
*
 *   (at your option) any later version.
*
 *
*
 *   This code is distributed in the hope that it will be useful, but
*
 *   WITHOUT ANY WARRANTY; without even the implied warranty of
*
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
*
 *   General Public License for more details.
*
 *
*
 *   A copy of the GNU General Public License is available on the World
*
 *   Wide Web at . You can also
*
 *   obtain it by writing to the Free Software Foundation,
*
 *   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
 *
*

***
}
program Hello_world;

{$mode objfpc}{$H+}

uses Interfaces, Forms, HelloForm;

begin
   Application.Initialize; { calls InitProcedure which starts up GTK }
   Application.CreateForm(THello, Hello);
   Application.Run;
end.

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-gaems.org (<--- brand new)


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


[Lazarus] DTM Island Maker test program working fine... problems were with saving the form with a different name

2010-06-02 Thread Peter E Williams
Hi All,

Here is a saved txt file from my public domain Digital Terrain Model
Island Maker app 2.6.alpha. It produces ascii text islands suitable for
importing into text based adventure games.

PQK.VXYKIJ
...ORJLTUWLZ12
.@.s...647..nisfdchfg3
.URT...538..MHGENMB9A4
.Q92XWVU.RQO988754
P.1AY...TS.PBA7635
...MNO.E.CBZ.CE216
..KLI..FD.FEDCB..D.Z..
...J.HG.IG...AY.U.
..U.H89.5.XWVT
..VTS.76.4...S
...C..OPRW..J321Z...R.
..DBJM.NQXY..K.VWO.Q..
...JKLAINKM1Z.4Z.LNYU.P...
IE.*HOPQ5YI31M.XT.
...HEGFGL2.SRWXJ2.OPRS
FD..3.8T6VGHMN.Q..
.C.549A7UF.LK.
B96...B.E.
A78...CD..

Island map is generated starting with a "*" and ending with a "@".
All points in between go in the sequence A..Z..1..9 and repeat. This
is simply to show the sequence in which the points were generated.

I found my older Lazarus code and used it. The problems arose when I
saved my unit1.pas and unit1.lfm as a new file name. Lazarus produces
the strange error messages.

I still have 2.5-alpha with the new file names if anyone is interested.


-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-gaems.org (<--- brand new)


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


Re: [Lazarus] How do I switch from viewing a form in the source editor to viewing in the design GUI interface?

2010-06-01 Thread Peter E Williams
Hi Mattias,

Mattias Gärtner nc-gaertnma at netcologne.de 
Tue Jun 1 16:19:10 CEST 2010 

Zitat von Peter E Williams :

> > Hi All,
> >
> > How do I switch from viewing a form in the source editor to viewing
> in
> > the design GUI interface?
> 
> Short cut F12 or the speedbutton: "Toggle Form/Unit".

Nup. Doesn't work. Also the Speedbutton "Toggle Form/Unit" is greyed out.

Okay, so I admit that I had the wrong form name but I corrected it, resaved it 
then reopened it again still no joy.

> 
> 
> > I have a ported old lazarus to current lazarus app and I cannot view
> the
> > form in design view, only in the source editor xml view
> 
> xml? Maybe you mean dfm or lfm? How did you create the xml?
> 
> 
> 

Unable to convert text form data of file
"/home/peterthepoet/Public/My-programming/Lazarus_source_coe/dtm_maker/lazarus_code/set_max_unit.lfm"
into binary stream. (Wrong token type: Symbol expected but / found (at 2,2, 
stream offset 0001A))

file: set_max.lfm
  object OK_button: TButton
Left = 112
Height = 25
Top = 96
Width = 75
Caption = '&OK'
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ModalResfile: set_max.lfm
object set_max: Tset_max
  Left = 212
  Height = 167
  Top = 214
  Width = 406
  Caption = 'Please enter the maximum values for X & Y'
  ClientHeight = 167
  ClientWidth = 406
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  ParentFont = False
  LCLVersion = '0.9.26'
  object Label1: TLabel
Left = 16
Height = 11
Top = 24
Widtame = 'MS Sans Serif'
  ParentFont = False
  LCLVersion = '0.9.26'
  object Label1: TLabel
Left = 16
Height = 11
Top = 24
Width = 168
Caption = 'Maximum Horizontal Value (X):'
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ParentColor = False
ParentFont = False
  end
  object Label2: TLabel
Left = 16
Height = 11
Top = 56
Width = 155
Caption = 'Maximum Vertical Value (Y):'
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ParentColor = False
ParentFont = False
  end
  object Label3: TLabel
Left = 288
Height = 11
Top = 24
Width = 95
Caption = '(Absolute maximum'
ParentColor = False
  end
  object Label4: TLabel
Left = 320
Height = 11
Top = 40
Width = 40
Caption = 'is 1000)'
ParentColor = False
  end
  object max_x_param: TEdit
Left = 192
Height = 21
Top = 16
Width = 73
TabOrder = 0
Text = '0'
  end
  object max_y_param: TEdit
Left = 192
Height = 21
Top = 48
Width = 73
TabOrder = 1
Text = '0'
  end
  object Cancel_button: TButton
Left = 224
Height = 25
Top = 96
Width = 75
Caption = '&Cancel'
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ModalResult = 2
ParentFont = False
TabOrder = 2
  end
  object OK_button: TButton
Left = 112
Height = 25
Top = 96
Width = 75
Caption = '&OK'
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ModalResult = 1
ParentFont = False
TabOrder = 3
  end
end

Unable to convert text form data of file
"/home/peterthepoet/Public/My-programming/Lazarus_source_coe/dtm_maker/lazarus_code/set_max_unit.lfm"
into binary stream. (Wrong token type: Symbol expected but / found (at 2,2, 
stream offset 0001A))

> 
> 
> Mattias



 

// i need to change this

 Your application description here.

// i need to change this

 
  
   
  
 
 
  
   

   
  
 


Peter

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-gaems.org (<--- brand new)



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


[Lazarus] How do I switch from viewing a form in the source editor to viewing in the design GUI interface?

2010-06-01 Thread Peter E Williams
Hi All,

How do I switch from viewing a form in the source editor to viewing in
the design GUI interface?

I have a ported old lazarus to current lazarus app and I cannot view the
form in design view, only in the source editor xml view

Peter

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-gaems.org (<--- brand new)


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


Re: [Lazarus] The default local HTML Help path is blank -- what should it be?

2010-06-01 Thread Peter E Williams
[Lazarus] The default local HTML Help path is blank -- what should it be?
Mattias Gaertner nc-gaertnma at netcologne.de 
Sun May 23 09:49:42 CEST 2010 


On Sun, 23 May 2010 09:25:55 +1000
Peter E Williams  wrote:

> Hi All,
> 
> I asked this question in my previous post but in hindsight I should
have
> posted it as a separate question. 
> 
> > Selecting Help from the message window gives this error. The path to
> > the Help Help was blank even tho' it has apparently been installed.
I
> > don't know where to set the path to (default location). I tried the
> > online help but got lost :-(((
> > 
> > Help not found
> > No help found for "main_island.pas(270,41) Error: Incompatible type
> > for arg no.
> > 1: Got "TranslateString", expected "QWord""
> > [Cancel]

> The help for fpc messages is not installed. They are tricky.

Okay Mattias and all, I have just two days ago got my Linux Ubuntu 10.04
LTS system stable with all the updates and latest Lazarus.

Tested it with a blank project and it works great !!! :-)))

How do I install the help for fpc. What is the trick???

I printed out Lazarus IDE Tools (16 pages) and Lazarus Tutorial (16
pages) but I cannot find it.

Can I please suggest that when a user right clicks to open the context
menu that a menu option 'Look up Help' be added (defaulting to local
help if present, then internet help if not)

>Mattias

Peter

-- 
Proudly developing Quality Cross Platform Open Source Games
Since 1970 with a Commodore PET 4016 with 16 KRAM
http://pews-freeware-gaems.org (<--- brand new)




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


Re: [Lazarus] clarification / Re: constant-highlight ? [Re: quick opinion poll / pascal highlighting "case"]

2010-05-27 Thread Peter E Williams
Hi Vannus & Waldo,

On Thu, 2010-05-27 at 14:40 +0200,
lazarus-requ...@lists.lazarus.freepascal.org wrote:
Message: 9
Date: Thu, 27 May 2010 21:27:18 +0100
From: Vannus 
Subject: On 27 May 2010 20:25, waldo kitty 
wrote:

> On 5/26/2010 14:26, Vannus wrote:
>
>> IMO thats redundant lines + more scrolling to read the code.
whereas:-
>>
>> if x then begin
>>   code
>> end else begin
>>   if y then begin
>> code
>>   end else begin
>> code
>>   end;
>> end;
>>
>>
> the above format hurts my eyes... i cannot see else, for one thing,
and
> cannot separate out the individual code blocks... it is really bad
when it
> spans 50 lines or more... especially when it covers several pages...
at that
> point, you loose the rest of it...

Vannus> im looking for indents, your looking for begin/ends. i think
this is where
Vannus> 'what your used to' comes in.. we both use what suits us.
Vannus> when 'code' makes the 'if' big, then i put the 'code's into
their own
Vannus> procedures/functions. keeps things neat & orderly. imho what the
'if' is
Vannus> doing is seperate from what the 'code' is doing.

Vannus> taking the AI perpective:-
Vannus> 'if' - making decision.
Vannus> 'code' - acting on decision.

Vannus> this lets you debug/maintain the decisions making from the
acting on
Vannus> decisions easily, and lets others pick up whats going on
quickly..

Please take a look here:

http://en.wikipedia.org/wiki/Dangling_else

it is a discussion of the classic programming problem of the Dangling
Else which we learnt about at the Uni of Canberra in 1990.

>  involves less scrolling when its big, or when using smaller screen.
>>

I am using a 15.5" monitor on this pc. Currently Ubuntu 9 without
Lazarus installed. Ubuntu 10.04 LTS does have Lazarus installed. Have
not been able to install security fixes for either Ubuntu for a
week :-(((



Vannus> i find scrolling up & down constantly to make sure what i've
done isn't
Vannus> going to adversely affect the other code (proof-read the code)
is an
Vannus> unnecessary inconvenience.

>  where the semicolons should go is clear
>> every line is functional, no redundant lines
>> more like one-line if
>>
>
> hehehe... more like a one line program :P ;)

Vannus> i can only aspire to such things 8D

I am wondering what are your views on programs such as Code Browser
(freeware cross platform)

http://tibleiz.net/code-browser/download.html

Peter W
Hobart, Australia


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


Re: [Lazarus] Error: Identifier not found "CreateaNewIsland1Click" - now compiles. Wrong form loaded

2010-05-23 Thread Peter E Williams
Hi Vannus & All,

-- 
Love and Friendship, Peter Eric Williams 
+61 3 6236-9675 (home or leave a message) Mobile 044-99-256-50
Proudly created in Australia. Quality Cross-Platform Games since 1970
with a Commodore PET 4016 with 16 Kilobytes of RAM (not Megabytes). 


On Sun, 2010-05-23 at 03:11 +0100, Vannus wrote:
> 
> 
> On 23 May 2010 00:56, Peter E Williams
>  wrote:
> Hi All,
> 
> I am now getting an identifier not found error. In the error
> messages
> window, if I select Help the lazarus cannot find the local
> HTML help
> file. I cannot find my way around the lazarus website. :-(
> 
> >file set_max.pas
> Uses
> main_island;
> 
> { set_max_form }
> 
> procedure Tset_max_form.OK_buttonClick(Sender:
> TObject);
> begin
> > line 42
> CreateaNewIsland1Click(Sender);
> 
> 
> shouldn't this be main_island.CreateaNewIsland1Click(Sender); like
> below?
>  
> //
> main_island.CreateaNewIsland1Click(Sender);
> end;

main_island_form.CreateaNewIsland1Click(Sender);
is correct. Now it compiles on my desktop (Linux Ubuntu 10.10 LTS)

Now the problem I have is that the default Form1 is in the project from
the default project & I cannot figure out where I add *my* forms to the
project and remove the default form1.

Please tell me where this is documented. I used the Lazarus menu option
(I'm on my laptop without Lazarus installed) to view the forms in the
project but I couldn't find the "add forms to project" option anywhere.
Also I could not find the project set default form or project name and
icon options.

This is compounded by the fact that the default path to the local html
help files is blank even tho' it is apparently installed!!! Where in
God's name is this documented?!?

I find the lazarus website to be massive and there appears to not be a
search option so that I can type in, Google style, what I am looking
for.
 
Also, IIRC in the view forms in project dialog clicking on the Help
button does not do anything!!! Is this a bug?!? Surely if the help file
is not found then couldn't we just have a showmessage('Help file not
found!'); Maybe even print in the message window the path that it was
searching for the help file. Preferably such that one can copy the path
into a text editor, and then change the lazarus search path options (I
lose track of this menu option too!) Having the documentation to read
would really help!!!

I am having problems getting the latest updates on the laptop. So, I'll
need to investigate that.
> 

Fond Regards,
Peter W.


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


[Lazarus] Error: Identifier not found "CreateaNewIsland1Click"

2010-05-22 Thread Peter E Williams
Hi All,

I am now getting an identifier not found error. In the error messages
window, if I select Help the lazarus cannot find the local HTML help
file. I cannot find my way around the lazarus website. :-(

>file set_max.pas
Uses
main_island;   

{ set_max_form }

procedure Tset_max_form.OK_buttonClick(Sender:
TObject);
begin   
 
> line 42
CreateaNewIsland1Click(Sender);   
//
main_island.CreateaNewIsland1Click(Sender); 
end;

Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 2.4.0-2 [2010/03/06] for i386
Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for i386
Compiling project1.pas
Compiling set_max.pas
set_max.pas(42,25) Error: Identifier not found "CreateaNewIsland1Click"
set_max.pas(50) Fatal: There were 1 errors compiling module, stopping

>file main_island.pas
type
  Tmain_island_form = class(TForm)

procedure make_an_island;

  private
{ Private declarations }
  public
{ Public declarations }
procedure CreateaNewIsland1Click(Sender: TObject);
  end;

var
  main_island_form : Tmain_island_form;

procedure Tmain_island_form.CreateaNewIsland1Click(Sender: TObject);
begin
  make_an_island;
end; { CreateaNewIsland1Click }

-- 
Love and Friendship, Peter Eric Williams 
+61 3 6236-9675 (home or leave a message) Mobile 044-99-256-50
Proudly created in Australia. Quality Cross-Platform Games since 1970
with a Commodore PET 4016 with 16 Kilobytes of RAM (not Megabytes). 




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


  1   2   >