TreeItem.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="TreeItem" inherits="Object" category="Core" version="3.0.alpha.custom_build">
  3. <brief_description>
  4. Control for a single item inside a [Tree].
  5. </brief_description>
  6. <description>
  7. Control for a single item inside a [Tree]. May have child [code]TreeItem[/code]s and be styled as well as contain buttons.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="add_button">
  15. <return type="void">
  16. </return>
  17. <argument index="0" name="column" type="int">
  18. </argument>
  19. <argument index="1" name="button" type="Texture">
  20. </argument>
  21. <argument index="2" name="button_idx" type="int" default="-1">
  22. </argument>
  23. <argument index="3" name="disabled" type="bool" default="false">
  24. </argument>
  25. <argument index="4" name="tooltip" type="String" default="&quot;&quot;">
  26. </argument>
  27. <description>
  28. Adds a button with [Texture] [code]button[/code] at column [code]column[/code]. The [code]button_idx[/code] index is used to identify the button when calling other methods. If not specified, the next available index is used, which may be retrieved by calling [code]get_buton_count()[/code] immediately after this method. Optionally, the button can be [code]disabled[/code] and have a [code]tooltip[/code].
  29. </description>
  30. </method>
  31. <method name="clear_custom_bg_color">
  32. <return type="void">
  33. </return>
  34. <argument index="0" name="column" type="int">
  35. </argument>
  36. <description>
  37. Resets the background color for the given column to default.
  38. </description>
  39. </method>
  40. <method name="clear_custom_color">
  41. <return type="void">
  42. </return>
  43. <argument index="0" name="column" type="int">
  44. </argument>
  45. <description>
  46. Resets the color for the given column to default.
  47. </description>
  48. </method>
  49. <method name="deselect">
  50. <return type="void">
  51. </return>
  52. <argument index="0" name="column" type="int">
  53. </argument>
  54. <description>
  55. Deselects the given column.
  56. </description>
  57. </method>
  58. <method name="erase_button">
  59. <return type="void">
  60. </return>
  61. <argument index="0" name="column" type="int">
  62. </argument>
  63. <argument index="1" name="button_idx" type="int">
  64. </argument>
  65. <description>
  66. Removes the button at index [code]button_idx[/code] in column [code]column[/code].
  67. </description>
  68. </method>
  69. <method name="get_button" qualifiers="const">
  70. <return type="Texture">
  71. </return>
  72. <argument index="0" name="column" type="int">
  73. </argument>
  74. <argument index="1" name="button_idx" type="int">
  75. </argument>
  76. <description>
  77. Returns the [Texture] of the button at index [code]button_idx[/code] in column [code]column[/code].
  78. </description>
  79. </method>
  80. <method name="get_button_count" qualifiers="const">
  81. <return type="int">
  82. </return>
  83. <argument index="0" name="column" type="int">
  84. </argument>
  85. <description>
  86. Returns the number of buttons in column [code]column[/code]. May be used to get the most recently added button's index, if no index was specified.
  87. </description>
  88. </method>
  89. <method name="get_cell_mode" qualifiers="const">
  90. <return type="int" enum="TreeItem.TreeCellMode">
  91. </return>
  92. <argument index="0" name="column" type="int">
  93. </argument>
  94. <description>
  95. Returns the column's cell mode. See [code]CELL_MODE_*[/code] constants.
  96. </description>
  97. </method>
  98. <method name="get_children">
  99. <return type="TreeItem">
  100. </return>
  101. <description>
  102. Returns the TreeItem's child items.
  103. </description>
  104. </method>
  105. <method name="get_custom_bg_color" qualifiers="const">
  106. <return type="Color">
  107. </return>
  108. <argument index="0" name="column" type="int">
  109. </argument>
  110. <description>
  111. Returns the custom background color of column [code]column[/code].
  112. </description>
  113. </method>
  114. <method name="get_custom_minimum_height" qualifiers="const">
  115. <return type="int">
  116. </return>
  117. <description>
  118. Returns the custom minimum height.
  119. </description>
  120. </method>
  121. <method name="get_expand_right" qualifiers="const">
  122. <return type="bool">
  123. </return>
  124. <argument index="0" name="column" type="int">
  125. </argument>
  126. <description>
  127. Returns [code]true[/code] if [code]expand_right[/code] is set.
  128. </description>
  129. </method>
  130. <method name="get_icon" qualifiers="const">
  131. <return type="Texture">
  132. </return>
  133. <argument index="0" name="column" type="int">
  134. </argument>
  135. <description>
  136. Returns the given column's icon [Texture]. Error if no icon is set.
  137. </description>
  138. </method>
  139. <method name="get_icon_max_width" qualifiers="const">
  140. <return type="int">
  141. </return>
  142. <argument index="0" name="column" type="int">
  143. </argument>
  144. <description>
  145. Returns the column's icon's maximum width.
  146. </description>
  147. </method>
  148. <method name="get_icon_region" qualifiers="const">
  149. <return type="Rect2">
  150. </return>
  151. <argument index="0" name="column" type="int">
  152. </argument>
  153. <description>
  154. Returns the icon [Texture] region as [Rect2].
  155. </description>
  156. </method>
  157. <method name="get_metadata" qualifiers="const">
  158. <return type="Variant">
  159. </return>
  160. <argument index="0" name="column" type="int">
  161. </argument>
  162. <description>
  163. </description>
  164. </method>
  165. <method name="get_next">
  166. <return type="TreeItem">
  167. </return>
  168. <description>
  169. Returns the next TreeItem in the tree.
  170. </description>
  171. </method>
  172. <method name="get_next_visible">
  173. <return type="TreeItem">
  174. </return>
  175. <description>
  176. Returns the next visible TreeItem in the tree.
  177. </description>
  178. </method>
  179. <method name="get_parent">
  180. <return type="TreeItem">
  181. </return>
  182. <description>
  183. Returns the parent TreeItem.
  184. </description>
  185. </method>
  186. <method name="get_prev">
  187. <return type="TreeItem">
  188. </return>
  189. <description>
  190. Returns the previous TreeItem in the tree.
  191. </description>
  192. </method>
  193. <method name="get_prev_visible">
  194. <return type="TreeItem">
  195. </return>
  196. <description>
  197. Returns the previous visible TreeItem in the tree.
  198. </description>
  199. </method>
  200. <method name="get_range" qualifiers="const">
  201. <return type="float">
  202. </return>
  203. <argument index="0" name="column" type="int">
  204. </argument>
  205. <description>
  206. </description>
  207. </method>
  208. <method name="get_range_config">
  209. <return type="Dictionary">
  210. </return>
  211. <argument index="0" name="column" type="int">
  212. </argument>
  213. <description>
  214. </description>
  215. </method>
  216. <method name="get_text" qualifiers="const">
  217. <return type="String">
  218. </return>
  219. <argument index="0" name="column" type="int">
  220. </argument>
  221. <description>
  222. Returns the given column's text.
  223. </description>
  224. </method>
  225. <method name="get_text_align" qualifiers="const">
  226. <return type="int" enum="TreeItem.TextAlign">
  227. </return>
  228. <argument index="0" name="column" type="int">
  229. </argument>
  230. <description>
  231. Returns the given column's text alignment.
  232. </description>
  233. </method>
  234. <method name="get_tooltip" qualifiers="const">
  235. <return type="String">
  236. </return>
  237. <argument index="0" name="column" type="int">
  238. </argument>
  239. <description>
  240. Returns the given column's tooltip.
  241. </description>
  242. </method>
  243. <method name="is_button_disabled" qualifiers="const">
  244. <return type="bool">
  245. </return>
  246. <argument index="0" name="column" type="int">
  247. </argument>
  248. <argument index="1" name="button_idx" type="int">
  249. </argument>
  250. <description>
  251. Returns [code]true[/code] if the button at index [code]button_idx[/code] for the given column is disabled.
  252. </description>
  253. </method>
  254. <method name="is_checked" qualifiers="const">
  255. <return type="bool">
  256. </return>
  257. <argument index="0" name="column" type="int">
  258. </argument>
  259. <description>
  260. Returns [code]true[/code] if the given column is checked.
  261. </description>
  262. </method>
  263. <method name="is_collapsed">
  264. <return type="bool">
  265. </return>
  266. <description>
  267. Returns [code]true[/code] if this TreeItem is collapsed.
  268. </description>
  269. </method>
  270. <method name="is_custom_set_as_button" qualifiers="const">
  271. <return type="bool">
  272. </return>
  273. <argument index="0" name="column" type="int">
  274. </argument>
  275. <description>
  276. </description>
  277. </method>
  278. <method name="is_editable">
  279. <return type="bool">
  280. </return>
  281. <argument index="0" name="column" type="int">
  282. </argument>
  283. <description>
  284. Returns [code]true[/code] if column [code]column[/code] is editable.
  285. </description>
  286. </method>
  287. <method name="is_folding_disabled" qualifiers="const">
  288. <return type="bool">
  289. </return>
  290. <description>
  291. Returns [code]true[/code] if folding is disabled for this TreeItem.
  292. </description>
  293. </method>
  294. <method name="is_selectable" qualifiers="const">
  295. <return type="bool">
  296. </return>
  297. <argument index="0" name="column" type="int">
  298. </argument>
  299. <description>
  300. Returns [code]true[/code] if column [code]column[/code] is selectable.
  301. </description>
  302. </method>
  303. <method name="is_selected">
  304. <return type="bool">
  305. </return>
  306. <argument index="0" name="column" type="int">
  307. </argument>
  308. <description>
  309. Returns [code]true[/code] if column [code]column[/code] is selected.
  310. </description>
  311. </method>
  312. <method name="move_to_bottom">
  313. <return type="void">
  314. </return>
  315. <description>
  316. Moves this TreeItem to the bottom in the [Tree] hierarchy.
  317. </description>
  318. </method>
  319. <method name="move_to_top">
  320. <return type="void">
  321. </return>
  322. <description>
  323. Moves this TreeItem to the top in the [Tree] hierarchy.
  324. </description>
  325. </method>
  326. <method name="remove_child">
  327. <return type="void">
  328. </return>
  329. <argument index="0" name="child" type="Object">
  330. </argument>
  331. <description>
  332. Removes the child TreeItem at index [code]index[/code].
  333. </description>
  334. </method>
  335. <method name="select">
  336. <return type="void">
  337. </return>
  338. <argument index="0" name="column" type="int">
  339. </argument>
  340. <description>
  341. Selects the column [code]column[/code].
  342. </description>
  343. </method>
  344. <method name="set_button">
  345. <return type="void">
  346. </return>
  347. <argument index="0" name="column" type="int">
  348. </argument>
  349. <argument index="1" name="button_idx" type="int">
  350. </argument>
  351. <argument index="2" name="button" type="Texture">
  352. </argument>
  353. <description>
  354. Sets the given column's button [Texture] at index [code]button_idx[/code] to [code]button[/code].
  355. </description>
  356. </method>
  357. <method name="set_cell_mode">
  358. <return type="void">
  359. </return>
  360. <argument index="0" name="column" type="int">
  361. </argument>
  362. <argument index="1" name="mode" type="int" enum="TreeItem.TreeCellMode">
  363. </argument>
  364. <description>
  365. Sets the given column's cell mode to [code]mode[/code]. See [code]CELL_MODE_*[/code] constants.
  366. </description>
  367. </method>
  368. <method name="set_checked">
  369. <return type="void">
  370. </return>
  371. <argument index="0" name="column" type="int">
  372. </argument>
  373. <argument index="1" name="checked" type="bool">
  374. </argument>
  375. <description>
  376. If [code]true[/code] the column [code]column[/code] is checked.
  377. </description>
  378. </method>
  379. <method name="set_collapsed">
  380. <return type="void">
  381. </return>
  382. <argument index="0" name="enable" type="bool">
  383. </argument>
  384. <description>
  385. If [code]true[/code] the TreeItem is collapsed.
  386. </description>
  387. </method>
  388. <method name="set_custom_as_button">
  389. <return type="void">
  390. </return>
  391. <argument index="0" name="column" type="int">
  392. </argument>
  393. <argument index="1" name="enable" type="bool">
  394. </argument>
  395. <description>
  396. </description>
  397. </method>
  398. <method name="set_custom_bg_color">
  399. <return type="void">
  400. </return>
  401. <argument index="0" name="column" type="int">
  402. </argument>
  403. <argument index="1" name="color" type="Color">
  404. </argument>
  405. <argument index="2" name="just_outline" type="bool" default="false">
  406. </argument>
  407. <description>
  408. Sets the given column's custom background color and whether to just use it as an outline.
  409. </description>
  410. </method>
  411. <method name="set_custom_color">
  412. <return type="void">
  413. </return>
  414. <argument index="0" name="column" type="int">
  415. </argument>
  416. <argument index="1" name="color" type="Color">
  417. </argument>
  418. <description>
  419. Sets the given column's custom color.
  420. </description>
  421. </method>
  422. <method name="set_custom_draw">
  423. <return type="void">
  424. </return>
  425. <argument index="0" name="column" type="int">
  426. </argument>
  427. <argument index="1" name="object" type="Object">
  428. </argument>
  429. <argument index="2" name="callback" type="String">
  430. </argument>
  431. <description>
  432. Sets the given column's custom draw callback to [code]callback[/code] method on [code]object[/code].
  433. </description>
  434. </method>
  435. <method name="set_custom_minimum_height">
  436. <return type="void">
  437. </return>
  438. <argument index="0" name="height" type="int">
  439. </argument>
  440. <description>
  441. Sets the custom minimum height of this TreeItem.
  442. </description>
  443. </method>
  444. <method name="set_disable_folding">
  445. <return type="void">
  446. </return>
  447. <argument index="0" name="disable" type="bool">
  448. </argument>
  449. <description>
  450. If [code]true[/code] folding is disabled for this TreeItem.
  451. </description>
  452. </method>
  453. <method name="set_editable">
  454. <return type="void">
  455. </return>
  456. <argument index="0" name="column" type="int">
  457. </argument>
  458. <argument index="1" name="enabled" type="bool">
  459. </argument>
  460. <description>
  461. If [code]true[/code] column [code]column[/code] is editable.
  462. </description>
  463. </method>
  464. <method name="set_expand_right">
  465. <return type="void">
  466. </return>
  467. <argument index="0" name="column" type="int">
  468. </argument>
  469. <argument index="1" name="enable" type="bool">
  470. </argument>
  471. <description>
  472. If [code]true[/code] column [code]column[/code] is expanded to the right.
  473. </description>
  474. </method>
  475. <method name="set_icon">
  476. <return type="void">
  477. </return>
  478. <argument index="0" name="column" type="int">
  479. </argument>
  480. <argument index="1" name="texture" type="Texture">
  481. </argument>
  482. <description>
  483. Sets the given column's icon [Texture].
  484. </description>
  485. </method>
  486. <method name="set_icon_max_width">
  487. <return type="void">
  488. </return>
  489. <argument index="0" name="column" type="int">
  490. </argument>
  491. <argument index="1" name="width" type="int">
  492. </argument>
  493. <description>
  494. Sets the given column's icon's maximum width.
  495. </description>
  496. </method>
  497. <method name="set_icon_region">
  498. <return type="void">
  499. </return>
  500. <argument index="0" name="column" type="int">
  501. </argument>
  502. <argument index="1" name="region" type="Rect2">
  503. </argument>
  504. <description>
  505. Sets the given column's icon's texture region.
  506. </description>
  507. </method>
  508. <method name="set_metadata">
  509. <return type="void">
  510. </return>
  511. <argument index="0" name="column" type="int">
  512. </argument>
  513. <argument index="1" name="meta" type="Variant">
  514. </argument>
  515. <description>
  516. </description>
  517. </method>
  518. <method name="set_range">
  519. <return type="void">
  520. </return>
  521. <argument index="0" name="column" type="int">
  522. </argument>
  523. <argument index="1" name="value" type="float">
  524. </argument>
  525. <description>
  526. </description>
  527. </method>
  528. <method name="set_range_config">
  529. <return type="void">
  530. </return>
  531. <argument index="0" name="column" type="int">
  532. </argument>
  533. <argument index="1" name="min" type="float">
  534. </argument>
  535. <argument index="2" name="max" type="float">
  536. </argument>
  537. <argument index="3" name="step" type="float">
  538. </argument>
  539. <argument index="4" name="expr" type="bool" default="false">
  540. </argument>
  541. <description>
  542. </description>
  543. </method>
  544. <method name="set_selectable">
  545. <return type="void">
  546. </return>
  547. <argument index="0" name="column" type="int">
  548. </argument>
  549. <argument index="1" name="selectable" type="bool">
  550. </argument>
  551. <description>
  552. If [code]true[/code] the given column is selectable.
  553. </description>
  554. </method>
  555. <method name="set_text">
  556. <return type="void">
  557. </return>
  558. <argument index="0" name="column" type="int">
  559. </argument>
  560. <argument index="1" name="text" type="String">
  561. </argument>
  562. <description>
  563. </description>
  564. </method>
  565. <method name="set_text_align">
  566. <return type="void">
  567. </return>
  568. <argument index="0" name="column" type="int">
  569. </argument>
  570. <argument index="1" name="text_align" type="int" enum="TreeItem.TextAlign">
  571. </argument>
  572. <description>
  573. Sets the given column's text alignment. See [code]ALIGN_*[/code] constants.
  574. </description>
  575. </method>
  576. <method name="set_tooltip">
  577. <return type="void">
  578. </return>
  579. <argument index="0" name="column" type="int">
  580. </argument>
  581. <argument index="1" name="tooltip" type="String">
  582. </argument>
  583. <description>
  584. Sets the given column's tooltip text.
  585. </description>
  586. </method>
  587. </methods>
  588. <constants>
  589. <constant name="CELL_MODE_STRING" value="0">
  590. Cell contains a string.
  591. </constant>
  592. <constant name="CELL_MODE_CHECK" value="1">
  593. Cell can be checked.
  594. </constant>
  595. <constant name="CELL_MODE_RANGE" value="2">
  596. Cell contains a range.
  597. </constant>
  598. <constant name="CELL_MODE_RANGE_EXPRESSION" value="3">
  599. Cell contains a range expression.
  600. </constant>
  601. <constant name="CELL_MODE_ICON" value="4">
  602. Cell contains an icon.
  603. </constant>
  604. <constant name="CELL_MODE_CUSTOM" value="5">
  605. </constant>
  606. <constant name="ALIGN_LEFT" value="0">
  607. Align text to the left. See [code]set_text_align()[/code].
  608. </constant>
  609. <constant name="ALIGN_CENTER" value="1">
  610. Center text. See [code]set_text_align()[/code].
  611. </constant>
  612. <constant name="ALIGN_RIGHT" value="2">
  613. Align text to the right. See [code]set_text_align()[/code].
  614. </constant>
  615. </constants>
  616. </class>