Page 1 of 9
Using event handlers - (obsolete version)
Posted: Tue Apr 11, 2006 5:06 pm
by srod
Update: 20th September 2007.
Major update.
Version 3.0.0.
Please see the new thread on EasyVENT 3 as this is totally incompatible with earlier versions.
The original version of EasyVENT is still available :
HERE
whilst version 2.02 is
HERE
Remainder of post removed.
Posted: Tue Apr 11, 2006 5:11 pm
by netmaestro
I would argue is ready to be used
er... battening down for an onslaught?

Posted: Tue Apr 11, 2006 5:13 pm
by srod
I didn't say it would work, only that it could be used!
**Edit: actually I think that I did say that it would work!
Oh well, I can run fast...
Posted: Tue Apr 11, 2006 8:12 pm
by Shannara
Running is healthy

I love this product already. It is definately nice to have event bindings

I think a very old screenshot of VD showed something similar, maybe an integration would be wonderful

Posted: Tue Apr 11, 2006 8:19 pm
by techjunkie
Shannara wrote:I think a very old screenshot of VD showed something similar, maybe an integration would be wonderful

Ohhh yea! That would be the 17:th nail in the chest, the 8:th colour of the rainbow or the make the pizza complete!

Posted: Tue Apr 11, 2006 9:58 pm
by Kale
Impressive stuff!

Posted: Tue Apr 11, 2006 10:05 pm
by utopiomania
Veeery impressing indeed

Thanks!
Posted: Tue Apr 11, 2006 11:53 pm
by srod
You're welcome.
Posted: Wed Apr 12, 2006 12:40 am
by Straker
techjunkie wrote:
Ohhh yea! That would be the 17:th nail in the chest, the 8:th colour of the rainbow or the make the pizza complete!

What is it with you and pizzas? Is that all you eat? We already know what your drink...

Posted: Wed Apr 12, 2006 1:46 am
by Dare2
Hi srod.
This is stunning - perhaps a turning point for many coders!
Thank you very much!
Posted: Wed Apr 12, 2006 10:31 am
by srod
Thanks Dare2. Glad you like it.
Posted: Wed Apr 12, 2006 1:55 pm
by ebs
srod,
Nice work! I'm glad to see how you've been able to extend EasyVent to cover so many events.
I have a question about the TrackbarGadget #OnScroll event. The demo program correctly shows
the trackbar value when I move the trackbar "thumb" with the mouse.
If I just click on the trackbar, however, the position reported is 0.
Is this the expected behavior? Do I have to use another event to catch when the user changes the position by clicking?
Or would it be possible to extend the #OnScroll event to cover both cases?
Regards,
Eric
Posted: Wed Apr 12, 2006 2:20 pm
by srod
Hi ebs, it seems to be a Windows peculiarity as this is just the default value provided by Windows. It also happens with Scroll Bar controls.
I could replace the 'default' value with a call to #TBM_GETPOS_() etc. to fill the details in, but to be honest, you're better off using a GetGadgetState() command in your event handler, which undoubtedly amounts to the same thing (just look out for the #SB_ENDSCROLL value in the *sender\state field for the best results).
Code: Select all
Procedure.l Change(*sender.PB_Sender)
If *sender\state<>#SB_ENDSCROLL And *sender\state<>#SB_THUMBPOSITION
Debug GetGadgetState(0)
EndIf
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure
Regards.
Posted: Thu Apr 13, 2006 1:38 pm
by srod
Update - and bug fix!
I found that the events dealing with dragging and dropping items from ListIcons / ExplorerLists was flawed and too inflexible. I have thus removed the original events and added 3 far more flexible events.
Two example programs of dragging items from ListIcons are now included, the second of which highlights the target row as you drag the item around etc. (My thanks to 'freak' for his excellent tutorial on this.)
The new events are coloured red.
The full list of supported events runs as follows:
- #OnButtonClick
- #OnChange
- #OnClose
- #OnCollapseExpandSelection
- #OnContextMenuPopup
- #OnCursorEnter
- #OnCursorExit
- #OnDragDrop
- #OnDragItemOver
- #OnDblClick
- #OnEditTreeLabels
- #OnEndDragItem
- #OnGotFocus
- #OnKeyDown
- #OnKeyPress
- #OnKeyUp
- #OnLostFocus
- #OnMaximize
- #OnMenuItemSelect
- #OnMinimize
- #OnMouseDown
- #OnMouseOver
- #OnMouseUp
- #OnMove
- #OnPaint
- #OnResize
- #OnSelectItem
- #OnScroll
- #OnStartDragItem
That's it. I think that's all the events I need to cover at this stage.
Have also upgraded the user guide so that it gives more details on each event.
See the first post for the download link.
Right, now to put all this work to some use!
Thanks to all those who have tested this code.
Posted: Thu Apr 13, 2006 2:16 pm
by ebs
srod,
I just tried the new drag and drop demo programs and noticed something odd.
When I start dragging an item from the left ListIconGadget, my mouse cursor disappears
and I don't see the item being dragged. Since nothing is visible, I can't tell what's going on,
but when I release the mouse button the dragged item *is* dropped correctly.
I'm using the standard Windows arrow mouse cursor.
Have you (or anyone else) seen this behavior?
Regards,
Eric