iup_tabs.e 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. class IUP_TABS
  2. -- Creates a native container for composing elements in hidden layers with only
  3. -- one layer visible (just like IUP_ZBOX), but its visibility can be
  4. -- interactively controlled. The interaction is done in a line of tabs with
  5. -- titles and arranged according to the tab type. Also known as Notebook in
  6. -- native systems.
  7. inherit
  8. IUP_ZBOX
  9. rename
  10. zbox_empty as tabs_empty
  11. zbox as tabs
  12. redefine
  13. tabs_empty,
  14. tabs,
  15. execute_map,
  16. execute_unmap,
  17. execute_destroy,
  18. execute_getfocus,
  19. execute_killfocus,
  20. execute_enterwindow,
  21. execute_leavewindow,
  22. execute_k_any,
  23. execute_help,
  24. execute_tabchange,
  25. execute_tabchangepos,
  26. execute_tabclose,
  27. execute_rightclick,
  28. execute_focus
  29. end
  30. IUP_WIDGET_BGCOLOR
  31. IUP_WIDGET_EXPAND
  32. IUP_WIDGET_FGCOLOR
  33. IUP_WIDGET_SIZE
  34. IUP_WIDGET_ACTIVE
  35. IUP_WIDGET_FONT
  36. IUP_WIDGET_SCREENPOSITION
  37. IUP_WIDGET_POSITION
  38. IUP_WIDGET_CLIENTSIZE
  39. IUP_WIDGET_CLIENTOFFSET
  40. IUP_WIDGET_MAXMIN_SIZE
  41. IUP_WIDGET_TIP
  42. IUP_WIDGET_RASTERSIZE
  43. IUP_WIDGET_USERSIZE
  44. IUP_WIDGET_ZORDER
  45. IUP_WIDGET_VISIBLE
  46. IUP_WIDGET_CHILD
  47. IUP_WIDGET_NAME
  48. IUP_WIDGET_FOCUS
  49. IUP_WIDGET_PROPAGATEFOCUS
  50. IUP_WIDGET_FLOATING
  51. IUP_WIDGET_CHILDSIZEALL
  52. create {ANY}
  53. tabs_empty,
  54. tabs
  55. feature {ANY}
  56. tabs_empty
  57. -- Create an empty tabs
  58. local
  59. p, a_tabs: POINTER
  60. do
  61. a_tabs := int_tabs_empty (p)
  62. set_widget(a_tabs)
  63. end
  64. tabs (col: ARRAY[IUP_WIDGET])
  65. -- Create a new tabs containing the list of widgets
  66. local
  67. iterator: ITERATOR[IUP_WIDGET]; i: INTEGER; arg: NATIVE_ARRAY[POINTER]; s: IUP_WIDGET; a_tabs: POINTER
  68. do
  69. i := col.count
  70. arg := arg.calloc(i)
  71. iterator := col.new_iterator
  72. i := 0
  73. from
  74. iterator.start
  75. until
  76. iterator.is_off
  77. loop
  78. s := iterator.item
  79. arg.put(s.widget, i)
  80. iterator.next
  81. i := i + 1
  82. end
  83. a_tabs := int_tabs (arg.to_external)
  84. set_widget(a_tabs)
  85. end
  86. -- Attributes
  87. set_childoffset (horizontal, vertical: INTEGER)
  88. require
  89. horizontal >= 0
  90. vertical >= 0
  91. local
  92. offset: STRING
  93. do
  94. offset := horizontal.to_string
  95. offset.append_string("x")
  96. offset.append_string(vertical.to_string)
  97. iup_open.set_attribute(Current, "CHILDOFFSET", offset)
  98. end
  99. get_childoffset: TUPLE[INTEGER, INTEGER]
  100. -- Return the offset of the child.
  101. local
  102. offset: STRING
  103. do
  104. offset := iup_open.get_attribute(Current, "CHILDOFFSET")
  105. Result := components_of_size(offset)
  106. end
  107. count: INTEGER
  108. -- (read-only) (non inheritable): returns the number of tabs.
  109. do
  110. Result := get_child_count
  111. end
  112. set_multiline (state: BOOLEAN)
  113. -- [Windows Only] (non inheritable): Enable multiple lines of tab
  114. -- buttons. This will hide the tab scroll and fits to make all tab buttons
  115. -- visible. Can be "YES" or "NO". Default "NO". It is always enabled
  116. -- when TABTYPE=LEFT or TABTYPE=RIGHT.
  117. do
  118. iup_open.set_attribute(Current, "MULTILINE", boolean_to_yesno(state))
  119. end
  120. is_multiline: BOOLEAN
  121. -- Return the multiline status of the element.
  122. local
  123. str: STRING
  124. do
  125. str := iup_open.get_attribute(Current, "MULTILINE")
  126. Result := yesno_to_boolean(str)
  127. end
  128. set_showclose (state: BOOLEAN)
  129. -- [Windows and GTK Only] (non inheritable): enables the close button on
  130. -- each tab. Default value: "NO". In Windows the close button imply the
  131. -- classic visual for the control. By default when closed the tab is
  132. -- hidden. The change that behavior use the TABCLOSE_CB callback.
  133. do
  134. iup_open.set_attribute(Current, "SHOWCLOSE", boolean_to_yesno(state))
  135. end
  136. is_showclose: BOOLEAN
  137. -- Return the showclose status of the element.
  138. local
  139. str: STRING
  140. do
  141. str := iup_open.get_attribute(Current, "SHOWCLOSE")
  142. Result := yesno_to_boolean(str)
  143. end
  144. set_horizontal_tab
  145. -- (non inheritable): Indicates an horizontal orientation of tab text.
  146. -- This is the default value. In Windows, it can NOT be set,
  147. -- it is dependent on the TABTYPE attribute, if TABTYPE=LEFT or
  148. -- TABTYPE=RIGHT then TABORIENTATION=VERTICAL, if TABTYPE=TOP or
  149. -- TABTYPE=BOTTOM then TABORIENTATION=HORIZONTAL.
  150. do
  151. iup_open.set_attribute(Current, "TABORIENTATION", "HORIZONTAL")
  152. end
  153. set_vertical_tab
  154. -- (non inheritable): Indicates a vertical orientation of tab text.
  155. -- VERTICAL is supported only in GTK and in Windows. In Windows, it can
  156. -- NOT be set, it is dependent on the TABTYPE attribute, if TABTYPE=LEFT
  157. -- or TABTYPE=RIGHT then TABORIENTATION=VERTICAL, if TABTYPE=TOP or
  158. -- TABTYPE=BOTTOM then TABORIENTATION=HORIZONTAL.
  159. do
  160. iup_open.set_attribute(Current, "TABORIENTATION", "VERTICAL")
  161. end
  162. is_horizontal_tab: BOOLEAN
  163. local
  164. str: STRING
  165. do
  166. str := iup_open.get_attribute(Current, "TABORIENTATION")
  167. if str.is_equal("HORIZONTAL") then
  168. Result := True
  169. else
  170. Result := False
  171. end
  172. end
  173. is_vertical_tab: BOOLEAN
  174. local
  175. str: STRING
  176. do
  177. str := iup_open.get_attribute(Current, "TABORIENTATION")
  178. if str.is_equal("VERTICAL") then
  179. Result := True
  180. else
  181. Result := False
  182. end
  183. end
  184. set_tab_padding (horizontal, vertical: INTEGER)
  185. -- (non inheritable): internal margin of the tab title. Works just like
  186. -- the MARGIN attribute of the IUP_BOX and IUP_VBOX containers, but uses
  187. -- a different name to avoid inheritance problems. Default value: "0x0".
  188. require
  189. horizontal >= 0
  190. vertical >= 0
  191. local
  192. padding: STRING
  193. do
  194. padding := horizontal.to_string
  195. padding.append_string("x")
  196. padding.append_string(vertical.to_string)
  197. iup_open.set_attribute(Current, "TABPADDING", padding)
  198. end
  199. get_tab_padding: TUPLE[INTEGER, INTEGER]
  200. -- Return the margin of the tab title.
  201. local
  202. padding: STRING
  203. do
  204. padding := iup_open.get_attribute(Current, "TABPADDING")
  205. Result := components_of_size(padding)
  206. end
  207. set_tab_type (type: STRING)
  208. -- (non inheritable) (creation only in Windows): Indicates the type of
  209. -- tab, which can be "TOP", "BOTTOM", "LEFT" or "RIGHT". Default is "TOP".
  210. -- In Windows, if LEFT or RIGHT then MULTILINE=YES and
  211. -- TABORIENTATION=VERTICAL are set, if TOP or BOTTOM then
  212. -- TABORIENTATION=HORIZONTAL is set. In Windows, when not TOP, then
  213. -- visual style is removed from tabs.
  214. require
  215. is_valid_tabtype(type)
  216. do
  217. iup_open.set_attribute (Current, "TABTYPE", type)
  218. end
  219. get_tab_type: STRING
  220. -- Return the tab type.
  221. do
  222. Result := iup_open.get_attribute (Current, "TABTYPE")
  223. end
  224. -- Tab attributes
  225. set_tab_n_image (imagename: STRING; n: INTEGER)
  226. -- (non inheritable): image name to be used in the respective tab. Use
  227. -- set_attribute_handle to associate an image to a name. n starts at 0.
  228. -- See also IUP_IMAGE. In Motif, the image is shown only if TABTITLEn is
  229. -- Void. In Windows and Motif set the BGCOLOR attribute before setting
  230. -- the image. When set after map will update the TABIMAGE attribute on
  231. -- the respective child
  232. require
  233. n >= 0
  234. local
  235. str: STRING
  236. do
  237. str := "TABIMAGE" + n.to_string
  238. iup_open.set_attribute (Current, str, imagename)
  239. end
  240. get_tab_n_image (n: INTEGER): STRING
  241. -- Return the image name at tab n.
  242. require
  243. n >= 0
  244. local
  245. str: STRING
  246. do
  247. str := "TABIMAGE" + n.to_string
  248. Result := iup_open.get_attribute(Current, str)
  249. end
  250. set_tab_n_visible (state: BOOLEAN; n: INTEGER)
  251. -- Allows to hide a tab. n starts at 0. When a tab is hidden the tabs
  252. -- indices are not changed.
  253. require
  254. n >= 0
  255. do
  256. iup_open.set_attribute_id (Current, "TABVISIBLE", n, boolean_to_yesno(state))
  257. end
  258. is_tab_n_visible (n: INTEGER): BOOLEAN
  259. -- Return the visible status of tab n.
  260. require
  261. n >= 0
  262. local
  263. str: STRING
  264. do
  265. str := iup_open.get_attribute_id(Current, "TABVISIBLE", n)
  266. Result := yesno_to_boolean(str)
  267. end
  268. set_tab_n_title (title: STRING; n: INTEGER)
  269. -- (non inheritable): Contains the text to be shown in the respective
  270. -- tab title. n starts at 0. The "&" character can be used to define a
  271. -- mnemonic, the next character will be used as key. Use "&&" to show the
  272. -- "&" character instead on defining a mnemonic. The button can be
  273. -- activated from any control in the dialog using the "Alt+key"
  274. -- combination. When set after map will update the TABTITLE attribute on
  275. -- the respective child.
  276. require
  277. n >= 0
  278. do
  279. iup_open.set_attribute_id (Current, "TABTITLE", n, title)
  280. end
  281. get_tab_n_title (n: INTEGER): STRING
  282. -- Return the title of tab n.
  283. require
  284. n >= 0
  285. do
  286. Result := iup_open.get_attribute_id(Current, "TABTITLE", n)
  287. end
  288. -- Callbacks
  289. -- Common
  290. set_cb_map (act: FUNCTION[TUPLE[IUP_TABS], STRING])
  291. -- Called right after an element is mapped and its attributes updated.
  292. local
  293. operation: INTEGER
  294. do
  295. cb_map := act
  296. if cb_map /= Void then
  297. operation := 1
  298. else
  299. operation := 0
  300. end
  301. iup_open.set_callback (Current, "MAP_CB", "NONEEDED", operation)
  302. end
  303. set_cb_unmap (act: FUNCTION[TUPLE[IUP_TABS], STRING])
  304. -- Called right before an element is unmapped.
  305. local
  306. operation: INTEGER
  307. do
  308. cb_unmap := act
  309. if cb_unmap /= Void then
  310. operation := 1
  311. else
  312. operation := 0
  313. end
  314. iup_open.set_callback (Current, "UNMAP_CB", "NONEEDED", operation)
  315. end
  316. set_cb_destroy (act: FUNCTION[TUPLE[IUP_TABS], STRING])
  317. -- Called right before an element is destroyed.
  318. local
  319. operation: INTEGER
  320. do
  321. cb_destroy := act
  322. if cb_destroy /= Void then
  323. operation := 1
  324. else
  325. operation := 0
  326. end
  327. iup_open.set_callback (Current, "DESTROY_CB", "NONEEDED", operation)
  328. end
  329. set_cb_get_focus (act: FUNCTION[TUPLE[IUP_TABS], STRING])
  330. -- Action generated when an element is given keyboard focus.
  331. -- This callback is called after the KILLFOCUS_CB of the element
  332. -- that loosed the focus. The {IUP}.get_focus function during the
  333. -- callback returns the element that loosed the focus.
  334. local
  335. operation: INTEGER
  336. do
  337. cb_getfocus := act
  338. if cb_getfocus /= Void then
  339. operation := 1
  340. else
  341. operation := 0
  342. end
  343. iup_open.set_callback (Current, "GETFOCUS_CB", "NONEEDED", operation)
  344. end
  345. set_cb_kill_focus (act: FUNCTION[TUPLE[IUP_TABS], STRING])
  346. -- Action generated when an element loses keyboard focus. This
  347. -- callback is called before the GETFOCUS_CB of the element that
  348. -- gets the focus.
  349. local
  350. operation: INTEGER
  351. do
  352. cb_killfocus := act
  353. if cb_killfocus /= Void then
  354. operation := 1
  355. else
  356. operation := 0
  357. end
  358. iup_open.set_callback (Current, "KILLFOCUS_CB", "NONEEDED", operation)
  359. end
  360. set_cb_enter_window (act: FUNCTION[TUPLE[IUP_TABS], STRING])
  361. -- Action generated when the mouse enters the native element.
  362. local
  363. operation: INTEGER
  364. do
  365. cb_enterwindow := act
  366. if cb_enterwindow /= Void then
  367. operation := 1
  368. else
  369. operation := 0
  370. end
  371. iup_open.set_callback (Current, "ENTERWINDOW_CB", "NONEEDED", operation)
  372. end
  373. set_cb_leave_window (act: FUNCTION[TUPLE[IUP_TABS], STRING])
  374. -- Action generated when the mouse leaves the native element.
  375. local
  376. operation: INTEGER
  377. do
  378. cb_leavewindow := act
  379. if cb_leavewindow /= Void then
  380. operation := 1
  381. else
  382. operation := 0
  383. end
  384. iup_open.set_callback (Current, "LEAVEWINDOW_CB", "NONEEDED", operation)
  385. end
  386. set_cb_k_any (act: FUNCTION[TUPLE[IUP_TABS, INTEGER], STRING])
  387. -- Action generated when a keyboard event occurs.
  388. -- IUP_WIDGET the element that activated the event.
  389. -- INTEGER identifier of typed key. Please refer to the Keyboard
  390. -- Codes table for a list of possible values.
  391. --
  392. -- Returns: If IUP_IGNORE is returned the key is ignored and not
  393. -- processed by the control and not propagated. If returns
  394. -- IUP_CONTINUE, the key will be processed and the event will be
  395. -- propagated to the parent of the element receiving it, this is
  396. -- the default behavior. If returns IUP_DEFAULT the key is processed
  397. -- but it is not propagated. IUP_CLOSE will be processed.
  398. local
  399. operation: INTEGER
  400. do
  401. cb_k_any := act
  402. if cb_k_any /= Void then
  403. operation := 1
  404. else
  405. operation := 0
  406. end
  407. iup_open.set_callback (Current, "K_ANY", "NONEEDED", operation)
  408. end
  409. set_cb_help (act: PROCEDURE[TUPLE[IUP_TABS]])
  410. -- Action generated when the user press F1 at a control. In Motif
  411. -- is also activated by the Help button in some workstations
  412. -- keyboard.
  413. -- Returns: IUP_CLOSE will be processed.
  414. local
  415. operation: INTEGER
  416. do
  417. cb_help := act
  418. if cb_help /= Void then
  419. operation := 1
  420. else
  421. operation := 0
  422. end
  423. iup_open.set_callback (Current, "HELP_CB", "NONEEDED", operation)
  424. end
  425. -- Extra
  426. set_cb_tab_change (act: FUNCTION[TUPLE[IUP_TABS, IUP_WIDGET, IUP_WIDGET], STRING])
  427. -- Callback called when the user shifts the active tab.
  428. local
  429. operation: INTEGER
  430. do
  431. cb_tabchange := act
  432. if cb_tabchange /= Void then
  433. operation := 1
  434. else
  435. operation := 0
  436. end
  437. iup_open.set_callback (Current, "TABCHANGE_CB", "NONEEDED", operation)
  438. end
  439. set_cb_tab_change_position (act: FUNCTION[TUPLE[IUP_TABS, INTEGER, INTEGER], STRING])
  440. -- Callback called when the user shifts the active tab. Called only when
  441. -- TABCHANGE_CB is not defined.
  442. local
  443. operation: INTEGER
  444. do
  445. cb_tabchangepos := act
  446. if cb_tabchangepos /= Void then
  447. operation := 1
  448. else
  449. operation := 0
  450. end
  451. iup_open.set_callback (Current, "TABCHANGEPOS_CB", "NONEEDED", operation)
  452. end
  453. set_cb_tab_close (act: FUNCTION[TUPLE[IUP_TABS, INTEGER], STRING])
  454. -- [Windows and GTK Only]: Callback called when the user clicks on the
  455. -- close button. Called only when SHOWCLOSE=Yes.
  456. local
  457. operation: INTEGER
  458. do
  459. cb_tabclose := act
  460. if cb_tabclose /= Void then
  461. operation := 1
  462. else
  463. operation := 0
  464. end
  465. iup_open.set_callback (Current, "TABCLOSE_CB", "NONEEDED", operation)
  466. end
  467. set_cb_right_click (act: FUNCTION[TUPLE[IUP_TABS, INTEGER], STRING])
  468. -- Callback called when the user clicks on some tab using the right mouse
  469. -- button.
  470. local
  471. operation: INTEGER
  472. do
  473. cb_rightclick := act
  474. if cb_rightclick /= Void then
  475. operation := 1
  476. else
  477. operation := 0
  478. end
  479. iup_open.set_callback (Current, "RIGHTCLICK_CB", "NONEEDED", operation)
  480. end
  481. set_cb_focus (act: FUNCTION[TUPLE[IUP_TABS, INTEGER], STRING])
  482. -- Called when a child of the container gets or looses the focus. It is
  483. -- called only if PROPAGATEFOCUS is defined in the child.
  484. local
  485. operation: INTEGER
  486. do
  487. cb_focus := act
  488. if cb_focus /= Void then
  489. operation := 1
  490. else
  491. operation := 0
  492. end
  493. iup_open.set_callback (Current, "FOCUS_CB", "NONEEDED", operation)
  494. end
  495. feature {ANY}
  496. -- Callbacks
  497. execute_map: STRING
  498. do
  499. Result := cb_map.item([Current])
  500. end
  501. execute_unmap: STRING
  502. do
  503. Result := cb_unmap.item([Current])
  504. end
  505. execute_destroy: STRING
  506. do
  507. Result := cb_destroy.item([Current])
  508. end
  509. execute_getfocus: STRING
  510. do
  511. Result := cb_getfocus.item([Current])
  512. end
  513. execute_killfocus: STRING
  514. do
  515. Result := cb_getfocus.item([Current])
  516. end
  517. execute_enterwindow: STRING
  518. do
  519. Result := cb_enterwindow.item([Current])
  520. end
  521. execute_leavewindow: STRING
  522. do
  523. Result := cb_leavewindow.item([Current])
  524. end
  525. execute_k_any (c: INTEGER): STRING
  526. do
  527. Result := cb_k_any.item([Current, c])
  528. end
  529. execute_help
  530. do
  531. cb_help.call([Current])
  532. end
  533. execute_tabchange (new_tab, old_tab: IUP_WIDGET): STRING
  534. do
  535. Result := cb_tabchange.item([Current, new_tab, old_tab])
  536. end
  537. execute_tabchangepos (new_pos, old_pos: INTEGER): STRING
  538. do
  539. Result := cb_tabchangepos.item([Current, new_pos, old_pos])
  540. end
  541. execute_tabclose (pos: INTEGER): STRING
  542. do
  543. Result := cb_tabclose.item([Current, pos])
  544. end
  545. execute_rightclick (pos: INTEGER): STRING
  546. do
  547. Result := cb_rightclick.item([Current, pos])
  548. end
  549. execute_focus (focus: INTEGER): STRING
  550. do
  551. Result := cb_focus.item([Current, focus])
  552. end
  553. feature {}
  554. -- For Tabs callbacks
  555. cb_map: FUNCTION[TUPLE[IUP_TABS], STRING]
  556. cb_unmap: FUNCTION[TUPLE[IUP_TABS], STRING]
  557. cb_destroy: FUNCTION[TUPLE[IUP_TABS], STRING]
  558. cb_getfocus: FUNCTION[TUPLE[IUP_TABS], STRING]
  559. cb_killfocus: FUNCTION[TUPLE[IUP_TABS], STRING]
  560. cb_enterwindow: FUNCTION[TUPLE[IUP_TABS], STRING]
  561. cb_leavewindow: FUNCTION[TUPLE[IUP_TABS], STRING]
  562. cb_k_any: FUNCTION[TUPLE[IUP_TABS, INTEGER], STRING]
  563. cb_help: PROCEDURE[TUPLE[IUP_TABS]]
  564. cb_action: FUNCTION[TUPLE[IUP_TABS], STRING]
  565. cb_tabchange: FUNCTION[TUPLE[IUP_TABS, IUP_WIDGET, IUP_WIDGET], STRING]
  566. cb_tabchangepos: FUNCTION[TUPLE[IUP_TABS, INTEGER, INTEGER], STRING]
  567. cb_tabclose: FUNCTION[TUPLE[IUP_TABS, INTEGER], STRING]
  568. cb_rightclick: FUNCTION[TUPLE[IUP_TABS, INTEGER], STRING]
  569. cb_focus: FUNCTION[TUPLE[IUP_TABS, INTEGER], STRING]
  570. -- Internals
  571. int_tabs_empty (arguments: POINTER): POINTER
  572. external "plug_in"
  573. alias "{
  574. location: "${sys}/plugins"
  575. module_name: "iup"
  576. feature_name: "IupTabs"
  577. }"
  578. end
  579. int_tabs (arguments: POINTER): POINTER
  580. external "plug_in"
  581. alias "{
  582. location: "${sys}/plugins"
  583. module_name: "iup"
  584. feature_name: "IupTabsv"
  585. }"
  586. end
  587. -- Validations
  588. is_valid_tabtype (type: STRING): BOOLEAN
  589. do
  590. if type.is_equal("TOP") or
  591. type.is_equal("BOTTOM") or
  592. type.is_equal("LEFT") or
  593. type.is_equal("RIGHT") then
  594. Result := True
  595. else
  596. Result := False
  597. end
  598. end
  599. end
  600. -- The MIT License (MIT)
  601. -- Copyright (c) 2016, 2017, 2019 by German A. Arias
  602. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  603. -- of this software and associated documentation files (the "Software"), to deal
  604. -- in the Software without restriction, including without limitation the rights
  605. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  606. -- copies of the Software, and to permit persons to whom the Software is
  607. -- furnished to do so, subject to the following conditions:
  608. --
  609. -- The above copyright notice and this permission notice shall be included in
  610. -- all copies or substantial portions of the Software.
  611. --
  612. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  613. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  614. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  615. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  616. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  617. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  618. -- SOFTWARE.