abstract-controls.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  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. <!-- Separator Control -->
  96. <control name="Separator" type="display" category="basic" inherits="CommonControl">
  97. <description>Visual separator line for organizing interface elements</description>
  98. <constraints>
  99. <allowed-parents>Panel,ToolBar,StatusBar</allowed-parents>
  100. <allowed-children>none</allowed-children>
  101. <container>false</container>
  102. </constraints>
  103. <attributes>
  104. <attribute name="orientation" type="enum" values="horizontal,vertical" default="horizontal" />
  105. <attribute name="thickness" type="int" default="1" min="1" max="5" />
  106. <attribute name="color" type="color" default="#C0C0C0" />
  107. <attribute name="width" type="int" min="1" max="500" />
  108. <attribute name="height" type="int" min="1" max="500" />
  109. </attributes>
  110. </control>
  111. <!-- ListBox Control -->
  112. <control name="ListBox" type="input" category="basic" inherits="CommonControl">
  113. <description>List selection control with single or multiple selection</description>
  114. <constraints>
  115. <allowed-parents>Panel,SplitPanel,FormField</allowed-parents>
  116. <allowed-children>items,context-menu</allowed-children>
  117. <container>false</container>
  118. <requires-structure>items</requires-structure>
  119. </constraints>
  120. <attributes>
  121. <attribute name="multi-select" type="bool" default="false" />
  122. <attribute name="selection-mode" type="enum" values="single,multiple,extended" default="single" />
  123. <attribute name="sorted" type="bool" default="false" />
  124. </attributes>
  125. <behavior>
  126. <event name="selection-changed" alias="on-select" />
  127. <event name="double-click" />
  128. </behavior>
  129. <structure>
  130. <items min-count="0" max-count="unlimited">
  131. <listbox-item inherits="ListBoxItem" />
  132. </items>
  133. <selected-items max-count="depends-on-multi-select" />
  134. <context-menu max-count="1" />
  135. </structure>
  136. </control>
  137. <!-- ColumnItem Structure -->
  138. <structure name="ColumnItem" type="data-item" category="basic">
  139. <description>Column definition for ListView control</description>
  140. <attributes>
  141. <attribute name="name" type="string" required="true" />
  142. <attribute name="text" type="string" required="true" />
  143. <attribute name="width" type="int" default="100" min="20" max="500" />
  144. <attribute name="sortable" type="bool" default="true" />
  145. <attribute name="visible" type="bool" default="true" />
  146. <attribute name="alignment" type="enum" values="left,center,right" default="left" />
  147. <attribute name="data-type" type="enum" values="text,number,date,boolean" default="text" />
  148. </attributes>
  149. </structure>
  150. <!-- ListView Control -->
  151. <control name="ListView" type="data" category="basic" inherits="CommonControl">
  152. <description>List view control with columns and detailed item display</description>
  153. <constraints>
  154. <allowed-parents>Panel,SplitPanel,FormField</allowed-parents>
  155. <allowed-children>columns,items,context-menu</allowed-children>
  156. <container>false</container>
  157. <requires-structure>columns,items</requires-structure>
  158. </constraints>
  159. <attributes>
  160. <attribute name="view-mode" type="enum" values="list,details,icons,tiles" default="details" />
  161. <attribute name="multi-select" type="bool" default="false" />
  162. <attribute name="grid-lines" type="bool" default="true" />
  163. <attribute name="full-row-select" type="bool" default="true" />
  164. <attribute name="sort-column" type="string" default="" />
  165. <attribute name="sort-direction" type="enum" values="asc,desc" default="asc" />
  166. </attributes>
  167. <behavior>
  168. <event name="selection-changed" alias="on-select" />
  169. <event name="item-double-click" />
  170. <event name="column-click" />
  171. </behavior>
  172. <structure>
  173. <columns min-count="1" max-count="20">
  174. <column-item inherits="ColumnItem" />
  175. </columns>
  176. <items min-count="0" max-count="unlimited">
  177. <listview-item>
  178. <values>
  179. <value column="" text="" />
  180. </values>
  181. </listview-item>
  182. </items>
  183. <selected-items max-count="depends-on-multi-select" />
  184. <context-menu max-count="1" />
  185. </structure>
  186. </control>
  187. <!-- TreeViewItem Structure -->
  188. <structure name="TreeViewItem" type="data-item" category="basic">
  189. <description>Node item within TreeView control</description>
  190. <attributes>
  191. <attribute name="text" type="string" required="true" />
  192. <attribute name="value" type="string" required="true" />
  193. <attribute name="expanded" type="bool" default="false" />
  194. <attribute name="selected" type="bool" default="false" />
  195. <attribute name="checked" type="bool" default="false" />
  196. <attribute name="image" type="string" default="" />
  197. <attribute name="enabled" type="bool" default="true" />
  198. </attributes>
  199. <structure>
  200. <children min-count="0" max-count="unlimited" max-depth="10">
  201. <tree-view-item inherits="TreeViewItem" />
  202. </children>
  203. </structure>
  204. </structure>
  205. <!-- TreeView Control -->
  206. <control name="TreeView" type="data" category="basic" inherits="CommonControl">
  207. <description>Hierarchical tree view control with expandable nodes</description>
  208. <constraints>
  209. <allowed-parents>Panel,SplitPanel,FormField</allowed-parents>
  210. <allowed-children>items</allowed-children>
  211. <container>false</container>
  212. <requires-structure>items</requires-structure>
  213. </constraints>
  214. <attributes>
  215. <attribute name="show-lines" type="bool" default="true" />
  216. <attribute name="show-root-lines" type="bool" default="true" />
  217. <attribute name="show-plus-minus" type="bool" default="true" />
  218. <attribute name="checkboxes" type="bool" default="false" />
  219. <attribute name="full-row-select" type="bool" default="false" />
  220. <attribute name="hottracking" type="bool" default="false" />
  221. </attributes>
  222. <behavior>
  223. <event name="node-selected" />
  224. <event name="node-expanded" />
  225. <event name="node-collapsed" />
  226. <event name="node-checked" />
  227. <event name="node-double-click" />
  228. </behavior>
  229. <structure>
  230. <items min-count="0" max-count="unlimited">
  231. <tree-view-item inherits="TreeViewItem" />
  232. </items>
  233. </structure>
  234. </control>
  235. <!-- Panel Control -->
  236. <control name="Panel" type="container" category="layout" inherits="CommonControl">
  237. <description>Container panel for organizing other controls</description>
  238. <constraints>
  239. <allowed-parents>Panel,SplitPanel,window,wireframe-instance</allowed-parents>
  240. <allowed-children>any-control</allowed-children>
  241. <container>true</container>
  242. <max-children>unlimited</max-children>
  243. </constraints>
  244. <attributes>
  245. <attribute name="border" type="bool" default="false" />
  246. <attribute name="border-style" type="enum" values="none,solid,raised,sunken" default="none" />
  247. <attribute name="background-color" type="color" default="transparent" />
  248. <attribute name="padding" type="int" default="0" min="0" max="50" />
  249. <attribute name="margin" type="int" default="0" min="0" max="50" />
  250. <attribute name="orientation" type="enum" values="horizontal,vertical" default="vertical" />
  251. <attribute name="alignment" type="enum" values="left,center,right,stretch" default="left" />
  252. <attribute name="auto-scroll" type="bool" default="false" />
  253. <attribute name="width" type="int" min="10" max="2000" />
  254. <attribute name="height" type="int" min="10" max="2000" />
  255. </attributes>
  256. <structure>
  257. <children allow-multiple="true" />
  258. </structure>
  259. </control>
  260. <!-- SplitPanel Control -->
  261. <control name="SplitPanel" type="container" category="layout" inherits="CommonControl">
  262. <description>Splitter container with two resizable panels</description>
  263. <constraints>
  264. <allowed-parents>Panel,SplitPanel,window,wireframe-instance</allowed-parents>
  265. <allowed-children>panel1,panel2</allowed-children>
  266. <container>true</container>
  267. <max-children>2</max-children>
  268. <requires-structure>panel1,panel2</requires-structure>
  269. </constraints>
  270. <attributes>
  271. <attribute name="orientation" type="enum" values="horizontal,vertical" default="vertical" />
  272. <attribute name="splitter-distance" type="int" default="50" min="10" max="90" />
  273. <attribute name="splitter-width" type="int" default="4" min="2" max="10" />
  274. <attribute name="fixed-panel" type="enum" values="none,panel1,panel2" default="none" />
  275. <attribute name="border" type="bool" default="true" />
  276. </attributes>
  277. <behavior>
  278. <event name="splitter-moved" />
  279. </behavior>
  280. <structure>
  281. <panel1 required="true">
  282. <children allow-multiple="true" />
  283. </panel1>
  284. <panel2 required="true">
  285. <children allow-multiple="true" />
  286. </panel2>
  287. </structure>
  288. </control>
  289. <!-- MenuItem Structure -->
  290. <structure name="MenuItem" type="menu-item" category="navigation">
  291. <description>Individual menu item within Menu control</description>
  292. <attributes>
  293. <attribute name="text" type="string" required="true" />
  294. <attribute name="value" type="string" default="" />
  295. <attribute name="enabled" type="bool" default="true" />
  296. <attribute name="visible" type="bool" default="true" />
  297. <attribute name="checked" type="bool" default="false" />
  298. <attribute name="separator" type="bool" default="false" />
  299. <attribute name="shortcut" type="string" default="" />
  300. <attribute name="image" type="string" default="" />
  301. </attributes>
  302. <behavior>
  303. <event name="click" alias="on-click" />
  304. </behavior>
  305. <structure>
  306. <sub-items min-count="0" max-count="unlimited" max-depth="5">
  307. <menu-item inherits="MenuItem" />
  308. </sub-items>
  309. </structure>
  310. </structure>
  311. <!-- Menu Control -->
  312. <control name="Menu" type="navigation" category="navigation" inherits="CommonControl">
  313. <description>Menu control with hierarchical menu items</description>
  314. <constraints>
  315. <allowed-parents>Panel,SplitPanel,ToolBar,window</allowed-parents>
  316. <allowed-children>items</allowed-children>
  317. <container>false</container>
  318. <requires-structure>items</requires-structure>
  319. </constraints>
  320. <attributes>
  321. <attribute name="orientation" type="enum" values="horizontal,vertical" default="horizontal" />
  322. <attribute name="show-images" type="bool" default="true" />
  323. <attribute name="show-shortcuts" type="bool" default="true" />
  324. </attributes>
  325. <structure>
  326. <items min-count="1" max-count="unlimited">
  327. <menu-item inherits="MenuItem" />
  328. </items>
  329. </structure>
  330. </control>
  331. <!-- Button Control -->
  332. <control name="Button" type="action" category="basic" inherits="CommonControl">
  333. <description>Clickable button control with text and/or image</description>
  334. <constraints>
  335. <allowed-parents>Panel,SplitPanel,StatusBar,ToolBar,FormField,ButtonBar</allowed-parents>
  336. <allowed-children>none</allowed-children>
  337. <container>false</container>
  338. </constraints>
  339. <attributes>
  340. <attribute name="type" type="enum" values="text,image,text-image" default="text" />
  341. <attribute name="image" type="string" default="" />
  342. <attribute name="image-position" type="enum" values="left,right,top,bottom" default="left" />
  343. <attribute name="style" type="enum" values="normal,primary,secondary,danger,borderless" default="normal" />
  344. <attribute name="auto-size" type="bool" default="false" />
  345. <attribute name="width" type="int" min="20" max="300" />
  346. <attribute name="height" type="int" min="20" max="100" />
  347. </attributes>
  348. <behavior>
  349. <event name="click" alias="on-click" required="true" />
  350. <event name="mouse-enter" />
  351. <event name="mouse-leave" />
  352. </behavior>
  353. </control>
  354. <!-- Image Control -->
  355. <control name="Image" type="display" category="basic" inherits="CommonControl">
  356. <description>Image display control</description>
  357. <constraints>
  358. <allowed-parents>Panel,SplitPanel,StatusBar,ToolBar,Button</allowed-parents>
  359. <allowed-children>none</allowed-children>
  360. <container>false</container>
  361. </constraints>
  362. <attributes>
  363. <attribute name="resource" type="string" required="true" />
  364. <attribute name="size-mode" type="enum" values="normal,stretch,zoom,center,auto-size" default="normal" />
  365. <attribute name="border" type="bool" default="false" />
  366. <attribute name="background-color" type="color" default="transparent" />
  367. <attribute name="width" type="int" min="10" max="1000" />
  368. <attribute name="height" type="int" min="10" max="1000" />
  369. </attributes>
  370. <behavior>
  371. <event name="click" />
  372. <event name="double-click" />
  373. </behavior>
  374. </control>
  375. <!-- StatusBar Control -->
  376. <control name="StatusBar" type="container" category="layout" inherits="CommonControl">
  377. <description>Status bar container for displaying status information</description>
  378. <constraints>
  379. <allowed-parents>Panel,window</allowed-parents>
  380. <allowed-children>items,context-menu</allowed-children>
  381. <container>true</container>
  382. <max-children>unlimited</max-children>
  383. <requires-structure>items</requires-structure>
  384. </constraints>
  385. <attributes>
  386. <attribute name="show-panels" type="bool" default="true" />
  387. <attribute name="sizing-grip" type="bool" default="true" />
  388. <attribute name="height" type="int" default="22" min="16" max="50" />
  389. </attributes>
  390. <structure>
  391. <items min-count="0" max-count="unlimited">
  392. <status-item>
  393. <control-ref allowed-types="Label,Image,ComboBox,Button" />
  394. </status-item>
  395. </items>
  396. <context-menu max-count="1" />
  397. </structure>
  398. </control>
  399. <!-- ToolBar Control -->
  400. <control name="ToolBar" type="container" category="layout" inherits="CommonControl">
  401. <description>Toolbar container for quick access to commands</description>
  402. <constraints>
  403. <allowed-parents>Panel,window</allowed-parents>
  404. <allowed-children>items,context-menu</allowed-children>
  405. <container>true</container>
  406. <max-children>unlimited</max-children>
  407. <requires-structure>items</requires-structure>
  408. </constraints>
  409. <attributes>
  410. <attribute name="orientation" type="enum" values="horizontal,vertical" default="horizontal" />
  411. <attribute name="appearance" type="enum" values="normal,flat,system" default="normal" />
  412. <attribute name="show-tooltips" type="bool" default="true" />
  413. <attribute name="divider" type="bool" default="true" />
  414. <attribute name="wrappable" type="bool" default="false" />
  415. <attribute name="button-size" type="enum" values="small,medium,large" default="medium" />
  416. </attributes>
  417. <structure>
  418. <items min-count="0" max-count="unlimited">
  419. <toolbar-item>
  420. <control-ref allowed-types="Label,Image,ComboBox,Button,Menu" />
  421. </toolbar-item>
  422. </items>
  423. <context-menu max-count="1" />
  424. </structure>
  425. </control>
  426. <!-- PopupPanel Control - specialized panel that can be shown/hidden -->
  427. <control name="PopupPanel" type="container" category="layout" inherits="Panel">
  428. <description>Panel that can be dynamically shown or hidden, typically overlaying other content</description>
  429. <constraints>
  430. <allowed-parents>Panel,window</allowed-parents>
  431. <allowed-children>any-control</allowed-children>
  432. <container>true</container>
  433. <max-children>unlimited</max-children>
  434. </constraints>
  435. <attributes>
  436. <attribute name="popup-visible" type="bool" default="false" />
  437. <attribute name="auto-hide" type="bool" default="true" />
  438. <attribute name="modal" type="bool" default="false" />
  439. <attribute name="position" type="enum" values="center,top-left,top-right,bottom-left,bottom-right" default="center" />
  440. <attribute name="animation" type="enum" values="none,fade,slide" default="fade" />
  441. </attributes>
  442. <behavior>
  443. <event name="popup-show" />
  444. <event name="popup-hide" />
  445. </behavior>
  446. </control>
  447. </patterns>