//Aurigma Graphics Mill for .NET
//Copyright 2004-2006 Aurigma Inc.
//Version 3.5.0.0
function UserInputController(){
this._bitmapViewer=null;
this._getHidden=function(name){
return document.getElementsByName("__"+this.id+"_"+name)[0];
}
this.connect=function(id){
this._bitmapViewer=document.getElementById(id);
var sa=this._bitmapViewer.__scrollableArea;
}
this.disconnect=function(){
if(this._bitmapViewer){this._bitmapViewer.setCursor("default");}
this._bitmapViewer=null;
}
}
function ZoomNavigator(){
this._base=UserInputController;this._base();
this.__scrollableAreaClick=function(e){
var c=this._bitmapViewer.getOffsetPoint(e);
var w=__parseInt(this._bitmapViewer.style.width),h=__parseInt(this._bitmapViewer.style.height);
c.x=Math.round(c.x*this._zoomK-w/2);
c.y=Math.round(c.y*this._zoomK-h/2);
this._bitmapViewer.setScrollingPosition(c);
this._bitmapViewer.setZoom(this._bitmapViewer.getZoom()*this._zoomK);
}
this._baseConnect=this.connect;
this.connect=function(id){
this._baseConnect(id);
var bv=this._bitmapViewer;
bv.setCursor(this._cursor);
bv.addClick(this.__scrollableAreaClick,this);
}
this._baseDisconnect=this.disconnect;
this.disconnect=function(){
if(this._bitmapViewer){
this._bitmapViewer.removeClick(this.__scrollableAreaClick,this);
}
this._baseDisconnect();
}
}
function ZoomInNavigator(){
this.__base=ZoomNavigator;this.__base();
this._zoomK=1.5;
this._cursor="zoomin";
}
function initZoomInNavigator(id){
var r=document.getElementById(id);r._ctor=ZoomInNavigator;r._ctor();
}
function ZoomOutNavigator(){
this.__base=ZoomNavigator;this.__base();
this._zoomK=0.667;
this._cursor="zoomout";
}
function initZoomOutNavigator(id){
var r=document.getElementById(id);r._ctor=ZoomOutNavigator;r._ctor();
}
function PanNavigator(){
this._base=UserInputController;this._base();
this._panned=false;
this.__bvMouseDown=function(e){
this._prevPoint=this._getScreenPoint(e);
this._panned=true;
}
this.__bvMouseMove=function(e){
var point=this._getScreenPoint(e);
if(this._panned){
var sp=this._bitmapViewer.getScrollingPosition();
sp.x=sp.x+this._prevPoint.x-point.x;
sp.y=sp.y+this._prevPoint.y-point.y;
this._bitmapViewer.setScrollingPosition(sp);
}
this._prevPoint=point;
}
this.__bvMouseUp=function(e){
this._panned=false;
}
this._getScreenPoint=function (e){
e=e?e:window.event;
return new Point(e.screenX,e.screenY);
}
this._baseConnect=this.connect;
this.connect=function(id){
this._baseConnect(id);
var bv=this._bitmapViewer;
bv.setCursor("pan");
bv.addMouseDown(this.__bvMouseDown,this);
bv.addMouseMove(this.__bvMouseMove,this);
bv.addMouseUp(this.__bvMouseUp,this);
}
this._baseDisconnect=this.disconnect;
this.disconnect=function(){
if(this._bitmapViewer){
var bv=this._bitmapViewer;
bv.removeMouseDown(this.__bvMouseDown,this);
bv.removeMouseMove(this.__bvMouseMove,this);
bv.removeMouseUp(this.__bvMouseUp,this);
}
this._baseDisconnect();
}
}
function initPanNavigator(id){
var r=document.getElementById(id);r._ctor=PanNavigator;r._ctor();
}
function RectangleController(OutlineColorId,OutlineStyleId,OutlineWidthId){
this._base=UserInputController;this._base();
this._events=new Events(this);
this._erase=function(){
this._setRectangle(new Rectangle(0,0,-1,-1));
}
this._createRect=function(width,height,color){
var d=document.createElement("div");
var s=d.style;
if(color!=null){
s.backgroundColor=color;
}
s.position="absolute";
s.zIndex=1000;
s.width=width+"px";
s.height=height+"px";
var i=d.appendChild(document.createElement("img"));
i.src=__gmResources.getUrl("spacer.gif");
i.width=i.height=1;
d.ondrag=i.ondrag=function(){return false};
i.galleryImg="no";
d.unselectable=i.unselectable="on";
return d;
}
this._createGrip=function(d){
var s=this._getGripSize();
g=this._createRect(s,s,this.getOutlineColor());
g.style.display=d?"block":"none";
return g;
}
this._createMask=function(){
var m=document.createElement("div");
var st=m.style;
st.position="absolute";st.zIndex=999;
st.backgroundImage="url("+__gmResources.getUrl("mask0.gif")+")";
var i=m.appendChild(document.createElement("img"));
i.src=__gmResources.getUrl("spacer.gif");
i.width=i.height=1;
m.ondrag=i.ondrag=function(){return false};
i.galleryImg="no";
m.unselectable=i.unselectable="on";
return m;
}
this._update=function(full){
if(!this._bitmapViewer)
{
return;
}
var sr=this._getRectangle();
var rm=this._getResizeMode();
var gv=this._getGripsVisible();
var ne=sr.width>=0&&sr.height>=0;
var d=ne?"block":"none";
this._rect.style.display=d;
if(full&&!this._draggedControl){
d=ne&&gv&&(rm!="None")?"block":"none";
this._tlGrip.style.display=this._trGrip.style.display=this._blGrip.style.display=this._brGrip.style.display=d;
d=ne&&gv&&rm=="Arbitrary"?"block":"none";
this._lGrip.style.display=this._rGrip.style.display=this._tGrip.style.display=this._bGrip.style.display=d;
d=ne&&this._getMaskVisible()?"block":"none";
this._tMask.style.display=this._bMask.style.display=this._lMask.style.display=this._rMask.style.display=d;
}
if(!ne){return;}
var tlC=this._bitmapViewer.bitmapToControlPoint(new Point(sr.left,sr.top));
var brC=this._bitmapViewer.bitmapToControlPoint(new Point(sr.left+sr.width,sr.top+sr.height));
var minC=this._bitmapViewer.bitmapToControlPoint(new Point(0,0));
var maxC=this._bitmapViewer.bitmapToControlPoint(new Point(this._bitmapViewer.bitmap.getWidth(),this._bitmapViewer.bitmap.getHeight()));
var ow=this.getOutlineWidth();
var bw=__browser.isCSS1Compat?ow*2:0;
var st=this._rect.style;
if(brC.x-tlC.x<=ow*2||brC.y-tlC.y<=ow*2){
st.display="none";
}
else{
st.display="block";
st.left=tlC.x+"px";
st.top=tlC.y+"px";
st.width=Math.max(brC.x-tlC.x-bw,0)+"px";
st.height=Math.max(brC.y-tlC.y-bw,0)+"px";
}
if(full){
if(gv){
var gs=this._getGripSize(),gs2=Math.round(gs/2);
var go=Math.max(Math.floor((gs-ow)/2),0);
var tlGX=tlC.x-go,tlGW=tlGX<0?gs+tlGX:gs;tlGX=Math.max(tlGX,0);
var tlGY=tlC.y-go,tlGH=tlGY<0?gs+tlGY:gs;tlGY=Math.max(tlGY,0);
var brGX=brC.x-gs+go,brGW=brGX+gs>maxC.x?maxC.x-brGX:gs;
var brGY=brC.y-gs+go,brGH=brGY+gs>maxC.y?maxC.y-brGY:gs;
var cc=new Point(Math.round((tlC.x+brC.x)/2),Math.round((tlC.y+brC.y)/2));
var tls=this._tlGrip.style,trs=this._trGrip.style,bls=this._blGrip.style,brs=this._brGrip.style;
var ls=this._lGrip.style,rs=this._rGrip.style,ts=this._tGrip.style,bs=this._bGrip.style;
tls.left=bls.left=ls.left=tlGX+"px";
tls.top=trs.top=ts.top=tlGY+"px";
tls.width=bls.width=ls.width=tlGW+"px";
tls.height=trs.height=ts.height=tlGH+"px";
brs.left=trs.left=rs.left=brGX+"px";
brs.top=bls.top=bs.top=brGY+"px";
brs.width=trs.width=rs.width=brGW+"px";
brs.height=bls.height=bs.height=brGH+"px";
rs.top=ls.top=(cc.y-gs2)+"px";
bs.left=ts.left=(cc.x-gs2)+"px";
ls.height=rs.height=ts.width=bs.width=gs+"px";
}
if(this._getMaskVisible()){
var ts=this._tMask.style,bs=this._bMask.style,ls=this._lMask.style,rs=this._rMask.style;
ts.display=tlC.y>0?"block":"none";
bs.display=maxC.y>brC.y?"block":"none";
ls.display=tlC.x>0?"block":"none";
rs.display=maxC.x>brC.x?"block":"none";
ts.left=bs.left=ls.left=ts.top="0px";
ts.width=bs.width=maxC.x+"px";
ts.height=tlC.y+"px";
bs.top=brC.y+"px";
bs.height=(maxC.y-brC.y)+"px";
ls.top=rs.top=tlC.y+"px";
ls.width=tlC.x+"px";
ls.height=rs.height=(brC.y-tlC.y)+"px";
rs.left=brC.x+"px";
rs.width=(maxC.x-brC.x)+"px";
bs.backgroundImage="url("+__gmResources.getUrl("mask"+(brC.y%2)+".gif")+")";
ls.backgroundImage="url("+__gmResources.getUrl("mask"+(tlC.y%2)+".gif")+")";
rs.backgroundImage="url("+__gmResources.getUrl("mask"+((tlC.y+brC.x)%2)+".gif")+")";
}
}
}
this._draggedControl=this._prevOffset=null;
this._handleInput=true;
this.__bvMouseDown=function(e){
if (!this._handleInput){
return;
}
this._startOffset=this._bitmapViewer.getOffsetPoint(e);
this._draggedControl=this._hitTest(this._startOffset);
if(this._getErasable()&&!this._draggedControl){
this._bitmapViewer.setCursor("crosshair");
this._draggedControl="BR";
var zoom=this._bitmapViewer.getZoom();
this._startRectangle=new Rectangle(Math.round(this._startOffset.x/zoom),Math.round(this._startOffset.y/zoom),0,0);
this._update(false);
}
else{
this._changeCursor(this._draggedControl);
var r=this._getRectangle();
switch (this._draggedControl){
case "TL":
r.top=r.top+r.height;r.height=-r.height;r.left=r.left+r.width;r.width=-r.width;
break;
case "T": case "TR":
r.top=r.top+r.height;r.height=-r.height;
break;
case "L": case "BL":
r.left=r.left+r.width;r.width=-r.width;
}
this._startRectangle=r;
}
this._bitmapViewer.__scrollableArea.setCapture();
}
this.__bvMouseMove=function(e){
if (!this._handleInput){
return;
}
var offset=this._bitmapViewer.getOffsetPoint(e);
if(this._draggedControl){
if(this._getMaskVisible()){this._tMask.style.display=this._bMask.style.display=this._lMask.style.display=this._rMask.style.display="none";}
if(this._getGripsVisible()){this._tlGrip.style.display=this._trGrip.style.display=this._blGrip.style.display=this._brGrip.style.display=this._lGrip.style.display=this._rGrip.style.display=this._tGrip.style.display=this._bGrip.style.display="none";}
var sr=this._startRectangle.clone();
var zoom=this._bitmapViewer.getZoom();
var b=this._bitmapViewer.bitmap;
var bw=b.getWidth(),bh=b.getHeight();
if(this._draggedControl=="inside"){
sr.left=Math.min(Math.max(sr.left+=Math.round((offset.x-this._startOffset.x)/zoom),0),bw-sr.width);
sr.top=Math.min(Math.max(sr.top+=Math.round((offset.y-this._startOffset.y)/zoom),0),bh-sr.height);
}
else{
function sign(v){
if(v>0){return 1;}else{return -1;}}
var dx=Math.round(offset.x/zoom)-sr.left,dy=Math.round(offset.y/zoom)-sr.top;
var r=this._getRatio();
var p=(this._getResizeMode()=="Proportional");
var pdy=p?Math.abs(Math.round(dx*r))*sign(dy):dy;
switch (this._draggedControl){
case "TL": case "TR": case "BL": case "BR":
sr.width=dx;sr.height=pdy;
break;
case "T": case "B":
sr.height=pdy;
break;
case "L": case "R":
sr.width=dx;
}
var c1=sr.left+sr.width>bw;
var c2=sr.left+sr.width<0;
if(c1){
sr.width=bw-sr.left;
}
if(c2){
sr.width=-sr.left;
}
if((c1||c2)&&p){
sr.height=Math.abs(Math.round(sr.width*r))*sign(sr.height);
}
c1=sr.top+sr.height>bh;
c2=sr.top+sr.height<0;
if(c1){
sr.height=bh-sr.top;
}
if(c2){
sr.height=-sr.top;
}
if((c1||c2)&&p){
sr.width=Math.abs(Math.round(sr.height/r))*sign(sr.width);
}
if(sr.width<0){
sr.left+=sr.width;
sr.width=-sr.width;
}
if(sr.height<0){
sr.top+=sr.height;
sr.height=-sr.height;
}
}
this._setRectangle(sr);
this._events.raiseEvent("RectangleChanging");
this._update(false);
}
else{
var control=this._hitTest(this._bitmapViewer.getOffsetPoint(e));
this._changeCursor(control);
}
this._prevOffset=offset;
}
this._hitTest=function(offset){
var rm=this._getResizeMode();
var r=this._getRectangle();
var gs=this._getGripSize(),gs2=Math.round(gs/2);
var tlB=new Point(r.left,r.top),brB=new Point(r.left+r.width,r.top+r.height);
var tlC=this._bitmapViewer.bitmapToControlPoint(tlB),brC=this._bitmapViewer.bitmapToControlPoint(brB);
var e1=offset.x>=tlC.x,e2=offset.x<=brC.x,e3=offset.y>=tlC.y,e4=offset.y<=brC.y;
if(rm!="None"){
var c1=offset.x>=tlC.x-gs2,c2=offset.x<=tlC.x+gs2,c3=offset.y>=tlC.y-gs2,c4=offset.y<=tlC.y+gs2;
if(c1&&c2&&c3&&c4) return "TL";
var c5=offset.x>=brC.x-gs2,c6=offset.x<=brC.x+gs2;
if(c5&&c6&&c3&&c4) return "TR";
var c7=offset.y>=brC.y-gs2,c8=offset.y<=brC.y+gs2;
if(c1&&c2&&c7&&c8) return "BL";
if(c5&&c6&&c7&&c8) return "BR";
if(rm=="Arbitrary"){
if(this._getGripsVisible()){
var cc=new Point(Math.round((tlC.x+brC.x)/2),Math.round((tlC.y+brC.y)/2));
var d1=offset.x>=cc.x-gs2,d2=offset.x<=cc.x+gs2;
if(d1&&d2&&c3&&c4) return "T";
if(d1&&d2&&c7&&c8) return "B";
var d3=offset.y>=cc.y-gs2,d4=offset.y<=cc.y+gs2;
if(c1&&c2&&d3&&d4) return "L";
if(c5&&c6&&d3&&d4) return "R";
}
else{
if(e1&&e2&&c3&&c4) return "T";
if(e1&&e2&&c7&&c8) return "B";
if(c1&&c2&&e3&&e4) return "L";
if(c5&&c6&&e3&&e4) return "R";
}
}
}
if(this._getMovable()&&e1&&e2&&e3&&e4){return "inside";}
return null;
}
this._cursors={"TL":"nw-resize","TR":"ne-resize","BL":"sw-resize","BR":"se-resize","T":"n-resize","B":"s-resize","L":"w-resize","R":"e-resize","inside":"move"};
this._changeCursor=function(control){
var c=this._cursors[control];
if(c==undefined){c="default";}
this._bitmapViewer.setCursor(c);
}
this.__bvZoomed=function(){this._update(true);}
this.__bvBitmapChanged=function(){
var sr=this._getRectangle();
if(sr.width>=0&&sr.height>=0){
var b=this._bitmapViewer.bitmap;
var bw=b.getWidth();
var bh=b.getHeight();
if (sr.left>=bw||sr.top>=bh){
this._erase();
}
else{
sr.width=Math.min(bw-sr.left,sr.width);
sr.height=Math.min(bh-sr.top,sr.height);
this._setRectangle(sr);
}
}
else{
this._erase();
}
this._update(true);
}
this._outlineColor=this._getHidden("OutlineColor");
this.setOutlineColor=function(value){
this._outlineColor.value=value;
if(this._bitmapViewer){
this._tlGrip.style.backgroundColor=this._trGrip.style.backgroundColor=this._blGrip.style.backgroundColor=this._brGrip.style.backgroundColor=this._lGrip.style.backgroundColor=this._rGrip.style.backgroundColor=this._tGrip.style.backgroundColor=this._bGrip.style.backgroundColor=this._rect.style.borderColor=value;
}
}
this.getOutlineColor=function(){
return this._outlineColor.value;
}
this._outineStyle=this._getHidden("OutlineStyle");
this.setOutlineStyle=function(value){
this._outineStyle.value=value;
if(this._bitmapViewer){
this._rect.style.borderStyle=this.getOutlineStyle();
}
}
this.getOutlineStyle=function(){
return this._outineStyle.value;
}
this._outineWidth=this._getHidden("OutlineWidth");
this.setOutlineWidth=function(value){
this._outineWidth.value=value;
if(this._bitmapViewer){
this._rect.style.borderWidth=this.getOutlineWidth()+"px";
this._update(true);
}
}
this.getOutlineWidth=function(){
return this._outineWidth.value*1;
}
this._baseConnect=this.connect;
this.connect=function(id){
this._baseConnect(id);
var bv=this._bitmapViewer;
var a=bv.__scrollableArea;
a.appendChild(this._tMask=this._createMask());
a.appendChild(this._bMask=this._createMask());
a.appendChild(this._lMask=this._createMask());
a.appendChild(this._rMask=this._createMask());
this._rect=this._createRect(1,1,null);
this._rect.style.borderWidth=this.getOutlineWidth()+"px";
this._rect.style.borderStyle=this.getOutlineStyle();
this._rect.style.borderColor=this.getOutlineColor();
a.appendChild(this._rect);
var rm=this._getResizeMode();
var d=(rm!="None"&&this._getGripsVisible());
a.appendChild(this._tlGrip=this._createGrip(d));
a.appendChild(this._trGrip=this._createGrip(d));
a.appendChild(this._blGrip=this._createGrip(d));
a.appendChild(this._brGrip=this._createGrip(d));
var d=(rm=="Arbitrary"&&this._getGripsVisible());
a.appendChild(this._lGrip=this._createGrip(d));
a.appendChild(this._rGrip=this._createGrip(d));
a.appendChild(this._tGrip=this._createGrip(d));
a.appendChild(this._bGrip=this._createGrip(d));
this._update(true);
bv.addMouseDown(this.__bvMouseDown,this);
bv.addMouseMove(this.__bvMouseMove,this);
bv.addMouseUp(this.__bvMouseUp,this);
bv.addZoomed(this.__bvZoomed, this);
bv.addBitmapChanged(this.__bvBitmapChanged, this);
}
this._baseDisconnect=this.disconnect;
this.disconnect=function(){
if(this._bitmapViewer){
var bv=this._bitmapViewer;
var a=bv.__scrollableArea;
a.removeChild(this._tMask);
a.removeChild(this._bMask);
a.removeChild(this._lMask);
a.removeChild(this._rMask);
this._tMask=this._bMask=this._lMask=this._rMask=null;
a.removeChild(this._rect);
this._rect=null;
a.removeChild(this._tlGrip);
a.removeChild(this._trGrip);
a.removeChild(this._blGrip);
a.removeChild(this._brGrip);
a.removeChild(this._lGrip);
a.removeChild(this._rGrip);
a.removeChild(this._tGrip);
a.removeChild(this._bGrip);
this._tlGrip=this._trGrip=this._blGrip=this._brGrip=this._lGrip=this._rGrip=this._tGrip=this._bGrip=null;
bv.removeMouseDown(this.__bvMouseDown,this);
bv.removeMouseMove(this.__bvMouseMove,this);
bv.removeMouseUp(this.__bvMouseUp,this);
bv.removeZoomed(this.__bvZoomed, this);
bv.removeBitmapChanged(this.__bvBitmapChanged, this);
}
this._baseDisconnect();
}
}
function RectangleRubberband(rectangleChangedPostBack){
this.__base=RectangleController;this.__base();
this._rectangleChangedPostBack=rectangleChangedPostBack;
this._rectangleChanged=this._getHidden("RectangleChanged");
this._autoPostBack=this._getHidden("AutoPostBack");
this._setAutoPostBack=function(v){
this._autoPostBack.value=v;
}
this._getAutoPostBack=function(){
return this._autoPostBack.value=="true";
}
this._erasable=this._getHidden("Erasable");
this._setErasable=function(v){
this._erasable.value=v;
}
this._getErasable=function(){
return this._erasable.value=="true";
}
this._gripSize=this._getHidden("GripSize");
this._setGripSize=function(v){
this._gripSize.value=v;
}
this._getGripSize=function(){
return this._gripSize.value*1;
}
this._gripsVisible=this._getHidden("GripsVisible");
this._setGripsVisible=function(v){
this._gripsVisible.value=v;
}
this._getGripsVisible=function(){
return this._gripsVisible.value=="true";
}
this._maskVisible=this._getHidden("MaskVisible");
this._setMaskVisible=function(v){
this._maskVisible.value=v;
}
this._getMaskVisible=function(){
return this._maskVisible.value=="true";
}
this._movable=this._getHidden("Movable");
this._setMovable=function(v){
this._movable.value=v;
}
this._getMovable=function(){
return this._movable.value=="true";
}
this._ratio=this._getHidden("Ratio");
this._setRatio=function(v){
this._ratio.value=v;
}
this._getRatio=function(){
return this._ratio.value*1;
}
this._rectangle=this._getHidden("Rectangle");
this._setRectangle=function(v){
this._rectangle.value=v.left+";"+v.top+";"+v.width+";"+v.height;
}
this._getRectangle=function(){
var r=this._rectangle.value.split(";");
return new Rectangle(r[0]*1,r[1]*1,r[2]*1,r[3]*1);
}
this._resizeMode=this._getHidden("ResizeMode");
this._setResizeMode=function(v){
this._resizeMode.value=v;
}
this._getResizeMode=function(){
return this._resizeMode.value;
}
this.__bvMouseUp=function(e){
if (!this._handleInput){
return;
}
this._draggedControl=null;
var control=this._hitTest(this._bitmapViewer.getOffsetPoint(e));
this._changeCursor(control);
this._events.raiseEvent("RectangleChanged");
this._update(true);
this._bitmapViewer.__scrollableArea.releaseCapture();
if (this._getAutoPostBack()){
this._rectangleChangedPostBack();
}
else{
this._rectangleChanged.value="true";
}
}
this.setAutoPostBack=this._setAutoPostBack;
this.getAutoPostBack=this._getAutoPostBack;
this.setErasable=this._setErasable;
this.getErasable=this._getErasable;
this.setGripSize=function(v){
this._setGripSize(v);
this._update(true);
}
this.getGripSize=this._getGripSize;
this.setGripsVisible=function(v){
this._setGripsVisible(v);
this._update(true);
}
this.getGripsVisible=this._getGripsVisible;
this.setMaskVisible=function(v){
this._setMaskVisible(v);
this._update(true);
}
this.getMaskVisible=this._getMaskVisible;
this.setMovable=this._setMovable;
this.getMovable=this._getMovable;
this.setRatio=this._setRatio;
this.getRatio=this._getRatio;
this.setRectangle=function(v){
this._setRectangle(v);
this._update(true);
}
this.getRectangle=this._getRectangle;
this.setResizeMode=function(v){
this._setResizeMode(v);
this._update(true);
}
this.getResizeMode=this._getResizeMode;
this.__baseConnect=this.connect;
this.connect=function(id){
this.__baseConnect(id);
this.update();
}
this.erase=function(){
if(this._getErasable()){
this._erase();
this._update(true);
}
}
this.update=function(){
this._handleInput=(this._bitmapViewer.getNavigator()=="");
}
this.addRectangleChanged=function(h,d){
this._events.addHandler("RectangleChanged",h,d);
}
this.removeRectangleChanged=function(h,d){
this._events.removeHandler("RectangleChanged",h,d);
}
this.addRectangleChanging=function(h,d){
this._events.addHandler("RectangleChanging",h,d);
}
this.removeRectangleChanging=function(h,d){
this._events.removeHandler("RectangleChanging",h,d);
}
}
function initRectangleRubberband(id,rectangleChangedPostBack){
var r=document.getElementById(id);r._ctor=RectangleRubberband;r._ctor(rectangleChangedPostBack);
}
function ZoomRectangleNavigator(){
this.__base=RectangleController;this.__base();
this._getAutoPostBack=function(){
return false;
}
this._getErasable=function(){
return true;
}
this._getGripSize=function(){
return 0;
}
this._getGripsVisible=function(){
return false;
}
this._getMaskVisible=function(){
return false;
}
this._getMovable=function(){
return false;
}
this._ratio=1;
this._setRatio=function(v){
this._ratio=v
}
this._getRatio=function(){
return this._ratio;
}
this._rectangle=new Rectangle(0,0,-1,-1);
this._setRectangle=function(v){
this._rectangle=v.clone();
}
this._getRectangle=function(){
return this._rectangle.clone();
}
this._getResizeMode=function(){
return "Proportional";
}
this.__bvMouseUp=function(e){
this._draggedControl=null;
this._bitmapViewer.setCursor("default");
var r=this._getRectangle();
this._erase();
this._update(true);
var w=__parseInt(this._bitmapViewer.style.width);
var z=this._bitmapViewer.getZoom();var newZ=w/r.width;
this._bitmapViewer.setZoom(newZ);
this._bitmapViewer.setScrollingPosition(new Point(Math.round(r.left*newZ), Math.round(r.top*newZ)));
this._bitmapViewer.__scrollableArea.releaseCapture();
}
this.__baseConnect=this.connect;
this.connect=function(id){
this.__baseConnect(id);
this._ratio=__parseInt(this._bitmapViewer.style.height)/__parseInt(this._bitmapViewer.style.width);
}
}
function initZoomRectangleNavigator(id){
var r=document.getElementById(id);r._ctor=ZoomRectangleNavigator;r._ctor();
}
