sample-minimal.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Minimal UI Layout Definition Format Sample -->
  3. <ui-layout-def xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="ui-layout-definition ui-layout-def.xsd"
  5. version="1.1">
  6. <!-- Basic pattern definitions (required) -->
  7. <patterns>
  8. <!-- Basic container control -->
  9. <control name="Panel" type="container" category="basic">
  10. <constraints>
  11. <allowed-parents>Panel,window</allowed-parents>
  12. <allowed-children>any-control</allowed-children>
  13. <container>true</container>
  14. </constraints>
  15. <attributes>
  16. <attribute name="width" type="int" default="200" />
  17. <attribute name="height" type="int" default="100" />
  18. <attribute name="orientation" type="enum" values="horizontal,vertical" default="vertical" />
  19. </attributes>
  20. </control>
  21. <!-- Basic text display -->
  22. <control name="Label" type="display" category="basic">
  23. <constraints>
  24. <allowed-parents>Panel</allowed-parents>
  25. <allowed-children>none</allowed-children>
  26. <container>false</container>
  27. </constraints>
  28. <attributes>
  29. <attribute name="text" type="string" default="" required="true" />
  30. <attribute name="font-size" type="int" default="12" />
  31. </attributes>
  32. </control>
  33. <!-- Basic text input -->
  34. <control name="TextBox" type="input" category="basic">
  35. <constraints>
  36. <allowed-parents>Panel</allowed-parents>
  37. <allowed-children>none</allowed-children>
  38. <container>false</container>
  39. </constraints>
  40. <attributes>
  41. <attribute name="value" type="string" default="" />
  42. <attribute name="placeholder" type="string" default="" />
  43. </attributes>
  44. </control>
  45. <!-- Basic button -->
  46. <control name="Button" type="action" category="basic">
  47. <constraints>
  48. <allowed-parents>Panel</allowed-parents>
  49. <allowed-children>none</allowed-children>
  50. <container>false</container>
  51. </constraints>
  52. <attributes>
  53. <attribute name="text" type="string" default="Button" required="true" />
  54. <attribute name="enabled" type="bool" default="true" />
  55. </attributes>
  56. <behavior>
  57. <event name="click" required="true" />
  58. </behavior>
  59. </control>
  60. </patterns>
  61. <!-- Simple view definition -->
  62. <views>
  63. <view name="SimpleView" type="utility" category="core">
  64. <description>A simple view for demonstration</description>
  65. <data-context>
  66. <property name="userName" type="string" scope="view" />
  67. <property name="isLoggedIn" type="bool" scope="view" />
  68. </data-context>
  69. <windows>
  70. <window-ref name="MainWindow" role="main" default="true" />
  71. </windows>
  72. <navigation>
  73. <action name="show-main" target="MainWindow" />
  74. </navigation>
  75. </view>
  76. </views>
  77. <!-- Single window definition -->
  78. <window name="MainWindow" title="Simple Application" view="SimpleView">
  79. <attributes>
  80. <attribute name="width" value="400" />
  81. <attribute name="height" value="300" />
  82. </attributes>
  83. <view-properties>
  84. <role>main</role>
  85. <default>true</default>
  86. <data-context-binding>userName</data-context-binding>
  87. </view-properties>
  88. <!-- Simple window content -->
  89. <Panel name="mainPanel" width="400" height="300">
  90. <Label name="titleLabel" text="Welcome to Simple App" font-size="16" />
  91. <Panel name="inputPanel" orientation="horizontal">
  92. <Label name="nameLabel" text="Your Name:" />
  93. <TextBox name="nameInput" placeholder="Enter your name..." />
  94. </Panel>
  95. <Panel name="buttonPanel" orientation="horizontal">
  96. <Button name="submitButton" text="Submit" />
  97. <Button name="clearButton" text="Clear" />
  98. </Panel>
  99. </Panel>
  100. </window>
  101. </ui-layout-def>