<commit_before><?xml version="1.0" encoding="utf-8"?>
<!--
/* ***** BEGIN LICENSE BLOCK *****
 *
 * This file is part of Weave.
 *
 * The Initial Developer of Weave is the Institute for Visualization
 * and Perception Research at the University of Massachusetts Lowell.
 * Portions created by the Initial Developer are Copyright (C) 2008-2015
 * the Initial Developer. All Rights Reserved.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 * 
 * ***** END LICENSE BLOCK ***** */
-->
<ui:CustomViewStack xmlns="weave.editors.*" 
				xmlns:mx="http://www.adobe.com/2006/mxml"
				xmlns:ui="weave.ui.*"
				horizontalScrollPolicy="off"
				verticalScrollPolicy="off"
				change="handleViewIndexChange(event)"
				width="100%" height="100%">
	<mx:Canvas label="{lang('List')}">
		<mx:List id="choiceList" width="100%" height="100%"
				 allowMultipleSelection="{allowMultipleSelection}"
				 change="if (!viewChanging) if (layoutMode == LAYOUT_LIST) chosenItems = choiceList.selectedItems;"
				 backgroundAlpha="0" borderStyle="none"
				 />
	</mx:Canvas>
	<mx:Canvas label="{lang('Combo Box')}">
		<ui:CustomComboBox id="choiceCombo"
						width="100%" height="100%" minHeight="0"
						cornerRadius="0" highlightAlphas="{[0, 0]}" fillAlphas="{[0, 0]}"
						prompt="{prompt}"
						valueCommit="if (!viewChanging) if (layoutMode == LAYOUT_COMBO) if (UIUtils.hasFocus(choiceCombo)) chosenItem = choiceCombo.selectedItem;"
						change="if (alwaysShowPrompt) choiceCombo.selectedIndex = -1;"
						/>
	</mx:Canvas>
	<mx:Canvas label="{lang('Vertical Slider')}">
		<mx:VSlider id="choiceVSlider" liveDragging="true" tickInterval="1" fillAlphas="{[1, 1]}"
					width="100%" height="100%" snapInterval="1" minimum="0" minHeight="0" showDataTip="false"
					change="if (!viewChanging) if (layoutMode == LAYOUT_VSLIDER) if (UIUtils.hasFocus(choiceVSlider)) chosenItem = _choices[choiceVSlider.maximum - choiceVSlider.value];"
					mouseDown="choiceVSlider.setFocus()"
					/><!-- slider may not have focus (bar may be clicked instead of thumb) -->
	</mx:Canvas>
	<mx:Canvas label="{lang('Horizontal Slider')}">
		<mx:HBox verticalAlign="middle" width="100%" height="100%">
			<mx:HSlider id="choiceHSlider" liveDragging="true" tickInterval="1" fillAlphas="{[1, 1]}"
						width="100%" height="100%" snapInterval="1" minimum="0" minWidth="0" showDataTip="false"
						change="if (!viewChanging) if (layoutMode == LAYOUT_HSLIDER) if (UIUtils.hasFocus(choiceHSlider)) chosenItem = _choices[choiceHSlider.value];"
						mouseDown="choiceHSlider.setFocus()"
						/><!-- slider may not have focus (bar may be clicked instead of thumb) -->
		</mx:HBox>
	</mx:Canvas>
	<mx:Canvas label="{lang('Checklist')}">
		<ui:CheckBoxList id="choiceCheckBoxList"
						 paddingLeft="4" height="100%"
						 allowMultipleSelection="{allowMultipleSelection}"
						 valueCommit="if (!viewChanging) if (layoutMode == LAYOUT_CHECKBOXLIST) chosenItems = choiceCheckBoxList.selectedItems;"
						 />
	</mx:Canvas>
	<mx:Script>
		<![CDATA[
			import mx.events.IndexChangedEvent;
			
			import weave.compiler.StandardLib;
			import weave.core.UIUtils;

			public static const LAYOUT_LIST:String = "List";
			public static const LAYOUT_COMBO:String = "ComboBox";
			public static const LAYOUT_VSLIDER:String = "VSlider";
			public static const LAYOUT_HSLIDER:String = "HSlider";
			public static const LAYOUT_CHECKBOXLIST:String = "CheckBoxList";
			
			public static const LAYOUTS:Array = [LAYOUT_LIST, LAYOUT_COMBO, LAYOUT_VSLIDER, LAYOUT_HSLIDER, LAYOUT_CHECKBOXLIST];
			private static const layoutLabels:Array = [lang('List'), lang('Combo Box'), lang('Vertical Slider'), lang('Horizontal Slider'), lang('Checklist')];
			public static function layoutLabelFunction(layoutMode:String):String
			{
				return layoutLabels[LAYOUTS.indexOf(layoutMode)];
			}<commit_msg>fixed bug where clicking the list wouldn't give it focus after restoring minimized window<commit_after><?xml version="1.0" encoding="utf-8"?>
<!--
/* ***** BEGIN LICENSE BLOCK *****
 *
 * This file is part of Weave.
 *
 * The Initial Developer of Weave is the Institute for Visualization
 * and Perception Research at the University of Massachusetts Lowell.
 * Portions created by the Initial Developer are Copyright (C) 2008-2015
 * the Initial Developer. All Rights Reserved.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 * 
 * ***** END LICENSE BLOCK ***** */
-->
<ui:CustomViewStack xmlns="weave.editors.*" 
				xmlns:mx="http://www.adobe.com/2006/mxml"
				xmlns:ui="weave.ui.*"
				horizontalScrollPolicy="off"
				verticalScrollPolicy="off"
				change="handleViewIndexChange(event)"
				width="100%" height="100%">
	<mx:Canvas label="{lang('List')}">
		<mx:List id="choiceList" width="100%" height="100%"
				 allowMultipleSelection="{allowMultipleSelection}"
				 change="if (!viewChanging) if (layoutMode == LAYOUT_LIST) chosenItems = choiceList.selectedItems;"
				 backgroundAlpha="0" borderStyle="none"
				 mouseDown="choiceList.setFocus()"
				 />
	</mx:Canvas>
	<mx:Canvas label="{lang('Combo Box')}">
		<ui:CustomComboBox id="choiceCombo"
						width="100%" height="100%" minHeight="0"
						cornerRadius="0" highlightAlphas="{[0, 0]}" fillAlphas="{[0, 0]}"
						prompt="{prompt}"
						valueCommit="if (!viewChanging) if (layoutMode == LAYOUT_COMBO) if (UIUtils.hasFocus(choiceCombo)) chosenItem = choiceCombo.selectedItem;"
						change="if (alwaysShowPrompt) choiceCombo.selectedIndex = -1;"
						/>
	</mx:Canvas>
	<mx:Canvas label="{lang('Vertical Slider')}">
		<mx:VSlider id="choiceVSlider" liveDragging="true" tickInterval="1" fillAlphas="{[1, 1]}"
					width="100%" height="100%" snapInterval="1" minimum="0" minHeight="0" showDataTip="false"
					change="if (!viewChanging) if (layoutMode == LAYOUT_VSLIDER) if (UIUtils.hasFocus(choiceVSlider)) chosenItem = _choices[choiceVSlider.maximum - choiceVSlider.value];"
					mouseDown="choiceVSlider.setFocus()"
					/><!-- slider may not have focus (bar may be clicked instead of thumb) -->
	</mx:Canvas>
	<mx:Canvas label="{lang('Horizontal Slider')}">
		<mx:HBox verticalAlign="middle" width="100%" height="100%">
			<mx:HSlider id="choiceHSlider" liveDragging="true" tickInterval="1" fillAlphas="{[1, 1]}"
						width="100%" height="100%" snapInterval="1" minimum="0" minWidth="0" showDataTip="false"
						change="if (!viewChanging) if (layoutMode == LAYOUT_HSLIDER) if (UIUtils.hasFocus(choiceHSlider)) chosenItem = _choices[choiceHSlider.value];"
						mouseDown="choiceHSlider.setFocus()"
						/><!-- slider may not have focus (bar may be clicked instead of thumb) -->
		</mx:HBox>
	</mx:Canvas>
	<mx:Canvas label="{lang('Checklist')}">
		<ui:CheckBoxList id="choiceCheckBoxList"
						 paddingLeft="4" height="100%"
						 allowMultipleSelection="{allowMultipleSelection}"
						 valueCommit="if (!viewChanging) if (layoutMode == LAYOUT_CHECKBOXLIST) chosenItems = choiceCheckBoxList.selectedItems;"
						 />
	</mx:Canvas>
	<mx:Script>
		<![CDATA[
			import mx.events.IndexChangedEvent;
			
			import weave.compiler.StandardLib;
			import weave.core.UIUtils;
			
			public static const LAYOUT_LIST:String = "List";
			public static const LAYOUT_COMBO:String = "ComboBox";
			public static const LAYOUT_VSLIDER:String = "VSlider";
			public static const LAYOUT_HSLIDER:String = "HSlider";
			public static const LAYOUT_CHECKBOXLIST:String = "CheckBoxList";
			
			public static const LAYOUTS:Array = [LAYOUT_LIST, LAYOUT_COMBO, LAYOUT_VSLIDER, LAYOUT_HSLIDER, LAYOUT_CHECKBOXLIST];
			private static const layoutLabels:Array = [lang('List'), lang('Combo Box'), lang('Vertical Slider'), lang('Horizontal Slider'), lang('Checklist')];
			public static function layoutLabelFunction(layoutMode:String):String
			{
				return layoutLabels[LAYOUTS.indexOf(layoutMode)];
			}
{'fraction_non_alphanumeric': 0.15123456790123457, 'fraction_numerical': 0.01950617283950617, 'mean_word_length': 4.991863905325443, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 2, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2000772', 'n_tokens_mistral': 3022, 'n_tokens_neox': 2552, 'n_words': 604}