Page 1 of 1
Canvas Gadget - Option to be a Container
Posted: Sun Jul 15, 2012 3:50 am
by IdeasVacuum
There are discussions and work-arounds on the forum about putting gadgets on top of a Canvas Gadget. It would be tremendous if the Canvas Gadget could optionally be flagged as being a Container.
Re: Canvas Gadget - Option to be a Container
Posted: Sun Jul 15, 2012 8:47 am
by Josh
+1
Re: Canvas Gadget - Option to be a Container
Posted: Tue Jul 31, 2012 3:22 am
by Mohawk70
+1 - I have plenty of uses for this one !
Re: Canvas Gadget - Option to be a Container
Posted: Tue Jul 31, 2012 3:21 pm
by Josh
i use
this code as workaround. works fine.
Re: Canvas Gadget - Option to be a Container
Posted: Tue Jul 31, 2012 4:16 pm
by skywalk
Josh wrote:i use
this code as workaround. works fine.
The code is not complete. If you change the canvas cursor to let the user know visually which has focus, it fails after the string gadget gets focus.
Add -> SetGadgetAttribute(0,#PB_Canvas_Cursor, #PB_Cursor_Cross)
Re: Canvas Gadget - Option to be a Container
Posted: Tue Jul 31, 2012 4:45 pm
by Josh
skywalk wrote:The code is not complete. If you change the canvas cursor to let the user know visually which has focus, it fails after the string gadget gets focus.
Add -> SetGadgetAttribute(0,#PB_Canvas_Cursor, #PB_Cursor_Cross)
I can't follow. If the cursor leave the stringgadget, the cursor change to mode, was before at the canvasgadget. In the example there is no use of the cross cursor.
Re: Canvas Gadget - Option to be a Container
Posted: Tue Jul 31, 2012 6:08 pm
by skywalk
I'm saying the cursor always stays at IBeam which does not tell me if the stringgadget or canvasgadget has the focus?
And, if I change the canvasgadget cursor to Cross initially, it still does not respect that cursor in your callback.
Code: Select all
If OpenWindow(0, 0, 0, 220, 220, "CanvasGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CanvasGadget(0, 10, 10, 200, 200, #PB_Canvas_Keyboard|#PB_Canvas_DrawFocus)
SetGadgetAttribute (0, #PB_Canvas_Cursor, #PB_Cursor_Cross) ;<-- Add this and no respect...
Re: Canvas Gadget - Option to be a Container
Posted: Tue Jul 31, 2012 7:30 pm
by Josh
skywalk wrote:I'm saying the cursor always stays at IBeam which does not tell me if the stringgadget or canvasgadget has the focus?
And, if I change the canvasgadget cursor to Cross initially, it still does not respect that cursor in your callback.
Ok, the problem was, that there is no automatic WM_MOUSELEAVE event, if XP skin support is disabled. I added the function TrackMouseEvent, so that the WM_MOUSELEAVE event is send in each case. code in german forum corrected.
Re: Canvas Gadget - Option to be a Container
Posted: Tue Jul 31, 2012 7:47 pm
by skywalk
Very nice
