<?xml version="1.0" encoding="UTF-8"?>
<!--
/***************************************************************************

 File Name:   windowGadgets.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://boxelyToolkit/resources/localization.dtd">



<?import href="box://boxelyToolkit/content/menuPack/menuGadgets.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="aolTitleBar" type="box">
        <attributes dragMode="window" accRole="titleBar" />
    </gadget>

    <gadget id="aolTitleBarCloseButton" inherits="#imageButton" type="control">
        <attributes accRole="pushButton" accName="Close" focusMode="ignore" tooltip="&windowControl.close;"/>
        <behavior>
            <reaction event="click" button="1" action="toolkit:Close"/>
        </behavior>
    </gadget>

    <gadget id="aolTitleBarMaxButton" inherits="#imageButton" type="control">
        <attributes accRole="pushButton" accName="Maximize" focusMode="ignore" tooltip="&windowControl.maximize;"/>
    </gadget>

    <gadget id="aolTitleBarMinButton" inherits="#imageButton" type="control">
        <attributes accRole="pushButton" accName="Minimize" focusMode="ignore" tooltip="&windowControl.minimize;"/>
    </gadget>

    <gadget id="aolTitleBarRestoreButton" inherits="#imageButton" type="control">
        <attributes accRole="pushButton" accName="Restore" focusMode="ignore" tooltip="&windowControl.restore;"/>
    </gadget>



    <gadget id="aolWindow"  type="window" language="jscript" code="box://boxelyToolkit/content/windowingPack/aolWindow.js">
        <attributes focusMode="defer" resizable="true" accRole="window" icon="#bmp.icon.default"
                    minimizable="true" maximizable="true" closable="true"/>
        <parts>
            <box:hbox id="titleGroup" inherits="active" on:mouseDown="gadget:onClickTitleBar();" on:doubleClick="gadget:onDoubleClickTitlebar();">
                <box:vbox s:vAlign="center">
                   <box:image id="titleBarIcon" inherits="src=icon,active" s:padding="0 0 0 5"
                         on:doubleClick="gadget:onDoubleClickSystemMenu();" on:mouseDown="gadget:onClickSystemMenu();" />
                </box:vbox>
                <box:vbox s:flex="1" id="windowBar">
                    <box:aolTitleBar id="titleBar"  s:flex="0" inherits="active">
                        <box:aolLabel dragMode="window" id="titleBarLabel" inherits="value=title,active" autoTooltip="none"/>
                        <box:hbox id="windowControls">
                            <box:aolTitleBarMinButton id="titleBarMin" message="minimize" inherits="active,flash,isFlashing">
                                <box:binding elementSource="_gadget" targetProperty="collapsed" path="minimizable"
                                            method="twoWay" sourceTransformer="toolkit:not" targetTransformer="toolkit:not"/>
                            </box:aolTitleBarMinButton>
                            <box:box> 
                                <box:binding elementSource="_gadget" targetProperty="collapsed" path="maximizable"
                                            method="twoWay" sourceTransformer="toolkit:not" targetTransformer="toolkit:not"/>
                                <box:aolTitleBarMaxButton id="titleBarMax" message="maximize" inherits="active,flash,isFlashing">
                                    <box:binding elementSource="_gadget" targetProperty="collapsed" path="maximized" method="twoWay"/>
                                    <box:binding elementSource="_gadget" targetProperty="hidden" path="maximized" method="twoWay"/>
                                </box:aolTitleBarMaxButton>
                                <box:aolTitleBarRestoreButton id="titleBarRestore" message="restore" inherits="active,flash,isFlashing">
                                    <box:binding elementSource="_gadget" targetProperty="collapsed" path="maximized"
                                                method="twoWay" sourceTransformer="toolkit:not" targetTransformer="toolkit:not"/>
                                    <box:binding elementSource="_gadget" targetProperty="hidden" path="maximized"
                                                method="twoWay" sourceTransformer="toolkit:not" targetTransformer="toolkit:not"/>
                                </box:aolTitleBarRestoreButton>
                            </box:box>
                            <box:aolTitleBarCloseButton id="titleBarClose" inherits="active,flash,isFlashing">
                                <box:binding elementSource="_gadget" targetProperty="collapsed" path="closable"
                                            method="twoWay" sourceTransformer="toolkit:not" targetTransformer="toolkit:not"/>
                            </box:aolTitleBarCloseButton>
                        </box:hbox>
                    </box:aolTitleBar>
                </box:vbox>
            </box:hbox>
            <box:hbox id="aolTitleBarSpacer" />
            <box:box id="windowGripTop" inherits="active"/>
            <box:hbox s:flex="1">
                <box:box id="windowGripLeft" inherits="active"/>
                <box:vbox id="aolWindowContent" inherits="$overflow=overflow,$padding=internalPadding" >
                    <box:content/>
                </box:vbox>
                <box:box id="windowGripRight" inherits="active"/>
            </box:hbox>
            <box:box id="windowGripBottom" inherits="active"/>
        </parts>
        <behavior>
            <reaction event="doubleclick" action="gadget:onDoubleClickWindow();"/>
            <reaction event="attributeSet" attributeName="accTheme" action="gadget:onAccThemeChange();"/>
        </behavior>

    </gadget>


    <gadget id="aolAppWindow" type="window" language="jscript" code="box://boxelyToolkit/content/windowingPack/aolAppWindow.js" >
        <attributes focusMode="defer" resizable="true" showMenuBarLogo="false"
                    accRole="window" largeIcon="true" icon="#bmp.icon.default"
                    minimizable="true" maximizable="true" closable="true" isFlashing="false" flash="false"/>
        <parts>
            <box:hbox >
                <box:box dragmode="window" id="largeIconBox" inherits="active,flash,isFlashing"
                        on:doubleClick="gadget:onDoubleClickSystemMenu();" on:mouseDown="gadget:onClickSystemMenu();">
                    <box:binding elementSource="_gadget" targetProperty="collapsed" path="largeIcon"
                                        method="twoWay" sourceTransformer="toolkit:not" targetTransformer="toolkit:not"/>

                    <box:image id="largeAppIcon" inherits="src=icon,active,flash,isFlashing" ornament="true">
                        <box:binding elementSource="_gadget" targetProperty="collapsed" path="largeIcon"
                                        method="twoWay" sourceTransformer="toolkit:not" targetTransformer="toolkit:not"/>
                    </box:image>
                </box:box>
                <box:box id="largeIconBoxSeparator"/>
                <box:box id="largeIconBoxSeparator2"/>
                <box:vbox id="aolTotalMenu" s:flex="1" s:right="0" inherits="active,flash,isFlashing">
                    <box:hbox id="aolTitleBarTopSpacer" collapsed="true"/>
                    <box:aolTitleBar id="titleBar" inherits="active,flash,isFlashing" on:mouseDown="gadget:onClickTitleBar();" on:doubleClick="gadget:onDoubleClickTitlebar();">
                        <box:image id="smallAppIcon" inherits="src=icon,active,flash,isFlashing">
                            <box:binding elementSource="_gadget" targetProperty="collapsed" path="largeIcon" method="twoWay"/>
                        </box:image>
                        <box:aolLabel dragMode="window" id="titleBarLabel" inherits="value=title,active,flash,isFlashing" autoTooltip="none"/>
                        <box:hbox id="windowControls">
                            <box:aolTitleBarMinButton id="titleBarMin" message="minimize" inherits="active,flash,isFlashing">
                                <box:binding elementSource="_gadget" targetProperty="collapsed" path="minimizable"
                                            method="twoWay" sourceTransformer="toolkit:not" targetTransformer="toolkit:not"/>
                            </box:aolTitleBarMinButton>
                            <box:box> 
                                <box:binding elementSource="_gadget" targetProperty="collapsed" path="maximizable"
                                            method="twoWay" sourceTransformer="toolkit:not" targetTransformer="toolkit:not"/>
                                <box:aolTitleBarMaxButton id="titleBarMax" message="maximize" inherits="active,flash,isFlashing">
                                    <box:binding elementSource="_gadget" targetProperty="collapsed" path="maximized" method="twoWay"/>
                                    <box:binding elementSource="_gadget" targetProperty="hidden" path="maximized" method="twoWay"/>
                                </box:aolTitleBarMaxButton>
                                <box:aolTitleBarRestoreButton id="titleBarRestore" message="restore" inherits="active,flash,isFlashing">
                                    <box:binding elementSource="_gadget" targetProperty="collapsed" path="maximized"
                                                method="twoWay" sourceTransformer="toolkit:not" targetTransformer="toolkit:not"/>
                                    <box:binding elementSource="_gadget" targetProperty="hidden" path="maximized"
                                                method="twoWay" sourceTransformer="toolkit:not" targetTransformer="toolkit:not"/>
                                </box:aolTitleBarRestoreButton>
                            </box:box>
                            <box:aolTitleBarCloseButton id="titleBarClose" inherits="active,flash,isFlashing">
                                <box:binding elementSource="_gadget" targetProperty="collapsed" path="closable"
                                            method="twoWay" sourceTransformer="toolkit:not" targetTransformer="toolkit:not"/>
                            </box:aolTitleBarCloseButton>
                        </box:hbox>
                    </box:aolTitleBar>
                    <box:hbox id="aolTitleBarBottomSpacer" />
                    <box:hbox id="aolTitleBarBottomSpacer2" />
                    <box:hbox id="menuBarArea">
                        <box:aolMenuBar id="__mainMenuBar" style="mainMenuBarStyle" inherits="active,flash,isFlashing,largeIcon">
                            <box:binding elementSource="_gadget" targetProperty="collapsed" path="largeIcon"
                                            method="twoWay" sourceTransformer="gadget:collapseIfNoMenuItems();"/>
                            <box:binding elementSource="_gadget" targetProperty="$colorScaleA" path="active"
                                            method="twoWay" sourceTransformer="gadget:fadeIfInactiveWindow();"/>

                        </box:aolMenuBar>
                        <box:image id="aolBrandingLogo" ornament="true">
                            <box:binding elementSource="_gadget" targetProperty="collapsed" path="showMenuBarLogo" method="oneWay" sourceTransformer="toolkit:not"/>
                        </box:image>
                    </box:hbox>
                </box:vbox>
            </box:hbox>

            <box:hbox s:flex="1" id="leftRightContainer">
                <box:binding elementSource="_gadget" targetProperty="$fill" path="$fill" method="twoWay"/>
                <box:box id="windowGripLeft" inherits="active,flash,isFlashing"/>
                <box:vbox id="aolWindowContent" inherits="active,$overflow=overflow,$padding=internalPadding,flash,isFlashing" s:flex="1">
                    <box:content/>
                </box:vbox>
                <box:box id="windowGripRight" inherits="active,flash,isFlashing"/>
            </box:hbox>
            <box:box id="windowGripBottom" inherits="active,flash,isFlashing"/>
        </parts>
        <behavior>
            <reaction event="constructed" action="gadget:initializeWindow();"/>
            <reaction event="doubleclick" action="gadget:onDoubleClickWindow();"/>
            <reaction event="attributeSet" attributeName="accTheme" action="gadget:onAccThemeChange();"/>
        </behavior>
    </gadget>



    <gadget id="aolDialog" type="window" language="jscript" code="box://boxelyToolkit/content/windowingPack/aolDialog.js" >
        <attributes focusMode="defer" resizable="false" icon="#bmp.icon.default"
                    minimizable="false" maximizable="false" closable="true" accRole="dialog"/>
        <parts>
            <box:hbox id="titleGroup" >
                <box:vbox s:vAlign="center">
                    <box:image id="titleBarIcon" inherits="src=icon" s:padding="0 0 0 5" on:doubleClick="gadget:onDoubleClickSystemMenu();" on:mouseDown="gadget:onClickSystemMenu();"/>
                </box:vbox>
                <box:vbox s:flex="1" id="windowBar">
                    <box:aolTitleBar id="titleBar" s:flex="0" on:mouseDown="gadget:onClickTitleBar();">
                        <box:aolLabel dragMode="window" id="titleBarLabel" inherits="value=title" autoTooltip="none"/>
                        <box:hbox id="windowControls">
                            <box:aolTitleBarMinButton id="titleBarMin" message="minimize" inherits="active,flash,isFlashing">
                                <box:binding elementSource="_gadget" targetProperty="collapsed" path="minimizable"
                                            method="twoWay" sourceTransformer="toolkit:not" targetTransformer="toolkit:not"/>
                            </box:aolTitleBarMinButton>
                            <box:box> 
                                <box:binding elementSource="_gadget" targetProperty="collapsed" path="maximizable"
                                            method="twoWay" sourceTransformer="toolkit:not" targetTransformer="toolkit:not"/>
                                <box:aolTitleBarMaxButton id="titleBarMax" message="maximize" inherits="active,flash,isFlashing">
                                    <box:binding elementSource="_gadget" targetProperty="collapsed" path="maximized" method="twoWay"/>
                                    <box:binding elementSource="_gadget" targetProperty="hidden" path="maximized" method="twoWay"/>
                                </box:aolTitleBarMaxButton>
                                <box:aolTitleBarRestoreButton id="titleBarRestore" message="restore" inherits="active,flash,isFlashing">
                                    <box:binding elementSource="_gadget" targetProperty="collapsed" path="maximized"
                                                method="twoWay" sourceTransformer="toolkit:not" targetTransformer="toolkit:not"/>
                                    <box:binding elementSource="_gadget" targetProperty="hidden" path="maximized"
                                                method="twoWay" sourceTransformer="toolkit:not" targetTransformer="toolkit:not"/>
                                </box:aolTitleBarRestoreButton>
                            </box:box>
                            <box:aolTitleBarCloseButton id="titleBarClose" inherits="active,flash,isFlashing">
                                <box:binding elementSource="_gadget" targetProperty="collapsed" path="closable"
                                            method="twoWay" sourceTransformer="toolkit:not" targetTransformer="toolkit:not"/>
                            </box:aolTitleBarCloseButton>
                        </box:hbox>
                    </box:aolTitleBar>
                </box:vbox>
            </box:hbox>

            <box:hbox id="aolTitleBarSpacer" />
            <box:vbox id="aolWindowContent" inherits="$overflow=overflow,$padding=internalPadding" >
                <box:content/>
            </box:vbox>
        </parts>
        <behavior inherits="box://boxelyToolkit/content/behaviors.box#dialog">
            <reaction event="doubleclick" action="gadget:onDoubleClickWindow();"/>
            <reaction event="attributeSet" attributeName="accTheme" action="gadget:onAccThemeChange();"/>
        </behavior>
    </gadget>


</library>