Onclick event fired twice ? lazarus / 31-LCL ---------------------------------------------------------------------- andresayang · 2013-10-12 03:19 Hi All, I have a small problem, using "menu as button": So I have a menu with menuitem. When I click on menuitem, I have an onclik event which add a line in a stringgrid. It seems that the onclick event is fired whith mousedown and another onclick event is fired with mouseup. Did someone else notice this ? (I had a quick look in bug tracker but did not see nothing about this) Thanks Ok, I have make some test. I think it is coming from the IsOnClickStored in the onclick property. Is there any way to set this to force this value to false ? ---------------------------------------------------------------------- User137 · 2013-10-12 19:43 How do you simply replicate it? I made new project and TMainMenu. Code: [Select]procedure TForm1.MenuItem1Click(Sender: TObject); begin   caption:=caption+'1'; end; When i click the menu, it adds only 1 of '1' in caption per click. Linked the click event to 1 submenu-item too, still just 1 event per click. ---------------------------------------------------------------------- andresayang · 2013-10-13 02:42 I have done your test before (or another equivalent, making a click counter in a TEdit): On my system, with your code: Click first time, it add only '1'. Click second time it add '11'. Click third time it add '1'. Click Fourth time it add '11'. ..... If you click on the form between each tine you click on the menu, it will add only '1'. That's the reason why i was suggesting the "bug" was coming from the IsOnClickStored property. Can someone confirm / deny he has the same behavior that the one i have (take only two second to do). Thanks ---------------------------------------------------------------------- User137 · 2013-10-13 06:38 Well, according to our signatures, we are using different versions of Lazarus, and you are using different widgetset too. ---------------------------------------------------------------------- andresayang · 2013-10-13 07:59 Yes, I have read you signature too, that's the reason why I ask if other people can test with the code you post. I made quick and dirty bypass using a boolean, I would prefer to have a fix. I use 1.0.12 from deb, I can not download from svn from where I am (satellite link too slow). Can svn version be installed locally (ie in user directory on linux) so maybe i can install two versions of Lazarus (as windows user, maybe you do not know). I am going to install on windows VM also to compile on both systems. Cheers ---------------------------------------------------------------------- BigChimp · 2013-10-13 10:02 Quote from: andresayang on October 13, 2013, 09:59:21 amCan svn version be installed locally (ie in user directory on linux) so maybe i can install two versions of Lazarus (as windows user, maybe you do not know). 1. yes, there can be a system wide Lazarus and a Lazrus in your local directory 2. You can also install multiple Lazarus versions on Windows. In all cases, make sure the primary config path (where the settings are stored) is different, so the Lazarus instances don't interfere. You can use e.g. fpcup to automatically get an svn version of Laz+FPC