/** set options using the labels of the values as keys and as HTML as values
	 * @param array $values of mixed 
	 * @param string $type of value
	 * @param PntStringConverter $cnv initialized to convert the $values toLabel and toHtml
	 */
	function setOptionsFromValues($values, $type, $cnv) {
		$options = array();
		$this->optionsMaxLength = 0;
		$selectedIdInOptions = false;
		forEach($values as $value) {
			$label = $cnv->toLabel($value, $type);
			$html = $cnv->toHtml($label);
			$options[$label] = $html;
			$this->optionsMaxLength = max($this->optionsMaxLength, strLen($label));
			if ($label == $this->getSelectedId()) $selectedIdInOptions = true;
		}
		if (strLen($this->getSelectedId()) && !$selectedIdInOptions) {
			$options[$this->getSelectedId()] = $cnv->toHtml($this->getSelectedId());
		}
		$this->setOptions($options);
	}