Jump to content

[SOLVED] How to clone a template UI?


photo

Recommended Posts

I have a template interface elements (blank), I want to use it a few times

<vbox name="canvas" export="1" />

<hbox name="blank" export="1">
  <editline width="100"></editline>
  <button><text>OK</text></button>
</hbox>
WidgetVBox canvas;
WidgetHBox blank;

canvas.addChild( blank, GUI_ALIGN_EXPAND );
canvas.addChild( blank, GUI_ALIGN_EXPAND );
canvas.addChild( blank, GUI_ALIGN_EXPAND );
canvas.addChild( blank, GUI_ALIGN_EXPAND );
canvas.addChild( blank, GUI_ALIGN_EXPAND );

How to do it, tell me an option?

Link to comment

Hey Vita, didn't use this but in my "mind" I would try to use a class-array object.

 

Pseudocode:

 

className test = new className(gui);

 

ClassName()
{
  gui.addUserInterface(thestaticlink.ui)
 gui.addChild(...);
}

 

array stackedClasses.

stackedClasses.append(test);

 

test.yourPropertiesToTalkToWidgets.

 

 

In your .UI file you map normaly like "export=1 name=TestNamespace::TestClass::WidgetName".

 

So you have an array with all your classes and you can pass the actual GUI element with which you wanna work.

 

Maybe this helps you, if any questions are open feel free.

greets

Lars

Link to comment
  • 4 weeks later...
×
×
  • Create New...