home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / AIMP2 / aimp_2.61.583.exe / $TEMP / YandexPackSetup.msi / fil81F47E027CC9C15ECD7637F2A85DCF57 < prev    next >
Extensible Markup Language  |  2010-07-12  |  4KB  |  109 lines

  1. <?xml version="1.0"?>
  2.  
  3. <bindings xmlns="http://www.mozilla.org/xbl"
  4.           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  5.           xmlns:xbl="http://www.mozilla.org/xbl">
  6.   
  7.   <binding id="custom-arrowscrollbox-clicktoscroll">
  8.     <content>
  9.       <xul:box class="scrollbutton-arrow"
  10.                anonid="buttonup"
  11.                onclick="_dispEv(event)"
  12.                onmousedown="_dispEv(event)"
  13.                onmouseover="_dispEv(event)"
  14.                onmouseup="_dispEv(event)"
  15.                onmouseout="_dispEv(event)">
  16.         <xul:image/>
  17.       </xul:box>
  18.       
  19.       <xul:arrowscrollbox xbl:inherits="orient,align,pack,dir" flex="1"
  20.                           anonid="arrowscrollbox" clicktoscroll="true">
  21.         <children/>
  22.       </xul:arrowscrollbox>
  23.       
  24.       <xul:box class="scrollbutton-arrow"
  25.                anonid="buttondown"
  26.                onclick="_dispEv(event)"
  27.                onmousedown="_dispEv(event)"
  28.                onmouseover="_dispEv(event)"
  29.                onmouseup="_dispEv(event)"
  30.                onmouseout="_dispEv(event)">
  31.         <xul:image/>
  32.       </xul:box>
  33.     </content>
  34.     
  35.     <implementation>
  36.       <field name="mScrollbox">document.getAnonymousElementByAttribute(this, "anonid", "arrowscrollbox")</field>
  37.       <field name="mSelfbuttonup">document.getAnonymousElementByAttribute(this, "anonid", "buttonup")</field>
  38.       <field name="mSelfbuttondown">document.getAnonymousElementByAttribute(this, "anonid", "buttondown")</field>
  39.       <field name="mNativebuttonup">null</field>
  40.       <field name="mNativebuttondown">null</field>
  41.       
  42.       <constructor><![CDATA[
  43.         if (!this.mScrollbox)
  44.           return;
  45.         
  46.         this.mNativebuttonup = document.getAnonymousElementByAttribute(this.mScrollbox, "anonid", "scrollbutton-up");
  47.         this.mNativebuttondown = document.getAnonymousElementByAttribute(this.mScrollbox, "anonid", "scrollbutton-down");
  48.         
  49.         if (!this.mNativebuttonup || !this.mNativebuttondown)
  50.           return;
  51.         
  52.         var me = this;
  53.         this.mScrollbox.addEventListener("UpdatedScrollButtonsDisabledState",
  54.           function(){me.checkButtonsDisabledState()}, true
  55.         );
  56.         
  57.         this.checkButtonsDisabledState();
  58.       ]]></constructor>
  59.       
  60.       <destructor><![CDATA[
  61.         if (this.mScrollbox && this.mNativebuttonup && this.mNativebuttondown) {
  62.           var me = this;
  63.           this.mScrollbox.removeEventListener("UpdatedScrollButtonsDisabledState",
  64.             function(){me.checkButtonsDisabledState()}, true
  65.           );
  66.         }
  67.       ]]></destructor>
  68.       
  69.       <property name="scrollBoxObject" readonly="true">
  70.         <getter><![CDATA[
  71.           return this.mScrollbox.scrollBoxObject;
  72.         ]]></getter>
  73.       </property>
  74.       
  75.       <method name="scrollByPixels">
  76.         <parameter name="px"/>
  77.         <body><![CDATA[
  78.           this.mScrollbox.scrollByPixels(px);
  79.         ]]></body>
  80.       </method>
  81.       
  82.       <method name="checkButtonsDisabledState">
  83.         <body><![CDATA[
  84.           for each (var direction in ["up", "down"]) {
  85.             var nativeButton = this["mNativebutton" + direction];
  86.             this["mSelfbutton" + direction].setAttribute("disabled", nativeButton.collapsed ||
  87.                                                                      nativeButton.getAttribute("disabled"));
  88.           }
  89.         ]]></body>
  90.       </method>
  91.       
  92.       <method name="_dispEv">
  93.         <parameter name="aEvent"/>
  94.         <body><![CDATA[
  95.           var target = aEvent.target;
  96.           
  97.           if (target.localName == "image")
  98.             target = target.parentNode;
  99.           
  100.           var eventTypeAttr = "on" + aEvent.type;
  101.           
  102.           var button = this["mNative" + target.getAttribute("anonid")]
  103.           
  104.           return (button && button.hasAttribute(eventTypeAttr)) ? button[eventTypeAttr]() : false;
  105.         ]]></body>
  106.       </method>
  107.     </implementation>
  108.   </binding>
  109. </bindings>