CreateDialog - custom gadget - Runtime Procedure

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

CreateDialog - custom gadget - Runtime Procedure

Post by eddy »

Hi,

I wonder if it's possible to support custom gadget. (like TabBarGadget)

Code: Select all

Define xml$="<window id='#win' name='test' text='Dock Panel' minwidth='200' minheight='300' width='200' height='300' " + 
            "   flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget'>" + 
            "     <tabbar id='#Toolbar' margin='0' spacing='0' />" + 
            "        <tab text='First tab' image='#photo' />" + 
            "        <tab text='Second tab' image='#logo' />" + 
            "     </tabbar>" + 
            "</window>"
The sipmle way is to used Runtime Procedure named with postfix 'Gadget'.

Code: Select all

Runtime Procedure.i TabBarGadget(Id, Map Attribute.s(), ContentXML.s)
   ;* Attribute  => retrieves all tag attributes    name,x,y,width,height,etc...
   ;* ContentXML => retrieves inner xml tags        <tab text='First tab' / >... <tab />
   result=CreateGaget(Id, ....)
   ProcedureReturn result
EndProcedure
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool