How about a USER Gadget?
Result = UserGadget(#Gadget, x, y, Width, Height, Text$, Flags/Style, Class)
I would like to have a ContainerGadget with the background like a PanelGadgetItem.
(It looks so cool with FlyAKite...)
With WinAPI it's:
CreateWindowEx_(0,"SysTabControl32", 0, #WS_CHILD|#WS_VISIBLE, 20, 20, 200, 200, hWnd, 1, 0, 0)
but then there is no inner link to PureBasic's internal automatic stuff (GadgetList etc.).
So no Gadgets can be placed.
Please consider.
Thanks
PS. Or maybe somebody knows how to change the class of a control without destroying it.
Haven't found anything on the net...
HotBasic can do it, so it should be possible :roll:
UserGadget
You can use the result of CreateWindowEX_() for the GadgetList
Code: Select all
Global Window_0, Button_0, Hwnd
Procedure Open_Window_0()
Window_0 = OpenWindow(#PB_Any, 5, 5, 400, 200, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "Window 0")
If Window_0
Hwnd = CreateWindowEx_(0,"SysTabControl32", 0, #WS_CHILD|#WS_VISIBLE, 20, 20, 200, 200, WindowID(Window_0), 1, 0, 0)
If CreateGadgetList(Hwnd)
Button_0 = ButtonGadget(#PB_Any, 60, 100, 70, 50, "ok")
EndIf
EndIf
EndProcedure
Open_Window_0()
Repeat
Event = WaitWindowEvent()
WindowID = EventWindow()
GadgetID = EventGadget()
If Event = #PB_Event_Gadget
EndIf
Until Event = #PB_Event_CloseWindow
End
Why don't work?
Code: Select all
Global Window_0, Button_0, hWnd
Procedure Open_Window_0()
Window_0 = OpenWindow(#PB_Any, 5, 5, 400, 200, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "Window 0")
If Window_0
hWnd = CreateWindowEx_(0,"SysTabControl32", 0, #WS_CHILD|#WS_VISIBLE, 20, 20, 200, 200, WindowID(Window_0), 1, 0, 0)
If CreateGadgetList(hWnd)
Button_0 = ButtonGadget(#PB_Any, 60, 100, 70, 50, "ok")
EndIf
EndIf
EndProcedure
Open_Window_0()
Repeat
Event = WaitWindowEvent()
WindowID = EventWindow()
GadgetID = EventGadget() ;get always 0
Debug "GadgetID="+Str(GadgetID)
If Event = #PB_Event_Gadget ; never happen
Debug "Event="+Str(Event)
EndIf
Until Event = #PB_Event_CloseWindow
End
Re: UserGadget
Just popped in my mind that another parameter needs to be added: Type.fsw wrote:How about a USER Gadget?
Result = UserGadget(#Gadget, x, y, Width, Height, Text$, Flags/Style, Class)
Since V4 PB distinguishes between GadgetTypes:
#PB_GadgetType_Button
#PB_GadgetType_ButtonImage
#PB_GadgetType_Calendar
#PB_GadgetType_CheckBox
#PB_GadgetType_ComboBox
#PB_GadgetType_Container
#PB_GadgetType_Date
#PB_GadgetType_Editor
#PB_GadgetType_ExplorerCombo
#PB_GadgetType_ExplorerList
#PB_GadgetType_ExplorerTree
#PB_GadgetType_Frame3D
#PB_GadgetType_HyperLink
#PB_GadgetType_Image
#PB_GadgetType_IPAddress
#PB_GadgetType_ListIcon
#PB_GadgetType_ListView
#PB_GadgetType_MDI
#PB_GadgetType_Option
#PB_GadgetType_Panel
#PB_GadgetType_ProgressBar
#PB_GadgetType_ScrollArea
#PB_GadgetType_ScrollBar
#PB_GadgetType_Spin
#PB_GadgetType_Splitter
#PB_GadgetType_String
#PB_GadgetType_Text
#PB_GadgetType_TrackBar
#PB_GadgetType_Tree
#PB_GadgetType_Unknown
#PB_GadgetType_Web
So the function would be:
Result = UserGadget(#Gadget, x, y, Width, Height, Text$, Flags/Style, Class, Type)
This way the user Gadget can be categorized to a GadgetType Family.
Actually it would be nice to get this not only for Gadgets, but also for Windows, Menues, Toolbars etc. for everything that gets special treatment (events etc.) inside the PB GUI toolkit.
Re: UserGadget
Trying to make thumbnails?fsw wrote:CreateWindowEx_(0,"SysTabControl32", 0, #WS_CHILD|#WS_VISIBLE, 20, 20, 200, 200, hWnd, 1, 0, 0)
