Re: [Lazarus] Example of TObjectList sorting

2016-05-23 Thread Richard Mace
On 22 May 2016 at 11:22, Ondrej Pokorny  wrote:

> You are using "procedure of object" where you need "procedure".
>

​Thanks Ondrej, that sorted it :)
​
​Thanks for everyone's help​

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


Re: [Lazarus] Example of TObjectList sorting

2016-05-22 Thread Richard Mace
Thanks Denis,

I am now getting:

inboundroutedestlist.pas(49,35) Error: Incompatible type for arg no. 1: Got
"", expected ""

Any ideas?

Richard

On 22 May 2016 at 07:30, Denis Kozlov <dez...@gmail.com> wrote:

>
> On 21 May 2016 at 13:49, Richard Mace <richard.m...@gmail.com> wrote:
>
>> ​Would I call the List.sort externally, or would the List call sort when
>> an Add has happened, as I don't seem to have a ".sort" method on my
>> TObjectList?
>>
>
> You need to call List.Sort yourself, it is not sorted automatically when
> you add more elements.
>
> TObjectList does have a Sort method, since it descends from TList class.
>
> Denis
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Example of TObjectList sorting

2016-05-21 Thread Richard Mace
Hi Denis,

Thanks for your reply.

On 9 May 2016 at 13:24, Denis Kozlov <dez...@gmail.com> wrote:

> On 9 May 2016 at 12:48, Richard Mace <richard.m...@gmail.com> wrote:
>
>> I have a TObjectList that contains many objects that have a property
>> called "Position" which is an integer.
>>
>> Could somebody show me an example of the code that I will need to create
>> that will sort all of my Objects within the TObjectList so that they are in
>> position order e.g. 1,2,3,4,5 and so on?
>>
>
> Call TList.Sort method and supply a comparison function.
>
>
> For example:
>
> List.Sort(@CompareByPositionPtr);
>

​Would I call the List.sort externally, or would the List call sort when an
Add has happened, as I don't seem to have a ".sort" method on my
TObjectList?

Thanks​

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


[Lazarus] Example of TObjectList sorting

2016-05-09 Thread Richard Mace
Hi All,

I have a TObjectList that contains many objects that have a property called
"Position" which is an integer.

Could somebody show me an example of the code that I will need to create
that will sort all of my Objects within the TObjectList so that they are in
position order e.g. 1,2,3,4,5 and so on?

Thanks

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


Re: [Lazarus] Strange error with TValueListEditor

2016-03-31 Thread Richard Mace
On 31 March 2016 at 15:03, Bart  wrote:

> I see no real difference in the lfm structure (apart from the fact
> that the problematic one has   OnStringsChange =
> vle11TrunkPropertiesStringsChange, which sould not raise the error you
> mentioned)
>
> Does the form contain any other components that are NOT installed in
> the "minimal IDE"?
> I'm asking because in that case I will ot be able to load the form
> (especially if it has third-party controls).
>

​No, I'm pretty sure it doesn't​


>
> For testing purposes in priciple I only need the form
> (lfm+sourcecode), not the entire project. I don't need to compile it,
> jus be able to load the form.
> You can send it to my private email adress, I will treat is as
> copyrighted material.
>

​emailed the project to you privately.

Thanks​

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


Re: [Lazarus] Strange error with TValueListEditor

2016-03-31 Thread Richard Mace
On 31 March 2016 at 14:39, Bart <bartjun...@gmail.com> wrote:

> On 3/31/16, Richard Mace <richard.m...@gmail.com> wrote:
>
> > ​I've tested it in 1.6, in Ubuntu 14.04 and it comes up with the same
> > error.
>
> Strange indeed.
> Which fpc version?
>

​2.6.4 With Lazarus 1.4.4 and 3.0.0 with Lazarus 1.6​


> Can you attach the project (zipped source) here?
>

​It's not Open Source, but I don't mind emailing it to you personally​?


>
> If you start a new project with a TValueListEditor, save, quit
> Lazarus, restart: same problem?
>

​Nope, works fine.​


> If not: does the lfm look different?
>

​A bit:

  object ValueListEditor1: TValueListEditor
Left = 8
Height = 100
Top = 8
Width = 200
FixedCols = 0
RowCount = 2
TabOrder = 0
Strings.Strings = (
  ''
)
ColWidths = (
  64
  132
)
  end ​

​Thanks for your help

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


Re: [Lazarus] Strange error with TValueListEditor

2016-03-31 Thread Richard Mace
On 31 March 2016 at 13:41, Bart <bartjun...@gmail.com> wrote:

> On 3/31/16, Richard Mace <richard.m...@gmail.com> wrote:
>
> > Error: Identifier Strings is not published in class "TValueListStrings"
> and
> > it's highlighted a row that contains:
> > Strings.Strings = ('')
>
> Typically the Strings.Strings should be part of the TValueListEditor.
> There should be no TValueListStrings in the lfm.
>
> Here's anexample of an lfm with a TValueListEditor
>
>   object ValEd: TValueListEditor
> Left = 8
> Height = 188
> Top = 8
> Width = 350
> FixedCols = 0
> RowCount = 4
> TabOrder = 0
> OnPrepareCanvas = ValEdPrepareCanvas
> KeyOptions = [keyEdit, keyAdd]
> Options = [goFixedVertLine, goFixedHorzLine, goVertLine,
> goHorzLine, goColSizing, goEditing, goAutoAddRows, goAlwaysShowEditor,
> goThumbTracking]
> Strings.Strings = (
>   'a=b'
>   'c=d'
>   'e=f'
> )
> ColWidths = (
>   64
>   282
> )
>   end
>
> This is from my ValueListEditor test suite, and it loads without
> problems on Lazarus trunk and Lazarus 1.6 (32-bit on Win7-64).
>
> 1. Can you copy the relevant part of the lfm file and post it here?
>

​  object vle11TrunkProperties: TValueListEditor
Left = 13
Height = 288
Top = 51
Width = 496
FixedCols = 0
RowCount = 2
TabOrder = 1
Strings.Strings = (
  ''
)
OnStringsChange = vle11TrunkPropertiesStringsChange
ColWidths = (
  64
  432
)
  end
​
​The "Strings.Strings = ("​ line is what is highlighted with the error:
Identifier Strings is not published in class "TValueListStrings"



> 2. 1.4 series is old. Please update to 1.6
>

​I've tested it in 1.6, in Ubuntu 14.04 and it comes up with the same error.

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


[Lazarus] Strange error with TValueListEditor

2016-03-31 Thread Richard Mace
Hi all,

I am getting the following error within Lazarus 1.4.4 On Windows 10 when
loading my project:

Fix LFM file:
Error: Identifier Strings is not published in class "TValueListStrings" and
it's highlighted a row that contains:
Strings.Strings = ('')

I have a button that says "Remove all invalid properties" and then I click
that, I then get
"Division by zero" with just a cancel button.

It then takes me to my main.lfm file and then that's it.
Every subsequent time I reload Lazarus, I get the same "Division by zero"
message and I can no longer view my form.

Any ideas please?

Thanks

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


Re: [Lazarus] Stopping a service from within a service

2016-02-05 Thread Richard Mace
That works great thanks :)
On 4 Feb 2016 22:53, "Jy V" <jyv...@gmail.com> wrote:

> On Thu, Feb 4, 2016 at 8:57 PM, Richard Mace <richard.m...@gmail.com>
> wrote:
>
>> On 4 February 2016 at 17:39, Jy V <jyv...@gmail.com> wrote:
>>
>>> On Thu, Feb 4, 2016 at 5:41 PM, Richard Mace <richard.m...@gmail.com>
>>> wrote:
>>> XMLRAD stop a program registered as a service running following code,
>>>
>>
>> ​So, would I run this code by creating a TProcess from within my service,
>> to get it to "stop" my service?
>>
>
> if you have the SvcHandle available inside your program since you are the
> very own running service,
> you can even skip OpenSCManagerA and OpenServiceA and stop the process
> directly
> calling ControlService(SvcHandle, SERVICE_CONTROL_STOP, Status)
>
> --
> ___
> 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] Stopping a service from within a service

2016-02-04 Thread Richard Mace
Hi,

What's the best way of shutting down a service that is a service, having
the same effect as the user clicking stop.

Basically, I want my service to monitor a condition, which if met, it will
stop itself.

Windows Lazarus 1.4.4

Thanks

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


Re: [Lazarus] Stopping a service from within a service

2016-02-04 Thread Richard Mace
But what code would you out in the service to terminate itself? Effectively
doing the same as calling close in a GUI app?

Richard
On 4 Feb 2016 19:11, <wkitt...@windstream.net> wrote:

> On 02/04/2016 11:41 AM, Richard Mace wrote:
>
>> Hi,
>>
>> What's the best way of shutting down a service that is a service, having
>> the
>> same effect as the user clicking stop.
>>
>> Basically, I want my service to monitor a condition, which if met, it
>> will stop
>> itself.
>>
>> Windows Lazarus 1.4.4
>>
>
> i don't know of a ""best"" way but there are several... the easiest might
> be to monitor a disk-based semaphore file... if it exists, the service
> closes as you desire...
>
> --
>  NOTE: No off-list assistance is given without prior approval.
>*Please keep mailing list traffic on the list* unless
>private contact is specifically requested and granted.
>
> --
> ___
> 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] Stopping a service from within a service

2016-02-04 Thread Richard Mace
On 4 February 2016 at 17:39, Jy V <jyv...@gmail.com> wrote:

>
>
> On Thu, Feb 4, 2016 at 5:41 PM, Richard Mace <richard.m...@gmail.com>
> wrote:
>
>> What's the best way of shutting down a service that is a service, having
>> the same effect as the user clicking stop.
>
> Basically, I want my service to monitor a condition, which if met, it will
>> stop itself.
>
>
> XMLRAD stop a program registered as a service running following code,
>
>
​So, would I run this code by creating a TProcess from within my service,
to get it to "stop" my service?

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


[Lazarus] Detecting when decompiler is running

2015-12-04 Thread Richard Mace
Hi All,
I was wondering if there was a way where an application, written in
Lazarus, could detect when a compiler is running, perhaps by it's mutex?
My idea was, in my application, I could periodically check to see if a
decompiler was running and then my app could perform an operation, such as
maybe closing.

Thanks in advance

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


Re: [Lazarus] Detecting when decompiler is running

2015-12-04 Thread Richard Mace
Because this particular application of mine, is not open source.

Richard
On 4 Dec 2015 09:29, "Michael Schnell" <mschn...@lumino.de> wrote:

> On 12/04/2015 09:29 AM, Richard Mace wrote:
>
>
> My idea was, in my application, I could periodically check to see if a
> decompiler was running and then my app could perform an operation, such as
> maybe closing.
>
>
> Why should open source software need a decompiler ?
>
> -Michael
>
> --
> ___
> 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] Detecting when decompiler is running

2015-12-04 Thread Richard Mace
On 4 Dec 2015 09:48, "Sven Barth"  wrote:

> Do you want to protect your whole application or only a specific part?
(e.g. a specific algorithm you don't want to disclose or the license
validation code)
>
> Regards,
> Sven
>

Hi Sven,
I guess just the license checking part really.
I am already using OnGuard but I was just thinking about maximising the
protection before its released.

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


Re: [Lazarus] Are you on Windows 10? Are you experiencing slow installs? Here's the deal...

2015-12-04 Thread Richard Mace
>
>
> My solution to this mess is simple, albeit not too forward thinking: Don't
> use Windows 10
>

​The trouble is, that's not an option as if your coding for Windows, that
will be the majority platform at some point.

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


Re: [Lazarus] Detecting when decompiler is running

2015-12-04 Thread Richard Mace
On 4 December 2015 at 11:01, Gabriele Cappelletto <
cappellettogabri...@yahoo.it> wrote:

> Even my project is not open source and if I see him I would be willing to
> make a small donation to the project FreePascal / lazarus
>
> Gabriele
>
>
​I intend to make a contribution to FreePascal / Lazarus for each copy of
this application that is sold as my part of giving back.

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


Re: [Lazarus] Google Docs for help documentation

2015-10-12 Thread Richard Mace
Sorry, no I was talking about a help file for my application itself.

Richard

On 11 October 2015 at 21:05, DougC <d...@moosemail.net> wrote:

>  On Sun, 11 Oct 2015 15:28:18 -0400 *Richard Mace
> <richard.m...@gmail.com <richard.m...@gmail.com>>* wrote 
>
> Hi All,
> I was wondering what people thought about using a Google Doc as a help
> file?
>
> It looks like you can have a contents, use anchors and obviously have
> pictures.
>
> Any thoughts?
>
>
> Are you talking about a help file for your app or for Lazarus, itself?
>
> If for Lazarus, what's the problem you are solving by suggesting this? Is
> the existing wiki so bad?
>
> It is a really bad idea to tie your documentation to a single vendor.
>
>
>
> --
> ___
> 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] Google Docs for help documentation

2015-10-11 Thread Richard Mace
Hi All,
I was wondering what people thought about using a Google Doc as a help file?

It looks like you can have a contents, use anchors and obviously have
pictures.

Any thoughts?

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


Re: [Lazarus] Sending secure smtp email via Synapse

2015-09-23 Thread Richard Mace
>
>
> I also include them with every XanaNews (news client written in Delphi)
> release I make. But I get them from the [http://indy.fulgan.com/SSL/]
> link, so that is your best bet.
>
>   https://github.com/graemeg/xananews
>
>
> Regards,
>   - Graeme -
>

​Thanks Graeme,
There seems to be lots of different files. Can you recommend a particular
file please?

Thanks

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


[Lazarus] Sending secure smtp email via Synapse

2015-09-23 Thread Richard Mace
Hi All,
I am trying to send secure SMTP email by using Synapse and Lazarus 1.4.2
under Windows 7 and am not getting very far.
I have followed the example on this page:
http://wiki.freepascal.org/Synapse

and am wondering whether I am missing some DLL's or something, as I can't
get it to work.

When debugging through the code, the following code is not run as
SMTP.login returns false:

if SMTP.Login then
begin
  result := SMTP.MailFrom(MailFrom, Length(MailData)) and
 SMTP.MailTo(MailTo) and
 SMTP.MailData(sl);
  SMTP.Logout;
end;

I am currently trying to send via smtp.gmail.com on port 465, but I'll need
to allow the option in my application for any SMTP server to be used.

I have "ssl_openssl" in my uses, but I haven't downloaded any DLL(s)?

Could anybody point me in the right direction please?

Many thanks

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


Re: [Lazarus] Specifying Y axis

2015-08-16 Thread Richard Mace
On 15 August 2015 at 10:38, Werner Pamler werner.pam...@freenet.de wrote:

 Chart1.Extent.YMax := 1;
 Chart1.Extent.YMin := 0;
 Chart1.Extent.UseYMax := true;
 Chart1.Extent.UseYMin := true;

 Call this before or after adding data to the series, or set it in the
 object inspector.


​Thanks Werner, That works great.
I've now got a the 0 as Min and the 1 as Max, however, it's also showing a
0.5 in the middle.
Any idea how I can remove that?

Also, is it possible to actually replace the 0 and 1 for words such as
true and false?

Thanks

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


[Lazarus] Specifying Y axis

2015-08-14 Thread Richard Mace
Hi,
I have a line graph that only needs to display 0's and 1's however, when
the first 0 is plotted, the Y axis is set-up as the lowest mark being -1,
then goes up through 0 to then be +1.
How can I set the graph up to say that the lowest mark would be 0 and the
highest would be 1?

Many thanks

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


Re: [Lazarus] Sending and receiving record or object data between applications running on different machines.

2015-07-27 Thread Richard Mace
Hi Travis,
Yes, I'm just not sure of the best way to do it with Lazarus.

Richard
On 26 Jul 2015 17:16, Travis Ayres tray...@gmail.com wrote:

 If there is a network they share, TCP/IP would work. A client/server
 architecture.
 On Jul 26, 2015 2:27 AM, Richard Mace richard.m...@gmail.com wrote:

 Hi,
 Can anybody point me at an example of how 2 application's can transfer
 data between one another across 2 different machines.

 Thanks
 Richard

 PS Lazarus 1.4.2 FPC 2.6.4 windows

 --
 ___
 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] Sending and receiving record or object data between applications running on different machines.

2015-07-26 Thread Richard Mace
Hi,
Can anybody point me at an example of how 2 application's can transfer data
between one another across 2 different machines.

Thanks
Richard

PS Lazarus 1.4.2 FPC 2.6.4 windows
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Tracking software useage

2015-07-24 Thread Richard Mace
Thanks for everyone's reply.
Really valuable.

Richard
On 23 Jul 2015 18:28, Graeme Geldenhuys mailingli...@geldenhuys.co.uk
wrote:

 On 2015-07-23 17:40, waldo kitty wrote:
  if you really desire this information, make it configurable so that
 those who
  don't care can enable it if they like... it should be disabled by
 default, though...

 +1
 I don't like call home software either.


 On a side note:
 We did once, for internal franchise testing only, added Google Analytics
 [yes, what you normally use for websites ;-) ] into our desktop
 application. Different areas of our desktop application was tracked like
 different web pages in a website. :)  Our product was a total rewrite of
 a previous version with lots of redesigned areas. We wanted to collect
 data to see what areas in the new program is used a lot, what isn't etc.
 That way we could tweak the user interface based on where our
 franchisees get stuck or missing out on useful features.  We did give
 them training, but you know how it goes in by the one ear, out by
 the other. :)


 Regards,
   - Graeme -


 --
 ___
 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] Tracking software useage

2015-07-22 Thread Richard Mace
Hi all,
I am really interested in tracking how many people are using my software
and was wondering what people that would be a good and ethical way of doing
it. Any thoughts?

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


Re: [Lazarus] Capturing the output from a command using TPorcess

2015-07-21 Thread Richard Mace
On 20 Jul 2015 22:23, Frederic Da Vitoria davito...@gmail.com wrote:

 2015-07-20 21:41 GMT+02:00 Richard Mace
 How can I code TProcess, so that it shows me the output from the
ipconfig /all command instead?


 Hello,

 This is not exactly what you asked for, but you could simply redirect the
output with something like ipconfig /all  ipconfig..txt then read the
contents of ipconfig.txt (or whatever name you gave to the output file).
You must take care where you put the output file, though: you must have the
rights to write in that folder.

 Of course my solution is only a quick trick, the answer to your question
would be much cleaner and much more interesting.

Hi Frederic, that's a good idea and I hadn't thought of that work around.
I'll give it a go

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


Re: [Lazarus] Capturing the output from a command using TPorcess

2015-07-21 Thread Richard Mace
On 20 Jul 2015 23:30, Bart

  How can I code TProcess, so that it shows me the output from the
ipconfig
  /all command instead?


http://wiki.lazarus.freepascal.org/Executing_External_Programs#Reading_large_output

Thanks Bart, but I have already read that page and my code is based on that.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Capturing the output from a command using TPorcess

2015-07-21 Thread Richard Mace
On 21 July 2015 at 10:15, shoKwave shokw...@gmx.net wrote:

 Hi,

 instead of using psexec you could try getmac /S pcname.

 Hope this helps.

 Ingo


​Well, I never knew that command existed. Thanks very much, that was
exactly what I was looking for.

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


[Lazarus] Capturing the output from a command using TPorcess

2015-07-20 Thread Richard Mace
Hi All,
I hope this question is going to make sense.
I am trying to obtain the MAC Address of a remote PC, using psexec \\pcname
and running the command ipconfig /all.
If I run the psexec command from my machine via a command prompt, ipconfig
/all is successfully run on the remote machine, and I can see it's MAC
address, however, if I run it via TProcess, in Lazarus, the output I get
from TProcess is the output from psexec (successfully run and exited with
error code 0) rather than the output from ipconfig.
How can I code TProcess, so that it shows me the output from the ipconfig
/all command instead?

I hope that makes sense?

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


[Lazarus] Pop menu and disabled images

2015-07-11 Thread Richard Mace
Hi All,
I have polished my application a lot by adding a disabled images list to my
toolbar, so that the images are displayed properly when the action is
disabled.
However, when I try to do the same thing for a pop up menu, I notice that
there isn't a DisabledImages property like there is with a toolbar.
Am I missing something?

Thanks

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


[Lazarus] Help for your applications

2015-07-03 Thread Richard Mace
Hi,
When writing help files and documentation for your apps, what are peoples
preferences?

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


[Lazarus] Disabled images

2015-07-02 Thread Richard Mace
Hi All,
I have a toolbar with buttons on it, that are linked to actions. I also
note, that there is a property called DisabledImages. I'm presuming this is
to do with images that will be displayed on the toolbar, instead of the
normal images, when the action is disabled?
If this is the case, how do I specify which image relates to the correct
action in the ImageList?

Hope that makes sense?

Windows 7 Pro Lazarus 1.4 FPC 2.6.4

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


Re: [Lazarus] Disabled images

2015-07-02 Thread Richard Mace
Great, thanks for the info.

Richard
On 2 Jul 2015 13:24, Werner Pamler werner.pam...@freenet.de wrote:

  Your understanding that the disabled images will be used instead of the
 normal images if the action is disabled is correct. You may have noticed
 also there are also HotImages which become active if the mouse is moved
 over a toolbutton. BUT: Since there is only one ImageIndex all Imagelists
 (Images, DisabledImages, HotImages) must be in sync, i.e. same count and
 same order of images. This is some kind of restriction for practical use.

 Am 02.07.2015 um 14:00 schrieb Richard Mace:

  Hi All,
 I have a toolbar with buttons on it, that are linked to actions. I also
 note, that there is a property called DisabledImages. I'm presuming this is
 to do with images that will be displayed on the toolbar, instead of the
 normal images, when the action is disabled?
 If this is the case, how do I specify which image relates to the correct
 action in the ImageList?

  Hope that makes sense?

  Windows 7 Pro Lazarus 1.4 FPC 2.6.4

  Richard


 --
 ___
 Lazarus mailing 
 listLazarus@lists.lazarus.freepascal.orghttp://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] Flashing task bat icon orange on Windows 7

2015-06-12 Thread Richard Mace
​Hi,
I am trying to work out how to flash the taskbar icon in Windows 7, like
Skype does, pragmatically. I have googled, and the closest I found was
FlashWindowEx, but that doesn't actually flash the icon, just the form
window.

Any ideas?

Thanks

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


[Lazarus] change the icon image of my running application

2015-06-10 Thread Richard Mace
Hi,
Does anybody know how I can change the image of my running application,
like Skype does when a new notification has happened?
Effectively, I am wanting to update the running taskbar image by overlaying
a numerical number to show the number of notifications in my app

Hope that makes sense

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


Re: [Lazarus] TAChart

2015-06-06 Thread Richard Mace
Thanks, that worked a treat.

Richard

On 5 June 2015 at 14:24, Salvatore Coppola coppolastu...@gmail.com wrote:

 Maybe

 TChart.ZoomFull

 can help you

 2015-06-04 21:35 GMT+02:00 Richard Mace richard.m...@gmail.com:

 Hi,
 Another quick question. How can you, via code, zoom out of a chart,
 effectively back to what it was by default? If that makes sense?

 Thanks

 Richard

 --
 ___
 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] TAChart

2015-06-04 Thread Richard Mace
Hi,
Another quick question. How can you, via code, zoom out of a chart,
effectively back to what it was by default? If that makes sense?

Thanks

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


Re: [Lazarus] TAChart

2015-06-03 Thread Richard Mace
On 3 June 2015 at 17:49, Werner Pamler werner.pam...@freenet.de wrote:

 I suppose you use a TLineSeries, but the same principle should work for
 TBSplineSeries and TCubicSplineSeries

 ​​
 Chart1LineSeries1.Pointer.Style := psCircle; // round points
 Chart1LineSeries1.Pointer.Pen.Style := psClear;// no border


​Thanks Werner.
That's interesting,
  ​
Chart1LineSeries1.Pointer.Style := psCircle;
Doesn't compile, but I can navigate to it at design time?

  chartMain.ClearSeries;
  FLine := TLineSeries.Create(chartMain);
  FLine.Marks.Style := TSeriesMarksStyle(4);
  FLine.Marks.OverlapPolicy := opHideNeighbour;
  FLine.ShowLines := true;
  FLine.ShowPoints := true;
  FLine.Pointer.Brush.Color := clBlue;
  FLine.Pointer.Style := psCircle;  this line won't compile

Richard


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


[Lazarus] TAChart

2015-06-03 Thread Richard Mace
Hi.
When drawing points on a line graph, is it possible, via code, to make the
points round and without a black boarder?
Could someone give me any code examples please?
Thanks
Richard
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Detecting X minutes ago.

2015-06-01 Thread Richard Mace
Hi All,
What's the best way of detecting what Now - 5 minutes is?
Effectively, I want to do the following:

5MinsAgo: TDateTime;

5MinsAgo := Now -5 minutes?

Thanks in advance

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


Re: [Lazarus] Getting common documents folders

2015-05-28 Thread Richard Mace
Perfect

Thank you
On 27 May 2015 22:39, silvioprog silviop...@gmail.com wrote:

 On Wed, May 27, 2015 at 6:21 PM, Michael Van Canneyt 
 mich...@freepascal.org wrote:


 On Wed, 27 May 2015, Glaucos Ginez wrote:

  Hi, you can use GetEnvironmentVariable('LocalAppData')

 2015-05-27 14:53 GMT-04:00 Richard Mace richard.m...@gmail.com:
   Hi All,
 I need to use/get a common windows folder (in Win XP,Vista,7,8 and 8.1)
 that all users will have
 read/write access to by default.
 I think it is CSIDL_COMMON_DOCUMENTS

 Any ideas how I can code this in Lazarus?


 You can use the shfolder unit. It contains the necessary constants and
 calls to retrieve the location.

 Michael.


 Here in Brazil, on Lazarus-BR group, an member (Joao Marcelo Vaz) sent an
 very nice tip:

 uses
   windirs;

 ...

   ShowMessage(GetWindowsSpecialDir(CSIDL_COMMON_DOCUMENTS));

 =)

 --
 Silvio Clécio
 My public projects - github.com/silvioprog

 --
 ___
 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] Getting common documents folders

2015-05-27 Thread Richard Mace
Hi All,
I need to use/get a common windows folder (in Win XP,Vista,7,8 and 8.1)
that all users will have read/write access to by default.
I think it is CSIDL_COMMON_DOCUMENTS

Any ideas how I can code this in Lazarus?

Many thanks

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


[Lazarus] LHelp

2015-05-25 Thread Richard Mace
Hi All,
Does LHelp support images? That is, can you include screen shots within the
.chm file for LHelp to display?

Thanks

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


Re: [Lazarus] CHM Maker not working

2015-05-15 Thread Richard Mace
Hi,
I was just suggesting that the demo may need to be adjusted for the
distribution of Lazarus, as all I did was load it and then run it?

Richard
On 15 May 2015 08:24, leledumbo leledumbo_c...@yahoo.co.id wrote:

  Any ideas?

 Show screenshot of that See on the bottom of the dialog. You're likely to
 set it wrong since you're on windows but trying to execute xterm as a
 launching application. The path is even clear: /usr/X11R6/bin/xterm, would
 that ever exist on windows?



 --
 View this message in context:
 http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-CHM-Maker-not-working-tp4042211p4042214.html
 Sent from the Free Pascal - Lazarus mailing list archive at Nabble.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] CHM Maker not working

2015-05-14 Thread Richard Mace
Hi,
I am trying to run the CHM Maker help file application, but when running
the chmmaker.lpi in Windows 7 Lazarus 1.4 I get:

[image: Inline images 1]

Any ideas?

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


[Lazarus] Creating TProcess from within a TThread

2015-04-28 Thread Richard Mace
Hi,
I am currently working on a project that will need to use multiple threads
which will each need to create their own TProcess.

Is this possible as when I attempt it at the moment, tprocess requires a
tcomponent when created?

Thanks

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


Re: [Lazarus] Creating TProcess from within a TThread

2015-04-28 Thread Richard Mace
Thanks Mattias,
I should have guessed that
Richard
On 28 Apr 2015 13:14, Mattias Gaertner nc-gaert...@netcologne.de wrote:

 On Tue, 28 Apr 2015 13:10:33 +0100
 Richard Mace richard.m...@gmail.com wrote:

  Hi,
  I am currently working on a project that will need to use multiple
 threads
  which will each need to create their own TProcess.
 
  Is this possible as when I attempt it at the moment, tprocess requires a
  tcomponent when created?

 You can pass nil:
 aProcess:=TProcess.Create(nil);

 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] ShowMessage not Modal

2015-04-27 Thread Richard Mace
Ok, it's definitely a bug because if I put a show message in the form
activate event, then all other show messages work. If I remove it again,
they stop working.
Very strange

Richard
On 26 Apr 2015 06:57, Richard Mace richard.m...@gmail.com wrote:

 Sorry, I should have also added...

 Lazarus 1.4 Windows 7 fpc 2.6.4

 Richard

 On 26 April 2015 at 06:56, Richard Mace richard.m...@gmail.com wrote:

 Hi All,
 I have a strange problem.
 If I use ShowModal (or MessageDlg) in my application, the code is being
 executed, but it is not Modal.

 e.g.

 If I coded

 ShowMessage('Hello');
 Close;
 Exit;

 The message would not show (or just flicker) and the application would
 close.

 What's puzzling is that if I create a new app, and they do the same code,
 it works as expected!

 Any ideas?

 Richard



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


[Lazarus] ShowMessage not Modal

2015-04-25 Thread Richard Mace
Hi All,
I have a strange problem.
If I use ShowModal (or MessageDlg) in my application, the code is being
executed, but it is not Modal.

e.g.

If I coded

ShowMessage('Hello');
Close;
Exit;

The message would not show (or just flicker) and the application would
close.

What's puzzling is that if I create a new app, and they do the same code,
it works as expected!

Any ideas?

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


Re: [Lazarus] ShowMessage not Modal

2015-04-25 Thread Richard Mace
Sorry, I should have also added...

Lazarus 1.4 Windows 7 fpc 2.6.4

Richard

On 26 April 2015 at 06:56, Richard Mace richard.m...@gmail.com wrote:

 Hi All,
 I have a strange problem.
 If I use ShowModal (or MessageDlg) in my application, the code is being
 executed, but it is not Modal.

 e.g.

 If I coded

 ShowMessage('Hello');
 Close;
 Exit;

 The message would not show (or just flicker) and the application would
 close.

 What's puzzling is that if I create a new app, and they do the same code,
 it works as expected!

 Any ideas?

 Richard

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


[Lazarus] Detecting if a remote web server is running

2014-10-30 Thread Richard Mace
Hi All,
What's the most reliable way of detecting whether a remote website is
responding?

Thanks

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


Re: [Lazarus] Detecting if a remote web server is running

2014-10-30 Thread Richard Mace
Thanks for everyone's replies, very helpful.

Richard

On 30 October 2014 14:42, silvioprog silviop...@gmail.com wrote:

 On Thu, Oct 30, 2014 at 11:39 AM, waldo kitty wkitt...@windstream.net
 wrote:

 On 10/30/2014 7:29 AM, Felipe Monteiro de Carvalho wrote:

 On Thu, Oct 30, 2014 at 10:44 AM, Richard Mace richard.m...@gmail.com
 wrote:

 Hi All,
 What's the most reliable way of detecting whether a remote website is
 responding?

 
  maybe ping?

 ping might tell you if the IP address is active but that's all... it
 won't tell you if the server is running or servicing requests... you have
 to request something from the server to see if it is servicing requests...
 the easiest and smallest would be to request the headers (only) from the
 root...


 +1

 Like this:
 http://lists.lazarus.freepascal.org/pipermail/lazarus/2014-October/089112.html

 --
 Silvio Clécio
 My public projects - github.com/silvioprog

 --
 ___
 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] Getting the last modified date of a directory

2014-10-28 Thread Richard Mace
On 27 October 2014 18:57, Mark Morgan Lloyd markmll.laza...@telemetry.co.uk
 wrote:

 Rik van Kekem wrote:

 Maybe it's just me but what's the use of Date modified for a folder?
 It *does not* (like TS expects) reflect the date of the last file
 *changed* in the folder. Only when files are removed or added the Date
 modified of the folder changes. If you also want the time of the last
 changes in the folder you would need to loop through all the files.


 That of course is a good point, but if [whoever asked the question] was
 writing an archiver or a file transfer program then his users would assume
 that it should (i.e. would be reasonably expected to, irrespective of
 documentation etc.) preserve all the POSIX timestamps, even if their
 meaning was counter-intuitive.


​Thanks for all of everyones input regarding this. It looks like the
solution that I am going to have to use is to scan all of the files within
the folder and work out new latest modified file from that.

Thanks again

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


Re: [Lazarus] Getting the last modified date of a directory

2014-10-26 Thread Richard Mace
I want to know the last time any file was created or modified within a
given folder which I believe is represented in windows via the last
modified date next to the folder?

Richard
On 26 Oct 2014 09:11, Jürgen Hestermann juergen.hesterm...@gmx.de wrote:


 Am 2014-10-25 um 19:19 schrieb Richard Mace:

  Hi All,
 I can see that we have a FileAge function and also a FileGetDate
 however, I was wondering what the best way of getting the last modified
 date of a folder? Effectively, the last time that a file was
 created/changed within a folder?

  I think that FileAge should work for directory names too.
 Have not tested though.

 The question is: What does a directory date tell you?

 --
 ___
 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] Getting the last modified date of a directory

2014-10-25 Thread Richard Mace
Hi All,
I can see that we have a FileAge function and also a FileGetDate
however, I was wondering what the best way of getting the last modified
date of a folder? Effectively, the last time that a file was
created/changed within a folder?

Thanks in advance

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


Re: [Lazarus] New app written in Lazarus

2014-10-07 Thread Richard Mace

  ​I have come cross one bug, but I haven't managed to find someone who is
  able to fix it yet. I think I might have to add a bounty to it.
 Do you have a bugtracker number for that bug? Would be helpful if people
 on this list want to take a look...


​I do, it's 0025397 http://mantis.freepascal.org/view.php?id=25397
​
​Richard​





 --
 ___
 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] New app written in Lazarus

2014-10-06 Thread Richard Mace
On 4 October 2014 10:33, Mattias Gaertner nc-gaert...@netcologne.de wrote:

 On Sat, 4 Oct 2014 09:36:58 +0100
 Richard Mace richard.m...@gmail.com wrote:

  Hi all,
  Is this list an appropriate place to announce a new NON open source
  application written in Lazarus?

 If the announcement contains some hints/advice for Lazarus programmers
 it is ok with me. For example what tools/components did you use.
 Or maybe you helped fixing some bugs/implementing some features of
 FPC/Lazarus.


​I have come cross one bug, but I haven't managed to find someone who is
able to fix it yet. I think I might have to add a bounty to it.
​


  Or should it just be put on the wiki?

 Adding it to the wiki is important for advertising Lazarus. So, yes,
 please add it to the wiki.


​Will do. I have tried, but I only seem to be able to add what's there.
I'll have another go.​

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


[Lazarus] New app written in Lazarus

2014-10-04 Thread Richard Mace
Hi all,
Is this list an appropriate place to announce a new NON open source
application written in Lazarus? Or should it just be put on the wiki?

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


Re: [Lazarus] Using a DateTimeIntervalChartSource in TAChart

2014-09-24 Thread Richard Mace
On 23 September 2014 23:55, Werner Pamler werner.pam...@freenet.de wrote:

 Where can I find the Intervals.Min and MaxLength properties?


 MinLength and MaxLength are sub-properties of the Params of the
 DateTimeIntervalChartSource.
 Sorry, I confused it with the property Intervals of the Axis...


​Perfect, thanks Werner, that's made a massive difference.

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


Re: [Lazarus] Using a DateTimeIntervalChartSource in TAChart

2014-09-23 Thread Richard Mace



 * You may want to play with its properties a bit to optimize its output.
 For
 example increase Intervals.MinLength and/or MaxLength to avoid overlapping
 of labels.
 * To be honest I don't fully understand the effect of the Steps property.
 I have the
 feeling that you have to turn off those options which you don't want to
 have
 in the labels.


​Thanks very much Werner, that was a great help.
Where can I find the Intervals.Min and MaxLength properties?

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


Re: [Lazarus] [FEATURE REQUEST] Check syntax on the fly

2014-09-22 Thread Richard Mace
I also agree with leledumbo. A ctrl-F9 is so quick, it's nearly automatic
for me anyway :)

Richard

On 22 September 2014 18:02, Kostas Michalopoulos badsectorac...@gmail.com
wrote:

 I agree with leledumbo, i really dislike that feature in modern IDEs
 which all it does is slow down the editor and make random pauses.

 On Mon, Sep 22, 2014 at 5:55 PM, leledumbo leledumbo_c...@yahoo.co.id
 wrote:

  But if you share your opinion or direct me in the right way, I could try
 write it by myself.

 Feel free to write one, but IMO it's not a good idea to integrate it (or
 worse: having it installed and turned on by default) with the IDE. My
 primary reason is regarding speed. Features like this could eat cpu cycle
 in
 the middle of coding, thus decreasing IDE's responsiveness. Second,
 calling
 the compiler is fast. Only first call will be a bit slow due to loading of
 required units to RAM. After that, it runs in milliseconds.



 --
 View this message in context:
 http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-FEATURE-REQUEST-Check-syntax-on-the-fly-tp4038627p4038629.html
 Sent from the Free Pascal - Lazarus mailing list archive at Nabble.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] Using a DateTimeIntervalChartSource in TAChart

2014-09-22 Thread Richard Mace
Hi All,
I am trying to create a line graph where the X axis is a zoomable TDateTime
value and I believe that I need to use a DateTimeIntervalChartSource
However, I cannot seem to work out how to add values to it.
Could somebody give me any pointers please?

Thanks

PS I've have looked at the axis demo under the TAChart components, which
does display a DateTime on the bottom axis, however, it didn't seem clear
to me on how that graph actually got it's data.

Thanks, as always, in advance.

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


Re: [Lazarus] Help system questions

2014-09-19 Thread Richard Mace
Excellent, is this likely to get into 1.26?

Richard

On 19 September 2014 12:42, Reinier Olislagers reinierolislag...@gmail.com
wrote:

 On 13/09/2014 07:00, Reinier Olislagers wrote:
  I'm working on fixing some things in the help system.
  2. My patch in
  http://bugs.freepascal.org/view.php?id=26079
  seems to work ok: for context-sensitive lhelp is started, hidden, loads
  .chm files and then is shown once the files are loaded.
  Then it shows the help for the requested item.

 Just implemented a fix for this that works for me on FPC trunk x86,
 Lazarus trunk, Windows.
 Menu Help/Help should also show help contents (after starting up lhelp).

 Would appreciate people on other platforms to test and tell me if it
 doesn't work.
 Thanks.


 --
 ___
 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] Displaying a Listview entry in bold and a different colour

2014-09-16 Thread Richard Mace
Hi Howard,
Many thanks for your reply.
That does seem to work, but my subitems and images don't seem to be
displayed now?
Would you mind giving me a further pointer as to how to display the images,
and the subitems in the same colour?

Thanks

Richard

On 15 September 2014 16:42, Howard Page-Clark h...@talktalk.net wrote:

 On 15/09/2014 13:10, Richard Mace wrote:

 Hi All,
 I just want to make sure that I am not doing anything wrong here, please
 can somebody give me a little code example of how to correctly set the
 font to bold and a differnet colour in a listview entry?


 I wouldn't claim the following is 'correct', but it works on Windows using
 TListView's OnCustomDrawItem() event.

 Howard

 ==code==

 unit mainListviewOwnerDraw;

 {$mode objfpc}{$H+}

 interface

 uses
   Classes, SysUtils, Forms, Graphics, ComCtrls, LCLType, StdCtrls;

 type
   TForm1 = class(TForm)
 ListView1: TListView;
 procedure FormCreate(Sender: TObject);
 procedure ListView1CustomDrawItem(Sender: TCustomListView; Item:
 TListItem;
   State: TCustomDrawState; var DefaultDraw: Boolean);
   end;

 var
   Form1: TForm1;

 implementation

 {$R *.lfm}

 procedure TForm1.FormCreate(Sender: TObject);
 var
   li: TListItem;
   lc: TListColumn;
   i: Integer;
 begin
   ListView1.ViewStyle:=vsReport;
   ListView1.OwnerDraw:=True;
   lc:=TListColumn.Create(ListView1.Columns);
   lc.Caption:='Select an item to show custom draw:';
   lc.Width:=ListView1.Canvas.TextWidth(lc.Caption) + 20;
   for i:=0 to 4 do begin
 li:=TListItem.Create(ListView1.Items);
 li.Caption:=Format('Item number %d',[i]);
 ListView1.Items.AddItem(li);
   end;
 end;

 procedure TForm1.ListView1CustomDrawItem(Sender: TCustomListView;
   Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
 var
   rct: TRect;
 begin
   DefaultDraw:=False;
   if (cdsSelected in State) then begin
 Sender.Canvas.Font.Style:=[fsBold];
 Sender.Canvas.Font.Color:=clRed;
   end
   else begin
 Sender.Canvas.Font.Style:=[];
 Sender.Canvas.Font.Color:=clBlack;
   end;
   rct:=Item.DisplayRect(drLabel);
   Sender.Canvas.FillRect(rct); //paint background with default brush colour
   Sender.Canvas.TextOut(rct.Left, rct.Top, Item.Caption);
 end;

 end.

 --
 ___
 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] Displaying a Listview entry in bold and a different colour

2014-09-15 Thread Richard Mace
Hi All,
I just want to make sure that I am not doing anything wrong here, please
can somebody give me a little code example of how to correctly set the font
to bold and a differnet colour in a listview entry?
Also, what event should I be using?
I think I've found a bug, but am not sure

Thanks in advance.

Richard

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


[Lazarus] ListView Custom Draw Item

2014-09-10 Thread Richard Mace
Hi All,
I have the following code on a ListView Custom Draw Item event, where the
font is displayed red, but it's not bold.
Any ideas?

Sender.Canvas.Font.Style := [fsBold];
Sender.Canvas.Font.Color := clRed;

Lazarus 1.24 Windows 8

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


Re: [Lazarus] Lazarus trunk? Please recompile lhelp

2014-09-08 Thread Richard Mace
Hi Reinier,
I was having issues getting the. Chm file to display at all.

Should it work in 1.24 ?
On 4 Sep 2014 21:06, Reinier Olislagers reinierolislag...@gmail.com
wrote:

 On 04/09/2014 16:12, Richard Mace wrote:
  So will this mean that we can now use .chm help files reliably in our
  projects?

 Depends on what reliability issues you faced - as mentioned, the aim was
 to improve communication (e.g. telling lhelp what help topic to display)
 robustness...

 What reliability issues are you seeing?



 --
 ___
 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] Lazarus trunk? Please recompile lhelp

2014-09-04 Thread Richard Mace
Hi Reinier,
So will this mean that we can now use .chm help files reliably in our
projects?

Richard


On 4 September 2014 10:22, Reinier Olislagers reinierolislag...@gmail.com
wrote:

 Summary:
 If you are on Lazarus trunk, please recompile
 components\chmhelp\lhelp\lhelp.lpr

 Details:
 - Lhelp improvements
 Lhelp is used to show (context-sensitive) help.

 Recently, Juha kindly committed revision 46121 for me, fixing bugtracker
 issue/feature 26614

 * Making communication with lhelp more robust
 * Updating communications protocol from version 1 to 2 (see
 * Debug file support for lhelp diagnostic info, e.g. set environment
 variable lhelp_debuglog to the path/filename of your desired log file
 (note: needs patch/solution in bug 26537 first though)

 - Result
 Because the help communication protocol version has changed existing
 lhelp applications reporting version 1 (or no version) should not (or
 might not reliably) work with current Lazarus trunk.
 The solution is to rebuild lhelp.

 - Please report issues
 Please report any regressions (i.e. problems that occur with the new
 protocol but did *not* occur with the old protocol) and I'll have a look.

 Note that there are some known existing problems with lhelp - see
 bugtracker, including 26556: when starting lhelp, it flickers when
 loading all the chms in a directory. Help appreciated - I probably am
 too ignorant of the IPro components...

 --
 ___
 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] Handling Firebird connection

2014-08-25 Thread Richard Mace
Hi all,

I have the following code that I use to connect to a Firebird database,
which works fine, however, if the Firebird server becomes unavailable,
fIBConnection.Connected always returns true. What's the best way of
checking to make sure that the Firebird server is still available before I
attempt to connect to the database?

Thanks in advance

Richard

  fOnline := True;
  try
if fIBConnection.Connected then
  Exit;

with fIBConnection do
  begin
HostName := 'hostname';
DatabaseName := 'location';
UserName := 'username';
Password := 'password';
  end;
  end;

fIBConnection.Transaction  := fSQLTransaction;

with fSQLQuery do
  begin
DataBase := fIBConnection;
Transaction := fSQLTransaction;
  end;

//Finally switch on connection
fSQLTransaction.DataBase := fIBConnection;
fIBConnection.Connected := True;
  except
fOnline := False;
  end;
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Handling Firebird connection

2014-08-25 Thread Richard Mace
Antonia,
Many thanks for your reply.
I'll re-code my app and do some more testing.

Richard


On 25 August 2014 09:19, SPRL AFOR afors...@gmail.com wrote:

  Le 25/08/2014 09:32, Richard Mace a écrit :

  Hi all,

  I have the following code that I use to connect to a Firebird database,
 which works fine, however, if the Firebird server becomes unavailable,
 fIBConnection.Connected always returns true. What's the best way of
 checking to make sure that the Firebird server is still available before I
 attempt to connect to the database?


  AFAIK the TIbConnection is based upon TSQLConnection itself based upon
 the TDatabase component. In all this chain the Connected property is
 defined in the latest component, the TDatabase. And the Connected property
 has a read function wich sends a boolean variable content (FConnected
 variable). That's why once the first connection has been established with
 the Firebird server (whether is succeeds or not), the connection status is
 kept thru all component life until next disconnect or re-connect operation
 takes place.
 To solve the situation when the link to the databse server is broken I
 rely on the transaction mechanism. In fact I always control the transaction
 state allowing any query to be executed, as the Firebird server requires
 that any database access has to be done under the control of a transaction.
 This means thar when the MyTrans.StartTransaction fails I know (most of the
 times) that the link to the FB server is broken (omitting programmatic
 errors which can be controlled or checkced in another way). This does not
 protect your code from a connection exception between two consecutive
 database access (two consecutive calls to the fbclient library anyway).
 When I need a fine tuned control over a database access, after a initial
 MyDB.Connected := True, I always use the same sequence:

 try
 MyDatabase.Connedted := True;
 except
 on ...(exception process) do ... connection fault
 end
 [...] prepare data for the database
 try
 MyTransaction;StartTransaction
 try
 do whatever has to be done with the database
 finally
 MyTransaction.Commit
 end
 except
 do whatever needed when the exception rises: check whether its is
 an ordinary exception or a server link fault
 if MyTransaction.InTransaction then
 MyTransaction.RollBack;
 end;

 This sequence does not protect against the server disconnection between
 two consecutive database calls. I easily can imagine that the same process
 occurs with any other database server hosted in a remote machine. Even when
 the database server is hosted in the same machine of the applicaton, TCP/IP
 communication applies.

 Antonio.



 --
http://www.avast.com/

 Ce courrier électronique ne contient aucun virus ou logiciel malveillant
 parce que la protection Antivirus avast! http://www.avast.com/ est
 active.


 --
 ___
 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] Handling Firebird connection

2014-08-25 Thread Richard Mace
​Hi Antonia​,


 This sequence does not protect against the server disconnection between
 two consecutive database calls.


​Would you mind giving me an example of this?

Thanks

Richard

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


Re: [Lazarus] Obtaining uptime

2014-08-06 Thread Richard Mace
Ah, that's interesting.
Even if you actually choose Shutdown from the menu?
Richard
On 6 Aug 2014 07:06, Sven Barth pascaldra...@googlemail.com wrote:

 Am 06.08.2014 07:50 schrieb Richard Mace richard.m...@gmail.com:
 
  Hi,
  Does anyone know why the following code returns the correct days uptime
 in XP, but doesn't in Windows 8? (not tested in anything other)

 Just in case: you know that Windows 8 does not really shutdown by default,
 but merely suspends to provide a faster user experience? So the result
 returned by GetTickCount will not be what you might expect.
 Also on Unix systems it won't work as GetTickCount is linked up with a
 date/time based function there.

 Regards,
 Sven

 --
 ___
 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] Obtaining uptime

2014-08-06 Thread Richard Mace
Interesting. I was sure that it was fully shutting down.
I'll test the code after a fresh reboot
Richard
On 6 Aug 2014 10:53, Sven Barth pascaldra...@googlemail.com wrote:

 Am 06.08.2014 11:28 schrieb Richard Mace richard.m...@gmail.com:
 
  Ah, that's interesting.
  Even if you actually choose Shutdown from the menu?

 Especially then. AFAIK a reboot triggers a full shutdown (with restart of
 course) and there might also be another possibility for a clean shutdown,
 but I don't remember that...

 Regards,
 Sven

 --
 ___
 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] Obtaining uptime

2014-08-06 Thread Richard Mace
Hi Sven,
I'm amazed! Sure enough, if I choose restart the uptime reads 0 days, and
yet, shutdown doesn't actually shut it down!
Crazy!
Richard


On 6 August 2014 10:52, Sven Barth pascaldra...@googlemail.com wrote:

 Am 06.08.2014 11:28 schrieb Richard Mace richard.m...@gmail.com:

 
  Ah, that's interesting.
  Even if you actually choose Shutdown from the menu?

 Especially then. AFAIK a reboot triggers a full shutdown (with restart of
 course) and there might also be another possibility for a clean shutdown,
 but I don't remember that...

 Regards,
 Sven

 --
 ___
 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] Obtaining uptime

2014-08-05 Thread Richard Mace
Hi,
Does anyone know why the following code returns the correct days uptime in
XP, but doesn't in Windows 8? (not tested in anything other)
Also, is it close to working correctly in Linux as well?

Thanks in advance

Richard

function TfrmMain.GetDaysUptime: integer;
var
   TickCount: variant;

   mySeconds: variant;
   dys,hrs,min,sec : variant;
begin
  TickCount := LclIntf.GetTickCount;

  mySeconds := TickCount Div 1000;

  hrs := (mySeconds Div 60) Div 60;
  mySeconds := mySeconds - (hrs * 60 * 60);
  min := mySeconds Div 60;
  mySeconds := mySeconds - (min * 60);
  sec := mySeconds;
  if hrs = 24 then
dys := hrs Div 24
  else
dys := 0;

   Result := dys;
end;
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Saving an array to a string

2014-07-01 Thread Richard Mace
Hi All,
Is it possible to save an array of string to a single string for storing in
a string field within a database?
If so, could anyone give me any pointers please?

Thanks

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


Re: [Lazarus] Saving an array to a string

2014-07-01 Thread Richard Mace
Thanks Michael. And reading it back?
On 1 Jul 2014 15:57, Michael Thompson mike.cornfl...@gmail.com wrote:

  Is it possible to save an array of string to a single string for storing
 in a string field within a database?

 Suspect it'll be something like
 MyString := '';
 For i := Low(MyArray) to High(MyArray) Do
   MyString := MyString + MyArray[i] + LineEnding;

 MyStringField.AsString := MyString;


 On 1 July 2014 16:49, Richard Mace richard.m...@gmail.com wrote:

 Hi All,
 Is it possible to save an array of string to a single string for storing
 in a string field within a database?
 If so, could anyone give me any pointers please?

 Thanks

 Richard

 --
 ___
 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] Illegal typecast in Linux only

2014-05-01 Thread Richard Mace
Hi,
I am getting the following error: Illegal type conversion: TObject to
LongInt on the following code:

TFSGatewayType(Integer(cbo11TrunkType.Items.Objects[cbo11TrunkType.ItemIndex]))

Is this because I am compiling under Linux 64bit or just Linux or just
64bit? Under Windows 32bit it compiles fine?

Thanks

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


Re: [Lazarus] Illegal typecast in Linux only

2014-05-01 Thread Richard Mace
Thanks Juhu,
Changing my code now :)

Richard


On 1 May 2014 15:23, Juha Manninen juha.mannine...@gmail.com wrote:

 On Thursday, May 1, 2014, Richard Mace richard.m...@gmail.com wrote:

 Hi,
 I am getting the following error: Illegal type conversion: TObject to
 LongInt on the following code:


 TFSGatewayType(Integer(cbo11TrunkType.Items.Objects[cbo11TrunkType.ItemIndex]))


 Typecast to Integer should be PtrInt. It works also on a 64-bit system.

 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] Illegal typecast in Linux only

2014-05-01 Thread Richard Mace
Thanks Mattias,
PtrUInt works like a charm :)

Richard


On 1 May 2014 15:20, Mattias Gaertner nc-gaert...@netcologne.de wrote:

 On Thu, 1 May 2014 15:04:56 +0100
 Richard Mace richard.m...@gmail.com wrote:

  Hi,
  I am getting the following error: Illegal type conversion: TObject to
  LongInt on the following code:
 
 
 TFSGatewayType(Integer(cbo11TrunkType.Items.Objects[cbo11TrunkType.ItemIndex]))
 
  Is this because I am compiling under Linux 64bit or just Linux or just
  64bit? Under Windows 32bit it compiles fine?

 64bit.
 TObject is a 64bit pointer under 64bit.
 You can use
 TFSGatewayType(PtrUInt(cb...

 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] Forcing TMemo to dislplay last entry

2014-04-25 Thread Richard Mace
Hi All,
I have some code that populates a TMemo via TMemo.Text := 'lots of lines of
text..' and need a cross platform way of programatically forcing the TMemo
to display the last entry as if the user has had manually scrolled to the
bottom.

Any idea how I can achieve this?

Thanks in advance

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


Re: [Lazarus] Forcing TMemo to dislplay last entry

2014-04-25 Thread Richard Mace
Hi both,
Thanks for the quick responses :)

Richard


On 25 April 2014 18:46, Howard Page-Clark h...@talktalk.net wrote:

 On 25/04/2014 18:30, Richard Mace wrote:

 I have some code that populates a TMemo via TMemo.Text := 'lots of lines
 of text..' and need a cross platform way of programatically forcing the
 TMemo to display the last entry as if the user has had manually scrolled
 to the bottom.


 You can also use

 Memo1.SelStart:=Length(Memo1.Text);

 Howard



 --
 ___
 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] Forcing TMemo to dislplay last entry

2014-04-25 Thread Richard Mace
On 25 April 2014 18:35, Sandro Cumerlato sandro.cumerl...@gmail.com wrote:

 Hello Richard,
 you can use the following code:

 SendMessage(Memo1.Handle, EM_LINESCROLL, 0, Memo1.Lines.Count);


​Hi Sandro,
EM_LINESCROLL won't compile under Linux (Lubuntu 14.04)?

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


[Lazarus] Reading and Writing to TProcess

2014-04-12 Thread Richard Mace
Hi All,
I have the following code working well with TProcess outputting to a TMemo,
however, what I'd like to do it monitor the output and then when a certain
string is detected, I'd like to feed back to the process. That is, if the
TProcess outputs a question, I'd like to feed back either a y or a n as
if the user pressed it manually.

Hope that makes sense

Any ideas where to tweak?

Thanks Richard

const
  C_BUFSIZE = 2048;
var
  Hbk: TProcess;
  Buffer: pointer;
  SStream: TStringStream;
  nread: longint;
begin
  Hbk := TProcess.Create(nil);

  // Replace the line below with your own command string
  Hbk.CommandLine := 'c:\windows\system32\cmd.exe /c dir c:\windows\*.*';
  //

  Hbk.Options := [poUsePipes];
  Hbk.Execute;

  // Prepare for capturing output
  Getmem(Buffer, C_BUFSIZE);
  SStream := TStringStream.Create('');

  // Start capturing output
  while Hbk.Running do
  begin
nread := Hbk.Output.Read(Buffer^, C_BUFSIZE);
if nread = 0 then
  sleep(100)
else
  begin
// Translate raw input to a string
SStream.size := 0;
SStream.Write(Buffer^, nread);
// And add the raw stringdata to the memo
Memo1.Lines.Text := Memo1.Lines.Text + SStream.DataString;
  end;
  end;

  // Capture remainder of the output
  repeat
nread := Hbk.Output.Read(Buffer^, C_BUFSIZE);
if nread  0 then
begin
  SStream.size := 0;
  SStream.Write(Buffer^, nread);
  Memo1.Lines.Text := Memo1.Lines.Text + SStream.Datastring;
end
  until nread = 0;

  // Clean up
  Hbk.Free;
  Freemem(buffer);
  SStream.Free;
end;
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Large toolbar buttons

2014-04-07 Thread Richard Mace
On 6 April 2014 21:03, Vojtěch Čihák vojtech.ci...@atlas.cz wrote:

 Hi,



 there are two ShowCaption properties. One TToolButton.ShowCaption and the
 second TToolBar.ShowCaption.

 Also, there is TToolBar.ButtonHeight when you need large buttons.


​Ah, that was it :)

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


Re: [Lazarus] Large toolbar buttons

2014-04-06 Thread Richard Mace
Thanks Mattias,

 I was wondering what the best component was for a tool bar with large
  buttons and images on. I am trying to use the TToolbar component,
 however,
  it doesn't seem to display captions and I can't seem to get the buttons
 to
  be bigger than 16x16?
 
  Any ideas?

 Change the ImageList's Width and Height.


When I change the ImageLists's Height and Width it clears all of the
current images, I presume that because I have to add larger images in now?
Also, when do the captions get displayed?

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


Re: [Lazarus] Large toolbar buttons

2014-04-06 Thread Richard Mace
On 6 April 2014 08:21, Mattias Gaertner nc-gaert...@netcologne.de wrote:

  Also, when do the captions get displayed?

 Have you tried ShowCaptions?


Yes, I have. The buttons are linked to Actions so not sure if that makes
any difference?

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


Re: [Lazarus] Large toolbar buttons

2014-04-06 Thread Richard Mace


 If you set Caption to '' then there is no text.

 Check also ShowCaption of the button.


The caption is set to Add user and the ShowCaption is set to true, but
it's still not showing the text on the button?

Thanks

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


[Lazarus] Large toolbar buttons

2014-04-05 Thread Richard Mace
Hi All,
I was wondering what the best component was for a tool bar with large
buttons and images on. I am trying to use the TToolbar component, however,
it doesn't seem to display captions and I can't seem to get the buttons to
be bigger than 16x16?

Any ideas?

Thanks, as always in advance.

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


Re: [Lazarus] Confused by help

2014-03-24 Thread Richard Mace
 Hi Graeme,

  It looks very interesting.
  How would I instruct DocView to open at a particular section of a help
  file from Lazarus?

 DocView (binary download) comes with an extensive help file explaining
 all it's uses (concatenating help files at runtime, defining help as an
 environment variable, etc).

 But to answer your question, DocView accepts many parameters. The
 docview.inf help file explains that or select Help-Command Line
 Parameters inside DocView


 Supported command line parameters:

   filename   Load the help file filename
   -h   Show this help
   -k textSearch for keyword text in open help files
   -n id  Open Topic with numeric ID equal to id
   -s id  Open Topic with string ID equal to id
   -debuglog filename Log information to a file

 So you can define numerical or keyword help inside your application -
 just like you would do with LCL or VCL applications. I don't know if you
 can override the default help viewer in LCL based apps. But if not,
 simply trap the F1 key (or probably the OnHelp event) and launch DocView
 with the the appropriate parameters listed above.

 I'm planning on more parameters and integration too. eg: placement and
 size of DocView, as well as IPC communication between the application
 and docview. The latter will allow you to control docview from your
 application.

 Regards,
   - Graeme -



Graeme,
Thanks for the info. I'll check it out and see if I can start using it.
Hopefully the actuall creating of the .INF file will be a straight forward
process as well :)

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


Re: [Lazarus] Confused by help

2014-03-22 Thread Richard Mace
Hi Graeme,
It looks very interesting.
How would I instruct DocView to open at a particular section of a help file
from Lazarus?

Richard


On 21 March 2014 22:33, Graeme Geldenhuys mailingli...@geldenhuys.co.ukwrote:

 On 2014-03-21 20:51, Richard Mace wrote:
  Is CHM help still supported or should I be doing just HTML

 You can always use DocView as well. DocView is a stand-alone help viewer
 (no external dependencies). Very fast, and with inline user annotation
 support, bookmark support, font customization, advanced search etc. It
 reads the INF help file format which is also very easy to author, and
 very compact.

 To see DocView in action, you can download a binary and same sample INF
 help files from:

   DocView binaries:
 http://sourceforge.net/projects/fpgui/files/fpGUI/1.0/
   INF docs:
 http://sourceforge.net/projects/fpgui/files/fpGUI/Documentation/

   Screenshot:
 http://fpgui.sourceforge.net/screenshots_apps.shtml


 Regards,
   - Graeme -

 --
 fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
 http://fpgui.sourceforge.net/

 --
 ___
 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] Confused by help

2014-03-22 Thread Richard Mace


 You can always use DocView as well. DocView is a stand-alone help viewer
 (no external dependencies). Very fast, and with inline user annotation
 support, bookmark support, font customization, advanced search etc. It
 reads the INF help file format which is also very easy to author, and
 very compact.


Does the INF help file format support screen shots?
I notice that when I open my existing CHM file in lhelp, it doesn't show
the embedded screen shots, but when I just double click on the .CHM file
within Windows, Microsoft's own viewer is displayed and the screen shots
are there.

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


Re: [Lazarus] Confused by help

2014-03-22 Thread Richard Mace
I did look at that wiki page and after I installed the chm components it
did load the chm file, but it won't display any images?
On 22 Mar 2014 08:49, Reinier Olislagers reinierolislag...@gmail.com
wrote:

 On 21/03/2014 21:51, Richard Mace wrote:
  Hi All, I am trying to integrate a CHM help file into my application,
 Well did you look here
 http://wiki.lazarus.freepascal.org/Add_Help_to_Your_Application#CHM

  but I can only find HTML components in Lazarus 1.2 Is CHM help still
  supported or should I be doing just HTML
 Do you think it's likely CHM support (the default Lazarus help file
 format) has been withdrawn without any mention in the release notes?

 --
 ___
 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] Confused by help

2014-03-22 Thread Richard Mace
I have uploaded a test.chm file to www.rocksolidpbx.co.uk/downloads if
anyone has the time/interest in taking a look.

Richard


On 22 March 2014 10:20, Reinier Olislagers reinierolislag...@gmail.comwrote:

 On 22/03/2014 11:06, Richard Mace wrote:
  I did look at that wiki page and after I installed the chm components it
  did load the chm file, but it won't display any images?

 I have no idea (haven't used images in CHM myself); perhaps post a
 sample file somewhere so somebody else could have a look?


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


[Lazarus] Confused by help

2014-03-21 Thread Richard Mace
Hi All,
I am trying to integrate a CHM help file into my application, but I can
only find HTML components in Lazarus 1.2
Is CHM help still supported or should I be doing just HTML

Thanks in advance

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


Re: [Lazarus] Console app

2014-03-17 Thread Richard Mace
I have never written a console app and was wondering 2 things.

 Firstly, if I was to write an app that doesn't require a GUI, that runs on
 both Windows and Linux (with no XServer) is that classed as a console app?
 And secondly, is it fairly straight forward to write a console app that
 stores and retrieves data from a Firebird database, on the basis that I
 want to be able to use either the standard Lazarus components (or Zeos) to
 talk to the database?

  A problem might be that there (right now) is no Widget Type in
 Lazarus, that has no GUI binding and allows for using stuff like  TTimer,
 TThread.Synchronize, TThread.Queue and QueuAsyncCall().


Ah, yes. That would be ab issues as using a TTimer would be essential for
what I am planning :(

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


[Lazarus] Console app

2014-03-15 Thread Richard Mace
Hi All,
I have never written a console app and was wondering 2 things.
Firstly, if I was to write an app that doesn't require a GUI, that runs on
both Windows and Linux (with no XServer) is that classed as a console app?
And secondly, is it fairly straight forward to write a console app that
stores and retrieves data from a Firebird database, on the basis that I
want to be able to use either the standard Lazarus components (or Zeos) to
talk to the database?

Thanks in advance

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


[Lazarus] Checking characters in a string

2014-03-12 Thread Richard Mace
Hi,
I am trying to check to make sure the a string contains at least 1
uppercase character, 1 lowercase character and 1 number.
Any ideas as of the best way of coding this?

Thanks in advance

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


  1   2   3   >