<?xml version="1.0" encoding="UTF-8"?>
<!--
****************************************************************************

     File Name:   inputGadgets.box

****************************************************************************
   C O P Y R I G H T   A N D   C O N F I D E N T I A L I T Y   N O T I C E
****************************************************************************

//      Copyright (c) 2006 AOL LLC.  All rights reserved.
//      This software contains valuable confidential and proprietary
//      information of AOL LLC. and is subject to applicable
//      licensing agreements.  Unauthorized reproduction, transmission or
//      distribution of this file and its contents is a violation of
//      applicable laws.
//
//            A O L   C O N F I D E N T I A L

****************************************************************************
-->


<?boxely version="1.0"?>

<!DOCTYPE window SYSTEM "box://aimToolkit/resources/localization.dtd">



<?import href="box://aimToolkit/content/listPack/listGadgets.box"?>

<library xmlns="http://www.aol.com/boxely/resource.xsd"
         xmlns:box="http://www.aol.com/boxely/box.xsd"
         xmlns:s="http://www.aol.com/boxely/style.xsd"
         xmlns:on="http://www.aol.com/boxely/reaction.xsd"
         persists="true">



    <gadget id="aolInputExpandable" type="nativeText" language="jscript" code="box://aimToolkit/content/inputPack/aolInputExpandable.js">
        <attributes  engaged="true" expandedHeight="120" hscrollable="true" expandable="true" context="_inputContext"
        multiline="true" enablerich="true" vscrollable="true" vscrollbar="true" wordwrap="true" accRole="text"/>
        <behavior inherits="box://aimToolkit/content/behaviors.box#input">
            <reaction event="boxHeightExpand" action="gadget:inputExpand();"/>
            <reaction event="boxHeightCollapse" action="gadget:inputCollapse();"/>
            <reaction event="contextMenu" action="gadget:onContextMenu();"/>
        </behavior>
    </gadget>


    <gadget id="aolMultilineInput" type="nativeText" language="jscript" code="box://aimToolkit/content/core/aolInput.js">
        <attributes multiline="true" enablerich="true" vscrollable="true" vscrollbar="true" wordwrap="true" accRole="text" context="_inputContext"/>
        <behavior inherits="box://aimToolkit/content/behaviors.box#input">
            <reaction event="contextMenu" action="gadget:onContextMenu();"/>
        </behavior>
    </gadget>


    <gadget id="aolReadonlyText" type="nativeText" language="jscript" code="box://aimToolkit/content/core/aolInput.js">
        <attributes readonly="true" accRole="text" context="_inputContext"/>
        <behavior>
            <reaction event="contextMenu" action="gadget:onContextMenu();"/>
        </behavior>
    </gadget>


    <gadget id="aolMultilineStatic" type="text">
        <attributes wordwrap="true" focusMode="ignore" engaged="false" accRole="staticText"/>
    </gadget>


    <gadget id="aolHintInput" type="box" language="jscript" code="box://aimToolkit/content/inputPack/aolHintInput.js" >
        <attributes hintText="" blockEvents="false" focusMode="defer" search="false"/>
        <parts>
            <box:hbox id="inputContainer">
                <box:aolPromptInput id="inputField" focusMode="normal" on:focus="gadget:inputFocused();" on:blur="gadget:inputBlurred();" inherits="tooltip,instantTooltip,accUseLabel,accName">
                    <box:binding elementSource="_gadget" targetProperty="value" path="value" method="twoWay"/>
                    <box:binding elementSource="_gadget" targetProperty="maxlength" path="maxlength" method="twoWay"/>
                    <box:reaction event="attributeSet" attributeName="value" action="gadget:inputAttributeSet();"/>
                </box:aolPromptInput>
                <box:aolInput id="unfocusedTextDisplay" readonly="true" ornament="true" disabled="true">
                    <box:binding elementSource="_gadget" targetProperty="value" path="hintText" method="twoWay"/>
                </box:aolInput>
            </box:hbox>
        </parts>
    </gadget>



    <gadget id="aolSearchInput" type="control" language="jscript" code="box://aimToolkit/content/inputPack/aolSearchInput.js" >
        <attributes icon="#bmp.searchInputIcon" hintText="" defaultIconSrc="#bmp.searchInputIcon"
                    hideCriteriaMenu="false" hideHistoryPopup="true" hideClearButton="false" goButtonFocusable="false" hideGoButton="true" goButtonLabel="&searchInput.goButtonLabel;" useAutoSuggest="false"
                    useIconsFromMenu="true" blockEvents="false" focusMode="defer" find="true"/>
        <parts>
            <box:box id="searchIcon">
                <box:image ornament="true" inherits="src=icon"/>
                <box:binding elementSource="_gadget" targetProperty="collapsed" path="hideCriteriaMenu" sourceTransformer="toolkit:not" method="twoWay"/>
            </box:box>
            <box:_menuBox id="searchCriteria" focusMode="ignore" on:command="gadget:criteriaMenuItemSelected();" inherits="tooltip,instantTooltip">
                <box:binding elementSource="_gadget" targetProperty="collapsed" path="hideCriteriaMenu" method="twoWay"/>
                <box:image id="icon2" ornament="true" inherits="src=icon"/>
                <box:image id="dropdown" ornament="true" src="#bmp.searchInputDropDown"/>
                <box:menuPopup id="criteriaPopup" on:popping="gadget:onCriteriaPopping();" on:shutting="gadget:onCriteriaPopupClosed();">
                    <box:content/>
                </box:menuPopup>
            </box:_menuBox>
            <box:hbox id="inputContainer">
                <box:aolPromptInput id="inputField" focusMode="normal" on:modified="gadget:inputLabelChanged();"
                                    on:focus="gadget:inputFocused();" on:blur="gadget:inputBlurred();" inherits="accName,accUseLabel,tooltip,instantTooltip,tabIndex">
                    <box:binding elementSource="_gadget" targetProperty="value" path="value" method="twoWay"/>
                    <box:binding elementSource="_gadget" targetProperty="maxlength" path="maxlength" method="twoWay"/>
                    <box:reaction event="attributeSet" attributeName="value" action="gadget:inputAttributeSet();"/>
                </box:aolPromptInput>
                <box:aolInput id="unfocusedTextDisplay" readonly="true" ornament="true" disabled="true" s:position="fixed">
                    <box:binding elementSource="_gadget" targetProperty="value" path="hintText" method="twoWay"/>
                </box:aolInput>
            </box:hbox>
            <box:aolImageButton id="clearTextButton" focusMode="ignore" icon="#bmp.searchInputClear" on:command="gadget:clearText();" tooltip="&searchInput.clearButtonLabel;">
                <box:binding elementSource="_gadget" targetProperty="collapsed" path="find" sourceTransformer="toolkit:not" method="twoWay"/>
                <box:binding elementSource="_gadget" targetProperty="collapsed" path="hideClearButton" method="twoWay"/>
            </box:aolImageButton>
            <box:box id="separator">
                <box:binding elementSource="_gadget" targetProperty="$fill" path="$stroke" method="twoWay"/>
                <box:binding elementSource="_gadget" targetProperty="collapsed" path="hideHistoryPopup" method="oneWay"/>
            </box:box>
            <box:box focusMode="defer" id="searchResults" popup="_child" inherits="disabled">
                <box:binding elementSource="_gadget" targetProperty="collapsed" path="hideHistoryPopup" method="oneWay"/>
                <box:binding elementSource="_gadget" targetProperty="ornament" path="disabled" method="oneWay"/>
                <box:box id="searchResultsDropdown" ornament="true"/>
                <box:menuPopup id="searchResultsPopup" inherits="$height=listHeight" popupAlign="none" showNoActivate="true"
                    on:popping="gadget:onSearchResultsPopping();" on:shutting="gadget:onSearchResultsPopupClosed();"
                    on:command="gadget:onSearchResultSelected();" on:popped="gadget:onSearchResultsPopped();">
                    <box:reaction event="keyPress" keyCode="UP" alt="false" action="gadget:updateInputToSelection();"/>
                    <box:reaction event="keyPress" keyCode="DOWN" alt="false" action="gadget:updateInputToSelection();"/>
                </box:menuPopup>
            </box:box>
            <box:box id="separator2">
                <box:binding elementSource="_gadget" targetProperty="$fill" path="$stroke" method="twoWay"/>
                <box:binding elementSource="_gadget" targetProperty="collapsed" path="hideGoButton" method="oneWay"/>
            </box:box>
            <box:aolButton id="goButton" popup="_child" defaultButton="true" inherits="tooltip,instantTooltip,disabled" on:command="gadget:onGoCommanded();">
                <box:binding elementSource="_gadget" targetProperty="collapsed" path="hideGoButton" method="oneWay"/>
                <box:binding elementSource="_gadget" targetProperty="ornament" path="disabled" method="oneWay"/>
                <box:binding elementSource="_gadget" targetProperty="label" path="goButtonLabel" method="oneWay"/>
                <box:binding elementSource="_gadget" targetProperty="focusMode" path="goButtonFocusable" sourceTransformer="gadget:transformFocusModeBinding();" method="oneWay"/>
                <box:image id="goButtonArrow" ornament="true"/>
            </box:aolButton>
            <box:box id="preLightLayer" ornament="true" hitMode="none" inherits="search">
                <box:binding elementSource="gadget:inputField" targetProperty="focused" path="focused" method="twoWay"/>
            </box:box>
        </parts>
        <behavior>
            <reaction event="keyPress" keyCode="DOWN" alt="true" ctrl="false" action="gadget:showSearchPopup(true);"/>
            <reaction event="keyPress" keyCode="UP" alt="true" ctrl="false" action="gadget:showSearchPopup(true);"/>
            <reaction event="keyPress" keyCode="DOWN" alt="false" ctrl="true" action="gadget:showCriteriaPopup();"/>
            <reaction event="keyPress" keyCode="ESCAPE" action="gadget:clearText();"/>
            <reaction event="keyPress" keyCode="ENTER" action="gadget:onGoCommanded();"/>
        </behavior>
    </gadget>

    <gadget id="_menuBox" type="select">
        <attributes popup="_child"/>
        <parts>
        </parts>
        <behavior inherits="box://aimToolkit/content/behaviors.box#selectable"/>
    </gadget>




    <gadget id="aolSmartInput" type="control" language="jscript" code="box://aimToolkit/content/inputPack/aolSmartInput.js" >
        <attributes hintText="" hideCustomButton="true" customButtonLabel="Custom" blockEvents="false" focusMode="defer" autoCompleteDelayMs="250"
                    smartboxSeparator="," autoSeparator="false" expandedHeight="60" enablerich="false" expandable="false" hscrollable="true"/>
        <parts>
            <box:hbox id="inputContainer">
                <box:smartBoxInput id="inputField" focusMode="normal"
                                    on:focus="gadget:inputFocused();" on:blur="gadget:inputBlurred();"
                                    inherits="accName,accUseLabel,tooltip,instantTooltip,disabled,tabIndex,hscrollable,smartboxSeparator,autoSeparator,smartBoxId,autoCompleteDelayMs,expandedHeight,enableRich,expandable,$fontSize,$textColor,$fontUnderline,$fontBold,$fontItalics">
                    <box:binding elementSource="_gadget" targetProperty="value" path="value" method="twoWay"/>
                    <box:binding elementSource="_gadget" targetProperty="maxlength" path="maxlength" method="twoWay"/>
                    <box:reaction event="attributeSet" attributeName="value" action="gadget:inputAttributeSet();"/>
                </box:smartBoxInput>
                <box:aolInput id="unfocusedTextDisplay" readonly="true" ornament="true" disabled="true" s:position="fixed">
                    <box:binding elementSource="_gadget" targetProperty="value" path="hintText" method="twoWay"/>
                </box:aolInput>
            </box:hbox>
            <box:box id="separator">
                <box:binding elementSource="_gadget" targetProperty="$fill" path="$stroke" method="twoWay"/>
                <box:binding elementSource="_gadget" targetProperty="collapsed" path="hideCustomButton" method="oneWay"/>
            </box:box>
            <box:aolButton focusMode="normal" id="customButton" popup="_child" inherits="tooltip,instantTooltip,disabled" on:command="gadget:onCustomCommand();">
                <box:binding elementSource="_gadget" targetProperty="collapsed" path="hideCustomButton" method="oneWay"/>
                <box:binding elementSource="_gadget" targetProperty="ornament" path="disabled" method="oneWay"/>
                <box:binding elementSource="_gadget" targetProperty="label" path="customButtonLabel" method="oneWay"/>
                <box:image id="goButtonArrow" ornament="true"/>
            </box:aolButton>
            <box:box id="preLightLayer" ornament="true" hitMode="none" inherits="search">
                <box:binding elementSource="gadget:inputField" targetProperty="focused" path="focused" method="twoWay"/>
            </box:box>
        </parts>
        <behavior>
            <reaction event="keyPress" keyCode="ENTER" ctrl="false" alt="false" shift="false" action="gadget:onCustomCommand();"/>
        </behavior>
    </gadget>

    <gadget id="smartBoxInput" type="nativeText" language="jscript" code="box://aimToolkit/content/inputPack/aolSmartBoxInput.js">
        <attributes engaged="true" hscrollable="true" accRole="text" smartboxSeparator="," autoSeparator="false" autoCompleteDelayMs="250"
        expandedHeight="60" enablerich="false" expandable="false" context="_inputContext"/>
        <behavior>
            <reaction event="boxDestroyed" action="gadget:boxDestroyed();"/>
            <reaction event="modified" action="gadget:onUpdate();"/>
            <reaction event="boxHeightExpand" action="gadget:inputExpand();"/>
            <reaction event="boxHeightCollapse" action="gadget:inputCollapse();"/>
            <reaction event="attributeSet" attributeName="expandable" action="gadget:onExpandableAttributeSet();"/>
            <reaction event="attributeSet" attributeName="value" action="gadget:onExpandableAttributeSet();"/>
            <reaction event="contextMenu" action="gadget:onContextMenu();"/>
        </behavior>
    </gadget>


    <gadget id="aolSmartBox" type="popup" language="jscript" code="box://aimToolkit/content/inputPack/aolSmartBox.js">
        <attributes translucent="true" blockEvents="false" showNoActivate="true" usePlainText="false"/>
        <parts>
            <box:content/>
        </parts>
        <behavior>
            <reaction event="mouseDown" action="gadget:onMouseDown();"/>
            <reaction event="keyPress" keyCode="UP" action="gadget:onSelectUp();"/>
            <reaction event="keyPress" keyCode="DOWN" action="gadget:onSelectDown();"/>
            <reaction event="keyPress" keyCode="LEFT" action="gadget:onClose();"/>
            <reaction event="keyPress" keyCode="RIGHT" action="gadget:onClose();"/>
             <reaction event="keyPress" keyCode="ENTER" action="gadget:onKeyAccept('ENTER', false);"/>
            <reaction event="keyPress" keyCode="TAB" action="gadget:onKeyAccept('TAB', false);"/>

            <reaction event="keyPress" keyCode="ESCAPE" action="gadget:onClose();"/>
            <reaction event="keyPress" keyCode="DELETE" action="gadget:onBack();"/>
            <reaction event="keyPress" keyCode="BACK" action="gadget:onBack();"/>
        </behavior>
    </gadget>


</library>