Alien-Web-ExtJS-V3

 view release on metacpan or  search on metacpan

share/docs/source/SplitBar.html  view on Meta::CPAN

 * <br><br>
 * Usage:
 * <pre><code>
var split = new Ext.SplitBar("elementToDrag", "elementToSize",
                   Ext.SplitBar.HORIZONTAL, Ext.SplitBar.LEFT);
split.setAdapter(new Ext.SplitBar.AbsoluteLayoutAdapter("container"));
split.minSize = 100;
split.maxSize = 600;
split.animate = true;
split.on('moved', splitterMoved);
</code></pre>
 * @constructor
 * Create a new SplitBar
 * @param {Mixed} dragElement The element to be dragged and act as the SplitBar.
 * @param {Mixed} resizingElement The element to be resized based on where the SplitBar element is dragged
 * @param {Number} orientation (optional) Either Ext.SplitBar.HORIZONTAL or Ext.SplitBar.VERTICAL. (Defaults to HORIZONTAL)
 * @param {Number} placement (optional) Either Ext.SplitBar.LEFT or Ext.SplitBar.RIGHT for horizontal or
                        Ext.SplitBar.TOP or Ext.SplitBar.BOTTOM for vertical. (By default, this is determined automatically by the initial
                        position of the SplitBar).
 */
Ext.SplitBar = function(dragElement, resizingElement, orientation, placement, existingProxy){

<span id='Ext-SplitBar-property-el'>    /** @private */
</span>    this.el = Ext.get(dragElement, true);
    this.el.unselectable();
<span id='Ext-SplitBar-property-resizingEl'>    /** @private */
</span>    this.resizingEl = Ext.get(resizingElement, true);

<span id='Ext-SplitBar-property-orientation'>    /**
</span>     * @private
     * The orientation of the split. Either Ext.SplitBar.HORIZONTAL or Ext.SplitBar.VERTICAL. (Defaults to HORIZONTAL)
     * Note: If this is changed after creating the SplitBar, the placement property must be manually updated
     * @type Number
     */
    this.orientation = orientation || Ext.SplitBar.HORIZONTAL;

<span id='Ext-SplitBar-property-tickSize'>    /**
</span>     * The increment, in pixels by which to move this SplitBar. When &lt;i&gt;undefined&lt;/i&gt;, the SplitBar moves smoothly.
     * @type Number
     * @property tickSize
     */
<span id='Ext-SplitBar-property-minSize'>    /**
</span>     * The minimum size of the resizing element. (Defaults to 0)
     * @type Number
     */
    this.minSize = 0;

<span id='Ext-SplitBar-property-maxSize'>    /**
</span>     * The maximum size of the resizing element. (Defaults to 2000)
     * @type Number
     */
    this.maxSize = 2000;

<span id='Ext-SplitBar-property-animate'>    /**
</span>     * Whether to animate the transition to the new size
     * @type Boolean
     */
    this.animate = false;

<span id='Ext-SplitBar-property-useShim'>    /**
</span>     * Whether to create a transparent shim that overlays the page when dragging, enables dragging across iframes.
     * @type Boolean
     */
    this.useShim = false;

<span id='Ext-SplitBar-property-shim'>    /** @private */
</span>    this.shim = null;

    if(!existingProxy){
<span id='Ext-SplitBar-property-proxy'>        /** @private */
</span>        this.proxy = Ext.SplitBar.createProxy(this.orientation);
    }else{
        this.proxy = Ext.get(existingProxy).dom;
    }
<span id='Ext-SplitBar-property-dd'>    /** @private */
</span>    this.dd = new Ext.dd.DDProxy(this.el.dom.id, &quot;XSplitBars&quot;, {dragElId : this.proxy.id});

<span id='Ext-SplitBar-property-b4StartDrag'>    /** @private */
</span>    this.dd.b4StartDrag = this.onStartProxyDrag.createDelegate(this);

<span id='Ext-SplitBar-property-endDrag'>    /** @private */
</span>    this.dd.endDrag = this.onEndProxyDrag.createDelegate(this);

<span id='Ext-SplitBar-property-dragSpecs'>    /** @private */
</span>    this.dragSpecs = {};

<span id='Ext-SplitBar-property-adapter'>    /**
</span>     * @private The adapter to use to positon and resize elements
     */
    this.adapter = new Ext.SplitBar.BasicLayoutAdapter();
    this.adapter.init(this);

    if(this.orientation == Ext.SplitBar.HORIZONTAL){
<span id='global-property-placement'>        /** @ignore */
</span>        this.placement = placement || (this.el.getX() &gt; this.resizingEl.getX() ? Ext.SplitBar.LEFT : Ext.SplitBar.RIGHT);
        this.el.addClass(&quot;x-splitbar-h&quot;);
    }else{
<span id='global-property-placement'>        /** @ignore */
</span>        this.placement = placement || (this.el.getY() &gt; this.resizingEl.getY() ? Ext.SplitBar.TOP : Ext.SplitBar.BOTTOM);
        this.el.addClass(&quot;x-splitbar-v&quot;);
    }

    this.addEvents(
<span id='Ext-SplitBar-event-resize'>        /**
</span>         * @event resize
         * Fires when the splitter is moved (alias for {@link #moved})
         * @param {Ext.SplitBar} this
         * @param {Number} newSize the new width or height
         */
        &quot;resize&quot;,
<span id='Ext-SplitBar-event-moved'>        /**
</span>         * @event moved
         * Fires when the splitter is moved
         * @param {Ext.SplitBar} this
         * @param {Number} newSize the new width or height
         */
        &quot;moved&quot;,
<span id='Ext-SplitBar-event-beforeresize'>        /**
</span>         * @event beforeresize
         * Fires before the splitter is dragged
         * @param {Ext.SplitBar} this



( run in 0.955 second using v1.01-cache-2.11-cpan-119454b85a5 )