an old little question about layout file format...

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

Cloudage
Not too shy to talk
Not too shy to talk
Posts: 27
Joined: Thu May 28, 2009 11:37

an old little question about layout file format...

Postby Cloudage » Sat Dec 05, 2009 07:24

this question is nothing but just a little personal curiosity.current format is okay,but i just think...

currently our layout format is

Code: Select all

 <Window Type="WindowsLook/FrameWindow" Name="Root/Pad" >
  <Property Name="Font" Value="UKai-8" />
  <Property Name="Text" Value="Console" />
  <Property Name="AlwaysOnTop" Value="True" />
  <Window>...sub windows...</Window>
</Window>


i don`t understand why don`t we do it this way:

Code: Select all

 <Window Type="WindowsLook/FrameWindow" Name="Root/Pad" Font="UKai-8" Text ="Console" AlwaysOnTop="True" />
  <Window>...sub windows...</Window>
</Window>

or this way:

Code: Select all

<Window Type="WindowsLook/FrameWindow" Name="Root/Pad" >
  <Properties Font="UKai-8" Text="Console" AlwaysOnTop="True" />
  <Window>...sub windows...</Window>
</Window>


i just don`t understand what`s the point of <Property> as a xml element.seems it just a key-value pair,but the xml attributes is already naturally enumeratable key-value pairs.

and also a little question about udim,doesn`t "10%" and "10px" looks more comfortable than "{10,0}" and "{0,10}" for ui designers ?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: an old little question about layout file format...

Postby CrazyEddie » Sat Dec 05, 2009 14:30

Hi, interesting question :)

The main reason is one of validation. As you may (or may not) know, we support schema validation of our XML files via use of the Xerces-c++ XML parser - this way it's possible to check that things are largely correct as the XML is parsed (as well as enabling us to provide tools that can validate XML ahead of time). The upshot of this is that all element and attribute names need to be known ahead of time so they can be put into the .xsd files used for validation. For properties this is impossible since they can be added at any time by various means.

In regards to the 10% and 10px thing, yes it's easier for a human (or even a UI designer - those guys aren't human :lol:) to understand and perhaps the tools should definitely employ that approach in the future. I don't think the XML should necessarily be changed to incorporate that since the XML is really supposed to be for automated / machine consumption (no, really!), whereas the tools are the human interface to the XML, so those could / should present the info in that manner.

CE.

PS. I know there's not a 'full set' of tools at the moment, but it's a work in progress ;)

Cloudage
Not too shy to talk
Not too shy to talk
Posts: 27
Joined: Thu May 28, 2009 11:37

Re: an old little question about layout file format...

Postby Cloudage » Sat Dec 05, 2009 14:58

hi CE,
i understood now,thank you for the explanation.
and best wish for your toolset working. :)


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 10 guests