Render XML Dialog Structure into a ContainerGadget

Got an idea for enhancing SpiderBasic? New command(s) you'd like to see?
ljgww
Posts: 26
Joined: Thu Mar 26, 2020 5:47 pm

Render XML Dialog Structure into a ContainerGadget

Post by ljgww »

Add to wish list:

Having XML dialog structure to be a rendering within the container gadget (not a window) with the same behaviour as if it was a window.

Rationale:

This could simplify creation of application windows.

XMLdialog renders in predefined Window enclosure. There may be more than one dialog in the same XML each with its own window.

But it will be interesting to have something along this example :
(of course this code do not work :) )

Code: Select all

If OpenWindow( 0, 0, 0, 500, 500, "render in containers")
  container1 = ContainerGadget( #PB_Any, 0, 0, 250, 500)
  XML1$ =      "  <vbox>" +
              "    <hbox>" +
              "      <option name='visible' text='Visible' group='1'/>" +
              "      <option name='invisible' text='Invisible' group='1'/>" +
              "    </hbox>" +
              "    <text name='lbl1' text='Field Name'/>" +
              "    <string name='fieldName' width='50' height='30'/>" +
              "    <text name='lbl2' text='Field text'/>" +
              "    <string name='fieldValue' width='50' height='30'/>" +
              "    <hbox>" +
              "      <vbox>" +
              "        <text name='lbl3' text='Column'/>" +
              "        <string name='column' width='20' height='30'/>" +
              "      </vbox>" +
              "      <vbox>" +
              "        <text name='lbl4' text='Row'/>" +
              "        <string name='row' width='20' height='30'/>" +
              "      </vbox>" +
              "    </hbox>" +
              "    <hbox>" +
              "      <button name='ok' text='Save/Close' height='30' />" +
              "      <button name='cancel' text='Cancel/Close'/>" +
              "    </hbox>" +
              "  </vbox>" 
  XMLrender(#render1id, XML1$, #enclosureXXX, container1)
  CloseGadgetList()

  container2 = ContainerGadget( #PB_Any, 250, 0, 500, 500)
  XML2$= ....
  XMLrender(#render2id, XML1$, "otherid",container2) ; otherid to be string or id 'number'
  CloseGadgetList()
  ...
perhaps similar to Dialog with a multiple sets of windows, can be under some other 'enclosure'

Code: Select all

<XMLchunks>
   <enclosure id=xxx name=xxx>
     <vbox>
         ....
     </vbox>
  </enclosure>
  <enclosure id=otherid name=other name>
  </enclosure>
</XMLchunks>
// Edit: Moved to "Feature Requests and Wishlists" (Peter)
User avatar
Peter
Posts: 888
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: Render XML Dialog Structure into a ContainerGadget

Post by Peter »

this can be done the following way:

// Edit: Code removed. See: Module: XmlGadget
ljgww
Posts: 26
Joined: Thu Mar 26, 2020 5:47 pm

Re: Render XML Dialog Structure into a ContainerGadget

Post by ljgww »

Peter wrote:this can be done the following way:

// Edit: Code removed. See: Module: XmlGadget
Awesome! Gorgeous!

This is exactly what I need. Many thanks!
Post Reply