Page 7 of 9
Posted: Sat Feb 03, 2007 2:48 pm
by srod
Konne wrote:I didn't want to insult you or anything like that, I think it's a great peace of work. I was just wondering if you are still working on it, that's all.
And thanks fpr the code, but can I get clicks on Imagegadgets too?
No worries. Truth is that time is so tight at the moment, that I probably wouldn't be able to update the code anyhow if someone made a request.
As for mouse clicks:
Code: Select all
XIncludeFile "EasyVENT.pbi"
DisableExplicit
Declare.l MouseOver(*sender.PB_Sender)
Declare.l MouseDown(*sender.PB_Sender)
Declare.l MouseUp(*sender.PB_Sender)
myImage = LoadImage(#PB_Any, "icon.ico") ; Please use your own icon!
OpenWindow(0, 0, 0, 640, 480, "", #PB_Window_SystemMenu |#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget| #PB_Window_ScreenCentered|#PB_Window_Maximize)
CreateGadgetList(WindowID(0))
ImageGadget(1, 20,20, 300, 300, ImageID(myImage), #PB_Image_Border)
;Set event handlers.
SetEventHandler(GadgetID(1), #OnMouseOver, @MouseOver())
SetEventHandler(GadgetID(1), #OnMouseDown, @MouseDown())
SetEventHandler(GadgetID(1), #OnMouseUp, @MouseUp())
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
End
Procedure.l MouseOver(*sender.PB_Sender)
Debug "Mouse over image gadget!"
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure
Procedure.l MouseDown(*sender.PB_Sender)
Debug "Mouse click over image gadget!"
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure
Procedure.l MouseUp(*sender.PB_Sender)
Debug "Mouse up over image gadget!"
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure
Of course, you don't need 3 separate procedures for the above, you could easily combine them into a single handler and then keep an eye on the value of *sender\message in order to determine which event called the handler etc.
Posted: Sat Feb 03, 2007 7:15 pm
by SFSxOI
Maybe i'm not readin everything correcty, but why the 'DisableExplicit' ??
Posted: Sun Feb 04, 2007 1:24 am
by Konne
There maybe an EnableExplicit in his version of EasyEVNT. That is very usefull if you are writeing stuff like that
One other question:
In the help you wrote:
#OnItemSelected
This event fires after the user selects a new item in a registered gadget. The following
gadgets are supported:
ComboBoxGadget ExplorerComboGadget
ListViewGadget
ListIconGadget ExplorerListGadget
TreeGadget ExplorerTreeGadget
PanelGadget
Code: Select all
XIncludeFile "EasyVENT.pbi"
DisableExplicit
OpenWindow(0, 100, 100, 450, 250, "EasyVENT ComboBoxGadget demo.", #PB_Window_SystemMenu |#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget| #PB_Window_ScreenCentered)
CreateGadgetList(WindowID(0))
ComboBoxGadget(1, 10, 40, 250, 100)
For t = 1 To 10
AddGadgetItem(1, -1, "Item "+Str(t))
Next
Procedure Aha(*sender.PB_Sender)
Debug "NNNNNNNNNE"
EndProcedure
SetEventHandler(GadgetID(1), #OnItemSelected, @Aha())
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
End
So why isn't it working?
Posted: Sun Feb 04, 2007 7:05 pm
by srod
Konne wrote:So why isn't it working?
'cause there's a bug the size of Ireland in the code!!!
Fixed.
The bug was due to alterations I made for someone with a Keyboard accelerator problem.
My apologies.
Posted: Mon Feb 05, 2007 1:48 pm
by Konne
srod wrote:My apologies.
Why apologies. I really think you did a great work with EasyVENT.
And Bugs like that, I know it can happen.
So can I find the fixed code on your website?
And why Ireland???
Posted: Mon Feb 05, 2007 9:59 pm
by srod
The download link is in the first post and has been updated.
Why Ireland?
Big place. You tried walking across it?

Posted: Mon Feb 05, 2007 10:03 pm
by Konne
But if you wanna make a point you pick something really big like Canada or something really small like the Vatican.
It's just that the last update date at your page was something with October.
And #OnUnhandledWinMessage isn't declared in any includefile.
Posted: Mon Feb 05, 2007 10:10 pm
by rsts
Actually, I thought Ireland was quite funny - to me it had a nicer ring than say Canada or Texas, but maybe that's just me.
cheers
Posted: Mon Feb 05, 2007 10:15 pm
by srod
Konne wrote:And #OnUnhandledWinMessage isn't declared in any includefile.
It's there. The program would crash otherwise.
Look in the EasyVENTresident.pbi file, it's the 7th event listed.
@rsts:

Posted: Mon Feb 05, 2007 11:12 pm
by Konne
OK there are 3 possiblilitys.
1) I'm kind of gotten dumb this day or
2) My browser doesn't work or
3) You are Uploading the wrong file.
http://www.rodriguz.freeserve.co.uk/EasyVENT.zip
Try downloading it. It seems to be an old Version.
(The file in the archive is saying "Last Changed - 21.9.2006"
Posted: Tue Feb 06, 2007 8:35 am
by gnozal
Try
http://www.purecoder.net/EasyVENT.zip (link on his web site ; although it says 'Last updated on the 11th October 2006', EasyVENT.pbi has been updated)
Posted: Tue Feb 06, 2007 10:50 am
by srod
Whoops!

I swear I'm getting dumber in my old age!
Sorry Konne. I've updated the link in the first post - for definite this time! Gnozal had tracked down the correct version.
Posted: Tue Feb 06, 2007 12:34 pm
by SFSxOI
Tried it out in Vista...works great

Thank You
I borrowed the example code from Konne above and used it real quick with Vista's DWM and doing the 'sheet glass' effect on the background with the color blue. Works great but Vista had a little hiccup with the EnableExplicit so i rem'd it out for this example.
here's a pic of what it looks like
http://www.123pichosting.com/viewer.php ... anddwm.JPG
Posted: Wed Feb 07, 2007 12:26 am
by srod
Interesting.

Posted: Wed Feb 07, 2007 11:47 pm
by Konne
Uhh, works with Vista.
Anyways srod can you help me with this question?
http://www.purebasic.fr/english/viewtop ... 24cd240e5d