PDA

View Full Version : [CLOSED] Prevent dissapears window title bar



softmachine2011
Jun 13, 2012, 1:15 PM
Hi,

In Ext.NET 1.x, to prevent dissapearing window title bar, executes this code:



Ext.onReady(function () {
Ext.override(Ext.Window.DD, {
alignElWithMouse: function (el, iPageX, iPageY) {
var oCoord = this.getTargetCoord(iPageX, iPageY);
var fly = el.dom ? el : Ext.fly(el, '_dd');
if (!this.deltaSetXY) {
var aCoord = [oCoord.x, oCoord.y];
if (oCoord.x < Millenium.Windows.WindowHideX - el.getSize().width)
oCoord.x = Millenium.Windows.WindowHideX - el.getSize().width;
if (oCoord.y < Millenium.Windows.WindowHideY)
oCoord.y = Millenium.Windows.WindowHideY;
fly.setXY(aCoord);
var newLeft = fly.getLeft(true);
var newTop = fly.getTop(true);
this.deltaSetXY = [newLeft - oCoord.x, newTop - oCoord.y];
} else {
var x = oCoord.x + this.deltaSetXY[0];
if (x < Millenium.Windows.WindowHideX - el.getSize().width)
x = Millenium.Windows.WindowHideX - el.getSize().width
var y = oCoord.y + this.deltaSetXY[1];
if (y < Millenium.Windows.WindowHideY)
y = Millenium.Windows.WindowHideY;
fly.setLeftTop(x, y);
}

this.cachePosition(oCoord.x, oCoord.y);
this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
return oCoord;
}
});
});


Which is equivalent Ext.NET 2.x?

Thanks,

Vladimir
Jun 13, 2012, 4:48 PM
Please set ConstrainHeader="true" for a window

softmachine2011
Jun 14, 2012, 2:49 PM
Please set ConstrainHeader="true" for a window

Hi Vladimir,

With ConstrainHeader="true", when you move a window down, it breaks the viewport by moving the scroll down, to try to show the entire window.

In Ext.NET 1.x, with the previous function and ConstrainHeader = "false", it was possible not to move the viewport and always keep visible the head of the window.

Is there anyway to find the equivalence alignElWithMouse function in class DD?

Thanks,

Daniil
Jun 14, 2012, 9:04 PM
With ConstrainHeader="true", when you move a window down, it breaks the viewport by moving the scroll down, to try to show the entire window.


I am unable to reproduce. How can we reproduce the behavior you described?



Is there anyway to find the equivalence alignElWithMouse function in class DD?


v2 Window uses the Ext.util.ComponentDragger class to be draggable.
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.util.ComponentDragger (http://docs.sencha.com/ext-js/4-1/#%21/api/Ext.util.ComponentDragger)

I can't see there is the alignElWithMouse function.