Using event handlers - (obsolete version)

Developed or developing a new product in PureBasic? Tell the world about it.
Intrigued
Enthusiast
Enthusiast
Posts: 501
Joined: Thu Jun 02, 2005 3:55 am
Location: U.S.A.

Post by Intrigued »

Yes, and I stated I tried that too. It's got me scratching my head. I use a program that allows me to right-click a file and it will copy the path to the clipboard. I did that on the .pbi file in question and then put that in lue of the code in the examples you have.

Still no go. I'll look again and see what's up. It's just not making sense. It should work from what I see, but it will not.

Others are using this with no problem so I have to start with the idea that I have overlooked or mistyped something.

*smacks forehead*

:wink:

Thanks for your help. I'll post back when/if I get this sorted.

And the help file is nice, thanks for taking the time on that as well.
Intrigued - Registered PureBasic, lifetime updates user
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Sorry guys, been away for a few days.

@Flype, the DragDropItems demo 3 program drags multiple items etc.

@Intrigued, if you can't get anything to work then send me some code and I'll take a look.
I may look like a mule, but I'm not a complete ass.
Intrigued
Enthusiast
Enthusiast
Posts: 501
Joined: Thu Jun 02, 2005 3:55 am
Location: U.S.A.

Post by Intrigued »

@Intrigued, if you can't get anything to work then send me some code and I'll take a look.
[/quote]

Thanks srod. Here is a short .swf showing what I am trying to do and how.

www.amsuser.com/misc/PB&Easyvent=nogo.swf
Intrigued - Registered PureBasic, lifetime updates user
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

I'm not sure what it is you're trying to do :?:

Everything looks okay from your .swf file. The only thing I can add is that there are two XIncludeFile's to adjust; one in the drag demo (which you seem to have altered) and the other within the EasyVENT.pbi file itself.

The only other thing to try would be to copy the contents of the EasyVENTResident.pbi file into the EasyVENT.pbi file etc.
I may look like a mule, but I'm not a complete ass.
Intrigued
Enthusiast
Enthusiast
Posts: 501
Joined: Thu Jun 02, 2005 3:55 am
Location: U.S.A.

Post by Intrigued »

Thanks srod for taking a minute to help. I'll keep looking to see where I went wrong and look into what you suggest.

Thanks again,

UPDATE: I got it working. I went ahead and for the third time deleted all the files in this offering, redownloaded, and then adjusted the line in the xinclude file needed and the menu for the example came up straight away.

Thanks guys for hanging in there with me over this situation! And thanks for this and the excellent help file! This will surely come in handy in my applications.

*pats srod on the back*
Intrigued - Registered PureBasic, lifetime updates user
Intrigued
Enthusiast
Enthusiast
Posts: 501
Joined: Thu Jun 02, 2005 3:55 am
Location: U.S.A.

Post by Intrigued »

srod, one last question and then I'll pop back in my hole. :wink:

Can this code be modified to allow for the dragging and dropping of files onto any window via it's handle? I want to do that and have the results populate a plain text file (.txt).

I see this is for gadget-to-gadget, but I thought I would ask nontheless.

TIA
Intrigued - Registered PureBasic, lifetime updates user
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Intrigued wrote:srod, one last question and then I'll pop back in my hole. :wink:

Can this code be modified to allow for the dragging and dropping of files onto any window via it's handle? I want to do that and have the results populate a plain text file (.txt).

I see this is for gadget-to-gadget, but I thought I would ask nontheless.

TIA
Have a look at the ListIcongadget demo.pb program which allows you to drop files onto a list icon. You can replace the listicon with any gadget/window. Of course it is then up to you whether you display the filenames etc.
I may look like a mule, but I'm not a complete ass.
Intrigued
Enthusiast
Enthusiast
Posts: 501
Joined: Thu Jun 02, 2005 3:55 am
Location: U.S.A.

Post by Intrigued »

srod, thanks for the follow-up and tip.
Intrigued - Registered PureBasic, lifetime updates user
Konne
Enthusiast
Enthusiast
Posts: 434
Joined: Thu May 12, 2005 9:15 pm

Post by Konne »

Very nice code.
Gonna use it for a project.

Thank you very much!
Apart from that Mrs Lincoln, how was the show?
Konne
Enthusiast
Enthusiast
Posts: 434
Joined: Thu May 12, 2005 9:15 pm

Post by Konne »

How can I use Imagegadgets with that method?
Apart from that Mrs Lincoln, how was the show?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Konne wrote:How can I use Imagegadgets with that method?
Which method?
I may look like a mule, but I'm not a complete ass.
Konne
Enthusiast
Enthusiast
Posts: 434
Joined: Thu May 12, 2005 9:15 pm

Post by Konne »

How is it possible to receive an imagegadget event with EasyVENT (the SetEventHandler stuff you wrote). And do you still support the project or do we have to write extensions by our own?
Apart from that Mrs Lincoln, how was the show?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Image gadgets work fine, depending on what you intending doing with them of course. The mouse events work okay because I've used them myself.
And do you still support the project or do we have to write extensions by our own?
:?:

I've always responded to requests with this library, so yes I still support it. I haven't updated it for a while because I've had no requests to do so and, to be honest, it does everything I need and as far as GUI stuff is concerned, I'm not really sure how it could be extended, apart from really specialist stuff which can be handled through #OnUnhandledWinMessage anyhow.

But, feel free to alter the code in anyway you see fit; that's what it is there for.
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Image gadget example:

Code: Select all

XIncludeFile "EasyVENT.pbi"
DisableExplicit

Declare.l MouseOver(*sender.PB_Sender) 
myImage = LoadImage(#PB_Any, "myImage.bmp")

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())


Repeat
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
End

Procedure.l MouseOver(*sender.PB_Sender)
Debug "Mouse over image gadget!"
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure
I may look like a mule, but I'm not a complete ass.
Konne
Enthusiast
Enthusiast
Posts: 434
Joined: Thu May 12, 2005 9:15 pm

Post by Konne »

srod wrote:
:?:

I've always responded to requests with this library, so yes I still support it. I haven't updated it for a while because I've had no requests to do so and, to be honest, it does everything I need and as far as GUI stuff is concerned, I'm not really sure how it could be extended, apart from really specialist stuff which can be handled through #OnUnhandledWinMessage anyhow.

But, feel free to alter the code in anyway you see fit; that's what it is there for.
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?

Oh I just saw the message #onmuoseup Sry.
Apart from that Mrs Lincoln, how was the show?
Post Reply