sample-minimal.xml 8.2 KB

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