📄 globalfuncs.as
字号:
} } }public function setStringValue(whichStyle:String, whatValue:String, whichItem:String):void { if (whatValue == 'default') { this['my' + whichItem].clearStyle(whichStyle); if (whichItem == 'radioButton' || whichItem == 'checkBox') { this['my' + whichItem + "1"].clearStyle(whichStyle); this['my' + whichItem + "2"].clearStyle(whichStyle); } } else if (whichItem == 'toolTip') { StyleManager.getStyleDeclaration("ToolTip").setStyle(whichStyle, whatValue); } else if (whichItem == 'dropDown') { StyleManager.getStyleDeclaration(".DropDownStyles").setStyle(whichStyle, whatValue); } else if (whichItem == 'tab') { StyleManager.getStyleDeclaration(".StyledTabs").setStyle(whichStyle, whatValue); } else if (whichItem == 'selectedTab') { StyleManager.getStyleDeclaration(".SelectedStyledTabs").setStyle(whichStyle, whatValue); } else { if (whichStyle == 'headerfontFamily' && whichItem == 'dataGrid') { StyleManager.getStyleDeclaration(".DGHeaderStyle").setStyle('fontFamily', whatValue); } else if (whichStyle == 'headerfontSize' && whichItem == 'dataGrid') { StyleManager.getStyleDeclaration(".DGHeaderStyle").setStyle('fontSize', whatValue); } else if (whichStyle == 'headerfontFamily' && whichItem == 'dataGrid') { StyleManager.getStyleDeclaration(".DGHeaderStyle").setStyle('fontFamily', whatValue); } else if (whichStyle == 'headerfontSize' && whichItem == 'dataGrid') { StyleManager.getStyleDeclaration(".DGHeaderStyle").setStyle('fontSize', whatValue); } if (whichStyle == 'headerfontFamily' && whichItem == 'dateChooser') { StyleManager.getStyleDeclaration(".HeaderStyle").setStyle('fontFamily', whatValue); } else if (whichStyle == 'headerfontSize' && whichItem == 'dateChooser') { StyleManager.getStyleDeclaration(".HeaderStyle").setStyle('fontSize', whatValue); } else if (whichStyle == 'headerfontFamily' && whichItem == 'dateChooser') { StyleManager.getStyleDeclaration(".HeaderStyle").setStyle('fontFamily', whatValue); } else if (whichStyle == 'headerfontSize' && whichItem == 'dateChooser') { StyleManager.getStyleDeclaration(".HeaderStyle").setStyle('fontSize', whatValue); } else if (whichStyle == 'todayfontFamily') { StyleManager.getStyleDeclaration(".myTodayStyleName").setStyle('fontFamily', whatValue); } else if (whichStyle == 'todayfontSize') { StyleManager.getStyleDeclaration(".myTodayStyleName").setStyle('fontSize', whatValue); } else if (whichStyle == 'weekDayfontFamily') { StyleManager.getStyleDeclaration(".myWeekDayStyleName").setStyle('fontFamily', whatValue); } else if (whichStyle == 'weekDayfontSize') { StyleManager.getStyleDeclaration(".myWeekDayStyleName").setStyle('fontSize', whatValue); } else if (whichStyle == 'selectedfontFamily') { StyleManager.getStyleDeclaration(".mySelectedButtonStyle").setStyle('fontFamily', whatValue); } else if (whichStyle == 'selectedfontSize') { StyleManager.getStyleDeclaration(".mySelectedButtonStyle").setStyle('fontSize', whatValue); } else { this['my' + whichItem].setStyle(whichStyle, whatValue); if (whichItem == 'radioButton' || whichItem == 'checkBox') { this['my' + whichItem + "1"].setStyle(whichStyle, whatValue); this['my' + whichItem + "2"].setStyle(whichStyle, whatValue); } } } setCSS(whichStyle, 0, whatValue, whichItem);}public function setArrayValue (whichStyle:String, whatValue:Array, whatType:String, whichItem:String):void { if (whichItem == 'tab') { StyleManager.getStyleDeclaration(".StyledTabs").setStyle(whichStyle, whatValue); } else if (whichItem == 'selectedTab') { StyleManager.getStyleDeclaration(".SelectedStyledTabs").setStyle(whichStyle, whatValue); } else if (whichItem == 'application') { StyleManager.getStyleDeclaration("Application").setStyle(whichStyle, whatValue); } else { this['my' + whichItem].setStyle(whichStyle, whatValue); } if (whichItem == 'radioButton' || whichItem == 'checkBox') { this['my' + whichItem + "1"].setStyle(whichStyle, whatValue); this['my' + whichItem + "2"].setStyle(whichStyle, whatValue); } if (whichItem == 'buttonBar' || whichItem == 'toggleButtonBar') { if ( whichStyle == 'highlightAlphas') { for (var i:Number = 0; i < 3; i++) { this['my' + whichItem].getChildAt(i).setStyle(whichStyle, whatValue); } } } if (whatType == 'color') { setArrayCSS(whichStyle, whatValue[0], whatValue[1], true, whichItem); } else { setArrayCSS(whichStyle, whatValue[0], whatValue[1], false, whichItem); } }public function setQuadArrayValue (whichStyle:String, whatValue:Array, whatType:String, whichItem:String):void { this['my' + whichItem].setStyle(whichStyle, whatValue); if (whichItem == 'radioButton' || whichItem == 'checkBox') { this['my' + whichItem + "1"].setStyle(whichStyle, whatValue); this['my' + whichItem + "2"].setStyle(whichStyle, whatValue); } if (whichItem == 'buttonBar' || whichItem == 'toggleButtonBar' ) { if (whichStyle == 'fillAlphas' || whichStyle == 'fillColors') { for (var i:Number = 0; i < 3; i++) { this['my' + whichItem].getChildAt(i).setStyle(whichStyle, whatValue); } } } if (whatType == 'color') { setArrayFourCSS(whichStyle, whatValue[0], whatValue[1], whatValue[2], whatValue[3], true, whichItem); } else { setArrayFourCSS(whichStyle, whatValue[0], whatValue[1], whatValue[2], whatValue[3], false, whichItem); }}public function setArrayCSS(whichStyle:String, whatValue1:Number, whatValue2:Number, isColor:Boolean, whichItem:String):void { var newValue:String; if (isColor == true) { newValue = rgbToHex(whatValue1) + ", " + rgbToHex(whatValue2); } else { newValue =whatValue1 + ", " + whatValue2; } setCSS(whichStyle, 0, newValue, whichItem); }public function setArrayFourCSS(whichStyle:String, whatValue1:Number, whatValue2:Number, whatValue3:Number, whatValue4:Number, isColor:Boolean, whichItem:String):void { var newValue:String; if (isColor == true) { newValue = rgbToHex(whatValue1) + ", " + rgbToHex(whatValue2) + ", " + rgbToHex(whatValue3) + ", " + rgbToHex(whatValue4); } else { newValue =whatValue1 + ", " + whatValue2 + ", " + whatValue3 + ", " + whatValue4; } setCSS(whichStyle, 0, newValue, whichItem); }public function setCSS(whichStyle:String, whatValue:Number, whatType:String, whichItem:String):void { if (whatType == 'color') { whatType = String(rgbToHex(whatValue)); } else if (whatType == 'number') { whatType = String(whatValue); } if (whichStyle == 'cornerRadiusLeft') { this["css" + whichStyle] = " cornerRadius: " + whatType + ";\n"; } else if (whichStyle == 'cornerRadiusRight') { this["css" + whichStyle] = " cornerRadius: " + whatType + ";\n"; } else if (whichStyle == 'headerColor') { this["css" + whichStyle] = " color: " + whatType + ";\n"; } else if (whichStyle == 'headerletterSpacing') { this["css" + whichStyle] = " letterSpacing: " + whatType + ";\n"; } else if (whichStyle == 'headercolor') { this["css" + whichStyle] = " color: " + whatType + ";\n"; } else if (whichStyle == 'todaytextcolor') { this["css" + whichStyle] = " color: " + whatType + ";\n"; } else if (whichStyle == 'weekDaycolor') { this["css" + whichStyle] = " color: " + whatType + ";\n"; } else if (whichStyle == 'headerfontSize') { this["css" + whichStyle] = " fontSize: " + whatType + ";\n"; } else if (whichStyle == 'headerfontFamily') { this["css" + whichStyle] = " fontFamily: " + whatType + ";\n"; } else if (whichStyle == 'headerfontWeight') { this["css" + whichStyle] = " fontWeight: " + whatType + ";\n"; } else if (whichStyle == 'headerfontStyle') { this["css" + whichStyle] = " fontStyle: " + whatType + ";\n"; } else if (whichStyle == 'headertextDecoration') { this["css" + whichStyle] = " textDecoration: " + whatType + ";\n"; } else if (whichStyle == 'todayfontSize') { this["css" + whichStyle] = " fontSize: " + whatType + ";\n"; } else if (whichStyle == 'todayfontFamily') { this["css" + whichStyle] = " fontFamily: " + whatType + ";\n"; } else if (whichStyle == 'todayfontWeight') { this["css" + whichStyle] = " fontWeight: " + whatType + ";\n"; } else if (whichStyle == 'todayfontStyle') { this["css" + whichStyle] = " fontStyle: " + whatType + ";\n"; } else if (whichStyle == 'todaytextDecoration') { this["css" + whichStyle] = " textDecoration: " + whatType + ";\n"; } else if (whichStyle == 'weekDayfontSize') { this["css" + whichStyle] = " fontSize: " + whatType + ";\n"; } else if (whichStyle == 'weekDayfontFamily') { this["css" + whichStyle] = " fontFamily: " + whatType + ";\n"; } else if (whichStyle == 'weekDayfontWeight') { this["css" + whichStyle] = " fontWeight: " + whatType + ";\n"; } else if (whichStyle == 'weekDayfontStyle') { this["css" + whichStyle] = " fontStyle: " + whatType + ";\n"; } else if (whichStyle == 'weekDaytextDecoration') { this["css" + whichStyle] = " textDecoration: " + whatType + ";\n"; } else if (whichStyle == 'selectedcolor') { this["css" + whichStyle] = " color: " + whatType + ";\n"; } else if (whichStyle == 'selectedfontFamily') { this["css" + whichStyle] = " fontFamily: " + whatType + ";\n"; } else if (whichStyle == 'selectedfontSize') { this["css" + whichStyle] = " fontSize: " + whatType + ";\n"; } else if (whichStyle == 'selectedfontWeight') { this["css" + whichStyle] = " fontWeight: " + whatType + ";\n"; } else if (whichStyle == 'selectedfontStyle') { this["css" + whichStyle] = " fontStyle: " + whatType + ";\n"; } else if (whichStyle == 'selectedtextDecoration') { this["css" + whichStyle] = " textDecoration: " + whatType + ";\n"; } else if (whichItem == 'tab') { this["css" + whichStyle + 'tab'] = " " + whichStyle + ": " + whatType + ";\n"; } else if (whichItem == 'selectedTab') { this["css" + whichStyle + 'selectedTab'] = " " + whichStyle + ": " + whatType + ";\n"; } else if (whichItem == 'dropDown') { this["css" + whichStyle + 'dropDown'] = " " + whichStyle + ": " + whatType + ";\n"; } else { this["css" + whichStyle] = " " + whichStyle + ": " + whatType + ";\n"; } if (whatType == 'default') { this["cssborderStyle"] = ''; } if (whichItem == 'tab') { updateCSS('tabNavigator'); } else if (whichItem == 'selectedTab') { updateCSS('tabNavigator'); } else if (whichItem == 'dropDown') { updateCSS('comboBox'); } else { updateCSS(whichItem); } }public function updateCSS(whichItem:String):void { var whichItemUpper:String = whichItem.substr(0, 1).toUpperCase() + whichItem.substr(1); myCSS = whichItemUpper + " {\n"; for (var i:Number = 0; i < this[whichItem + 'Styles'].length; i++) { //Loop for Accordions, Panels, Sliders if (whichItem == 'accordion' || whichItem == 'panel' || whichItem == 'vSlider' || whichItem == 'hSlider') { if (this[whichItem + 'Styles'][i] != 'color' && this[whichItem + 'Styles'][i] != 'textAlign' && this[whichItem + 'Styles'][i] != 'fontFamily' && this[whichItem + 'Styles'][i] != 'fontSize' && this[whichItem + 'Styles'][i] != 'fontWeight' && this[whichItem + 'Styles'][i] != 'fontStyle' && this[whichItem + 'Styles'][i] != 'textDecoration' && this[whichItem + 'Styles'][i] != 'letterSpacing' ) { myCSS += this['css'+ this[whichItem + 'Styles'][i]]; } //Loop for DataGrid } else if (whichItem == 'dataGrid') { if (this[whichItem + 'Styles'][i] != 'headerColor' && this[whichItem + 'Styles'][i] != 'headerfontFamily' && this[whichItem + 'Styles'][i] != 'headerfontSize' && this[whichItem + 'Styles'][i] != 'headerfontWeight' && this[whichItem + 'Styles'][i] != 'headerfontStyle' && this[whichItem + 'Styles'][i] != 'headertextDecoration' && this[whichItem + 'Styles'][i] != 'headerletterSpacing') { myCSS += this['css'+ this[whichItem + 'Styles'][i]]; } //Loop for DateChooser } else if (whichItem == 'dateChooser') { if (this[whichItem + 'Styles'][i] != 'headercolor' && this[whichItem + 'Styles'][i] != 'headerfontFamily' && this[whichItem + 'Styles'][i] != 'headerfontSize' && this[whichItem + 'Styles'][i] != 'headerfontWeight' && this[whichItem + 'Styles'][i] != 'headerfontStyle' && this[whichItem + 'Styles'][i] != 'headertextDecoration' && this[whichItem + 'Styles'][i] != 'weekDaycolor' && this[whichItem + 'Styles'][i] != 'weekDayfontFamily' && this[whichItem + 'Styles'][i] != 'weekDayfontSize' && this[whichItem + 'Styles'][i] != 'weekDayfontWeight'
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -