Page 1 of 1

Render XML Dialog Structure into a ContainerGadget

Posted: Thu Apr 09, 2020 2:15 pm
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)

Re: Render XML Dialog Structure into a ContainerGadget

Posted: Thu Apr 09, 2020 4:46 pm
by Peter
this can be done the following way:

// Edit: Code removed. See: Module: XmlGadget

Re: Render XML Dialog Structure into a ContainerGadget

Posted: Fri Apr 10, 2020 12:46 pm
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!