[Implemented] SetGadgetFont(#PB_Default, ...) for XMLDialog

Got an idea for enhancing SpiderBasic? New command(s) you'd like to see?
User avatar
Peter
Posts: 1197
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

[Implemented] SetGadgetFont(#PB_Default, ...) for XMLDialog

Post by Peter »

It would be great, if SetGadgetFont(#PB_Default, ...) also works for XMLDialog-Gadgets (like in PB):

Code: Select all

LoadFont(0, "Arial", 36)
SetGadgetFont(#PB_Default, FontID(0))

#Dialog = 0
#Xml = 0

XML$ = "<window id='#PB_Any' name='test' text='Dialog example' minwidth='300' minheight='300' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
       " <button text='myButton'/>" +
       "</window>"

If ParseXML(#Xml, XML$) And XMLStatus(#Xml) = #PB_XML_Success
  
  If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "test")
    
    CompilerIf #PB_Compiler_OS <> #PB_OS_Web
      Repeat
      Until WaitWindowEvent(0) = #PB_Event_CloseWindow
    CompilerEndIf
    
  Else  
    Debug "Dialog error: " + DialogError(#Dialog)
  EndIf
Else
  Debug "XML error: " + XMLError(#Xml) + " (Line: " + XMLErrorLine(#Xml) + ")"
EndIf
Thanks in advance & Greetings ... Peter