Controls in references.xml (1 Viewer)

landrews320

Portal Member
April 27, 2006
9
0
Hi
Is it possible to create a new type of control in references.xml that contains several controls?
i.e. is this possible?

Code:
<control>
  <type>MyNewControl</type>
    <control>
      <type>button</type>
      ...
    </control>
    <control>
      <type>label</type>
      ...
    </control>
    <control>
      <type>image</type>
      ...
    </control>
</control>


I want to be able to create 5 "MyNewControl" controls on a screen, but I'm trying to avoid copying and pasting the xml 5 times.

Thanks
Code:
 

MrMario64

Retired Team Member
  • Premium Supporter
  • April 22, 2004
    822
    1
    50
    Home Country
    Netherlands Netherlands
    no, you can't.
    But you can make a new xml file called common.buttons.xml for example.
    The you can include in other xml's like
    <include>common.buttons.xml</include>

    and the contents of the file will be put in the spot of the include.

    The common.buttons.xml does need to be a valid xml file so you have to have:
    <window>
    <controls>
    put stuff here
    </controls>
    </window>
     

    landrews320

    Portal Member
    April 27, 2006
    9
    0
    Thanks for the info. I have already created another xml file as you mentioned.
    Out of interest, whats the difference between using <include></include> and <import></import> to include xml from other screen files?

    Does <import> place the xml somewhere differently within the file?
     

    Smirnuff

    Portal Pro
    December 7, 2004
    630
    3
    United Kingdom
    Out of interest, whats the difference between using <include></include> and <import></import>

    No difference between them. The developer responsible was moving from C++ to C# around that time and this kinda reflects that, started as <include> but was then changed to <import>, both were kept so as to not break any existing markup.
     

    MrMario64

    Retired Team Member
  • Premium Supporter
  • April 22, 2004
    822
    1
    50
    Home Country
    Netherlands Netherlands
    and I am using the import function extensively on my new skin.
    I hereby like to thank the programmer again for making skinning easier for us :)
    I still miss him.....




    ;)
     

    Users who are viewing this thread

    Top Bottom