Re: [Lazarus] how to get Type of Sender or Components[i] in order to Cast?

2015-07-27 Thread Sven Barth
Am 27.07.2015 11:37 schrieb "Mark Morgan Lloyd" < markmll.laza...@telemetry.co.uk>: > > Now obviously I could have a separate property holding an enumeration, but it's a pity that it's not possible to do something like > > case MainForm.OutputComponent of > TListBox: begin end; >

Re: [Lazarus] how to get Type of Sender or Components[i] in order to Cast?

2015-07-27 Thread Sven Barth
Am 27.07.2015 12:06 schrieb "Mark Morgan Lloyd" < markmll.laza...@telemetry.co.uk>: > > Péter Gábor wrote: >> >> If you use the classname property you can: >> >> case Sender.classname of >> 'TCheckBox': ShowMessage('This is a TCheckBox'); >> end; > > > Good point. I wonder if that's mode-specific

Re: [Lazarus] how to get Type of Sender or Components[i] in order to Cast?

2015-07-27 Thread Péter Gábor
2015-07-27 13:33 keltezéssel, Michael Schnell írta: > > I suppose you meant > > if Sender is TButton then { do something} ; > > -Michael > Yes! -- Péter Gábor p...@freemail.hu -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http:/

Re: [Lazarus] how to get Type of Sender or Components[i] in order to Cast?

2015-07-27 Thread Flávio Etrusco
On Mon, Jul 27, 2015 at 6:37 AM, Mark Morgan Lloyd wrote: > JuuS wrote: >> >> On 07/27/2015 09:31 AM, Mark Morgan Lloyd wrote: >>> >>> Péter Gábor wrote: Sorry! I was "misreading" your mail... you want to know the type of them. You can compare the type of them: i

Re: [Lazarus] Owner of a TCanvas

2015-07-27 Thread Howard Page-Clark
On 27/07/2015 10:31, Xiangrong Fang wrote: Hi There, Can I somehow get the object which owns a Canvas? e.g.: function GetCanvasOwner(ACanvas: TCanvas): TObject; begin Result := ACanvas.Owner; end; pb := TPaintBox(GetCanvasOwner(pb.Canvas); A TCanvas does not have a built-in Owner property

Re: [Lazarus] how to get Type of Sender or Components[i] in order to Cast?

2015-07-27 Thread Michael Schnell
On 07/27/2015 07:47 AM, Péter Gábor wrote: if Sender = TButton then { do something} ; I suppose you meant if Sender is TButton then { do something} ; OP: If you want to deal with a lot of different classes that might be the sender, it might help to define an array of these classes (types) an

Re: [Lazarus] Owner of a TCanvas

2015-07-27 Thread Flávio Etrusco
On Mon, Jul 27, 2015 at 6:31 AM, Xiangrong Fang wrote: > Hi There, > > Can I somehow get the object which owns a Canvas? e.g.: > > function GetCanvasOwner(ACanvas: TCanvas): TObject; > begin >Result := ACanvas.Owner; > end; > pb := TPaintBox(GetCanvasOwner(pb.Canvas); > > Thanks! > Xiangrong

Re: [Lazarus] how to get Type of Sender or Components[i] in order to Cast?

2015-07-27 Thread Chris Kelling
Sorry about that - that message was supposed to be sent in reply to a message rhar came in right before one that was for this list. My Note 4 thought I was trying to reply a thread in the Lazarus group. -Chris On Jul 27, 2015 7:23 AM, Chris Kelling wrote: > > We have one in Room B. It is Ed S

Re: [Lazarus] how to get Type of Sender or Components[i] in order to Cast?

2015-07-27 Thread Chris Kelling
We have one in Room B. It is Ed Sax's old machine. It is an early model that has the chicklett keyboard. About the only distinction tge PC Jr has is that is was a finacial failure. Both style of keyboards are wireless, but you had to have the keyboard aimed directly at the IR receiver on the PC.

Re: [Lazarus] how to get Type of Sender or Components[i] in order to Cast?

2015-07-27 Thread Mark Morgan Lloyd
Péter Gábor wrote: If you use the classname property you can: case Sender.classname of 'TCheckBox': ShowMessage('This is a TCheckBox'); end; Good point. I wonder if that's mode-specific (language manual simply says "Free Pascal allows"). -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT

Re: [Lazarus] how to get Type of Sender or Components[i] in order to Cast?

2015-07-27 Thread Péter Gábor
If you use the classname property you can: case Sender.classname of 'TCheckBox': ShowMessage('This is a TCheckBox'); end; 2015-07-27 09:31 keltezéssel, Mark Morgan Lloyd írta: > Péter Gábor wrote: >> >> if Sender = TButton then { do something} ; > > Can this be elegantly put into a case statem

Re: [Lazarus] how to get Type of Sender or Components[i] in order to Cast?

2015-07-27 Thread Michael Van Canneyt
On Mon, 27 Jul 2015, Mark Morgan Lloyd wrote: JuuS wrote: On 07/27/2015 09:31 AM, Mark Morgan Lloyd wrote: Péter Gábor wrote: Sorry! I was "misreading" your mail... you want to know the type of them. You can compare the type of them: if Sender = TButton then { do something} ; Can this be

Re: [Lazarus] how to get Type of Sender or Components[i] in order to Cast?

2015-07-27 Thread Mark Morgan Lloyd
JuuS wrote: On 07/27/2015 09:31 AM, Mark Morgan Lloyd wrote: Péter Gábor wrote: Sorry! I was "misreading" your mail... you want to know the type of them. You can compare the type of them: if Sender = TButton then { do something} ; Can this be elegantly put into a case statement? Hi, I just

[Lazarus] Owner of a TCanvas

2015-07-27 Thread Xiangrong Fang
Hi There, Can I somehow get the object which owns a Canvas? e.g.: function GetCanvasOwner(ACanvas: TCanvas): TObject; begin Result := ACanvas.Owner; end; pb := TPaintBox(GetCanvasOwner(pb.Canvas); Thanks! Xiangrong -- ___ Lazarus mailing list Lazaru

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

2015-07-27 Thread Lukasz Sokol
On 27/07/15 09:31, Richard Mace wrote: > Hi Travis, > Yes, I'm just not sure of the best way to do it with Lazarus. > > Richard > Please avoid top-posting.(unless you have good reason for it; most email/news readers have a setting of where you start your reply, with others you just scroll down b

Re: [Lazarus] how to get Type of Sender or Components[i] in order to Cast?

2015-07-27 Thread JuuS
On 07/27/2015 09:31 AM, Mark Morgan Lloyd wrote: > Péter Gábor wrote: >> Sorry! >> I was "misreading" your mail... you want to know the type of them. >> >> You can compare the type of them: >> >> if Sender = TButton then { do something} ; > > Can this be elegantly put into a case statement? > H

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

2015-07-27 Thread Michael Van Canneyt
On Mon, 27 Jul 2015, Richard Mace wrote: Hi Travis, Yes, I'm just not sure of the best way to do it with Lazarus. if performance is not an issue: By far the easiest will be to let one app be a HTTP server, the other a HTTP client. If you need high performance, then you should look at proto

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" 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" wrote: > >> Hi, >> Can anybody point me a

Re: [Lazarus] how to get Type of Sender or Components[i] in order to Cast?

2015-07-27 Thread Mark Morgan Lloyd
Péter Gábor wrote: Sorry! I was "misreading" your mail... you want to know the type of them. You can compare the type of them: if Sender = TButton then { do something} ; Can this be elegantly put into a case statement? -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above

Re: [Lazarus] TEncoding class

2015-07-27 Thread Aradeonas
Very good! Regards, Ara -- http://www.fastmail.com - The way an email service should be -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus