ProductList

Constructor

ProductList <id> (Process container, string path_and_name_of_the_property))

Action

Multiply the values of a property of a container's elements. The product is calculated on each change of the list.

Predefined children

  • TextProperty: spec path and name of the property used for calculating the product.
  • DoubleProperty: output the sum.

Example


use core
use base
use gui

_main_
Component root {
  Frame f ("myFrame", 0, 0, 500, 500)
  Exit ex (0, 1)
  f.close -> ex
  List l {
    Rectangle r1 (0, 0, 100, 40, 0, 0)
    Rectangle r2 (0, 10, 50, 60, 0, 0)
    Rectangle r3 (0, 20, 150, 90, 0, 0)
  }
  ProductList sum (l, "height")
  TextPrinter result
  sum.output =:> result.input
}