Re: [Lazarus] PostMessage return value

2014-09-18 Thread Michael Schnell
On 09/17/2014 04:51 PM, Xiangrong Fang wrote: 2014-09-17 16:09 GMT+08:00 Michael Schnell mschn...@lumino.de mailto:mschn...@lumino.de: Here you are. It is strange that it works on one computer but does not work (or partially work) on another -- causing SIGSEGV. Both running same

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Michael Schnell
On 09/18/2014 12:13 AM, Graeme Geldenhuys wrote: I haven't followed this whole thread, but I can add that the tiOPF project (on SourceForge) has had a threadpool class for many years. Well unit tested too. Great ! Thanks. I'll take a look. I did the TThreadPool class just for fun. I'll

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Xiangrong Fang
2014-09-18 16:13 GMT+08:00 Michael Schnell mschn...@lumino.de: I did the TThreadPool class just for fun. I'll compare the two thingies and come back with some comments. ​I don't quite understand the logic or difference between critical section ​ ​and events. My feeling is that to do

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Michael Schnell
You said that you in fact did need or do an OnReady Event for each thread. I just added that feature to TThreadPool: now each user Task (TTask class) can be provided an OnReady Notify function. Let me know if you want the extended code. -Michael --

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Michael Schnell
On 09/18/2014 10:32 AM, Xiangrong Fang wrote: I don't quite understand the logic or difference between critical section and events. They have nothing in common. TCriticalSection is a Semaphore (see Wikipedia) An event is a callback procedure -

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Michael Schnell
On 09/18/2014 10:32 AM, Xiangrong Fang wrote: how can you use a CS for the purpose of thread synchronization! Thread synchronization is the only cause why TCriticalSection has been invented (and provided with Delphi decades ago by Borland). -Michael --

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Michael Schnell
On 09/18/2014 10:32 AM, Xiangrong Fang wrote: 2014-09-18 16:13 GMT+08:00 Michael Schnell mschn...@lumino.de mailto:mschn...@lumino.de: I did the TThreadPool class just for fun. I'll compare the two thingies and come back with some comments. I don't quite understand the logic or

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Michael Schnell
On 09/18/2014 10:32 AM, Xiangrong Fang wrote: Yesterday I read your ThreadPool source code, and cannot understand how you control which thread can get the Wait CS, rather than just let the 2 thread compete for it. Could you please explain the logic behind this? Each worker Thread (i.e.

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Sven Barth
Am 18.09.2014 11:03 schrieb Michael Schnell mschn...@lumino.de: On 09/18/2014 10:32 AM, Xiangrong Fang wrote: ​I don't quite understand the logic or difference between critical section ​ ​and events. They have nothing in common. TCriticalSection is a Semaphore (see Wikipedia) An

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Michael Schnell
On 09/18/2014 11:36 AM, Sven Barth wrote: A critical section is a mutex OK. (but a mutex is constructed from a semphore, anyway, even if this might be done in the OS). (I did this when doing my own special purpose multitasking OS (in C), some 20 Years ago.) and an event in this context is

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Michael Schnell
On 09/18/2014 10:32 AM, Xiangrong Fang wrote: I don't quite understand the logic or difference between critical section and events. Sorry for my previous rude reply. Sven made me know that by event you did not mean an object pascal language Event (i.e. a callback), but a TEvent instance.

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Mattias Gaertner
On Thu, 18 Sep 2014 11:55:09 +0200 Michael Schnell mschn...@lumino.de wrote: [...] (It's a shame that the creators of our brand of the Object Pascal Language once chose to invent new notions for commonly use concepts (Callback - Event, Mutex - CriticalSection, TEvent - Semaphore, array of

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Michael Schnell
On 09/18/2014 12:10 PM, Mattias Gaertner wrote: a Set is not an array of boolean A set is an array (scientific English, not Pascal syntax) of bits (i.e. boolean values) supported by special operators. (Remember: Boolean Algebra and Logical Algebra are mathematically equivalent). The Set

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Michael Schnell
On 09/18/2014 12:34 PM, Michael Schnell wrote: Boolean Algebra and Logical Algebra are mathematically equivalent. Sorry: Set Algebra and Logical Algebra are mathematically equivalent. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Mattias Gaertner
On Thu, 18 Sep 2014 12:34:30 +0200 Michael Schnell mschn...@lumino.de wrote: On 09/18/2014 12:10 PM, Mattias Gaertner wrote: a Set is not an array of boolean A set is an array (scientific English, not Pascal syntax) of bits (i.e. boolean values) supported by special operators. On planet

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Xiangrong Fang
2014-09-18 17:55 GMT+08:00 Michael Schnell mschn...@lumino.de: Sven made me know that by event you did not mean an object pascal language Event (i.e. a callback), but a TEvent instance. Sorry, I mean *neither*. I mean an RTLEvent. See this page:

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Michael Schnell
On 09/18/2014 01:06 PM, Xiangrong Fang wrote: What I need help to understand is, repeating my previous email: ... I think, in the other mail, I did explain how Wait is supposed to work in TThreadPool. (And of course with some appropriate modifications of the source code, you can use

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Xiangrong Fang
2014-09-18 19:34 GMT+08:00 Michael Schnell mschn...@lumino.de: I think, in the other mail, I did explain how Wait is supposed to work in TThreadPool. Initially, when the threadpool is created, Wait is hold by the main thread, so the worker just wait there, no problem, but after the worker

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Michael Schnell
On 09/18/2014 01:46 PM, Xiangrong Fang wrote: 2014-09-18 19:34 GMT+08:00 Michael Schnell mschn...@lumino.de mailto:mschn...@lumino.de: I think, in the other mail, I did explain how Wait is supposed to work in TThreadPool. Initially, when the threadpool is created, Wait is hold by

Re: [Lazarus] Fuzzy translations ignored

2014-09-18 Thread Giuliano Colla
I compiled, and that's how your graphs look like under Linux (both Gtk2 and Qt WS, it doesn't make a difference): http://www.bononiadocta.it/Lazarus/Pochecker.png It would appear that FloodFill is rather broken under Linux! I had in mind a different approach (components instead of just

Re: [Lazarus] Fuzzy translations ignored

2014-09-18 Thread Mattias Gaertner
On Thu, 18 Sep 2014 14:35:33 +0200 Giuliano Colla giuliano.co...@fastwebnet.it wrote: I had in mind a different approach (components instead of just pictures, to be able to operate on them) so I implemented an alternative, which at first sight was not so bad, under Linux, with Qt WS:

Re: [Lazarus] Fuzzy translations ignored

2014-09-18 Thread Bart
On 9/18/14, Mattias Gaertner nc-gaert...@netcologne.de wrote: Are you saying, that Canvas.Pie is broken? Since I am unfamilliar with graphics and I did not get how to use Canvas.Pie, I tried to emulate it myself. I calcuate where the lines need to be drawn using basic goniometry, then fill in

Re: [Lazarus] Fuzzy translations ignored

2014-09-18 Thread Giuliano Colla
Il 18/09/2014 14:55, Mattias Gaertner ha scritto: Are you saying, that Canvas.Pie is broken? In short, yes. Canvas.RadalPie on GTK2 and Windows works only clockwise, but provides a very poor image (more like a portion of an octagon that a portion of a circle). Counterclockwise it generates

Re: [Lazarus] Fuzzy translations ignored

2014-09-18 Thread Howard Page-Clark
On 18/09/2014 17:41, Giuliano Colla wrote: Canvas.RadalPie on GTK2 and Windows works only clockwise, but provides a very poor image (more like a portion of an octagon that a portion of a circle). Counterclockwise it generates the image of my previous e-mail. On Windows here, Pie (RadialPie)

Re: [Lazarus] Fuzzy translations ignored

2014-09-18 Thread Giuliano Colla
Il 18/09/2014 19:16, Howard Page-Clark ha scritto: On 18/09/2014 17:41, Giuliano Colla wrote: Canvas.RadalPie on GTK2 and Windows works only clockwise, but provides a very poor image (more like a portion of an octagon that a portion of a circle). Counterclockwise it generates the image of my

Re: [Lazarus] Fuzzy translations ignored

2014-09-18 Thread Giuliano Colla
Il 18/09/2014 16:00, Bart ha scritto: what do I need to do to make that work using Canvas.Pie And the same Q for a fraction Y, starting of from section X? Pie and RadialPie are quite easy to use. RadialPie works with resolution of 1/16 degree (meaning that a full circle is 360*16 = 5760).

Re: [Lazarus] Fuzzy translations ignored

2014-09-18 Thread Giuliano Colla
Il 18/09/2014 16:00, Bart ha scritto: PS. You'll note the code for the GraphStat form is rather clumsy. Currently I'm about to convert it by using a ListView with an ImageList and create Bitmap's at runtime. This will make anchoring/aligning that much easier. Just for your reference (it's

Re: [Lazarus] PostMessage return value

2014-09-18 Thread Mark Morgan Lloyd
Michael Schnell wrote: On 09/18/2014 12:10 PM, Mattias Gaertner wrote: a Set is not an array of boolean A set is an array (scientific English, not Pascal syntax) of bits (i.e. boolean values) supported by special operators. I suggest calling it a vector (supported by special operators) since

Re: [Lazarus] Fuzzy translations ignored

2014-09-18 Thread Bart
I've got thiscode now (from your example). It creates a bitmap. After that I add the bitmap to an imagelist that is set as the largeIcons properties of a TListView. function TForm1.CreateBitmap2(AStat: TStat): TBitmap; const FullCircle = 16 * 360; var Bmp: TBitmap; Translated16Angle,