iup_drop_button.e 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. class IUP_DROP_BUTTON
  2. -- Creates an interface element that is a button with a drop down arrow. It
  3. -- can function as a button and as a dropdown. Its visual presentation can
  4. -- contain a text and/or an image.
  5. --
  6. -- When dropped displays a child inside a dialog with no decorations, so it can
  7. -- simulate the initial function of a dropdown list, but it can display any
  8. -- layout of IUP elements inside the dropped dialog. When the user click
  9. -- outside the dialog, it is automatically closed.
  10. --
  11. -- It inherits from IUP_CANVAS.
  12. --
  13. -- Callbacks:
  14. --
  15. -- Inherits all callbacks of the IUP_CANVAS, but redefines a few of them.
  16. -- Including ACTION, BUTTON_CB, MOTION_CB, FOCUS_CB, LEAVEWINDOW_CB, and
  17. -- ENTERWINDOW_CB. To allow the application to use those callbacks the same
  18. -- callbacks are exported with the "FLAT_" prefix using the same parameters,
  19. -- except the FLAT_ACTION callback that now mimics the IupButton ACTION. They
  20. -- are all called before the internal callbacks and if they return IUP_IGNORE
  21. -- the internal callbacks are not processed.
  22. --
  23. -- Notes:
  24. --
  25. -- The natural size will be a combination of the size of the image and the
  26. -- title, if any, plus PADDING and SPACING (if both image and title are
  27. -- present), and plus the horizontal space occupied by the arrow.
  28. --
  29. -- The drop dialog is configured with no decorations and it is not resizable,
  30. -- and to close when loss the focus or when the user press the ESC key. It is a
  31. -- regular IUP_DIALOG. To obtain the drop button widget from the widget of the
  32. -- dialog call "drop_button" at the dialog. After performing some operation on
  33. -- the drop child, use set_show_drop_down=False on the drop button, you may
  34. -- also update its TITLE, just like a regular IUP_LIST with set_drop_down=True,
  35. -- but this will not be performed automatically by the drop button. For example,
  36. -- set the ACTION callback on the IUP_LIST used as drop child:
  37. --
  38. -- list_action (text: STRING; item, state: INTEGER): STRING
  39. -- local
  40. -- a_drop_button: IUP_DROP_BUTTON
  41. -- do
  42. -- if state.is_equal(1) then
  43. -- a_drop_button := list.get_dialog.get_drop_button
  44. -- a_drop_button.set_show_drop_down(False)
  45. -- a_drop_button.set_title(text)
  46. -- end
  47. --
  48. -- Result := "IUP_DEFAULT"
  49. -- end
  50. --
  51. -- Additionally to mimic a IUP_LIST with set_drop_down=True set
  52. -- set_border=True and set_drop_on_arrow=False on the drop button. But notice
  53. -- that the natural size will not use the largest item in the drop child list,
  54. -- so you can use EXPAND=HORIZONTAL or set VISIBLECOLUMNS, both on the drop
  55. -- button.
  56. inherit
  57. IUP_CANVAS
  58. redefine
  59. set_border,
  60. set_can_focus,
  61. set_expand,
  62. execute_flat_action,
  63. execute_dropdown,
  64. execute_dropshow,
  65. execute_flat_button,
  66. execute_flat_motion,
  67. execute_flat_focus,
  68. execute_flat_enterwindow,
  69. execute_flat_leavewindow
  70. end
  71. IUP_WIDGET_FGCOLOR
  72. IUP_WIDGET_SPACING
  73. IUP_WIDGET_TITLE
  74. IUP_WIDGET_FLAT_TEXT
  75. redefine
  76. set_alignment
  77. end
  78. IUP_WIDGET_BACK_IMAGE_2
  79. IUP_WIDGET_FRONT_IMAGE_2
  80. IUP_WIDGET_IMAGE_2
  81. IUP_WIDGET_PADDING
  82. redefine
  83. set_padding
  84. end
  85. IUP_WIDGET_BORDER
  86. IUP_WIDGET_HAS_FOCUS
  87. IUP_WIDGET_HIGHLIGHT
  88. IUP_WIDGET_PRESS
  89. IUP_WIDGET_FOCUSFEEDBACK
  90. create {ANY}
  91. drop_button_empty,
  92. drop_button
  93. feature {ANY}
  94. drop_button_empty
  95. local
  96. a_drop_button, p: POINTER
  97. do
  98. a_drop_button := int_drop_button(p)
  99. set_widget(a_drop_button)
  100. end
  101. drop_button (child: IUP_WIDGET)
  102. local
  103. a_drop_button: POINTER
  104. do
  105. a_drop_button := int_drop_button(child.widget)
  106. set_widget(a_drop_button)
  107. end
  108. -- Attributes
  109. set_alignment (horizontal, vertical: STRING)
  110. -- (non inheritable): horizontal and vertical alignment of the set
  111. -- image+text. Possible values: "ALEFT", "ACENTER" and "ARIGHT", combined
  112. -- to "ATOP", "ACENTER" and "ABOTTOM". Default: "ALEFT:ACENTER".
  113. -- Alignment does not includes the padding area.
  114. do
  115. Precursor (horizontal, vertical)
  116. end
  117. set_arrow_active (state: BOOLEAN)
  118. -- (non inheritable): the arrow can be disabled when the button is
  119. -- enabled. If there is no drop child the arrow will be automatically
  120. -- disabled.
  121. do
  122. iup_open.set_attribute(Current, "ARROWACTIVE", boolean_to_yesno(state))
  123. end
  124. set_arrow_align (value: STRING)
  125. -- (non inheritable): vertical arrow alignment. Can be: TOP, CENTER or
  126. -- BOTTOM. Default: CENTER.
  127. require
  128. is_valid_arrow_align(value)
  129. do
  130. iup_open.set_attribute(Current, "ARROWALIGN", value)
  131. end
  132. set_rgb_arrow_color (red: INTEGER; green: INTEGER; blue: INTEGER)
  133. -- color used for the arrow. Default use FGCOLOR.
  134. do
  135. iup_open.set_attribute(Current, "ARROWCOLOR",
  136. rgb_to_string(red, green, blue))
  137. end
  138. set_arrow_images (state: BOOLEAN)
  139. -- (non inheritable): replace the drawn arrows by the following images
  140. -- (attributes below). Make sure their sizes are equal or smaller than
  141. -- ARROWSIZE. Default: False.
  142. do
  143. iup_open.set_attribute(Current, "ARROWIMAGES", boolean_to_yesno(state))
  144. end
  145. set_arrow_image (name: STRING)
  146. -- (non inheritable): Arrow image name.
  147. do
  148. iup_open.set_attribute(Current, "ARROWIMAGE", name)
  149. end
  150. set_arrow_image_highlight (name: STRING)
  151. -- (non inheritable): Arrow image name of the element in highlight state.
  152. -- If it is not defined then the ARROWIMAGE is used.
  153. do
  154. iup_open.set_attribute(Current, "ARROWIMAGEHIGHLIGHT", name)
  155. end
  156. set_arrow_image_inactive (name: STRING)
  157. -- (non inheritable): Arrow image name of the element when inactive. If
  158. -- it is not defined then the ARROWIMAGE is used and its colors will be
  159. -- replaced by a modified version creating the disabled effect.
  160. do
  161. iup_open.set_attribute(Current, "ARROWIMAGEINACTIVE", name)
  162. end
  163. set_arrow_image_press (name: STRING)
  164. -- (non inheritable): Arrow image name of the element in pressed state.
  165. -- If it is not defined then the ARROWIMAGE is used.
  166. do
  167. iup_open.set_attribute(Current, "ARROWIMAGEPRESS", name)
  168. end
  169. set_arrow_padding (value: INTEGER)
  170. -- (non inheritable): internal margin for the arrow. It is inside
  171. -- ARROWSIZE. Default: 5.
  172. require
  173. value >= 0
  174. do
  175. iup_open.set_attribute(Current, "ARROWPADDING", value.out)
  176. end
  177. set_arrow_size (value: INTEGER)
  178. -- (non inheritable): size of the area occupied by the arrow, even when
  179. -- using images. Default: 24
  180. require
  181. value >= 0
  182. do
  183. iup_open.set_attribute(Current, "ARROWSIZE", value.out)
  184. end
  185. set_border (state: BOOLEAN)
  186. -- (creation only): Shows a border around the canvas. Default: "False".
  187. do
  188. Precursor (state)
  189. end
  190. set_can_focus (state: BOOLEAN)
  191. -- (creation only) (non inheritable): enables the focus traversal of the
  192. -- control. In Windows the button will respect CANFOCUS in opposite to
  193. -- the other controls. Default: True.
  194. do
  195. Precursor (state)
  196. end
  197. set_drop_child (name: STRING)
  198. -- the name of the element that will be displayed when dropped. The drop
  199. -- dialog, were the drop child is inserted, is available right after
  200. -- setting the attribute using "get_dialog" on the drop child widget. See
  201. -- the Notes bellow for more information.
  202. do
  203. iup_open.set_attribute(Current, "DROPCHILD", name)
  204. end
  205. set_drop_child_widget (child: IUP_WIDGET)
  206. -- same as DROPCHILD but directly using the widget of the element.
  207. do
  208. iup_open.set_attribute_widget(Current, "DROPCHILD_HANDLE", child)
  209. end
  210. set_drop_on_arrow (state: BOOLEAN)
  211. -- (non inheritable): when enabled only clicking on the drop arrow will
  212. -- show the drop child. Clicking on the remaining of the button will call
  213. -- FLAT_ACTION. There will be two separates areas in the button, one for
  214. -- the drop arrow and one for the regular button. When disabled there
  215. -- will be only one area, and the drop child will be show any where the
  216. -- button is clicked, the callback FLAT_ACTION will not be called.
  217. -- Default: True.
  218. do
  219. iup_open.set_attribute(Current, "DROPONARROW", boolean_to_yesno(state))
  220. end
  221. set_drop_position (pos: STRING)
  222. -- (non inheritable): the drop child can be shown in four different
  223. -- positions relative to the drop button: BOTTOMLEFT, TOPLEFT,
  224. -- BOTTOMRIGHT, TOPRIGHT. BOTTOMLEFT the top-left corner of the drop
  225. -- child is aligned with the bottom-left corner of the drop button,
  226. -- BOTTOMRIGHT the top-right corner of the drop child is aligned with the
  227. -- bottom-right corner of the drop button, TOPLEFT the bottom-left corner
  228. -- of the drop child is aligned with the top-left corner of the drop
  229. -- button, TOPRIGHT the bottom-right corner of the drop child is aligned
  230. -- with the top-right corner of the drop button. Default: BOTTOMLEFT.
  231. require
  232. is_valid_drop_position(pos)
  233. do
  234. iup_open.set_attribute(Current, "DROPPOSITION", pos)
  235. end
  236. set_expand (type: STRING)
  237. -- (non inheritable): The default value is "False".
  238. do
  239. Precursor (type)
  240. end
  241. set_padding (horizontal, vertical: INTEGER)
  242. -- Internal margin. Works just like the MARGIN attribute of the IUP_HBOX
  243. -- and IUP_VBOX containers, but uses a different name to avoid
  244. -- inheritance problems. Alignment does not includes the padding area.
  245. -- Default value: "3x3".
  246. do
  247. Precursor (horizontal, vertical)
  248. end
  249. set_show_drop_down (state: BOOLEAN)
  250. -- opens or closes the dropdown child. Ignored if set before map.
  251. do
  252. iup_open.set_attribute(Current, "SHOWDROPDOWN", boolean_to_yesno(state))
  253. end
  254. set_visible_columns (value: INTEGER)
  255. -- Defines the number of visible columns for the Natural Size, this means
  256. -- that will act also as minimum number of visible columns. It uses a
  257. -- wider character size then the one used for the SIZE attribute so
  258. -- strings will fit better without the need of extra columns. Padding
  259. -- will be around the visible columns.
  260. require
  261. value > 0
  262. do
  263. iup_open.set_attribute(Current, "VISIBLECOLUMNS", value.out)
  264. end
  265. -- Extra callbacks
  266. set_cb_flat_action (act: detachable FUNCTION[TUPLE[IUP_DROP_BUTTON], STRING])
  267. -- Action generated when the button 1 (usually left) is selected. This
  268. -- callback is called only after the mouse is released and when it is
  269. -- released inside the button area. Called only when
  270. -- set_drop_on_arrow=True
  271. --
  272. -- ih: identifier of the element that activated the event.
  273. --
  274. -- Returns: IUP_CLOSE will be processed.
  275. local
  276. operation: INTEGER
  277. do
  278. cb_flat_action := act
  279. if cb_flat_action /= Void then
  280. operation := 1
  281. else
  282. operation := 0
  283. end
  284. iup_open.set_callback (Current, "FLAT_ACTION", "Fnff", operation)
  285. end
  286. set_cb_drop_down (act: detachable FUNCTION[TUPLE[IUP_DROP_BUTTON, INTEGER], STRING])
  287. -- Action generated right before the drop child is shown or hidden.
  288. --
  289. -- ih: identifier of the element that activated the event.
  290. -- state: the new state of the drop child 1=to be shown, 0=to be hidden.
  291. local
  292. operation: INTEGER
  293. do
  294. cb_dropdown := act
  295. if cb_dropdown /= Void then
  296. operation := 1
  297. else
  298. operation := 0
  299. end
  300. iup_open.set_callback (Current, "DROPDOWN_CB", "NONEEDED", operation)
  301. end
  302. set_cb_drop_show (act: detachable FUNCTION[TUPLE[IUP_DROP_BUTTON, INTEGER], STRING])
  303. -- Action generated right after the drop child is shown or hidden.
  304. --
  305. -- ih: identifier of the element that activated the event.
  306. -- state: the current state of the drop child 1=shown, 0=hidden.
  307. local
  308. operation: INTEGER
  309. do
  310. cb_dropdown := act
  311. if cb_dropdown /= Void then
  312. operation := 1
  313. else
  314. operation := 0
  315. end
  316. iup_open.set_callback (Current, "DROPDOWN_CB", "NONEEDED", operation)
  317. end
  318. ----------------------
  319. set_cb_flat_button (act: detachable FUNCTION[TUPLE[IUP_DROP_BUTTON, INTEGER, INTEGER, INTEGER, INTEGER, STRING], STRING])
  320. -- Action generated when any mouse button is pressed and when it is
  321. -- released. Both calls occur before the ACTION callback when button 1 is
  322. -- being used.
  323. -- IUP_CANVAS: identifies the element that activated the event.
  324. -- button: identifies the activated mouse button:
  325. --
  326. -- 1 - left mouse button (button 1);
  327. -- 2 - middle mouse button (button 2);
  328. -- 3 - right mouse button (button 3).
  329. --
  330. -- pressed: indicates the state of the button:
  331. --
  332. -- 0 - mouse button was released;
  333. -- 1 - mouse button was pressed.
  334. --
  335. -- x, y: position in the canvas where the event has occurred, in pixels.
  336. --
  337. -- status: status of the mouse buttons and some keyboard keys at the
  338. -- moment the event is generated. The following macros must be used for
  339. -- verification:
  340. --
  341. -- Returns: IUP_CLOSE will be processed. On some controls if IUP_IGNORE
  342. -- is returned the action is ignored (this is system dependent).
  343. local
  344. operation: INTEGER
  345. do
  346. cb_flat_button := act
  347. if cb_flat_button /= Void then
  348. operation := 1
  349. else
  350. operation := 0
  351. end
  352. iup_open.set_callback (Current, "FLAT_BUTTON_CB", "NONEEDED", operation)
  353. end
  354. set_cb_flat_motion (act: detachable FUNCTION[TUPLE[IUP_DROP_BUTTON, INTEGER, INTEGER, STRING], STRING])
  355. -- Action generated when the mouse moves.
  356. -- ih: identifier of the element that activated the event.
  357. -- x, y: position in the canvas where the event has occurred, in pixels.
  358. -- status: status of mouse buttons and certain keyboard keys at the
  359. -- moment the event was generated. The same macros used for BUTTON_CB can
  360. -- be used for this status.
  361. local
  362. operation: INTEGER
  363. do
  364. cb_flat_motion := act
  365. if cb_flat_motion /= Void then
  366. operation := 1
  367. else
  368. operation := 0
  369. end
  370. iup_open.set_callback (Current, "FALT_MOTION_CB", "NONEEDED", operation)
  371. end
  372. set_cb_flat_focus (act: detachable FUNCTION[TUPLE[IUP_DROP_BUTTON, INTEGER], STRING])
  373. -- Called when the canvas gets or looses the focus. It is called after
  374. -- the common callbacks GETFOCUS_CB and KILL_FOCUS_CB.
  375. -- ih: identifier of the element that activated the event.
  376. -- focus: is non zero if the canvas is getting the focus, is zero if it
  377. -- is loosing the focus.
  378. local
  379. operation: INTEGER
  380. do
  381. cb_flat_focus := act
  382. if cb_focus /= Void then
  383. operation := 1
  384. else
  385. operation := 0
  386. end
  387. iup_open.set_callback (Current, "FLAT_FOCUS_CB", "NONEEDED", operation)
  388. end
  389. set_cb_flat_enter_window (act: detachable FUNCTION[TUPLE[IUP_DROP_BUTTON], STRING])
  390. -- Action generated when the mouse enters the native element.
  391. local
  392. operation: INTEGER
  393. do
  394. cb_flat_enterwindow := act
  395. if cb_enterwindow /= Void then
  396. operation := 1
  397. else
  398. operation := 0
  399. end
  400. iup_open.set_callback (Current, "FLAT_ENTERWINDOW_CB", "NONEEDED", operation)
  401. end
  402. set_cb_flat_leave_window (act: detachable FUNCTION[TUPLE[IUP_DROP_BUTTON], STRING])
  403. -- Action generated when the mouse leaves the native element.
  404. local
  405. operation: INTEGER
  406. do
  407. cb_flat_leavewindow := act
  408. if cb_leavewindow /= Void then
  409. operation := 1
  410. else
  411. operation := 0
  412. end
  413. iup_open.set_callback (Current, "FLAT_LEAVEWINDOW_CB", "NONEEDED", operation)
  414. end
  415. -- Validations
  416. is_valid_drop_position (value: STRING): BOOLEAN
  417. do
  418. if value.is_equal("BOTTOMLEFT") or
  419. value.is_equal("TOPLEFT") or
  420. value.is_equal("BOTTOMRIGHT") or
  421. value.is_equal("TOPRIGHT") then
  422. Result := True
  423. else
  424. Result := False
  425. end
  426. end
  427. is_valid_arrow_align (value: STRING): BOOLEAN
  428. do
  429. if value.is_equal("TOP") or
  430. value.is_equal("CENTER") or
  431. value.is_equal("BOTTOM") then
  432. Result := True
  433. else
  434. Result := False
  435. end
  436. end
  437. feature {IUP}
  438. -- Callbacks
  439. execute_flat_action: STRING
  440. do
  441. if attached cb_flat_action as int_cb then
  442. Result := int_cb.item([Current])
  443. else
  444. Result := "IUP_DEFAULT"
  445. end
  446. end
  447. execute_dropdown (state: INTEGER): STRING
  448. do
  449. if attached cb_dropdown as int_cb then
  450. Result := int_cb.item([Current, state])
  451. else
  452. Result := "IUP_DEFAULT"
  453. end
  454. end
  455. execute_dropshow (state: INTEGER): STRING
  456. do
  457. if attached cb_dropshow as int_cb then
  458. Result := int_cb.item([Current, state])
  459. else
  460. Result := "IUP_DEFAULT"
  461. end
  462. end
  463. execute_flat_button (btn, pressed, x, y: INTEGER; status: STRING): STRING
  464. do
  465. if attached cb_flat_button as int_cb then
  466. Result := int_cb.item([Current, btn, pressed, x, y, status])
  467. else
  468. Result := "IUP_DEFAULT"
  469. end
  470. end
  471. execute_flat_motion (x, y: INTEGER; status: STRING): STRING
  472. do
  473. if attached cb_flat_motion as int_cb then
  474. Result := int_cb.item([Current, x, y, status])
  475. else
  476. Result := "IUP_DEFAULT"
  477. end
  478. end
  479. execute_flat_focus (focus: INTEGER): STRING
  480. do
  481. if attached cb_flat_focus as int_cb then
  482. Result := int_cb.item([Current, focus])
  483. else
  484. Result := "IUP_DEFAULT"
  485. end
  486. end
  487. execute_flat_enterwindow: STRING
  488. do
  489. if attached cb_flat_enterwindow as int_cb then
  490. Result := int_cb.item([Current])
  491. else
  492. Result := "IUP_DEFAULT"
  493. end
  494. end
  495. execute_flat_leavewindow: STRING
  496. do
  497. if attached cb_flat_leavewindow as int_cb then
  498. Result := int_cb.item([Current])
  499. else
  500. Result := "IUP_DEFAULT"
  501. end
  502. end
  503. feature {NONE}
  504. cb_flat_action: detachable FUNCTION[TUPLE[IUP_DROP_BUTTON], STRING]
  505. cb_dropdown: detachable FUNCTION[TUPLE[IUP_DROP_BUTTON, INTEGER], STRING]
  506. cb_dropshow: detachable FUNCTION[TUPLE[IUP_DROP_BUTTON, INTEGER], STRING]
  507. cb_flat_button: detachable FUNCTION[TUPLE[IUP_DROP_BUTTON, INTEGER, INTEGER, INTEGER, INTEGER, STRING], STRING]
  508. cb_flat_motion: detachable FUNCTION[TUPLE[IUP_DROP_BUTTON, INTEGER, INTEGER, STRING], STRING]
  509. cb_flat_focus: detachable FUNCTION[TUPLE[IUP_DROP_BUTTON, INTEGER], STRING]
  510. cb_flat_enterwindow: detachable FUNCTION[TUPLE[IUP_DROP_BUTTON], STRING]
  511. cb_flat_leavewindow: detachable FUNCTION[TUPLE[IUP_DROP_BUTTON], STRING]
  512. -- Internals
  513. int_drop_button (child: POINTER): POINTER
  514. external
  515. "C inline use %"eiffel-iup.h%""
  516. alias
  517. "return IupDropButton ($child);"
  518. end
  519. end -- class IUP_DROP_BUTTON
  520. -- The MIT License (MIT)
  521. -- Copyright (c) 2019, 2020 by German A. Arias
  522. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  523. -- of this software and associated documentation files (the "Software"), to deal
  524. -- in the Software without restriction, including without limitation the rights
  525. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  526. -- copies of the Software, and to permit persons to whom the Software is
  527. -- furnished to do so, subject to the following conditions:
  528. --
  529. -- The above copyright notice and this permission notice shall be included in
  530. -- all copies or substantial portions of the Software.
  531. --
  532. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  533. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  534. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  535. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  536. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  537. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  538. -- SOFTWARE.