Re: [Lazarus] Radiogroup not updating clicked button when in non-visible TPageControl tab
On 09/15/2014 02:20 AM, Alejandro Gonzalo wrote: Similarly if a TEdit or a TMemo have visible set to false, then PasteFromClipboard and CopyToClipboard fails. Fix this too please before 1.2.6 releases? Thanks. Please open an issue about it and attach example project. zeljko -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PostMessage return value
2014-09-15 17:12 GMT+08:00 Michael Schnell mschn...@lumino.de: For better clearness, flexibility and portability I would use Application.QueueAsyncCall instead (Or TThread.Queue, if you are on the svn Version of fpc and would like to do it Delphi-compatible). I would like to use the most clear, simple FPC way of inter-thread c ommunication / locking of shared resources. I DO need cross platform (linux/windows), but I do NOT want Delphi compatibility, my app only compiles with FPC/Lazarus :-) Finally, I prefer to use the latest GENERALLY-AVAIABLE version of FPC, which is 2.6.4 now, to save me trouble to setup development version of FPC on any PC I would need to run FPC :-) Any more hint please? Thanks a lot! Xiangrong -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PostMessage return value
On 09/15/2014 11:17 AM, Xiangrong Fang wrote: I DO need cross platform (linux/windows), but I do NOT want Delphi compatibility, my app only compiles with FPC/Lazarus :-) In that case I definitely would use Application.QueuAsyncCall. -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Fuzzy translations ignored
Thank you. Now it's me causing some delay, because I have some other matters to deal with. ASAP I'll look into it and come back to you. Giuliano Il 14/09/2014 16:26, Bart ha scritto: I started a graphical smmary in r46230. Please check it out and comment on it. Bart -- ___ 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] white popup hint box
On Sun, 14 Sep 2014 23:22:26 -0400, waldo kitty wkitt...@windstream.net wrote: i'm also quite confused how you saw that image with that section yellowed... i've looked at the same image on several machines and see only white on white :/ I find this interesting. I can see a very light yellow pop-u on your supplied screen-shot. I used GIMP to confirm those HTML color values: The white background = ff The popup = e1 I just checked my popup on Lazarus Ver 1.3, and it is definitely white on white, although I had once manually changed some settings in the Linux gtkrc setting file pointed to by ~/.gtkrc-2.0: filename: /usr/share/themes/Aurora/gtk-2.0/gtkrc I once had light gray text on white, so I changed the following line of that file to back tooltip fg on white tooltip bg as follows: gtk_color_scheme = fg_color:#00\nbg_color:#C7C7C7\nbase_color:#ff\ntext_color:#00\nselected_bg_color:#247EB3\nselected_fg_color:#ff\ntooltip_bg_color:#FF\ntooltip_fg_color:#00 -- ___ 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
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
Re: [Lazarus] PostMessage return value
2014-09-15 17:23 GMT+08:00 Michael Schnell mschn...@lumino.de: In that case I definitely would use Application.QueuAsyncCall. If I understand correct, from this page: http://wiki.freepascal.org/Asynchronous_Calls QueueAsyncCall is, like what its name suggest, doing this in asynchronous favor -- it execute queued method in the next message loop (while Application.ProcessMessages takes place, right?). But what I need PostMessage for is to notify main thread (or another thread) that a worker thread finished its job, so that the thread manager can start a new thread to do the remaining work. Anyway, is PostMessage considered deprecated or shall be used on windows only? Is there a better way to do what I want? Thanks, Xiangrong -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PostMessage return value
Am 15.09.2014 14:21 schrieb Xiangrong Fang xrf...@gmail.com: 2014-09-15 17:23 GMT+08:00 Michael Schnell mschn...@lumino.de: In that case I definitely would use Application.QueuAsyncCall. If I understand correct, from this page: http://wiki.freepascal.org/Asynchronous_Calls QueueAsyncCall is, like what its name suggest, doing this in asynchronous favor -- it execute queued method in the next message loop (while Application.ProcessMessages takes place, right?). But what I need PostMessage for is to notify main thread (or another thread) that a worker thread finished its job, so that the thread manager can start a new thread to do the remaining work. PostMessage is asynchronous as well. For a synchronous way I'd suggest you to take a look at TThread.Synchronize and corresponding documentation and tutorials. Note: Synchronize can only notify the main thread. Note2: The synchronous alternative to PostMessage would be SendMessage, though I don't know whether Lazarus provides this in a cross platform way If you want to use a separate thread (dispatcher) for enqueueing new work you should create an event that you pass to this thread and the worker threads. The dispatcher waits on the event and the worker threads will signal the event once they are done. Of course you'll likely also signal the event when new work items are queued that need to be dispatched. Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PostMessage return value
On 09/15/2014 02:19 PM, Xiangrong Fang wrote: 2014-09-15 17:23 GMT+08:00 Michael Schnell mschn...@lumino.de mailto:mschn...@lumino.de: In that case I definitely would use Application.QueuAsyncCall. If I understand correct, from this page: http://wiki.freepascal.org/Asynchronous_Calls QueueAsyncCall is, like what its name suggest, doing this in asynchronous favor -- it execute queued method in the next message loop (while Application.ProcessMessages takes place, right?). That is exactly what Postmessage does (in combination with procedure ... message). In fact you don't need to call Application.ProcessMessages (on that behalf). In fact (usually) the main thread is not supposed to do long lasting or even polling loops to be made of run-to-completion events. QueueAsyncCall just schedules another run-to-completion event for you and same will automatically happen as soon as the main thread is free (having done all previously scheduled events). But what I need PostMessage for is to notify main thread (or another thread) that a worker thread finished its job, so that the thread manager can start a new thread to do the remaining work. Neither QueueAsyncCall nor Postmessage have anything to do with finishing a thread (unless you call it right before the end of the thread's execute procedure). Anyway, is PostMessage considered deprecated or shall be used on windows only? Not really depreciated but IMHO (when used for thread to main thread signaling) it's a relict from Delphi's widows-only heritage. Is there a better way to do what I want? As said: you can do Application.QueueAsyncCall() right before the end of the thread's execute procedure; (Or you can simply start the new worker thread there instead of having the main thread do this if this might be appropriate.) -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PostMessage return value
On 09/15/2014 02:19 PM, Xiangrong Fang wrote: But what I need PostMessage for is to notify main thread (or another thread) You can only notify the main thread. There is no (standard) means to notify another thread, as they don't have an event queue. OTOH a worker thread is allowed to wait a long time for an event (e. g via TCriticalSection), while doing this in the main thread would freeze the GUI. -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PostMessage return value
On 09/15/2014 02:34 PM, Sven Barth wrote: The synchronous alternative to PostMessage would be SendMessage, though I don't know whether Lazarus provides this in a cross platform way AFAIK, in Lazarus, SendMessage just directly calls the assigned event handling function, and hence usually is only allowed in the Main thread, if the event handling function does LCL calls. -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PostMessage return value
2014-09-15 20:34 GMT+08:00 Sven Barth pascaldra...@googlemail.com: If you want to use a separate thread (dispatcher) for enqueueing new work you should create an event that you pass to this thread and the worker threads. The dispatcher waits on the event and the worker threads will signal the event once they are done. Of course you'll likely also signal the event when new work items are queued that need to be dispatched. In Michael's previous email, I understand that using PostMessage and QueueAsyncCall will does the same thing. How do I use Event to achieve the same? It seems that I can have N threads listen to the same event, but cannot have the main thread to listen to N different events? Anyway, if I use Event I'll do some more reading of the document. For now, I would like to know, performance-wise, which way is better? Using QueueAsyncCall/PostMessage or RTLEvent*? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TAChart CandleStick Chart
El 14/09/14 a las 11:46, Werner Pamler escibió: I'm not familiar with the multivalued series. But you chandlestick series looks much like the Box/Whisker series which is included in TAChart. Can you point out the difference? -- Mm, they look similar, but Box/Whisker, has a top and bottom horizontal lines and an horizontal line in the middle of the candle, maybe adding a couple of boolean properties like TopMark, BottomMark and MiddleMark to the Box/Whisker chart will let use it as a CandleStick chart. -- Leonardo M. Ramé http://leonardorame.blogspot.com -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PostMessage return value
On 09/15/2014 02:55 PM, Xiangrong Fang wrote: How do I use Event to achieve the same? What do you mean by Event ? It seems that I can have N threads listen to the same event, but cannot have the main thread to listen to N different events? In fact Windows does provide event (aka Message) queues for all threads out of the boy, Linux does not provide any event queues. Lazarus (like Delphi) provides some support for an Event Queue for the Main thread. Lazarus does this both in Windows and Linux (and Mac OS). The queue can be fed by GUI events, (non-Delphi) Application.QueueAsyncCall (and TThread.Synchronize and - with the FPC svn version - TThread.Queue). There is no support by the language for Event Queues for worker Threads. In Windows you could use messages directly by API calls, in Linux you could use Pipes with the appropriate API calls like open, select, epoll, ... For now, I would like to know, performance-wise, which way is better? Using QueueAsyncCall/PostMessage or RTLEvent*? Performance wise it's better not to destroy and create your threads but to manage a thread pool and assign work to the threads as appropriate. Here you would have the threads wait for work e.g. by trapping themselves in a TCriticalSection for each one. Now the Main thread can easily free a thread after it assigned work to it (e.g. by providing a callback function that is to be called in TThread.Execute). If work is done, the Thread could notify the manager (in the main thread) by Application.QueueAsyncCall or TThread.Queue. TThread. Synchronize would not harm in this case either, as the thread at that time has nothing to do anyway. -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PostMessage return value
2014-09-15 21:44 GMT+08:00 Michael Schnell mschn...@lumino.de: Performance wise it's better not to destroy and create your threads but to manage a thread pool and assign work to the threads as appropriate. Here you would have the threads wait for work e.g. by trapping themselves in a TCriticalSection for each one. Now the Main thread can easily free a thread after it assigned work to it (e.g. by providing a callback function that is to be called in TThread.Execute). If work is done, the Thread could notify the manager (in the main thread) by Application.QueueAsyncCall or TThread.Queue. TThread. Synchronize would not harm in this case either, as the thread at that time has nothing to do anyway. That's exactly what I planed to do. But I don't know CriticalSections can be used in here. My original thinking is that, by the end of Execute, I call either PostMessage or QueueAsyncCall to notify main thread that the current thread finished its work. The main thread, in its message handler then know from a status variable that this thread is in suspended status, then assign a new work to it and call its Execute() method again. Is that ok? To be exact, when a thread's execute() finished, it will go to a sleep status, and can be reused by calling execute() again, right? Even this works, if it is performance-wise not optimal, please give me a short example of how to use CriticalSection for this purpose. Thanks a lot. Xiangrong -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] white popup hint box
waldo kitty wrote: i'm also quite confused how you saw that image with that section yellowed... i've looked at the same image on several machines and see only white on white :/ Like Anthony already found out, even if it's white on screen it really is a very light shade of yellow. You can see this by adjusting the brightness of your screen but with a laptop that's a bit more difficult. I've seen multiple times, especially with laptops, that you can't see these subtle colors. (For me, with a desktop-screen, the difference is really visible) If you don't want to change your theme you can change it in the source of Lazarus itself. But your other programs will keep a white hint. I don't know how to make a clearer border but the color is here: Lazarus_dir\LCL\Include\hintwindow.inc // Color := clInfoBk; Color := clYellow; // - for instance But clInfoBk is used a lot more throughout the Lazarus IDE so it might be better to change your theme. Maybe somebody else could hunt down the border-drawing for this tooltip (which i couldn't find off hand). -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PostMessage return value
On 09/15/2014 03:57 PM, Xiangrong Fang wrote: 2014-09-15 21:44 GMT+08:00 Michael Schnell mschn...@lumino.de mailto:mschn...@lumino.de: Performance wise it's better not to destroy and create your threads but to manage a thread pool and assign work to the threads as appropriate. Here you would have the threads wait for work e.g. by trapping themselves in a TCriticalSection for each one. Now the Main thread can easily free a thread after it assigned work to it (e.g. by providing a callback function that is to be called in TThread.Execute). If work is done, the Thread could notify the manager (in the main thread) by Application.QueueAsyncCall or TThread.Queue. TThread. Synchronize would not harm in this case either, as the thread at that time has nothing to do anyway. That's exactly what I planed to do. But I don't know CriticalSections can be used in here. Why not (of course there might be alternatives). My original thinking is that, by the end of Execute, I call either PostMessage or QueueAsyncCall to notify main thread that the current thread finished its work. OK. Moreover TThread.Queue and TThread.Synchronize will work. The main thread, in its message handler (This is the procedure given in Application.QueueAsyncCall, TThread.Queue and TThread.Synchronize) then know from a status variable that this thread is in suspended status, OK, suspend will work similar to TCrtiticalSection. But for me Suspend is a bit suspicious, as there is no direct Linux and Information-Science equivalent to same (while TCriticalSection directly maps to a Semaphore). then assign a new work to it and call its Execute() method again. I don't know how to call its Execute(). I feel that you can't leave the Execute procedures without killing the thread. So you need to call the work-procedure from the execute procedure. Is that ok? To be exact, when a thread's execute() finished, it will go to a sleep status, No. It will die. and can be reused by calling execute() again, right? AFAIK: No. -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] white popup hint box
I see yellow too, but why doesn't the hint box have a border? Hint boxes on windows have a dark 1px border. On Mon, Sep 15, 2014 at 4:05 PM, Rik van Kekem r...@graficalc.nl wrote: waldo kitty wrote: i'm also quite confused how you saw that image with that section yellowed... i've looked at the same image on several machines and see only white on white :/ Like Anthony already found out, even if it's white on screen it really is a very light shade of yellow. You can see this by adjusting the brightness of your screen but with a laptop that's a bit more difficult. I've seen multiple times, especially with laptops, that you can't see these subtle colors. (For me, with a desktop-screen, the difference is really visible) If you don't want to change your theme you can change it in the source of Lazarus itself. But your other programs will keep a white hint. I don't know how to make a clearer border but the color is here: Lazarus_dir\LCL\Include\hintwindow.inc // Color := clInfoBk; Color := clYellow; // - for instance But clInfoBk is used a lot more throughout the Lazarus IDE so it might be better to change your theme. Maybe somebody else could hunt down the border-drawing for this tooltip (which i couldn't find off hand). -- ___ 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] PostMessage return value
On Mon, 15 Sep 2014 21:57:40 +0800 Xiangrong Fang xrf...@gmail.com wrote: [...] That's exactly what I planed to do. But I don't know CriticalSections can be used in here. My original thinking is that, by the end of Execute, I call either PostMessage or QueueAsyncCall to notify main thread that the current thread finished its work. The main thread, in its message handler then know from a status variable that this thread is in suspended status, then assign a new work to it and call its Execute() method again. Then write your thread Execute as a loop, calling Synchronize. Synchronize pauses the thread, waiting for the main thread, calling the method in the main thread, when method ended continuing thread. See http://wiki.freepascal.org/Multithreaded_Application_Tutorial Mattias -- ___ 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
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] TAChart CandleStick Chart
The TopMark and BottomMark, as you call it, can be removed by setting WhiskerWidth to 0, and the MiddleMark disappears with MedianPen.Style set to psClear. The Up and Down colors can be set by some logics when adding data points (there's the color parameter in the Add method...). The intrinsic problem that Box/Whisker expects ordered y values, while the Candle obviously does not (open can be greater or smaller then close), could be overcome by pre-sorting the data which should also take account of the Up/Down colors. Well, in total, these are a few lines of code, but relatively straightforward. Nevertheless, maybe too much for less code-centered guys? Anyway, I'll try to add your contribution to a new CandleStick series. A few question before I begin: Your posting says that Candlestick plots do not have top and bottom marks, but the wikipedia reference that you gave does show them. What is true? What should be the default up and down colors? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TAChart CandleStick Chart
El 15/09/14 a las 15:49, Werner Pamler escibió: The TopMark and BottomMark, as you call it, can be removed by setting WhiskerWidth to 0, and the MiddleMark disappears with MedianPen.Style set to psClear. The Up and Down colors can be set by some logics when adding data points (there's the color parameter in the Add method...). The intrinsic problem that Box/Whisker expects ordered y values, while the Candle obviously does not (open can be greater or smaller then close), could be overcome by pre-sorting the data which should also take account of the Up/Down colors. Well, in total, these are a few lines of code, but relatively straightforward. Nevertheless, maybe too much for less code-centered guys? Anyway, I'll try to add your contribution to a new CandleStick series. A few question before I begin: Your posting says that Candlestick plots do not have top and bottom marks, but the wikipedia reference that you gave does show them. What is true? What should be the default up and down colors? Thanks. I'm used to see CandleStick charts in many Stock Trading software, and I never saw thos top and bottom marks. Default UP can be clLime and Down clRed. P.S.: the next chart type is Heikin Ashi, a variation of CandleStick. -- Leonardo M. Ramé Medical IT - Griensu S.A. Av. Colón 636 - Piso 8 Of. A X5000EPT -- Córdoba Tel.: +54(351)4246924 +54(351)4247788 +54(351)4247979 int. 19 Cel.: +54 9 (011) 40871877 -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] white popup hint box
On 9/15/2014 7:15 AM, Anthony Tekatch wrote: On Sun, 14 Sep 2014 23:22:26 -0400, waldo kitty wkitt...@windstream.net wrote: i'm also quite confused how you saw that image with that section yellowed... i've looked at the same image on several machines and see only white on white :/ I find this interesting. I can see a very light yellow pop-u on your supplied screen-shot. I used GIMP to confirm those HTML color values: The white background = ff The popup = e1 well, i'll be... i just check this in the tool i used to create the graphic... i use the printscreen key to capture the screen and then pasted that into the tool where i then cropped it down so it wasn't too large for the list... the tool i used is an older paintshop pro and it causes the system to change the color scheme to windows vista basic... using the eye dropper tool, it took me a few minutes to realize the RGB values were 255,255,225... at some point, i had leaned over sideways and i did notice that there was a yellow tint to that popup... if i am at a roughly 45 degree angle left or right of the laptop screen, then i see the very light yellow... if i'm 45 degrees above or below, then it is kind of greenish with the editor's white background looking blue... I just checked my popup on Lazarus Ver 1.3, and it is definitely white on white, i'm glad i'm not the only one being fooled by this :) i'd still rather have a proper border around the popup, though :) although I had once manually changed some settings in the Linux gtkrc setting file pointed to by ~/.gtkrc-2.0: as noted above, this is on a vista machine so no gtk stuffs here for me to edit ;) filename: /usr/share/themes/Aurora/gtk-2.0/gtkrc I once had light gray text on white, so I changed the following line of that file to back tooltip fg on white tooltip bg as follows: gtk_color_scheme = fg_color:#00\nbg_color:#C7C7C7\nbase_color:#ff\ntext_color:#00\nselected_bg_color:#247EB3\nselected_fg_color:#ff\ntooltip_bg_color:#FF\ntooltip_fg_color:#00 interesting :) -- 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
Re: [Lazarus] white popup hint box
I also see a distinctive yellow color. Waldo Kitty, you should go to see an eye doctor, you are suffering from color blindness. :) You all noticed the hint window's color but nobody noticed it renders HTML nicely, giving a professional touch to hint and info windows. The same effect was available also earlier by installing TurboPowerIProDsgn package. Now some bugs are fixed (see #20202) and it is part of lazarus BigIde by default. On Mon, Sep 15, 2014 at 5:05 PM, Rik van Kekem r...@graficalc.nl wrote: I don't know how to make a clearer border but the color is here: Lazarus_dir\LCL\Include\hintwindow.inc // Color := clInfoBk; Color := clYellow; // - for instance That will not help because the THintWindow.Canvas is not used. Instead TurboPowerIProDsgn registers its own HTML renderer component there. If you want to study the code, here are some pointers: IdeHelpIntf (in package IdeIntf) has these events through which TurboPowerIProDsgn registers itself: CreateIDEHTMLControl: TCreateIDEHTMLControlEvent = nil; CreateIDEHTMLProvider: TCreateIDEHTMLProviderEvent = nil; Code that supports both the default text hints and registered hint renderers is now refactored into THintWindowManager class, also in IdeHelpIntf unit. Earlier such code was spread in different places, including OI and SE. There is a small border around hint windows. On Windows there is even a nice shadow so it looks like lifted up. I don't know what you people are complaining about. I tested with Windows, GTK2 and QT widgetsets. Juha -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] white popup hint box
Right, Waldo's screenshot does not have a border, it only has a shadow. In my Windows 7 there is both a border and a shadow. Juha -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] white popup hint box
On 15-09-2014 22:02, Juha Manninen wrote: I also see a distinctive yellow color. Waldo Kitty, you should go to see an eye doctor, you are suffering from color blindness. :) I take it you're not working with a laptop ;) I know for a fact laptops show these subtle colors differently. (Even my second screen shows the yellowish less clearly) // Color := clInfoBk; Color := clYellow; // - for instance That will not help because the THintWindow.Canvas is not used. Actually it does. I tested it myself :) Probably because the real object showing this is inherited from THintWindow. I couldn't find the actual object (with my somewhat limited knowledge of Lazarus) but i guess you're more familiar with it ;) There is a small border around hint windows. On Windows there is even a nice shadow so it looks like lifted up. What color is that border? It does have a margin but i don't see a real border. (Do you in the given screenshot?) If you can't see the yellowish color (which i can, but on a laptop is difficult to see) it's not pretty without a border and even damn confusing. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] white popup hint box
On 9/15/2014 10:05 AM, Rik van Kekem wrote: waldo kitty wrote: i'm also quite confused how you saw that image with that section yellowed... i've looked at the same image on several machines and see only white on white :/ Like Anthony already found out, even if it's white on screen it really is a very light shade of yellow. You can see this by adjusting the brightness of your screen but with a laptop that's a bit more difficult. I've seen multiple times, especially with laptops, that you can't see these subtle colors. (For me, with a desktop-screen, the difference is really visible) i'll have to try one of the other systems that still has a crt... most every system here has a flatscreen display... i think they're all lcd, too... If you don't want to change your theme you can change it in the source of Lazarus itself. But your other programs will keep a white hint. I don't know how to make a clearer border but the color is here: Lazarus_dir\LCL\Include\hintwindow.inc // Color := clInfoBk; Color := clYellow; // - for instance But clInfoBk is used a lot more throughout the Lazarus IDE so it might be better to change your theme. Maybe somebody else could hunt down the border-drawing for this tooltip (which i couldn't find off hand). i've changed the theme for now but yes, it would really be nice if someone would fix the border so it is grey or black or such... perhaps it might be a good thing to add these color settings to the options-colors area, too? eg: tool tip border : #00 tool tip background : light grey or how ever they are specified... it is much too deep in the innards of lazarus for me to even think about looking for... especially with my ancient TP/BP procedural thought process methodology ;) -- 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
Re: [Lazarus] white popup hint box
On 15-09-2014 22:09, Juha Manninen wrote: Right, Waldo's screenshot does not have a border, it only has a shadow. In my Windows 7 there is both a border and a shadow. I'm missing the border too on my machine. Lazarus 1.3 r46221:46236M FPC 2.7.1 i386-win32-win32/win64 Windows 7 Ultimate 64 bit What theme are you using. (Just tested both standard Aero theme and Classic theme and both show NO norder) -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] white popup hint box
On 15-09-2014 22:09, Juha Manninen wrote: Right, Waldo's screenshot does not have a border, it only has a shadow. In my Windows 7 there is both a border and a shadow. Now i see what you mean !! But for this to work you need the package turbopoweriprodsgn.lpk installed. And this is not done with a default installation. I just added turbopoweriprodsgn.lpk, rebuild lazarus and i now do get a greyish border completely around the window. Solved (but of course it should be default and i guess the other/default hint-rendering leaves something to be desired.) -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TAChart with transparent background
Though really late, I can confirm that the solution is working fine. I still have to add some profiling code to measure it, though with added background it seems perceivably slower even on a recent PC (core i5 vpro). Are BGRA or other backends known to be faster? thanks anyway for the help! R# 2014-09-04 1:08 GMT+02:00 Roberto P. padovan...@gmail.com: Thank you very much. I need a background image, therefore as soon as I am back at the office I'll try your code. Thank you again! R# 2014-09-02 18:18 GMT+02:00 Werner Pamler werner.pam...@freenet.de: It is not fully clear to me what you mean by a chart with transparent background. Do you want to see the form underneath the chart? I fear this is not easily possible. Or do you want to have a background image in the chart? For the latter case this code is working fine with me: type TForm1 = class(TForm) Chart1: TChart; procedure Chart1BeforeDrawBackground(ASender: TChart; ACanvas: TCanvas; const ARect: TRect; var ADoDefaultDrawing: Boolean); procedure Chart1BeforeDrawBackWall(ASender: TChart; ACanvas: TCanvas; const ARect: TRect; var ADoDefaultDrawing: Boolean); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); private { private declarations } FBackImage: TPicture; public { public declarations } end; procedure TForm1.Chart1BeforeDrawBackWall(ASender: TChart; ACanvas: TCanvas; const ARect: TRect; var ADoDefaultDrawing: Boolean); begin ADoDefaultDrawing := false; ACanvas.StretchDraw(ARect, FBackImage.Graphic); end; procedure TForm1.Chart1BeforeDrawBackground(ASender: TChart; ACanvas: TCanvas; const ARect: TRect; var ADoDefaultDrawing: Boolean); begin ACanvas.GradientFill(ARect, clSkyBlue, clWhite, gdVertical); ADoDefaultDrawing := false; end; procedure TForm1.FormCreate(Sender: TObject); begin FBackImage := TPicture.Create; FBackImage.LoadFromFile('C:\lazarus-svn\images\splash_logo.png'); // please adapt this path to your lazarus installation end; procedure TForm1.FormDestroy(Sender: TObject); begin FBackImage.Free; end; The basic idea is to assign a handler to the chart events OnBeforeDrawBackWall or OnBeforeDrawBackground and disable the default background painting by setting ADoDefaultDrawing to false. The first event replaces painting of the area enclosed by the chart's frame (Back wall), the other one replaces painting of the entire chart background. Above example paints the Lazarus splash-logo as BackWall and a gradient as background. Maybe I'll once write a tutorial on this topic... -- ___ 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] white popup hint box
On Monday, September 15, 2014, Rik van Kekem r...@graficalc.nl wrote: But for this to work you need the package turbopoweriprodsgn.lpk installed. And this is not done with a default installation. Yes it is. As I explained it is now part of bigide. The next version 1.4 installer will have it by default. Does this discussion mean that the old text hint window also changed its color? I refactored THintWindow but I did not touch the color IIRC. Juha -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] white popup hint box
On 9/15/2014 4:02 PM, Juha Manninen wrote: I also see a distinctive yellow color. Waldo Kitty, you should go to see an eye doctor, you are suffering from color blindness. :) hahahahaha! might be getting there in my old age ;) You all noticed the hint window's color but nobody noticed it renders HTML nicely, giving a professional touch to hint and info windows. i haven't been able to see that yet... i had a time trying to do the screen grab because as soon as i'd hit the print screen key, the popup would go away... i had to try 5 or 6 times before i got the image i posted showing it... The same effect was available also earlier by installing TurboPowerIProDsgn package. Now some bugs are fixed (see #20202) and it is part of lazarus BigIde by default. nice! i have generally installed that in the past but didn't understand this was what it was for... i haven't gotten around to trying to use it, either... it has been on my TODO list for a long while and no projects i've been working on have needed it... probably because they're mostly all command line text mode programs, i guess... On Mon, Sep 15, 2014 at 5:05 PM, Rik van Kekem r...@graficalc.nl wrote: I don't know how to make a clearer border but the color is here: Lazarus_dir\LCL\Include\hintwindow.inc // Color := clInfoBk; Color := clYellow; // - for instance That will not help because the THintWindow.Canvas is not used. Instead TurboPowerIProDsgn registers its own HTML renderer component there. If you want to study the code, here are some pointers: IdeHelpIntf (in package IdeIntf) has these events through which TurboPowerIProDsgn registers itself: CreateIDEHTMLControl: TCreateIDEHTMLControlEvent = nil; CreateIDEHTMLProvider: TCreateIDEHTMLProviderEvent = nil; Code that supports both the default text hints and registered hint renderers is now refactored into THintWindowManager class, also in IdeHelpIntf unit. Earlier such code was spread in different places, including OI and SE. i knew that someone (you i think) had been working on this by the posts in the various lists... i'm glad to see that your work is coming along nicely... There is a small border around hint windows. On Windows there is even a nice shadow so it looks like lifted up. I don't know what you people are complaining about. I tested with Windows, GTK2 and QT widgetsets. i get the shadow but not the border... it is somewhat unsettling to have a box popup that might not be noticed as a popup box at first... initially i had thought that some sort of formatting thing had happened and i moved to try to clear it up when the box disappeared with the text i was going to try to clear out... it took me a few minutes to realize that it was a popup and that it was due to my mouse having moved over something that had a hint box associated with it... i actually don't mind the white (or very light yellow) background of the popup box but the missing border is something else... why it is missing i have no idea... that's why i posted asking where i need to go to adjust the colors for those items ;) -- 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
Re: [Lazarus] white popup hint box
On 9/15/2014 4:09 PM, Juha Manninen wrote: Right, Waldo's screenshot does not have a border, it only has a shadow. In my Windows 7 there is both a border and a shadow. i'm on vista (32bit) and i think i have their aero thing turned on on this box... on most i generally turn all the fancy stuffs off so the machine responds faster... -- 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
Re: [Lazarus] white popup hint box
On 15-09-2014 23:24, Juha Manninen wrote: Yes it is. As I explained it is now part of bigide. The next version 1.4 installer will have it by default. This afternoon i did a complete reinstall (on another machine) and did NOT get turbopoweriprodsgn. I did get TurboPowerIPro by default. (And i guess Waldo didn't get it either by default) I did a complete new install with fpcup. (Or is that the problem? Is that not the BigIde?) Lazarus 1.3 r46238 FPC 2.7.1 i386-win32-win32/win64 Does this discussion mean that the old text hint window also changed its color? I refactored THintWindow but I did not touch the color IIRC. I don't know if the color used to be different. I did notice the color of the TurboPowerIProDsgn is somewhat more yellow (and thus more visible). And it indeed does look a lot better with more options. But the old text hint window doesn't have a border. And it does take its color correctly from the theme which as it should be (clInfoBk). Although the real hints, from buttons etc., are taken from the theme itself and can't be overridden. The personalize tooltip should only be used for Classic and Basic themes but somehow clInfoBk does also get that color in Aero theme, but only for that text-window. For the other button-hints etc. the color is white-gradient with border (according to theme-standard which is correct). I guess the old text hint does not do Themedrawing by default (otherwise it would also be white-gradient with a border). (But if TurboPowerIProDsgn becomes/is default the old text hint windows shouldn't mater anymore) -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PostMessage return value
2014-09-15 22:30 GMT+08:00 Michael Schnell mschn...@lumino.de: Is that ok? To be exact, when a thread's execute() finished, it will go to a sleep status, No. It will die. and can be reused by calling execute() again, right? AFAIK: No. What's the meaning of die? By calling execute() I simply mean call its Start() method. I will create the thread in Suspended mode, i.e. Create(True). So I hope I can Start() it again after Execute() ended. That's what I understand where the document said Resume() is deprecated and replaced by Start(), which means, Start() can be called multiple times?? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] TAChart with transparent background
I added some simple time measuring code (using GetTickCount) to the background image tutorial to see the speed loss that you mention: Without the backgrounds (Lazarus logo and gradient) the GetTickCount reports 0 ms between the OnBeforeDrawBackground and OnAfterPaint events, while with the backgrounds it reports 16 ms, sometimes 0 ms. Replacing the StretchDraw by a simple Draw in the painting of the logo, brings down the time also to 0. Therefore I'd guess that the background painting is not perceivable unless you squeeze a 20 mega-pixel photo into the chart area or load the image during the painting event. What exactly are you doing? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] white popup hint box
On 9/15/2014 4:55 PM, Rik van Kekem wrote: On 15-09-2014 22:09, Juha Manninen wrote: Right, Waldo's screenshot does not have a border, it only has a shadow. In my Windows 7 there is both a border and a shadow. Now i see what you mean !! But for this to work you need the package turbopoweriprodsgn.lpk installed. And this is not done with a default installation. I just added turbopoweriprodsgn.lpk, rebuild lazarus and i now do get a greyish border completely around the window. well eff me!! (see attachment) i would never have thought of adding that package... it actually was not installed in this lazarus although i have had it installed in the past... i guess i left it out the last time i reinstalled because i hadn't seen any benefit and simply hadn't gotten to it on my TODO list to see what it could offer me... Solved (but of course it should be default and i guess the other/default hint-rendering leaves something to be desired.) yeah, i don't do bigide as was mentioned in the juha's previous message... i build from trunk in the repository using the following in my build script... make OPT=-gl -gh -dHEAPTRC_WINDOW lazbuild lcl basecomponents starter bigidecomponents lhelp lazbuild.exe --build-ide=-gl -gh -dHEAPTRC_WINDOW --build-mode=debug ide generally speaking, my miscellaneousoptions.xml is used but my script has the ability of disabling it by renaming it so it isn't found... in this case, it is used and i don't recall the testing that was being done before where i needed to be able to disable miscellaneousoptions.xml... probably when trying to work with one of the docking manager things which i don't use any more for various reasons... -- 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
Re: [Lazarus] TAChart with transparent background
The image is a 30KB png, not much. It is smaller than the area, so it gets actually stretched. Can I use Draw instead of StretchDraw if I make the image exactly the size I need? I can force the form size. I think that tens of milliseconds can be actually relevant, because I am plotting data received (and processed) every 50ms from a serial port. R# 2014-09-16 0:07 GMT+02:00 Werner Pamler werner.pam...@freenet.de: I added some simple time measuring code (using GetTickCount) to the background image tutorial to see the speed loss that you mention: Without the backgrounds (Lazarus logo and gradient) the GetTickCount reports 0 ms between the OnBeforeDrawBackground and OnAfterPaint events, while with the backgrounds it reports 16 ms, sometimes 0 ms. Replacing the StretchDraw by a simple Draw in the painting of the logo, brings down the time also to 0. Therefore I'd guess that the background painting is not perceivable unless you squeeze a 20 mega-pixel photo into the chart area or load the image during the painting event. What exactly are you doing? -- ___ 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] white popup hint box
On Tuesday, September 16, 2014, Rik van Kekem r...@graficalc.nl wrote: This afternoon i did a complete reinstall (on another machine) and did NOT get turbopoweriprodsgn. I did get TurboPowerIPro by default. Run make clean bigide at cmd line. If it still is not there, then we have a bug. But the old text hint window doesn't have a border. Did it have border before I refactored the code? If it did then it is a regression and must be fixed. Yet, I don't think it had, I would have noticed the code drawing a border. Juha -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] white popup hint box
On 16-09-2014 00:26, Juha Manninen wrote: Run make clean bigide at cmd line. If it still is not there, then we have a bug. YES... It did come with bigide. I guess it's not the target of fpcup. Always used fcpup but maybe it's time to switch to svn and do the make myself (and learn what i'm doing ;)). I tried this some time ago but always got lots of errors. Did it have border before I refactored the code? If it did then it is a regression and must be fixed. Yet, I don't think it had, I would have noticed the code drawing a border. No, i don't think it ever got a border (at least that i noticed). I can even remember seeing some similar hint in Delphi 7 (without border) but i'm not sure (long time ago). At least with the new TurboPowerIProDsgn it looks a LOT better with more options. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] white popup hint box
On 9/15/2014 5:24 PM, Juha Manninen wrote: On Monday, September 15, 2014, Rik van Kekem r...@graficalc.nl wrote: But for this to work you need the package turbopoweriprodsgn.lpk installed. And this is not done with a default installation. Yes it is. As I explained it is now part of bigide. The next version 1.4 installer will have it by default. as noted previously, i don't use any installer... i pull trunk from the repository and compile it as per my previously posted command lines... in retrospect, i guess i should have filed a bug report and then amended it when we discovered that the turbopoweriprodsgn was necessary for it to appear correctly... perhaps there should be some checking code to see if the turbopoweriprodsgn routines are available and if not, then render the popups as desired in the old way with a border and background color with or without the html capabilities... Does this discussion mean that the old text hint window also changed its color? I refactored THintWindow but I did not touch the color IIRC. TBH, i don't know... all i know is that i was not able to immediately recognize the popup for what it was... -- 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
Re: [Lazarus] white popup hint box
On 16 september 2014 01:17:55 CEST, waldo kitty wkitt...@windstream.net wrote: as noted previously, i don't use any installer... i pull trunk from the repository and compile it as per my previously posted command lines... Isn't Lazarus 1.3 r42488 a really old version? (November 2013?) Or am I seeing this wrong? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PostMessage return value
On 16.09.2014 00:06, Xiangrong Fang wrote: 2014-09-15 22:30 GMT+08:00 Michael Schnell mschn...@lumino.de mailto:mschn...@lumino.de: Is that ok? To be exact, when a thread's execute() finished, it will go to a sleep status, No. It will die. and can be reused by calling execute() again, right? AFAIK: No. What's the meaning of die? By calling execute() I simply mean call its Start() method. I will create the thread in Suspended mode, i.e. Create(True). So I hope I can Start() it again after Execute() ended. That's what I understand where the document said Resume() is deprecated and replaced by Start(), which means, Start() can be called multiple times?? No. A thread's Execute() method is only called once. If it exits the thread ends to never return. Suspend() uses operating system functionality to stop a thread's execution whereever it currently is (dangerous!) and Resume() let's the thread continue its execution from that point on. Now with the deprecation of these two methods a new method was needed to get the thread out of the create suspended state. Thus Start() was born (internally Start() is basically just an alias for Resume()). It's only reason of existance is to start a thread that was created as suspended. Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus