sample-minimal.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- FIXED: Simple UI Layout Definition Example v1.3 -->
  3. <ui-layout-def xmlns="http://quadarax.com/ui-layout-definition"
  4. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  5. xsi:schemaLocation="http://quadarax.com/ui-layout-definition ui-layout-def.xsd"
  6. version="1.3"
  7. schema-version="1.3"
  8. target-platform="basic"
  9. accessibility-compliance="wcag-aa">
  10. <!-- Simple validation rules -->
  11. <validation-rules>
  12. <custom-validator name="RequiredFieldValidator" version="1.0" category="structural">
  13. <description>Validates that required fields have content</description>
  14. <implementation>
  15. <rule-expression expression="string-length(@text) > 0 or @required != 'true'" language="xpath" />
  16. </implementation>
  17. <test-case name="required-field-with-content">
  18. <input><TextBox text="Hello World" required="true" /></input>
  19. <expected-result>pass</expected-result>
  20. </test-case>
  21. <test-case name="required-field-empty">
  22. <input><TextBox text="" required="true" /></input>
  23. <expected-result>fail</expected-result>
  24. <expected-message>This field is required</expected-message>
  25. </test-case>
  26. </custom-validator>
  27. </validation-rules>
  28. <!-- Basic control patterns -->
  29. <patterns>
  30. <!-- Define basic controls used in windows -->
  31. <control name="Label" type="display" category="basic">
  32. <description>Simple text display control</description>
  33. <attributes>
  34. <attribute name="text" type="string" default="" />
  35. <attribute name="font" type="font" default="Default" />
  36. <attribute name="color" type="color" default="Black" />
  37. </attributes>
  38. <behavior>
  39. <event name="click" />
  40. </behavior>
  41. </control>
  42. <control name="TextBox" type="input" category="basic">
  43. <description>Text input control</description>
  44. <attributes>
  45. <attribute name="text" type="string" default="" />
  46. <attribute name="placeholder" type="string" default="" />
  47. <attribute name="required" type="bool" default="false" />
  48. <attribute name="maxlength" type="int" default="255" />
  49. </attributes>
  50. <behavior>
  51. <event name="textchanged" />
  52. <event name="focus" />
  53. <event name="blur" />
  54. </behavior>
  55. <validation>
  56. <rule name="required-validation" type="required" message="This field is required" severity="error" />
  57. </validation>
  58. </control>
  59. <control name="Button" type="button" category="basic">
  60. <description>Clickable button control</description>
  61. <attributes>
  62. <attribute name="text" type="string" default="Button" />
  63. <attribute name="enabled" type="bool" default="true" />
  64. </attributes>
  65. <behavior>
  66. <event name="click" />
  67. </behavior>
  68. </control>
  69. <control name="Panel" type="container" category="basic">
  70. <description>Container for other controls</description>
  71. <attributes>
  72. <attribute name="width" type="int" default="200" />
  73. <attribute name="height" type="int" default="100" />
  74. <attribute name="background" type="color" default="Transparent" />
  75. </attributes>
  76. <behavior>
  77. <event name="resize" />
  78. </behavior>
  79. </control>
  80. <!-- Simple layout structure -->
  81. <structure name="SimpleForm" type="layout" category="layout">
  82. <description>Basic form layout with label and input pairs</description>
  83. <attributes>
  84. <attribute name="title" type="string" default="Form" />
  85. <attribute name="width" type="int" default="300" />
  86. <attribute name="height" type="int" default="200" />
  87. </attributes>
  88. <template>
  89. <Panel name="formContainer" width="{width}" height="{height}" background="White">
  90. <Label name="titleLabel" text="{title}" font="Bold,14" />
  91. <!-- Content will be inserted here -->
  92. </Panel>
  93. </template>
  94. </structure>
  95. </patterns>
  96. <!-- Simple window definition -->
  97. <window name="SimpleContactForm">
  98. <attributes>
  99. <attribute name="title" value="Contact Information" />
  100. <attribute name="width" value="400" />
  101. <attribute name="height" value="300" />
  102. <attribute name="resizable" value="true" />
  103. </attributes>
  104. <template>
  105. <Panel name="mainPanel" width="380" height="260" background="LightGray">
  106. <!-- Header -->
  107. <Label name="headerLabel" text="Please enter your contact information"
  108. font="Bold,12" color="DarkBlue" />
  109. <!-- Name field -->
  110. <Label name="nameLabel" text="Full Name:" />
  111. <TextBox name="nameTextBox" placeholder="Enter your full name"
  112. required="true" maxlength="100" />
  113. <!-- Email field -->
  114. <Label name="emailLabel" text="Email Address:" />
  115. <TextBox name="emailTextBox" placeholder="Enter your email"
  116. required="true" maxlength="255" />
  117. <!-- Phone field -->
  118. <Label name="phoneLabel" text="Phone Number:" />
  119. <TextBox name="phoneTextBox" placeholder="Enter your phone number"
  120. maxlength="20" />
  121. <!-- Buttons -->
  122. <Panel name="buttonPanel" width="350" height="40" background="Transparent">
  123. <Button name="submitButton" text="Submit" enabled="true" />
  124. <Button name="cancelButton" text="Cancel" enabled="true" />
  125. <Button name="clearButton" text="Clear" enabled="true" />
  126. </Panel>
  127. </Panel>
  128. </template>
  129. </window>
  130. <!-- Inherited window example -->
  131. <window name="BusinessContactForm" inherits="SimpleContactForm">
  132. <attributes>
  133. <attribute name="title" value="Business Contact Information" override="true" />
  134. <attribute name="height" value="350" override="true" />
  135. </attributes>
  136. <template>
  137. <Panel name="mainPanel" width="380" height="310" background="LightGray">
  138. <!-- Header -->
  139. <Label name="headerLabel" text="Please enter your business contact information"
  140. font="Bold,12" color="DarkBlue" />
  141. <!-- Name field -->
  142. <Label name="nameLabel" text="Full Name:" />
  143. <TextBox name="nameTextBox" placeholder="Enter your full name"
  144. required="true" maxlength="100" />
  145. <!-- Company field (new) -->
  146. <Label name="companyLabel" text="Company:" />
  147. <TextBox name="companyTextBox" placeholder="Enter your company name"
  148. required="true" maxlength="100" />
  149. <!-- Email field -->
  150. <Label name="emailLabel" text="Business Email:" />
  151. <TextBox name="emailTextBox" placeholder="Enter your business email"
  152. required="true" maxlength="255" />
  153. <!-- Phone field -->
  154. <Label name="phoneLabel" text="Business Phone:" />
  155. <TextBox name="phoneTextBox" placeholder="Enter your business phone"
  156. required="true" maxlength="20" />
  157. <!-- Buttons -->
  158. <Panel name="buttonPanel" width="350" height="40" background="Transparent">
  159. <Button name="submitButton" text="Submit" enabled="true" />
  160. <Button name="cancelButton" text="Cancel" enabled="true" />
  161. <Button name="clearButton" text="Clear" enabled="true" />
  162. </Panel>
  163. </Panel>
  164. </template>
  165. </window>
  166. </ui-layout-def>