abstract-controls.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Abstract Control Definitions for UI Layout Definition Format -->
  3. <patterns xmlns="ui-layout-patterns">
  4. <!-- Base abstract control with common attributes -->
  5. <control name="CommonControl" type="base" category="abstract">
  6. <description>Base abstract control defining common attributes for all controls</description>
  7. <constraints>
  8. <allowed-parents>any</allowed-parents>
  9. <allowed-children>depends-on-implementation</allowed-children>
  10. <container>depends-on-implementation</container>
  11. </constraints>
  12. <attributes>
  13. <attribute name="name" type="string" required="true" />
  14. <attribute name="enabled" type="bool" default="true" />
  15. <attribute name="text" type="string" default="" />
  16. <attribute name="visible" type="bool" default="true" />
  17. <attribute name="data-source" type="string" default="" />
  18. <attribute name="dock" type="enum" values="none,left,right,top,bottom" default="none" />
  19. <attribute name="tooltip" type="string" default="" />
  20. </attributes>
  21. </control>
  22. <!-- Label Control -->
  23. <control name="Label" type="display" category="basic" inherits="CommonControl">
  24. <description>Display text label control</description>
  25. <constraints>
  26. <allowed-parents>Panel,SplitPanel,StatusBar,ToolBar,FormField</allowed-parents>
  27. <allowed-children>none</allowed-children>
  28. <container>false</container>
  29. </constraints>
  30. <attributes>
  31. <attribute name="font-size" type="int" default="12" min="8" max="72" />
  32. <attribute name="font-weight" type="enum" values="normal,bold" default="normal" />
  33. <attribute name="color" type="color" default="#000000" />
  34. <attribute name="alignment" type="enum" values="left,center,right" default="left" />
  35. </attributes>
  36. </control>
  37. <!-- TextBox Control -->
  38. <control name="TextBox" type="input" category="basic" inherits="CommonControl">
  39. <description>Text input control for single or multi-line text</description>
  40. <constraints>
  41. <allowed-parents>Panel,SplitPanel,FormField</allowed-parents>
  42. <allowed-children>none</allowed-children>
  43. <container>false</container>
  44. </constraints>
  45. <attributes>
  46. <attribute name="placeholder" type="string" default="" />
  47. <attribute name="max-length" type="int" default="255" min="1" max="10000" />
  48. <attribute name="readonly" type="bool" default="false" />
  49. <attribute name="multiline" type="bool" default="false" />
  50. <attribute name="password" type="bool" default="false" />
  51. </attributes>
  52. <behavior>
  53. <event name="text-changed" />
  54. <event name="focus" />
  55. <event name="blur" />
  56. <event name="enter-pressed" />
  57. </behavior>
  58. </control>
  59. <!-- ListBoxItem Structure -->
  60. <structure name="ListBoxItem" type="data-item" category="basic">
  61. <description>Individual item within list-based controls</description>
  62. <attributes>
  63. <attribute name="value" type="string" required="true" />
  64. <attribute name="text" type="string" required="true" />
  65. <attribute name="selected" type="bool" default="false" />
  66. <attribute name="enabled" type="bool" default="true" />
  67. <attribute name="image" type="string" default="" />
  68. </attributes>
  69. </structure>
  70. <!-- ComboBox Control -->
  71. <control name="ComboBox" type="input" category="basic" inherits="CommonControl">
  72. <description>Dropdown selection control with editable option</description>
  73. <constraints>
  74. <allowed-parents>Panel,SplitPanel,StatusBar,ToolBar,FormField</allowed-parents>
  75. <allowed-children>items</allowed-children>
  76. <container>false</container>
  77. <requires-structure>items</requires-structure>
  78. </constraints>
  79. <attributes>
  80. <attribute name="selected-value" type="string" default="" />
  81. <attribute name="editable" type="bool" default="false" />
  82. <attribute name="dropdown-height" type="int" default="200" min="100" max="500" />
  83. </attributes>
  84. <behavior>
  85. <event name="selection-changed" alias="on-select" />
  86. <event name="text-changed" />
  87. </behavior>
  88. <structure>
  89. <items min-count="0" max-count="unlimited">
  90. <listbox-item inherits="ListBoxItem" />
  91. </items>
  92. <selected-items max-count="1" />
  93. </structure>
  94. </control>
  95. <!-- ListBox Control -->
  96. <control name="ListBox" type="input" category="basic" inherits="CommonControl">
  97. <description>List selection control with single or multiple selection</description>
  98. <constraints>
  99. <allowed-parents>Panel,SplitPanel,FormField</allowed-parents>
  100. <allowed-children>items,context-menu</allowed-children>
  101. <container>false</container>
  102. <requires-structure>items</requires-structure>
  103. </constraints>
  104. <attributes>
  105. <attribute name="multi-select" type="bool" default="false" />
  106. <attribute name="selection-mode" type="enum" values="single,multiple,extended" default="single" />
  107. <attribute name="sorted" type="bool" default="false" />
  108. </attributes>
  109. <behavior>
  110. <event name="selection-changed" alias="on-select" />
  111. <event name="double-click" />
  112. </behavior>
  113. <structure>
  114. <items min-count="0" max-count="unlimited">
  115. <listbox-item inherits="ListBoxItem" />
  116. </items>
  117. <selected-items max-count="depends-on-multi-select" />
  118. <context-menu max-count="1" />
  119. </structure>
  120. </control>
  121. <!-- ColumnItem Structure -->
  122. <structure name="ColumnItem" type="data-item" category="basic">
  123. <description>Column definition for ListView control</description>
  124. <attributes>
  125. <attribute name="name" type="string" required="true" />
  126. <attribute name="text" type="string" required="true" />
  127. <attribute name="width" type="int" default="100" min="20" max="500" />
  128. <attribute name="sortable" type="bool" default="true" />
  129. <attribute name="visible" type="bool" default="true" />
  130. <attribute name="alignment" type="enum" values="left,center,right" default="left" />
  131. <attribute name="data-type" type="enum" values="text,number,date,boolean" default="text" />
  132. </attributes>
  133. </structure>
  134. <!-- ListView Control -->
  135. <control name="ListView" type="data" category="basic" inherits="CommonControl">
  136. <description>List view control with columns and detailed item display</description>
  137. <constraints>
  138. <allowed-parents>Panel,SplitPanel,FormField</allowed-parents>
  139. <allowed-children>columns,items,context-menu</allowed-children>
  140. <container>false</container>
  141. <requires-structure>columns,items</requires-structure>
  142. </constraints>
  143. <attributes>
  144. <attribute name="view-mode" type="enum" values="list,details,icons,tiles" default="details" />
  145. <attribute name="multi-select" type="bool" default="false" />
  146. <attribute name="grid-lines" type="bool" default="true" />
  147. <attribute name="full-row-select" type="bool" default="true" />
  148. <attribute name="sort-column" type="string" default="" />
  149. <attribute name="sort-direction" type="enum" values="asc,desc" default="asc" />
  150. </attributes>
  151. <behavior>
  152. <event name="selection-changed" alias="on-select" />
  153. <event name="item-double-click" />
  154. <event name="column-click" />
  155. </behavior>
  156. <structure>
  157. <columns min-count="1" max-count="20">
  158. <column-item inherits="ColumnItem" />
  159. </columns>
  160. <items min-count="0" max-count="unlimited">
  161. <listview-item>
  162. <values>
  163. <value column="" text="" />
  164. </values>
  165. </listview-item>
  166. </items>
  167. <selected-items max-count="depends-on-multi-select" />
  168. <context-menu max-count="1" />
  169. </structure>
  170. </control>
  171. <!-- TreeViewItem Structure -->
  172. <structure name="TreeViewItem" type="data-item" category="basic">
  173. <description>Node item within TreeView control</description>
  174. <attributes>
  175. <attribute name="text" type="string" required="true" />
  176. <attribute name="value" type="string" required="true" />
  177. <attribute name="expanded" type="bool" default="false" />
  178. <attribute name="selected" type="bool" default="false" />
  179. <attribute name="checked" type="bool" default="false" />
  180. <attribute name="image" type="string" default="" />
  181. <attribute name="enabled" type="bool" default="true" />
  182. </attributes>
  183. <structure>
  184. <children min-count="0" max-count="unlimited" max-depth="10">
  185. <tree-view-item inherits="TreeViewItem" />
  186. </children>
  187. </structure>
  188. </structure>
  189. <!-- TreeView Control -->
  190. <control name="TreeView" type="data" category="basic" inherits="CommonControl">
  191. <description>Hierarchical tree view control with expandable nodes</description>
  192. <constraints>
  193. <allowed-parents>Panel,SplitPanel,FormField</allowed-parents>
  194. <allowed-children>items</allowed-children>
  195. <container>false</container>
  196. <requires-structure>items</requires-structure>
  197. </constraints>
  198. <attributes>
  199. <attribute name="show-lines" type="bool" default="true" />
  200. <attribute name="show-root-lines" type="bool" default="true" />
  201. <attribute name="show-plus-minus" type="bool" default="true" />
  202. <attribute name="checkboxes" type="bool" default="false" />
  203. <attribute name="full-row-select" type="bool" default="false" />
  204. <attribute name="hottracking" type="bool" default="false" />
  205. </attributes>
  206. <behavior>
  207. <event name="node-selected" />
  208. <event name="node-expanded" />
  209. <event name="node-collapsed" />
  210. <event name="node-checked" />
  211. <event name="node-double-click" />
  212. </behavior>
  213. <structure>
  214. <items min-count="0" max-count="unlimited">
  215. <tree-view-item inherits="TreeViewItem" />
  216. </items>
  217. </structure>
  218. </control>
  219. <!-- Panel Control -->
  220. <control name="Panel" type="container" category="layout" inherits="CommonControl">
  221. <description>Container panel for organizing other controls</description>
  222. <constraints>
  223. <allowed-parents>Panel,SplitPanel,window,wireframe-instance</allowed-parents>
  224. <allowed-children>any-control</allowed-children>
  225. <container>true</container>
  226. <max-children>unlimited</max-children>
  227. </constraints>
  228. <attributes>
  229. <attribute name="border" type="bool" default="false" />
  230. <attribute name="border-style" type="enum" values="none,solid,raised,sunken" default="none" />
  231. <attribute name="background-color" type="color" default="transparent" />
  232. <attribute name="padding" type="int" default="0" min="0" max="50" />
  233. <attribute name="margin" type="int" default="0" min="0" max="50" />
  234. <attribute name="orientation" type="enum" values="horizontal,vertical" default="vertical" />
  235. <attribute name="alignment" type="enum" values="left,center,right,stretch" default="left" />
  236. <attribute name="auto-scroll" type="bool" default="false" />
  237. <attribute name="width" type="int" min="10" max="2000" />
  238. <attribute name="height" type="int" min="10" max="2000" />
  239. </attributes>
  240. <structure>
  241. <children allow-multiple="true" />
  242. </structure>
  243. </control>
  244. <!-- SplitPanel Control -->
  245. <control name="SplitPanel" type="container" category="layout" inherits="CommonControl">
  246. <description>Splitter container with two resizable panels</description>
  247. <constraints>
  248. <allowed-parents>Panel,SplitPanel,window,wireframe-instance</allowed-parents>
  249. <allowed-children>panel1,panel2</allowed-children>
  250. <container>true</container>
  251. <max-children>2</max-children>
  252. <requires-structure>panel1,panel2</requires-structure>
  253. </constraints>
  254. <attributes>
  255. <attribute name="orientation" type="enum" values="horizontal,vertical" default="vertical" />
  256. <attribute name="splitter-distance" type="int" default="50" min="10" max="90" />
  257. <attribute name="splitter-width" type="int" default="4" min="2" max="10" />
  258. <attribute name="fixed-panel" type="enum" values="none,panel1,panel2" default="none" />
  259. <attribute name="border" type="bool" default="true" />
  260. </attributes>
  261. <behavior>
  262. <event name="splitter-moved" />
  263. </behavior>
  264. <structure>
  265. <panel1 required="true">
  266. <children allow-multiple="true" />
  267. </panel1>
  268. <panel2 required="true">
  269. <children allow-multiple="true" />
  270. </panel2>
  271. </structure>
  272. </control>
  273. <!-- MenuItem Structure -->
  274. <structure name="MenuItem" type="menu-item" category="navigation">
  275. <description>Individual menu item within Menu control</description>
  276. <attributes>
  277. <attribute name="text" type="string" required="true" />
  278. <attribute name="value" type="string" default="" />
  279. <attribute name="enabled" type="bool" default="true" />
  280. <attribute name="visible" type="bool" default="true" />
  281. <attribute name="checked" type="bool" default="false" />
  282. <attribute name="separator" type="bool" default="false" />
  283. <attribute name="shortcut" type="string" default="" />
  284. <attribute name="image" type="string" default="" />
  285. </attributes>
  286. <behavior>
  287. <event name="click" alias="on-click" />
  288. </behavior>
  289. <structure>
  290. <sub-items min-count="0" max-count="unlimited" max-depth="5">
  291. <menu-item inherits="MenuItem" />
  292. </sub-items>
  293. </structure>
  294. </structure>
  295. <!-- Menu Control -->
  296. <control name="Menu" type="navigation" category="navigation" inherits="CommonControl">
  297. <description>Menu control with hierarchical menu items</description>
  298. <constraints>
  299. <allowed-parents>Panel,SplitPanel,ToolBar,window</allowed-parents>
  300. <allowed-children>items</allowed-children>
  301. <container>false</container>
  302. <requires-structure>items</requires-structure>
  303. </constraints>
  304. <attributes>
  305. <attribute name="orientation" type="enum" values="horizontal,vertical" default="horizontal" />
  306. <attribute name="show-images" type="bool" default="true" />
  307. <attribute name="show-shortcuts" type="bool" default="true" />
  308. </attributes>
  309. <structure>
  310. <items min-count="1" max-count="unlimited">
  311. <menu-item inherits="MenuItem" />
  312. </items>
  313. </structure>
  314. </control>
  315. <!-- Button Control -->
  316. <control name="Button" type="action" category="basic" inherits="CommonControl">
  317. <description>Clickable button control with text and/or image</description>
  318. <constraints>
  319. <allowed-parents>Panel,SplitPanel,StatusBar,ToolBar,FormField,ButtonBar</allowed-parents>
  320. <allowed-children>none</allowed-children>
  321. <container>false</container>
  322. </constraints>
  323. <attributes>
  324. <attribute name="type" type="enum" values="text,image,text-image" default="text" />
  325. <attribute name="image" type="string" default="" />
  326. <attribute name="image-position" type="enum" values="left,right,top,bottom" default="left" />
  327. <attribute name="style" type="enum" values="normal,primary,secondary,danger,borderless" default="normal" />
  328. <attribute name="auto-size" type="bool" default="false" />
  329. <attribute name="width" type="int" min="20" max="300" />
  330. <attribute name="height" type="int" min="20" max="100" />
  331. </attributes>
  332. <behavior>
  333. <event name="click" alias="on-click" required="true" />
  334. <event name="mouse-enter" />
  335. <event name="mouse-leave" />
  336. </behavior>
  337. </control>
  338. <!-- Image Control -->
  339. <control name="Image" type="display" category="basic" inherits="CommonControl">
  340. <description>Image display control</description>
  341. <constraints>
  342. <allowed-parents>Panel,SplitPanel,StatusBar,ToolBar,Button</allowed-parents>
  343. <allowed-children>none</allowed-children>
  344. <container>false</container>
  345. </constraints>
  346. <attributes>
  347. <attribute name="resource" type="string" required="true" />
  348. <attribute name="size-mode" type="enum" values="normal,stretch,zoom,center,auto-size" default="normal" />
  349. <attribute name="border" type="bool" default="false" />
  350. <attribute name="background-color" type="color" default="transparent" />
  351. <attribute name="width" type="int" min="10" max="1000" />
  352. <attribute name="height" type="int" min="10" max="1000" />
  353. </attributes>
  354. <behavior>
  355. <event name="click" />
  356. <event name="double-click" />
  357. </behavior>
  358. </control>
  359. <!-- StatusBar Control -->
  360. <control name="StatusBar" type="container" category="layout" inherits="CommonControl">
  361. <description>Status bar container for displaying status information</description>
  362. <constraints>
  363. <allowed-parents>Panel,window</allowed-parents>
  364. <allowed-children>items,context-menu</allowed-children>
  365. <container>true</container>
  366. <max-children>unlimited</max-children>
  367. <requires-structure>items</requires-structure>
  368. </constraints>
  369. <attributes>
  370. <attribute name="show-panels" type="bool" default="true" />
  371. <attribute name="sizing-grip" type="bool" default="true" />
  372. <attribute name="height" type="int" default="22" min="16" max="50" />
  373. </attributes>
  374. <structure>
  375. <items min-count="0" max-count="unlimited">
  376. <status-item>
  377. <control-ref allowed-types="Label,Image,ComboBox,Button" />
  378. </status-item>
  379. </items>
  380. <context-menu max-count="1" />
  381. </structure>
  382. </control>
  383. <!-- ToolBar Control -->
  384. <control name="ToolBar" type="container" category="layout" inherits="CommonControl">
  385. <description>Toolbar container for quick access to commands</description>
  386. <constraints>
  387. <allowed-parents>Panel,window</allowed-parents>
  388. <allowed-children>items,context-menu</allowed-children>
  389. <container>true</container>
  390. <max-children>unlimited</max-children>
  391. <requires-structure>items</requires-structure>
  392. </constraints>
  393. <attributes>
  394. <attribute name="orientation" type="enum" values="horizontal,vertical" default="horizontal" />
  395. <attribute name="appearance" type="enum" values="normal,flat,system" default="normal" />
  396. <attribute name="show-tooltips" type="bool" default="true" />
  397. <attribute name="divider" type="bool" default="true" />
  398. <attribute name="wrappable" type="bool" default="false" />
  399. <attribute name="button-size" type="enum" values="small,medium,large" default="medium" />
  400. </attributes>
  401. <structure>
  402. <items min-count="0" max-count="unlimited">
  403. <toolbar-item>
  404. <control-ref allowed-types="Label,Image,ComboBox,Button,Menu" />
  405. </toolbar-item>
  406. </items>
  407. <context-menu max-count="1" />
  408. </structure>
  409. </control>
  410. </patterns>