Page 1 of 1
More Gadget Attributes
Posted: Tue May 27, 2003 9:15 am
by darklordz
More Gadget Attributes,
for example, Imagegadget has no Tooltip or Actions, this is a problem for me because it the only way to mimic a gui in PB if it had advanced events.

Re: More Gadget Attributes
Posted: Tue May 27, 2003 1:15 pm
by tinman
darklordz wrote:More Gadget Attributes,
for example, Imagegadget has no Tooltip or Actions, this is a problem for me because it the only way to mimic a gui in PB if it had advanced events.
ImageGadgets are just a way of displaying images in your GUI without you having to worry about refreshing them.
It might be easier to have a "no border" flag for ButtonImageGadget, as it already has the other stuff you mention.
Posted: Tue May 27, 2003 2:31 pm
by darklordz
Even if there was a no border flag for the image button witch isn't possible because the button gadget is created trough windows api. There would still be an issue of the UP/Down/Over States. On a Button it's simple, BevelUp,BevelDown. But thats not what i need. I need the image gadget like in VB. Sad but true...
Posted: Tue May 27, 2003 2:53 pm
by Rings
Imagegadget-events are fine.
For the first time try this
snippet
which uses WindowMouseX.....
Posted: Tue May 27, 2003 3:38 pm
by darklordz
@ the moment i am using windowmousex() n same for y, do define regeons but it's sutch an elaborate method....
Posted: Tue May 27, 2003 8:56 pm
by Berikco
Use a CallBack
Check for the WM_LBUTTONDOWN and WM_LBUTTONUP messages
and use ChildWindowFromPoint_() to get the imagegadget handle where the mouse is.
WM_MOUSEMOVE can be used to make flat style buttons
Posted: Tue May 27, 2003 8:56 pm
by plouf
can't find it but someone in the past has poseted this code to understand events from imagegadgets
Code: Select all
;GADGET IDs
#Image0=0
;WINDOW ID
#Window1=0
#SS_NOTIFY=256
;WINDOW
OpenWindow(#Window1,150,70,550,350,#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget|#PB_Window_TitleBar,"Window1")
CreateGadgetList(WindowID(#Window1))
;LoadImage(0,"C:\yourimage.bmp")
CreateImage(0,60,60)
hwimage=ImageGadget(#Image0,10,16,300,232,UseImage(0))
os=getwindowlong_(hwimage,#GWL_STYLE)
setwindowlong_(hwimage,#GWL_STYLE,os|#SS_NOTIFY)
;EVENT LOOP
Repeat
EventID=WaitWindowEvent()
Select EventID
Case #PB_EventGadget
Select EventGadgetID()
Case #Image0
beep_(1000,100)
EndSelect
EndSelect
Until EventID=#PB_EventCloseWindow
Posted: Tue May 27, 2003 9:16 pm
by darklordz
@Berikco, tried callback, didnt work, can you gomme an example....
@plouf, Looks Great I thank you....
Posted: Tue May 27, 2003 11:32 pm
by darklordz
I fixed the callback. It Works Perfectly now....for those that want the code.....Lemme know...
Posted: Wed May 28, 2003 9:20 am
by Berikco
if you have a nice example, why not post it in tricks and tips