Guest Efthymios Kalyviotis Posted June 20, 2011 Posted June 20, 2011 Hello, first of all, I must congratulate all of the persons that are working on this exciting project. I have a couple of small questions. 1) When I add a TUniListBox on a TUniForm and assign its onClick event handler, I observe the following strange thing: Opening the application inside the WebBrowser and clicking an item on the list box, the event is being called twice. Why is that happening? Is it possible that something conflicts with the application that runs on the desktop? 2) I do populate a uniListBox with a procedure like the following inside an other (master) UniListBox onClick event: SubDevsUniListBox.Clear; DevsNum:= JSON['result'].AsObject['totalDevicesReturned'].AsInteger; for i := 0 to DevsNum - 1 do begin item:= JSON['result'].AsObject['devices'].AsArray.O; SubDevsUniListBox.Items.Add(item['key'].AsString); end; uniTimer.Enabled:= True; In my timer event, I do something like the following inside it: for i := 0 to SubDevsUniListBox.Count - 1 do sDevs:= sDevs + '{"key": "' + SubDevsUniListBox.Items + '", "channels": "null"},'; The problem is that the SubDevsUniListBox that is populated before the timer gets enabled, contains in its count property a value like 2543345 which is imposible. What might be happening and how can I solve it? Is it possible that the error occurs because my masters onClick event handler is called by the system twice? 3) It would be a nice idea if we had a way to implement somehow our own custom UniSomething components. Perhaps in other versions we might get a framework for that? Thank you very much. Yours sincerely, Efthymios Kalyviotis. Quote
zilav Posted June 20, 2011 Posted June 20, 2011 Use uniStringGrid instead of ListBox, way more functionality - columns, stripes coloring, custom draw handler, RefreshRow method etc. I tried ListBoxes earlier, but they feel "unreliable", so I replaced them with stringgrids, and after recent minor bugfixing they are simply brilliant. Quote
Administrators Farshad Mohajeri Posted June 20, 2011 Administrators Posted June 20, 2011 1) When I add a TUniListBox on a TUniForm and assign its onClick event handler, I observe the following strange thing: Opening the application inside the WebBrowser and clicking an item on the list box, the event is being called twice. Why is that happening? Is it possible that something conflicts with the application that runs on the desktop? 2) I do populate a uniListBox with a procedure like the following inside an other (master) UniListBox onClick event: SubDevsUniListBox.Clear; DevsNum:= JSON['result'].AsObject['totalDevicesReturned'].AsInteger; for i := 0 to DevsNum - 1 do begin item:= JSON['result'].AsObject['devices'].AsArray.O; SubDevsUniListBox.Items.Add(item['key'].AsString); end; uniTimer.Enabled:= True; In my timer event, I do something like the following inside it: for i := 0 to SubDevsUniListBox.Count - 1 do sDevs:= sDevs + '{"key": "' + SubDevsUniListBox.Items + '", "channels": "null"},'; The problem is that the SubDevsUniListBox that is populated before the timer gets enabled, contains in its count property a value like 2543345 which is imposible. What might be happening and how can I solve it? Is it possible that the error occurs because my masters onClick event handler is called by the system twice? 3) It would be a nice idea if we had a way to implement somehow our own custom UniSomething components. Perhaps in other versions we might get a framework for that? Hello, 1 & 2 : First of all are you using the latest build of uniGUI which is 0.85.0.873? If yes can you send a test case which can reproduce above issues? 3: Yes, certainly that will be possible. Quote
Guest Efthymios Kalyviotis Posted June 22, 2011 Posted June 22, 2011 Hello, 1 & 2 : First of all are you using the latest build of uniGUI which is 0.85.0.873? If yes can you send a test case which can reproduce above issues? 3: Yes, certainly that will be possible. Dear Farshad, I am using the uniGUI Beta v0.84.5.836 (8.70 MB 2011-03-21). I tried to reproduce both of my problems in a small application created (I attached it). For the 1st. The click event is called twice (in the browser) only when I have a breakpoint inside the onclick event of the list box. For the 2nd. Clicking one item inside the 1st list box will see the problem. The rar has both the source code and executable. Thank you very much. UniGuiLBClick.rar Quote
Administrators Farshad Mohajeri Posted June 22, 2011 Administrators Posted June 22, 2011 I tested with latest build and couldn't reproduce the problem. Version 0.84 is obsolete now and many things have changed since then. Please see beta forums for latest 0.85 build and try again with it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.