Multiple questions about new Dialog feature

Just starting out? Need help? Post your questions and find answers here.
User avatar
Shardik
Addict
Addict
Posts: 2058
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: Multiple questions about new Dialog feature

Post by Shardik »

Fred in announcement of PB 5.40 Beta 1 wrote:- Added "group" XML attribute for 'option' dialog gadget, to specify explicitly a group
Now with the new 'group' attribute for the 'option' dialog Kukulkan's code example from his first posting (or Fred's modified example) is working fine cross-platform (tested with PB 5.40 Beta 1 on Windows XP SP3, Kubuntu 14.04 x86 and MacOS X Yosemite x86):

Code: Select all

CompilerIf #PB_Compiler_Unicode
  #XmlEncoding = #PB_UTF8
CompilerElse
  #XmlEncoding = #PB_Ascii
CompilerEndIf

#Dialog = 0
#Xml = 0

XML$ = "<?xml version='1.0' ?>"+
       " <window id='#PB_Any' name='test' text='Gridbox' minwidth='auto' minheight='auto' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget'>"+
       "   <gridbox columns='2'>"+
       "     <option group='1' name='cboProxy1' colspan='2' text='Keinen Proxy verwenden'/>"+
       "     <option group='1' name='cboProxy2' colspan='2' text='Proxy Server verwenden (server:port):'/>"+
       "     <empty /><string name='strProxyURL' minwidth='450' />"+
       "     <option group='1' name='cboProxy3' colspan='2' text='Proxy Autoconfiguration File (PAC) verwenden:'/>"+
       "     <empty /><string name='strProxyPACURL' minwidth='450' />"+
       "     <empty /><hbox>"+
       "                 <button name='btnOK' text='OK' />"+
       "                 <button name='btnCancel' text='Abbruch'/>"+
       "              </hbox>"+
       "   </gridbox>"+
       " </window>"

If CatchXML(#Xml, @XML$, StringByteLength(XML$), 0, #XmlEncoding) And XMLStatus(#Xml) = #PB_XML_Success
 
  If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "test")
    SetGadgetState(DialogGadget(0, "cboProxy1"), #True)

    Repeat
      Event = WaitWindowEvent()
    Until Event = #PB_Event_CloseWindow
   
  Else 
    Debug "Dialog error: " + DialogError(#Dialog)
  EndIf
Else
  Debug "XML error: " + XMLError(#Xml) + " (Line: " + XMLErrorLine(#Xml) + ")"
EndIf
Thank you PB team!
User avatar
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: Multiple questions about new Dialog feature

Post by Kukulkan »

Yes, this is nice and it was absolutely needed and necessary. Only pity that it took almost two years...
User avatar
blueb
Addict
Addict
Posts: 1111
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: Multiple questions about new Dialog feature

Post by blueb »

Kukulkan wrote:Yes, this is nice and it was absolutely needed and necessary. Only pity that it took almost two years...
"Patience is bitter; but the fruit is sweet" :mrgreen:
- It was too lonely at the top.

System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
Post Reply