/* * * GrapeCity InputMan Library 1.0.0 * http://grapecity.com/ * * Copyright(c) GrapeCity, Inc. All rights reserved. * **/ var __extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},GCIM;(function(n){var i=function(){function t(t,i){this._autoSize=!0,this._enabled=!0,this._visible=!0,this._forbidReservedKeyBehavior=!0,this._width="",this._height="",this._foreColor="",this._backColor="",this._backgroundImageUrl="",this._cursor=n.Cursor.NotSet,this._displayStyle=n.DisplayStyle.ImageAndText,this._toolTipText="",this._fontFamily="",this._fontSize="",this._fontStyle="",this._fontWeight="",this._text="",this._textDecoration="",this._textAlign="left",this._imageUrl="",this._imageWidth=30,this._imageHeight=16,this._imagePosition=n.ImagePosition.Left,this._functionKey=n.FunctionKeys.None,typeof t!="undefined"&&typeof i!="undefined"&&(this.SetFunctionKey(t),this.SetText(i))}return t.prototype.GetAutoSize=function(){return this._autoSize},t.prototype.SetAutoSize=function(t){if(t===this._autoSize)return;this._autoSize=n.Utility.CheckBool(t),this._owner&&this._notifyOwner()},t.prototype.GetBackColor=function(){return this._backColor},t.prototype.SetBackColor=function(t){return t!==this._backColor&&(this._backColor=n.Utility.CheckColor(t),this._owner&&this._notifyOwner(!0)),this},t.prototype.GetBackgroundImageUrl=function(){return n.Utility.GetCssImageUrl(this._backgroundImageUrl)},t.prototype.SetBackgroundImageUrl=function(t){if(t===this._backgroundImageUrl)return;this._backgroundImageUrl=n.Utility.CheckCssImageUrl(t),this._owner&&this._notifyOwner(!0)},t.prototype.GetCursor=function(){return this._cursor},t.prototype.SetCursor=function(t){return t!==this._cursor&&(this._cursor=n.Utility.CheckEnum(n.Cursor,t),this._owner&&this._notifyOwner(!0)),this},t.prototype.GetDisplayStyle=function(){return this._displayStyle},t.prototype.SetDisplayStyle=function(t){if(t===this._displayStyle)return;this._displayStyle=n.Utility.CheckEnum(n.DisplayStyle,t),this._owner&&this._notifyOwner()},t.prototype.GetEnabled=function(){return this._enabled},t.prototype.SetEnabled=function(t){return t!==this._enabled&&(this._enabled=n.Utility.CheckBool(t),this._owner&&this._notifyOwner(!0)),this},t.prototype.GetFontFamily=function(){return this._fontFamily},t.prototype.SetFontFamily=function(t){if(t===this._fontFamily)return;this._fontFamily=n.Utility.CheckString(t),this._owner&&this._notifyOwner()},t.prototype.GetFontSize=function(){return this._fontSize},t.prototype.SetFontSize=function(t){if(t===this._fontSize)return;this._fontSize=n.Utility.CheckFontSizeValue(t),this._owner&&this._notifyOwner()},t.prototype.GetFontStyle=function(){return this._fontStyle},t.prototype.SetFontStyle=function(t){if(t===this._fontStyle)return;this._fontStyle=n.Utility.CheckEnum(n.FontStyle,t),this._owner&&this._notifyOwner(!0)},t.prototype.GetFontWeight=function(){return this._fontWeight},t.prototype.SetFontWeight=function(t){if(t===this._fontWeight)return;this._fontWeight=n.Utility.CheckEnum(n.FontWeight,t),this._owner&&this._notifyOwner(!0)},t.prototype.GetTextDecoration=function(){return n.Utility.GetMultipleStringEnum(this._textDecoration)},t.prototype.SetTextDecoration=function(t){t=n.Utility.CheckMultipleStringEnum(n.TextDecoration,t);if(t===this._textDecoration)return;this._textDecoration=t,this._owner&&this._notifyOwner(!0)},t.prototype.GetForbidReservedKeyBehavior=function(){return this._forbidReservedKeyBehavior},t.prototype.SetForbidReservedKeyBehavior=function(n){this._forbidReservedKeyBehavior=n},t.prototype.GetForeColor=function(){return this._foreColor},t.prototype.SetForeColor=function(t){return t!==this._foreColor&&(this._foreColor=n.Utility.CheckColor(t),this._owner&&this._notifyOwner(!0)),this},t.prototype.GetTextAlign=function(){return this._textAlign},t.prototype.SetTextAlign=function(t){return t=n.Utility.CheckEnum(n.HorizontalAlignment,t),t!=this._textAlign&&(this._textAlign=t,this._owner&&this._notifyOwner(!0)),this},t.prototype.GetFunctionKey=function(){return this.ConvertEnumKeyValueToString(n.CombinationKeyDisplayMode.Always)},t.prototype.SetFunctionKey=function(i){var r=n.FunctionKeys.None;r=typeof i=="string"?t.ConvertStringKeyToEnumValue(i):i;if(r===this._functionKey)return;this._functionKey=n.Utility.CheckInt(r),this._owner&&this._notifyOwner()},t.prototype.GetImageUrl=function(){return n.Utility.GetCssImageUrl(this._imageUrl)},t.prototype.SetImageUrl=function(t){if(t===this._imageUrl)return;this._imageUrl=n.Utility.CheckCssImageUrl(t),this._owner&&this._notifyOwner()},t.prototype.GetImageWidth=function(){return this._imageWidth},t.prototype.SetImageWidth=function(t){if(t===this._imageWidth)return;this._imageWidth=n.Utility.CheckInt(t),this._owner&&this._notifyOwner()},t.prototype.GetImageHeight=function(){return this._imageHeight},t.prototype.SetImageHeight=function(t){if(t===this._imageHeight)return;this._imageHeight=n.Utility.CheckInt(t),this._owner&&this._notifyOwner()},t.prototype.GetText=function(){return this._text},t.prototype.SetText=function(t){return t!==this._text&&(this._text=n.Utility.CheckString(t),this._owner&&this._notifyOwner()),this},t.prototype.GetImagePosition=function(){return this._imagePosition},t.prototype.SetImagePosition=function(t){if(t===this._imagePosition)return;this._imagePosition=n.Utility.CheckEnum(n.ImagePosition,t),this._owner&&this._notifyOwner()},t.prototype.GetToolTipText=function(){return this._toolTipText},t.prototype.SetToolTipText=function(t){if(t===this._toolTipText)return;this._toolTipText=n.Utility.CheckString(t),this._owner&&this._notifyOwner(!0)},t.prototype.GetVisible=function(){return this._visible},t.prototype.SetVisible=function(t){return t!==this._visible&&(this._visible=n.Utility.CheckBool(t),this._owner&&this._notifyOwner()),this},t.prototype.GetWidth=function(){return this._width},t.prototype.SetWidth=function(t){if(this.GetAutoSize()||t===this._width)return;n.Utility.CheckCSSLength(t),this._width=t,this._owner&&this._notifyOwner()},t.prototype.GetHeight=function(){return this._height},t.prototype.SetHeight=function(t){if(this.GetAutoSize()||t===this._height)return;n.Utility.CheckCSSLength(t),this._height=t,this._owner&&this._notifyOwner()},t.prototype.SetOwner=function(t){if(t!==null&&!(t instanceof n.GcFunctionKey))return;this._owner=t},t.prototype._notifyOwner=function(n){if(!this._owner)return;this._owner.FunctionKeyButtonChanged(this,n)},t.prototype._getFunctionKeyValue=function(){return this._functionKey},t.ConvertStringKeyToEnumValue=function(t){for(var f=t.toLowerCase().split(/[,+ ]/),u=0,i,r=0;r"+f+"",{Element:r,Size:new n.Size(e.Width,e.Height)}):{Element:r,Size:new n.Size(0,0)}},t.prototype._updateLayout=function(){var h=this._owner._getId(),p=document.getElementById(h+"_Outter_Container"),r=this._owner._functionKeyButtonCollection,f=0,c=0,u=this._calculateControlSize(),l,a,o,s,y,i,e;p.style.width="100%";if(this._owner.GetAutoSize()){this._outerDiv.style.width="",f=u.Height===0?32:u.Height,c=f+this._owner.GetButtonPadding().Height*2,l=this._getNotAutoSizeButtons(r);if(l.length===0)for(i=0;i0&&(this._outerDiv.style.height="")},t.prototype._updateFlatStyle=function(){this._owner.GetEnablejQueryTheme()?(this._owner.GetBackColor()===""&&(this._outerTable.style.backgroundColor=""),n.Utility.AddClass(this._outerDiv,"ui-widget-content ui-corner-all"),n.Utility.AddClass(this._outerTable,"ui-corner-all")):(this._owner.GetBackColor()===""&&(this._outerTable.style.backgroundColor=this.GetDefaultBackColor()),n.Utility.RemoveClass(this._outerDiv,"ui-widget-content"),n.Utility.RemoveClass(this._outerDiv,"ui-corner-all"),n.Utility.RemoveClass(this._outerTable,"ui-corner-all")),this._updateAllButtonStyle()},t.prototype.GetDefaultBackColor=function(){return this._owner._template===n.FunctionKeyTemplate.System?"buttonface":"#D1E6ED"},t.prototype._updateAllButtonStyle=function(){for(var i=this._owner._functionKeyButtonCollection,t,n=0;nt.BGImgWidth[i])u+=t.BGImgWidth[i];else{r=t.BGImgWidth[i];break}return{SuitedWidth:r,SumWidth:u}},t.prototype.CheckAndSetStyle=function(n,t,i,r){n.style[t]!==i?n.style[t]=i:i==""&&r!=undefined&&(n.style[t]=r)},t.prototype.SetBackColor=function(n){n==""&&(n=this.GetDefaultBackColor()),this._outerTable.style.backgroundColor=n},t.prototype.SetBackgroundImage=function(n){this._outerTable.style.backgroundImage=n},t.prototype.SetCursor=function(n){var i,t;for(this._outerTable.style.cursor=n,i=this._owner._functionKeyButtonCollection,t=0;t0&&(u.FunctionKeyButtonPosition=i[0],u.Cancel=!1,o=this._owner._functionKeyButtonCollection.GetItem(i[0])._getFunctionKeyValue(),u.FunctionKey=o!=null?o:0),e!==null&&e!==""&&e!==undefined?(r&&(this._owner.GetKeyRepeat()||(this._keyBlock=!0)),f=function(){n.Utility.FireEvent(s._owner,e,u,"keydown"),u.Cancel||n.Utility.FireEvent(s._owner,h,u,"keydown")},setTimeout(f,500)):(f=function(){n.Utility.FireEvent(s._owner,h,u,"keydown")},setTimeout(f,500))},t.prototype._showFunctionKeyButtons=function(t,i){var f,u,r;this._owner.GetEnabled()&&this._owner.GetCombinationKeyDisplayMode()===n.CombinationKeyDisplayMode.Dynamic&&(f=this._parKeyCode(t),f!=-1?(u=this._getParKeyPosition(t,i),r=this._getRealPositionArray(u),this._showFunctionKeyButtonsRender(r)):(t.ctrlKey==!0&&t.keyCode==80||t.keyCode==44&&t.altKey==!0)&&this._reset(t))},t.prototype._getParKeyPosition=function(n,t){var i=this._parKeyCode(n);return this._parKeyIsMaxPart(i,t)},t.prototype._getRealPositionArray=function(n){var u=this._owner._functionKeyButtonCollection,t;if(u==null)return n;for(var o=u.GetCount(),s=n.length,e=[],r=0,i=0,f=0;r