wdgtHCLV g {HGIF89aH 4jGgAs(M}7Z섙ueVsТDzfſQ@&Vtn`϶4 `PC0𚏔}ptل쩣Ɛ𚐰Ԃ_P!,H@pH,Ȥrl:ШtJZجvzxL.zn|N~\!*&m!) "&]*P+!+#"$D J&ͩ)Pȥ"b%?!U+#z0/%h0ZSw-<A rAtȐ 4r%z@Ȃ ʔ8&7 2,+xX!cMxpYC84@VPUC#!Hmx[C+7"2%* )0#CIRʀǀEsg=#pq@ta"X6xd'@ m8Q!Plg 8PhBp{{o"%>`\G k iyi@|0'=)N_J4DQLT`Ajy|d @ji@6d"@hw I&1t>&T2)4]#HՀQ`e } `6č0BɍH AIP#  Q Őfz%P$LpYP0 "@ ByOH!T)ћzU(qF(D pПT*(]Ks_P0W)#( xQt dinU B|-{exXDP Azv%$0{eCIrvPk:D"XP&Pc&zϭ(* ]l}^)i>' >\A}(o2AOk]5N z_uΪ{P#||S5 <O:QG97!~5<= Č9:d[`oXzED.ik=ExiK< @ZV4kɀ;Ү o`EP 2SV\!z 3 Hd&z ҈CA2"V& G^~"AI "/bmV&'a[eȅ|t\Aj=#hI)v3.v }1 j*;jr \GdJS̝ > a6X l`$"'w3Dl^AM 40 t !EDeA'H`_*@5ӂUHf”WE"H>mQRJ_>—]ĩZHͨFzs'SgIYI^P]*6H-7함AFsiQG w@e%& `Y#%{G#R (@pL@x (" E <P 82"' () p> xt-f!4`kfbW 8f5Uՙ+r( J[4Y iMppRKP@_J*`hpM 9p[3h@ D`ER@@"oT  ( X &7.B[n,Y ԀpC&TF{ (@cs#T#oF%s^}:m\^ x8}*n2FcXD!gš@CY@ \IP$H{:#sy8P51ڜ/>/^8QȃovCmށP`+0$a hu _)&(煖ziTvU`5@]|xT).vX lh P@!X zXSUGHPlah'ƊņqTɐ¨Ŷ+0GЅla،FbǀlΘB@) @ `)bxD`&~_舎pv(#x!_wX$x ِ9;4bPNG  IHDRKFi4tEXtSoftwareAdobe ImageReadyqe<IDATx\ xL~dOdEQK4ƚFR)(ťJҖ{]Z]EhU*E,Y !$}?qfr$$~?3s_-9sB:2Vb?)YIg%%Qk,z]{+bEkVhe 4ee7+kfO7wGǖpRznA1.]MťT7PpzuB Q[;1ZT4J"t|wuЋ)<[G64+sށKtC&/֘2F;#g*؅Gzy8 CՐ1n , J+bʕx}g/ 11><3|#kbo Ey!2僪^D%Gak(>j|$T{@0<ًSGXvk2&9N^.v X(Ι菷_PF "&ТnYpZVߝ4BI?"q "V^furk?TjS/1CbE΁:MH]I Cde-YfpX(Fm!v54"RU1ѓ9צ %Wqvv'I]$ItH9'dQj UlJ6Bʋ,9;!҅$Yjك4,@SC׶.hdkbIŤl=$vjLN54˭Mp\"O=(! EdìGl֐k2ROVG8=Hèc}lkLJjUY bmi(-ii-Z5 ELW͘L22X)wZZԮdIV]6';։,æޥ›C->P릕-K +YĂd5,kH|(o '2!MdzfvԸ^ưs^&پLA \kT(9,c:l!>\)u?rQ6Pz/[r9W騈xݗc0e_YA EMZ ?֨2jԚ%΁ oJMdrS3ΒEjpv(M qIcjIik1.=%J@4!e of΄i\S=LfR~Y8mRA 4Nd\1nVX/37oU4y5Z(ƒѕ%#_[̸EYY w|ڋQ![cdGߕ|-Tɨ| OxyMZm9 ]J' <1܁tiY9"T>ĤnxC+I0* ".s·!ɾJ)ءa|c!KXܦjQV~XIaKVSuFQd 'a0*Sè;_O$9`hܞi>Ly.RBRoCR9WjF9͠ t{n3I\1O4$.$FQt8䲉#2iȵpngAujゞmb ]tXbW'X;\jW ǽ 19:kV/,D}cH4]TRqYcdN_JBVn!lпG'lf/$ KJy3f:#aD~N!aNVͿo!;_3Rfgu(TmKۼ/?=͡Cl>hڭ{s-:~'3Hf'MV̀?ZFIauH<;]ܺk_oZ[k R.f<0.fmX]iLu~a'x1뱻9^M] o lJ1gC}"Xz o,$ :ݟA٫X74abXEdlo򾲘TfЫXáȘYb( S-;e^;X>Y]?X>=YNydЈXHew?yŸt?C09ӗyL /@,Qj׽SKT ~t:X;ӆ *&_+V܄_%/k鄕ٕU]qG37Gddc/|x2&)gNÓ ZcCWh@߻3L {v\iGǴ:H'֓A}r1OMb775aRM cS-~'hL5@̥&,z Jafj_#To߱Ḱl}JxzDZYوMޑ A]۪Hh[ǖHȁ[NB)Նg,bH`$< ,6JO\R Z|^*Rp{[Ό[#JCpSbҰ^X06˹'kAg`$TbNRR6A]Hr^~1I?u4 ̢K>2wnd*bPIrQV(\Kƚ8e]:I\y9 uTGTG׍딱Ƣc߅R*~pf 3RU/{l2A8k>#g@/njؑxzA⟍2XG6!`FO,PIENDB`Gs"{/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2007 Yahoo! Inc. All Rights Reserved. /// /** * Version independent wrapper file for newest/real library class. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Includes /*---------------------------------------------------------------------*/ __LIBRARY_VERSION__ = 1.01; include("Resources/Library/Yahoo/Utility/Library.v1.01.js"); dn%/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2007 Yahoo! Inc. All Rights Reserved. /// /** * Version independent wrapper file for newest/real library class. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Includes /*---------------------------------------------------------------------*/ include(system.userWidgetsFolder + "/Library/Yahoo/Utility/LibraryShared.v1.01.js"); ,"/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * The exception that is thrown when a null reference is passed as a required argument. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Namespace /*---------------------------------------------------------------------*/ // Create namespace Yahoo if it doesn't already exist if(Yahoo==undefined) { var Yahoo = new Object() } /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {String} paramName The name of the parameter. * @param {String} message The error text for this exception. */ Yahoo.ArgumentNullException = function(paramName, message) { this.initialize(paramName, message); } /** * Define inheritance chain. */ Yahoo.ArgumentNullException.prototype = new Error(); Yahoo.ArgumentNullException.prototype.constructor = Yahoo.ArgumentNullException; Yahoo.ArgumentNullException.prototype.baseclass = Error.prototype; /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. * @param {String} paramName The name of the parameter. * @param {String} message The error text for this exception. */ Yahoo.ArgumentNullException.prototype.initialize = function(paramName, message) { this.paramName = paramName; if(message!=null && message!="") { this.message = message; } else { this.message = paramName; } this.name = "ArgumentNullException"; }5%/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * The exception that is thrown when an argument is outside the valid range for the method. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Namespace /*---------------------------------------------------------------------*/ // Create namespace Yahoo if it doesn't already exist if(Yahoo==undefined) { var Yahoo = new Object() } /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {String} paramName The name of the parameter. * @param {String} message The error text for this exception. */ Yahoo.ArgumentOutOfRangeException = function(paramName, message) { this.initialize(paramName, message); } /** * Define inheritance chain. */ Yahoo.ArgumentOutOfRangeException.prototype = new Error(); Yahoo.ArgumentOutOfRangeException.prototype.constructor = Yahoo.ArgumentOutOfRangeException ; Yahoo.ArgumentOutOfRangeException.prototype.baseclass = Error.prototype; /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. * @param {String} paramName The name of the parameter. * @param {String} message The error text for this exception. */ Yahoo.ArgumentOutOfRangeException.prototype.initialize = function(paramName, message) { this.paramName = paramName; if(message!=null && message!="") { this.message = message; } else { this.message = paramName; } this.name = "ArgumentOutOfRangeException "; } >44Pi,/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2007 Yahoo! Inc. All Rights Reserved. /// /** * Button control. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. */ Yahoo.Controls.Button = function(theme) { //log("Button.ctor()"); if(arguments.length>0) { this.initialize(theme); } } /** * Define inheritance chain. */ Yahoo.Controls.Button.prototype = new Yahoo.Controls.Sizable3PartControlBase(); Yahoo.Controls.Button.prototype.constructor = Yahoo.Controls.Button; Yahoo.Controls.Button.prototype.baseclassButton = Yahoo.Controls.Sizable3PartControlBase.prototype; /*-----------------------------------------------------------*/ // Control code /*-----------------------------------------------------------*/ /** * Raises the onEnabledChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Button.prototype._onEnabledChanged = function(sender, e) { //log("Button._onEnabledChanged"); // Call baseclass this.baseclassButton._onEnabledChanged.call(this, sender, e); this._lblText.enabled = this.enabled; this._button_setButtonState(); } /** * Raises the onFontChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Button.prototype._onFontChanged = function(sender, e) { //log("Button._onFontChanged"); // Call baseclass this.baseclassButton._onFontChanged.call(this, sender, e); this._lblText.font = this.font; } /** * Raises the onForeColorChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Button.prototype._onForeColorChanged = function(sender, e) { //log("Button._onForeColorChanged"); // Call baseclass this.baseclassButton._onForeColorChanged.call(this, sender, e); this._lblText.foreColor = this.foreColor; } /** * Raises the onResize event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Button.prototype._onResize = function(sender, e) { //log("Button._onResize"); // Call baseclass this.baseclassButton._onResize.call(this, sender, e); // Resize text this._button_setTextLocation(); } /** * Raises the onTextChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Button.prototype._onTextChanged = function(sender, e) { //log("Button._onTextChanged"); // Call baseclass this.baseclassButton._onTextChanged.call(this, sender, e); // Resize text this._lblText.text = this.text; } /** * Raises the onToolTipChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Button.prototype._onToolTipChanged = function(sender, e) { //log("Button._onToolTipChanged"); // Call baseclass this.baseclassButton._onToolTipChanged.call(this, sender, e); // Set tooltip this._lblText.toolTip = this.toolTip; } /** * Handles onEnter event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Button.prototype._onEnter = function(sender, e) { //log("Button._onEnter"); // Cancel enter event if we entered from / left one of our subcontrols if((this._isMouseOver == false) || this.displayRectangle.contains(system.event.x + this.left, system.event.y + this.top) == false) { // Call baseclass this.baseclassButton._onEnter.call(this, sender, e); this._button_setButtonState(); } } /** * Handles onLeave event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Button.prototype._onLeave = function(sender, e) { //log("Button._onLeave"); // Cancel leave event if we entered one of our subcontrols if(this.displayRectangle.contains(system.event.x + this.left, system.event.y + this.top) == false) { // Call baseclass this.baseclassButton._onLeave.call(this, sender, e); this._button_setButtonState(); } } /** * Handles onMouseDown event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Button.prototype._button_onMouseDown = function(sender, e) { //log("Button._button_onMouseDown"); sender._button_setButtonState(); } /** * Handles onMouseUp event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Button.prototype._button_onMouseUp = function(sender, e) { //log("Button._button_onMouseUp"); sender._button_setButtonState(); } /** * Handles onMouseEnter event for label. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Button.prototype._button_lblText_onEnter = function(sender, e) { //log("Button._button_lblText_onEnter"); sender.parent._onEnter.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles the onThemeChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Button.prototype._onThemeChanged = function(sender, e) { //log("Button._onThemeChanged"); // Call base class this.baseclassButton._onThemeChanged.call(this, sender, e); this._button_loadTheme(); } /** * Handles onMouseExit event for label. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Button.prototype._button_lblText_onLeave = function(sender, e) { //log("Button._button_lblText_onLeave"); // Don't forward this if we are still within the parent control if(sender.parent.displayRectangle.contains(system.event.x + sender.left + sender.parent.left, system.event.y + sender.top + sender.parent.top) == false) { sender.parent._onLeave.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } } /** * Handles onMouseDown event for label. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Button.prototype._button_lblText_onMouseDown = function(sender, e) { //log("Button._button_lblText_onMouseDown"); sender.parent._onMouseDown.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles onMouseUp event for label. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Button.prototype._button_lblText_onMouseUp = function(sender, e) { //log("Button._button_lblText_onMouseUp"); sender.parent._onMouseUp.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /*---------------------------------------------------------------------*/ // Private code /*---------------------------------------------------------------------*/ /** * Disposes native Widget Engine objects. * @private */ Yahoo.Controls.Button.prototype._button_disposeNativeObjects = function() { //log("ComboBox._comboBox_disposeNativeObjects"); // This isn't a native object, but we still dispose it here, baseclass takes care of its own if(this._lblText!=null) { this._lblText.dispose(); this._lblText = null; } } /** * Loads control elements based on current theme. * @private */ Yahoo.Controls.Button.prototype._button_loadTheme = function() { // Initialize variables/controls this._lblText = new Yahoo.Controls.Label(this._theme); this._lblText.fromTextObject(this._theme.getItem("buttonLabel")); this._lblText.textAlign = Yahoo.Drawing.ContentAlignment.MiddleCenter; this._lblText.addEventHandler(this._button_lblText_onEnter, "Enter"); this._lblText.addEventHandler(this._button_lblText_onLeave, "Leave"); this._lblText.addEventHandler(this._button_lblText_onMouseDown, "MouseDown"); this._lblText.addEventHandler(this._button_lblText_onMouseUp, "MouseUp"); this.addControl(this._lblText); // Get options for button from theme this._textMargins = this._theme.getParameter("buttonTextMargins"); this._paramDisabled = this._theme.getParameter("buttonDisabled"); this._paramDown = this._theme.getParameter("buttonDown"); this._paramNormal = this._theme.getParameter("buttonNormal"); this._paramOver = this._theme.getParameter("buttonOver"); this._button_setTextLocation(); this._button_setButtonStyle(this._paramNormal); } /** * Sets the location and size for the text label. * @private */ Yahoo.Controls.Button.prototype._button_setTextLocation = function() { if(this._lblText!=null) { this._lblText.left = parseInt(this._textMargins.left); this._lblText.top = parseInt(this._textMargins.top); this._lblText.width = this.width - (parseInt(this._textMargins.left) + parseInt(this._textMargins.right)); this._lblText.height = this.height - (parseInt(this._textMargins.top) + parseInt(this._textMargins.bottom)); } } /** * Sets the button state. * @private */ Yahoo.Controls.Button.prototype._button_setButtonState = function() { if(this.enabled==false) { this._button_setButtonStyle(this._paramDisabled); } else { if(this._isMouseOver==true && this._isMouseDown==true) { this._button_setButtonStyle(this._paramDown); } else if(this._isMouseOver==true && this._isMouseDown==false) { this._button_setButtonStyle(this._paramOver); } else { this._button_setButtonStyle(this._paramNormal); } } // if enabled } /** * Sets button elements to match current state. * @private * @param {Object} params Object that contains the control style parameters. */ Yahoo.Controls.Button.prototype._button_setButtonStyle = function(params) { if(this._disposing==false) { this._imgLeft.colorize = params.colorize; this._imgLeft.hslAdjustment = params.hslAdjustment; this._imgLeft.hslTinting = params.hslTinting; this._imgLeft.opacity = params.opacity; this._imgMiddle.colorize = params.colorize; this._imgMiddle.hslAdjustment = params.hslAdjustment; this._imgMiddle.hslTinting = params.hslTinting; this._imgMiddle.opacity = params.opacity; this._imgRight.colorize = params.colorize; this._imgRight.hslAdjustment = params.hslAdjustment; this._imgRight.hslTinting = params.hslTinting; this._imgRight.opacity = params.opacity; this._lblText.opacity = params.opacity; } //if disposing } /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. */ Yahoo.Controls.Button.prototype.initialize = function(theme) { //log("Button.initialize()"); // Call baseclass constructor this.baseclassButton.initialize.call(this, theme, "button"); // Includes lib.include("Yahoo.Controls.Label"); // Hook into mouse events for whole control this.addEventHandler(this._button_onMouseDown, "MouseDown"); this.addEventHandler(this._button_onMouseUp, "MouseUp"); this._button_loadTheme(); } /** * Disposes control's resources. */ Yahoo.Controls.Button.prototype.dispose = function() { // Dispose native items this._button_disposeNativeObjects(); // Call baseclass this.baseclassButton.dispose.call(this); } /*---------------------------------------------------------------------*/ // Public properties /*---------------------------------------------------------------------*/ /** * Gets or sets the alignment of the text on the button. * @type Yahoo.Drawing.ContentAlignment */ Yahoo.Controls.Button.prototype.textAlign getter = function() { return this._lblText.textAlign; } Yahoo.Controls.Button.prototype.textAlign setter = function(value) { if(value!=null) { this._lblText.textAlign = value; } else { throw new Yahoo.ArgumentNullException("value"); } } D,D5/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2007 Yahoo! Inc. All Rights Reserved. /// /** * CheckBox control. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. */ Yahoo.Controls.CheckBox = function(theme) { //log("CheckBox.ctor()"); if(arguments.length>0) { this.initialize(theme); } } /** * Define inheritance chain. */ Yahoo.Controls.CheckBox.prototype = new Yahoo.Controls.Control(); Yahoo.Controls.CheckBox.prototype.constructor = Yahoo.Controls.CheckBox; Yahoo.Controls.CheckBox.prototype.baseclassCheckBox = Yahoo.Controls.Control.prototype; /*-----------------------------------------------------------*/ // Control code /*-----------------------------------------------------------*/ /** * Raises the onEnabledChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._onEnabledChanged = function(sender, e) { //log("CheckBox._onEnabledChanged"); // Call baseclass this.baseclassCheckBox._onEnabledChanged.call(this, sender, e); this._chkCheck.enabled = this.enabled; this._lblText.enabled = this.enabled; } /** * Raises the onFontChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._onFontChanged = function(sender, e) { //log("CheckBox._onFontChanged"); // Call baseclass this.baseclassCheckBox._onFontChanged.call(this, sender, e); this._lblText.font = this.font; } /** * Raises the onForeColorChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._onForeColorChanged = function(sender, e) { //log("CheckBox._onForeColorChanged"); // Call baseclass this.baseclassCheckBox._onForeColorChanged.call(this, sender, e); this._lblText.foreColor = this.foreColor; } /** * Raises the onResize event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._onResize = function(sender, e) { //log("CheckBox._onResize"); // Call baseclass this.baseclassCheckBox._onResize.call(this, sender, e); // Resize check and text this._checkBox_setCheckBoxSize(); this._checkBox_setTextLocation(); } /** * Raises the onTextChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._onTextChanged = function(sender, e) { //log("CheckBox._onTextChanged"); // Call baseclass this.baseclassCheckBox._onTextChanged.call(this, sender, e); // Set text this._lblText.text = this.text; } /** * Raises the onToolTipChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._onToolTipChanged = function(sender, e) { //log("CheckBox._onToolTipChanged"); // Call baseclass this.baseclassCheckBox._onToolTipChanged.call(this, sender, e); // Set tooltip this._lblText.toolTip = this.toolTip; } /** * Handles onEnter event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._onEnter = function(sender, e) { //log("CheckBox._onEnter"); // Cancel enter event if we entered from / left one of our subcontrols if((this._isMouseOver == false) || this.displayRectangle.contains(system.event.x + this.left, system.event.y + this.top) == false) { // Call baseclass this.baseclassCheckBox._onEnter.call(this, sender, e); // Send enter event the checkboxbase this._chkCheck._isMouseOver = true; this._chkCheck._checkBoxBase_setCheckBoxBaseState.call(this._chkCheck); } } /** * Handles onLeave event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._onLeave = function(sender, e) { //log("CheckBox._onLeave"); // Cancel leave event if we entered one of our subcontrols if(this.displayRectangle.contains(system.event.x + this.left, system.event.y + this.top) == false) { // Call baseclass this.baseclassCheckBox._onLeave.call(this, sender, e); // Send leave event the checkboxbase this._chkCheck._isMouseOver = false; this._chkCheck._checkBoxBase_setCheckBoxBaseState.call(this._chkCheck); } } /** * Handles onMouseDown event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._checkBox_onMouseDown = function(sender, e) { //log("CheckBox._checkBox_onMouseDown"); // Send event the checkboxbase sender._chkCheck._isMouseDown = true; sender._chkCheck._checkBoxBase_setCheckBoxBaseState.call(sender._chkCheck); } /** * Handles onMouseUp event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._checkBox_onMouseUp = function(sender, e) { //log("CheckBox._checkBox_onMouseUp"); // Send event via the checkboxbase if(e.fromCheckBoxBase != true) { sender._chkCheck._isMouseDown = false; sender._chkCheck._checkBoxBase_onMouseUp.call(sender._chkCheck, sender._chkCheck, new Yahoo.EventArgs()); } } /** * Raises the onThemeChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._onThemeChanged = function(sender, e) { //log("CheckBox._onThemeChanged"); // Call base class this.baseclassCheckBox._onThemeChanged.call(this, sender, e); this._checkBox_loadTheme(); } /** * Handles onMouseEnter event for checkbox. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._checkBox_chkCheck_onEnter = function(sender, e) { //log("CheckBox._checkBox_chkCheck_onEnter"); sender.parent._onEnter.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles onMouseExit event for checkbox. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._checkBox_chkCheck_onLeave = function(sender, e) { //log("CheckBox._checkBox_chkCheck_onLeave"); // Don't forward this if we are still within the parent control if(sender.parent.displayRectangle.contains(system.event.x + sender.left + sender.parent.left, system.event.y + sender.top + sender.parent.top) == false) { sender.parent._onLeave.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } } /** * Handles onMouseDown event for checkbox. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._checkBox_chkCheck_onMouseDown = function(sender, e) { //log("CheckBox._checkBox_chkCheck_onMouseDown"); sender.parent._onMouseDown.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles onMouseUp event for checkbox. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._checkBox_chkCheck_onMouseUp = function(sender, e) { //log("CheckBox._checkBox_chkCheck_onMouseUp"); e = new Yahoo.EventArgs(); e.fromCheckBoxBase = true; // We keep the sender as the checkbox so we don't end up in an infinite loop later sender.parent._checkBox_onMouseUp.call(sender.parent, sender.parent, e); } /** * Handles onMouseEnter event for label. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._checkBox_lblText_onEnter = function(sender, e) { //log("CheckBox._checkBox_lblText_onEnter"); sender.parent._onEnter.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles onMouseExit event for label. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._checkBox_lblText_onLeave = function(sender, e) { //log("CheckBox._checkBox_lblText_onLeave"); // Don't forward this if we are still within the parent control if(sender.parent.displayRectangle.contains(system.event.x + sender.left + sender.parent.left, system.event.y + sender.top + sender.parent.top) == false) { sender.parent._onLeave.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } } /** * Handles onMouseDown event for label. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._checkBox_lblText_onMouseDown = function(sender, e) { //log("CheckBox._checkBox_lblText_onMouseDown"); sender.parent._checkBox_onMouseDown.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles onMouseUp event for label. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBox.prototype._checkBox_lblText_onMouseUp = function(sender, e) { //log("CheckBox._checkBox_lblText_onMouseUp"); sender.parent._checkBox_onMouseUp.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /*---------------------------------------------------------------------*/ // Private code /*---------------------------------------------------------------------*/ /** * Disposes native Widget Engine objects. * @private */ Yahoo.Controls.CheckBox.prototype._checkBox_disposeNativeObjects = function() { //log("CheckBox._checkBox_disposeNativeObjects"); // These aren't native objects, but we still dispose them here if(this._chkCheck!=null) { this._chkCheck.dispose(); this._chkCheck = null; } if(this._lblText!=null) { this._lblText.dispose(); this._lblText = null; } } /** * Loads control elements based on current theme. * @private */ Yahoo.Controls.CheckBox.prototype._checkBox_loadTheme = function() { var checked = false; if(this._chkCheck != null) { checked = this._chkCheck.checked; } // Remove any current objects this._checkBox_disposeNativeObjects(); this._chkCheck = new Yahoo.Controls.CheckBoxBase(this._theme, "checkBox"); this._chkCheck.left = 0; this._chkCheck.top = 0; this._chkCheck.addEventHandler(this._checkBox_chkCheck_onEnter, "Enter"); this._chkCheck.addEventHandler(this._checkBox_chkCheck_onLeave, "Leave"); this._chkCheck.addEventHandler(this._checkBox_chkCheck_onMouseDown, "MouseDown"); this._chkCheck.addEventHandler(this._checkBox_chkCheck_onMouseUp, "MouseUp"); this.addControl(this._chkCheck); this._lblText = new Yahoo.Controls.Label(this._theme); this._lblText.fromTextObject(this._theme.getItem("checkBoxLabel")); this._lblText.textAlign = Yahoo.Drawing.ContentAlignment.MiddleLeft; this._lblText.addEventHandler(this._checkBox_lblText_onEnter, "Enter"); this._lblText.addEventHandler(this._checkBox_lblText_onLeave, "Leave"); this._lblText.addEventHandler(this._checkBox_lblText_onMouseDown, "MouseDown"); this._lblText.addEventHandler(this._checkBox_lblText_onMouseUp, "MouseUp"); this.addControl(this._lblText); // Get options for checkBox from theme this._textMargins = this._theme.getParameter("checkBoxTextMargins"); this._paramDisabled = this._theme.getParameter("checkBoxDisabled"); this._paramDown = this._theme.getParameter("checkBoxDown"); this._paramNormal = this._theme.getParameter("checkBoxNormal"); this._paramOver = this._theme.getParameter("checkBoxOver"); // Set text this._lblText.text = this.text; this._chkCheck.checked = checked; if(this._isInitializing == true) { // Get initial height from checkbox theme this._frame.height = this._chkCheck.height; } this._checkBox_setCheckBoxSize(); this._checkBox_setTextLocation(); } /** * Sets the size for the checkbox. * @private */ Yahoo.Controls.CheckBox.prototype._checkBox_setCheckBoxSize = function() { //log("CheckBox._checkBox_setCheckBoxSize"); if(this._chkCheck!=null) { this._chkCheck.size = new Yahoo.Drawing.Size(this.height, this.height); } } /** * Sets the location and size for the text label. * @private */ Yahoo.Controls.CheckBox.prototype._checkBox_setTextLocation = function() { //log("CheckBox._checkBox_setTextLocation"); if(this._lblText!=null) { this._lblText.left = this._chkCheck.width + parseInt(this._textMargins.left); this._lblText.top = parseInt(this._textMargins.top); this._lblText.size = new Yahoo.Drawing.Size((this.width - (parseInt(this._textMargins.left) + parseInt(this._textMargins.right)) - this._chkCheck.width - 1), (this.height - (parseInt(this._textMargins.top) + parseInt(this._textMargins.bottom)))); } } /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. */ Yahoo.Controls.CheckBox.prototype.initialize = function(theme) { //log("CheckBox.initialize()"); // Call baseclass constructor this.baseclassCheckBox.initialize.call(this, theme, "checkBox"); this._isInitializing = true; // Includes lib.include("Yahoo.Controls.CheckBoxBase"); lib.include("Yahoo.Controls.Label"); // Hook into mouse events for whole control this.addEventHandler(this._checkBox_onMouseDown, "MouseDown"); this.addEventHandler(this._checkBox_onMouseUp, "MouseUp"); // Load theme and do layout this._checkBox_loadTheme(); this._isInitializing = false; } /** * Disposes control's resources. */ Yahoo.Controls.CheckBox.prototype.dispose = function() { this._checkBox_disposeNativeObjects(); // Call baseclass this.baseclassCheckBox.dispose.call(this); } // TODO: We need the events from CheckBoxBase !!! /*---------------------------------------------------------------------*/ // Public properties /*---------------------------------------------------------------------*/ /** * Gets or sets a value indicating whether the checked state changes automatically when the user clicks on the control. * @type Boolean */ Yahoo.Controls.CheckBox.prototype.autoCheck getter = function() { return this._chkCheck.autoCheck; } Yahoo.Controls.CheckBox.prototype.autoCheck setter = function(value) { this._chkCheck.autoCheck = value; } /** * Gets or sets a value indicating whether the control is checked. * @type Boolean */ Yahoo.Controls.CheckBox.prototype.checked getter = function() { return this._chkCheck.checked; } Yahoo.Controls.CheckBox.prototype.checked setter = function(value) { this._chkCheck.checked = value; } /** * Gets or sets the state of the checkbox when in three state mode. * @type Yahoo.Controls.CheckState */ Yahoo.Controls.CheckBox.prototype.checkState getter = function() { return this._chkCheck.checkState; } Yahoo.Controls.CheckBox.prototype.checkState setter = function(value) { this._chkCheck.checkState = value; } /** * Gets or sets a value indicating whether the checkbox supports three states instead of two. * @type Boolean */ Yahoo.Controls.CheckBox.prototype.threeState getter = function() { return this._chkCheck.threeState; } Yahoo.Controls.CheckBox.prototype.threeState setter = function(value) { this._chkCheck.threeState = value; } /** * Gets or sets the alignment of the text on the checkBox. * @type Yahoo.Drawing.ContentAlignment */ Yahoo.Controls.CheckBox.prototype.textAlign getter = function() { return this._lblText.textAlign; } Yahoo.Controls.CheckBox.prototype.textAlign setter = function(value) { if(value!=null) { this._lblText.textAlign = value; } else { throw new Yahoo.ArgumentNullException("value"); } } I_mIPi/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2007 Yahoo! Inc. All Rights Reserved. /// /** * CheckBoxBase control. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. * @param {String} themePrefix The prefix used to retrieve styles from the theme for this control. */ Yahoo.Controls.CheckBoxBase = function(theme, themePrefix) { //log("CheckBoxBase.ctor()"); if(arguments.length>0) { this.initialize(theme, themePrefix); } } /** * Define inheritance chain. */ Yahoo.Controls.CheckBoxBase.prototype = new Yahoo.Controls.Control(); Yahoo.Controls.CheckBoxBase.prototype.constructor = Yahoo.Controls.CheckBoxBase; Yahoo.Controls.CheckBoxBase.prototype.baseclassCheckBoxBase = Yahoo.Controls.Control.prototype; /*---------------------------------------------------------------------*/ // Public enums /*---------------------------------------------------------------------*/ /** * Available border styles for forms. */ Yahoo.Controls.CheckState = { Unchecked: 0, Checked: 1, Indeterminate: 2 } /*-----------------------------------------------------------*/ // Control code /*-----------------------------------------------------------*/ /** * Raises the onBackColorChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBoxBase.prototype._onBackColorChanged = function(sender, e) { //log("CheckBoxBase._onBackColorChanged"); // Call base class this.baseclassCheckBoxBase._onBackColorChanged.call(this, sender, e); this._imgBackground.colorize = this._backColor; } /** * Control's internal resize handler. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBoxBase.prototype._onResize = function(sender, e) { //log("CheckBoxBase._onResize"); // Call base class this.baseclassCheckBoxBase._onResize.call(this, sender, e); // Resize background this._checkBoxBase_paintBackground(); // Resize text this._checkBoxBase_setCheckLocation(); } /** * Raises the onToolTipChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBoxBase.prototype._onToolTipChanged = function(sender, e) { //log("baseclassCheckBoxBase._onToolTipChanged"); // Call base class this.baseclassCheckBoxBase._onToolTipChanged.call(this, sender, e); // Set tooltip this._imgBackground.tooltip = this.tooltip; this._imgCheck.tooltip = this.tooltip; } /** * Raises the onCheckedChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBoxBase.prototype._onCheckedChanged = function(sender, e) { //log("CheckBoxBase._onCheckedChanged"); this._checkBoxBase_setCheckBoxBaseState(); Yahoo.raiseEvent(sender, sender._onCheckedChangedEventHandlers, e); } /** * Raises the onCheckStateChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBoxBase.prototype._onCheckStateChanged = function(sender, e) { //log("CheckBoxBase._onCheckStateChanged"); this._checkBoxBase_setCheckBoxBaseState(); Yahoo.raiseEvent(sender, sender._onCheckStateChangedEventHandlers, e); } /** * Raises the onEnabledChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBoxBase.prototype._onEnabledChanged = function(sender, e) { //log("CheckBoxBase._onEnabledChanged"); // Call baseclass this.baseclassCheckBoxBase._onEnabledChanged.call(this, sender, e); this._checkBoxBase_setCheckBoxBaseState(); } /** * Handles onEnter event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBoxBase.prototype._onEnter = function(sender, e) { //log("CheckBoxBase._onEnter"); // Cancel enter event if we entered from / left one of our subcontrols if((this._isMouseOver == false) || this.displayRectangle.contains(system.event.x + this.left, system.event.y + this.top) == false) { // Call baseclass this.baseclassCheckBoxBase._onEnter.call(this, sender, e); this._checkBoxBase_setCheckBoxBaseState(); } } /** * Handles onLeave event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBoxBase.prototype._onLeave = function(sender, e) { //log("CheckBoxBase._onLeave"); // Cancel leave event if we entered one of our subcontrols if(this.displayRectangle.contains(system.event.x + this.left, system.event.y + this.top) == false) { // Call baseclass this.baseclassCheckBoxBase._onLeave.call(this, sender, e); this._checkBoxBase_setCheckBoxBaseState(); } } /** * Handles onMouseDown event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBoxBase.prototype._checkBoxBase_onMouseDown = function(sender, e) { //log("CheckBoxBase._checkBoxBase_onMouseDown"); sender._checkBoxBase_setCheckBoxBaseState(); } /** * Handles onMouseUp event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBoxBase.prototype._checkBoxBase_onMouseUp = function(sender, e) { //log("CheckBoxBase._checkBoxBase_onMouseUp"); if(sender.enabled==true) { // Check if we should switch states if(sender.autoCheck==true) { if(sender._isMouseOver) { if(sender._threeState==true) { switch(sender._checkState) { case Yahoo.Controls.CheckState.Checked: sender.checkState = Yahoo.Controls.CheckState.Indeterminate; break; case Yahoo.Controls.CheckState.Unchecked: sender.checkState = Yahoo.Controls.CheckState.Checked; break; case Yahoo.Controls.CheckState.Indeterminate: sender.checkState = Yahoo.Controls.CheckState.Unchecked; break; } } else { sender.checked = !sender.checked; } // threeState } // isMouseOver } // autoCheck } // enabled==true sender._checkBoxBase_setCheckBoxBaseState(); } /** * Handles onMouseEnter event for label. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBoxBase.prototype._checkBoxBase_imgCheck_onEnter = function(sender, e) { //log("CheckBoxBase._checkBoxBase_imgCheck_onEnter"); sender.parent._onEnter.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles onMouseExit event for label. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBoxBase.prototype._checkBoxBase_imgCheck_onLeave = function(sender, e) { //log("CheckBoxBase._checkBoxBase_imgCheck_onLeave"); // Don't forward this if we are still within the parent control if(sender.parent.displayRectangle.contains(system.event.x + sender.left + sender.parent.left, system.event.y + sender.top + sender.parent.top) == false) { sender.parent._onLeave.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } } /** * Handles onMouseDown event for check image. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBoxBase.prototype._checkBoxBase_imgCheck_onMouseDown = function(sender, e) { //log("CheckBoxBase._checkBoxBase_imgCheck_onMouseDown"); sender.parent._onMouseDown.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles onMouseUp event for check image. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBoxBase.prototype._checkBoxBase_imgCheck_onMouseUp = function(sender, e) { //log("CheckBoxBase._checkBoxBase_imgCheck_onMouseUp"); sender.parent._onMouseUp.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Raises the onThemeChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckBoxBase.prototype._onThemeChanged = function(sender, e) { //log("CheckBoxBase._onThemeChanged"); // Call base class this.baseclassCheckBoxBase._onThemeChanged.call(this, sender, e); this._checkBoxBase_loadTheme(); } /*---------------------------------------------------------------------*/ // Private code /*---------------------------------------------------------------------*/ /** * Disposes native Widget Engine objects. * @private */ Yahoo.Controls.CheckBoxBase.prototype._checkBoxBase_disposeNativeObjects = function() { //log("CheckBoxBase._checkBoxBase_disposeNativeObjects"); if(this._imgBackground!=null) { this._imgBackground.removeFromSuperview(); this._imgBackground = null; } if(this._imgCheck!=null) { this._imgCheck.removeFromSuperview(); this._imgCheck = null; } } /** * Loads control elements based on current theme. * @private */ Yahoo.Controls.CheckBoxBase.prototype._checkBoxBase_loadTheme = function() { //log("CheckBoxBase._checkBoxBase_loadTheme"); // Remove any current objects this._checkBoxBase_disposeNativeObjects(); // Load objects using current theme this._imgBackground = this._theme.getItem(this._themePrefix + "Background"); this._imgBackground.tag = this; this._frame.addSubview(this._imgBackground); this._imgCheck = this._theme.getItem(this._themePrefix + "Check"); this._imgCheck.tag = this; this._frame.addSubview(this._imgCheck); this._checkBoxBase_setCheckLocation(); this._checkBoxBase_setCheckBoxBaseState(); } /** * Resizes control border elements. * @private */ Yahoo.Controls.CheckBoxBase.prototype._checkBoxBase_paintBackground = function() { //log("CheckBoxBase._checkBoxBase_paintBackground"); this._imgBackground.width = this.width; this._imgBackground.height = this.height; } /** * Sets the check image location and size * @private */ Yahoo.Controls.CheckBoxBase.prototype._checkBoxBase_setCheckLocation = function() { if(this._imgCheck!=null) { this._imgCheck.hOffset = parseInt(this._checkMargins.left); this._imgCheck.vOffset = parseInt(this._checkMargins.top); this._imgCheck.width = this.width - (parseInt(this._checkMargins.left) + parseInt(this._checkMargins.right)); this._imgCheck.height = this.height - (parseInt(this._checkMargins.top) + parseInt(this._checkMargins.bottom)); } } /** * Sets the checkBoxBase state. * @private */ Yahoo.Controls.CheckBoxBase.prototype._checkBoxBase_setCheckBoxBaseState = function() { if(this.enabled==false) { this._checkBoxBase_setCheckBoxBaseStyle(this._paramDisabled); } else { if(this._isMouseOver==true && this._isMouseDown==true) { this._checkBoxBase_setCheckBoxBaseStyle(this._paramDown); } else if(this._isMouseOver==true && this._isMouseDown==false) { this._checkBoxBase_setCheckBoxBaseStyle(this._paramOver); } else { this._checkBoxBase_setCheckBoxBaseStyle(this._paramNormal); } } // if enabled // Set check image switch(this._checkState) { case Yahoo.Controls.CheckState.Checked: this._imgCheck.opacity = 255; break; case Yahoo.Controls.CheckState.Unchecked: this._imgCheck.opacity = 0; break; case Yahoo.Controls.CheckState.Indeterminate: this._imgCheck.opacity = 128; break; } } /** * Sets checkBoxBase elements to match current state. * @private * @param {Object} params Object that contains the control style parameters. */ Yahoo.Controls.CheckBoxBase.prototype._checkBoxBase_setCheckBoxBaseStyle = function(params) { this._imgBackground.colorize = params.colorize; this._imgBackground.hslAdjustment = params.hslAdjustment; this._imgBackground.hslTinting = params.hslTinting; this._imgBackground.opacity = params.opacity; //this._imgCheck.colorize = params.colorize; this._imgCheck.hslAdjustment = params.hslAdjustment; this._imgCheck.hslTinting = params.hslTinting; this._imgCheck.opacity = params.opacity; } /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. * @param {String} themePrefix The prefix used to retrieve styles from the theme for this control. */ Yahoo.Controls.CheckBoxBase.prototype.initialize = function(theme, themePrefix) { //log("CheckBoxBase.initialize()"); this._themePrefix = themePrefix; // Call baseclass constructor this.baseclassCheckBoxBase.initialize.call(this, theme, themePrefix); this._isInitializing = true; // Initialize properties this._autoCheck = true; this._checked = false; this._checkState = Yahoo.Controls.CheckState.Unchecked; this._threeState = false; this._onCheckedChangedEventHandlers = new Array(); this._onCheckStateChangedEventHandlers = new Array(); // Get options for checkBoxBase from theme this._checkMargins = this._theme.getParameter(themePrefix + "CheckMargins"); this._paramDisabled = this._theme.getParameter(themePrefix + "Disabled"); this._paramDown = this._theme.getParameter(themePrefix + "Down"); this._paramNormal = this._theme.getParameter(themePrefix + "Normal"); this._paramOver = this._theme.getParameter(themePrefix + "Over"); // Hook into mouse events for whole control this.addEventHandler(this._checkBoxBase_onMouseDown, "MouseDown"); this.addEventHandler(this._checkBoxBase_onMouseUp, "MouseUp"); // Get objects this._checkBoxBase_loadTheme(); // Get initial size from theme images this.width = this._imgBackground.width; this.height = this._imgBackground.height; this._isInitializing = false; } /** * Adds an event handler. Supported events are: CheckedChanged, CheckStateChanged * @param {Function} eventHandler The function that is to be called when the event is raised. * @param {String} eventName The name of the event that is being listened to. */ Yahoo.Controls.CheckBoxBase.prototype.addEventHandler = function(eventHandler, eventName) { // Call baseclass this.baseclassCheckBoxBase.addEventHandler.call(this, eventHandler, eventName) switch(eventName) { case "CheckedChanged": this._onCheckedChangedEventHandlers.push(eventHandler); break; case "CheckStateChanged": this._onCheckStateChangedEventHandlers.push(eventHandler); break; } } /** * Disposes control's resources. */ Yahoo.Controls.CheckBoxBase.prototype.dispose = function() { // Call baseclass this.baseclassCheckBoxBase.dispose.call(this); } /*---------------------------------------------------------------------*/ // Public properties /*---------------------------------------------------------------------*/ /** * Gets or sets the a value indicating whether the checked state changes automatically when the user click on the control. * @type Boolean */ Yahoo.Controls.CheckBoxBase.prototype.autoCheck getter = function() { return this._autoCheck; } Yahoo.Controls.CheckBoxBase.prototype.autoCheck setter = function(value) { if(value!=null) { this._autoCheck = value; } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets the a value indicating whether the control is checked. * @type Boolean */ Yahoo.Controls.CheckBoxBase.prototype.checked getter = function() { return this._checked; } Yahoo.Controls.CheckBoxBase.prototype.checked setter = function(value) { if(value!=null) { if(this._checked!=value) { this._checked = value; if(this._checked==true) { this._checkState = Yahoo.Controls.CheckState.Checked; } else { this._checkState = Yahoo.Controls.CheckState.Unchecked; } this._onCheckedChanged(this, new Yahoo.EventArgs()); } } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets the state of the checkbox. * @type Yahoo.Controls.CheckState */ Yahoo.Controls.CheckBoxBase.prototype.checkState getter = function() { return this._checkState; } Yahoo.Controls.CheckBoxBase.prototype.checkState setter = function(value) { if(value!=null) { if(this._checkState!=value) { this._checkState = value; switch(this._checkState) { case Yahoo.Controls.CheckState.Checked: this._checked = true; break; case Yahoo.Controls.CheckState.Unchecked: this._checked = false; break; case Yahoo.Controls.CheckState.Indeterminate: // Invalid setting for two state checkbox this._checked = false; break; } this._onCheckStateChanged(this, new Yahoo.EventArgs()); } } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets a value indicating whether the checkbox supports three states instead of two. * @type Boolean */ Yahoo.Controls.CheckBoxBase.prototype.threeState getter = function() { return this._threeState; } Yahoo.Controls.CheckBoxBase.prototype.threeState setter = function(value) { if(value!=null) { if(this._threeState!=value) { this._threeState = value; } } else { throw new Yahoo.ArgumentNullException("value"); } } QV1VM/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2007 Yahoo! Inc. All Rights Reserved. /// /** * CheckedListBox control. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. */ Yahoo.Controls.CheckedListBox = function(theme) { //log("CheckedListBox.ctor()"); if(arguments.length>0) { this.initialize(theme); } } /** * Define inheritance chain. */ Yahoo.Controls.CheckedListBox.prototype = new Yahoo.Controls.SizableControlBase(); Yahoo.Controls.CheckedListBox.prototype.constructor = Yahoo.Controls.CheckedListBox; Yahoo.Controls.CheckedListBox.prototype.baseclassCheckedListBox = Yahoo.Controls.SizableControlBase.prototype; /*-----------------------------------------------------------*/ // Control code /*-----------------------------------------------------------*/ /** * Raises the onEnabledChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckedListBox.prototype._onEnabledChanged = function(sender, e) { //log("CheckedListBox._onEnabledChanged"); // Call baseclass this.baseclassCheckedListBox._onEnabledChanged.call(this, sender, e); // TODO: Loop all items } /** * Raises the onFontChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckedListBox.prototype._onFontChanged = function(sender, e) { //log("CheckedListBox._onFontChanged"); // Call baseclass this.baseclassCheckedListBox._onFontChanged.call(this, sender, e); // TODO: Loop all items } /** * Raises the onForeColorChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckedListBox.prototype._onForeColorChanged = function(sender, e) { //log("CheckedListBox._onForeColorChanged"); // Call baseclass this.baseclassCheckedListBox._onForeColorChanged.call(this, sender, e); // TODO: Loop all items } /** * Raises the onResize event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckedListBox.prototype._onResize = function(sender, e) { //log("CheckedListBox._onResize"); // Call baseclass this.baseclassCheckedListBox._onResize.call(this, sender, e); // Resize elements this._checkedListBox_setSize(); } /** * Raises the onToolTipChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckedListBox.prototype._onToolTipChanged = function(sender, e) { //log("CheckedListBox._onToolTipChanged"); // Call baseclass this.baseclassCheckedListBox._onToolTipChanged.call(this, sender, e); // Set tooltip // TODO: Loop all items } /** * Handles onEnter event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckedListBox.prototype._onEnter = function(sender, e) { //log("CheckedListBox._onEnter"); // Cancel enter event if we entered from / left one of our subcontrols if((this._isMouseOver == false) || this.displayRectangle.contains(system.event.x + this.left, system.event.y + this.top) == false) { // Call baseclass this.baseclassCheckedListBox._onEnter.call(this, sender, e); } } /** * Handles onLeave event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckedListBox.prototype._onLeave = function(sender, e) { //log("CheckedListBox._onLeave"); // Cancel leave event if we entered one of our subcontrols if(this.displayRectangle.contains(system.event.x + this.left, system.event.y + this.top) == false) { // Call baseclass this.baseclassCheckedListBox._onLeave.call(this, sender, e); } } /** * Raises the onThemeChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckedListBox.prototype._onThemeChanged = function(sender, e) { //log("CheckedListBox._onThemeChanged"); // Call base class this.baseclassCheckedListBox._onThemeChanged.call(this, sender, e); this._checkedListBox_loadTheme(); } /** * Handles onMouseEnter event for item. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckedListBox.prototype._checkedListBox_chkItem_onEnter = function(sender, e) { //log("CheckedListBox._checkedListBox_chkItem_onEnter"); sender.parent._onEnter.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles onMouseExit event for item. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckedListBox.prototype._checkedListBox_chkItem_onLeave = function(sender, e) { //log("CheckedListBox._checkedListBox_chkItem_onLeave"); // Don't forward this if we are still within the parent control if(sender.parent.displayRectangle.contains(system.event.x + sender.left + sender.parent.left, system.event.y + sender.top + sender.parent.top) == false) { sender.parent._onLeave.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } } /** * Handles onMouseDown event for item. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckedListBox.prototype._checkedListBox_chkItem_onMouseDown = function(sender, e) { //log("CheckedListBox._checkedListBox_chkItem_onMouseDown"); sender.parent._onMouseDown.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles onMouseUp event for item. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckedListBox.prototype._checkedListBox_chkItem_onMouseUp = function(sender, e) { //log("CheckedListBox._checkedListBox_chkItem_onMouseUp"); sender.parent._onMouseUp.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles onCollectionChanged event for object collection. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.CheckedListBox.prototype._checkedListBox_collection_onCollectionChanged = function(sender, e) { //log("CheckedListBox._checkedListBox_collection_onCollectionChanged"); sender.parent._checkedListBox_refreshItems.call(sender.parent); } /*---------------------------------------------------------------------*/ // Private code /*---------------------------------------------------------------------*/ /** * Disposes native Widget Engine objects. * @private */ Yahoo.Controls.CheckedListBox.prototype._checkedListBox_disposeNativeObjects = function() { //log("CheckedListBox._checkedListBox_disposeNativeObjects"); if(this._scbContent!=null) { this._scbContent.removeFromSuperview(); this._scbContent = null; } if(this._fraContent!=null) { this._fraContent.removeFromSuperview(); this._fraContent = null; } // These aren't native objects, but we still dispose them here } /** * Loads control elements based on current theme. * @private */ Yahoo.Controls.CheckedListBox.prototype._checkedListBox_loadTheme = function() { // Remove any current objects this._checkedListBox_disposeNativeObjects(); var count; // Create client frame and scrollbar this._scbContent = new ScrollBar(); this._scbContent.zOrder = 101; this._scbContent.autoHide = false; this._scbContent.vOffset = this._imgBorderTop.height; this._scbContent.thumbColor = this._theme.getParameter("checkedListBoxScrollBarThumbColor").color; this._fraContent = new Frame(); this._fraContent.zOrder = 100; this.frame.addSubview(this._fraContent); this.frame.addSubview(this._scbContent); this._fraContent.vScrollBar = this._scbContent; // Redraw items this._checkedListBox_refreshItems(); this._checkedListBox_setSize(); } /** * Sets the size for all the items. * @private */ Yahoo.Controls.CheckedListBox.prototype._checkedListBox_setSize = function() { var count; if(this._fraContent!=null) { this._fraContent.hOffset = this._imgBorderLeft.width; this._fraContent.vOffset = this._imgBorderTop.height; this._fraContent.width = this.width - this._scbContent.width - (this._imgBorderLeft.width + this._imgBorderRight.width) - 1; this._fraContent.height = this.height - (this._imgBorderTop.height + this._imgBorderBottom.height); this._scbContent.hOffset = this._fraContent.width + 1; this._scbContent.height = this._fraContent.height; // Loop all items and set theme for(count=0; count=0 && checkedArray[countChecked]=0 && index=0 && index /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * CheckedListBoxCollection control. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Namespace /*---------------------------------------------------------------------*/ // Create namespace Yahoo.Controls if it doesn't already exist //if(Yahoo==undefined) { var Yahoo = new Object(); } //if(Yahoo.Controls==undefined) { Yahoo.Controls = new Object(); } /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor */ Yahoo.Controls.CheckedListBox.ObjectCollection = function() { //log("CheckedListBox.ObjectCollection.ctor()"); this.initialize(); } /*---------------------------------------------------------------------*/ // Private code /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. */ Yahoo.Controls.CheckedListBox.ObjectCollection.prototype.initialize = function() { //log("CheckedListBox.ObjectCollection.initialize()"); this._items = new Array(); this._onCollectionChangedEventHandlers = new Array(); } /** * Adds an event handler. Supported events are: CollectionChanged. * @param {Function} eventHandler The function that is to be called when the event is raised. * @param {String} eventName The name of the event that is being listened to. */ Yahoo.Controls.CheckedListBox.ObjectCollection.prototype.addEventHandler = function(eventHandler, eventName) { switch(eventName) { case "CollectionChanged": this._onCollectionChangedEventHandlers.push(eventHandler); break; } } /** * Adds an item to the collection. * @param {Object} item The item to add to the collection. * @type Integer */ Yahoo.Controls.CheckedListBox.ObjectCollection.prototype.add = function(item) { var result = -1; if(item!=null) { result = this._items.push(item) - 1; Yahoo.raiseEvent(this, this._onCollectionChangedEventHandlers, new Yahoo.EventArgs()); } else { throw new Yahoo.ArgumentNullException("item"); } return result; } /** * Adds an array of items to the collection. * @param {Array} value The array of items to add to the collection. */ Yahoo.Controls.CheckedListBox.ObjectCollection.prototype.addRange = function(value) { var count; if(value!=null) { for(count=0; count=0 && index=0 && index /// (C) Copyright 2005-2007 Yahoo! Inc. All Rights Reserved. /// /** * ComboBox control. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. */ Yahoo.Controls.ComboBox = function(theme) { //log("ComboBox.ctor()"); if(arguments.length>0) { this.initialize(theme); } } /** * Define inheritance chain. */ Yahoo.Controls.ComboBox.prototype = new Yahoo.Controls.SizableControlBase(); Yahoo.Controls.ComboBox.prototype.constructor = Yahoo.Controls.ComboBox; Yahoo.Controls.ComboBox.prototype.baseclassComboBox = Yahoo.Controls.SizableControlBase.prototype; /*-----------------------------------------------------------*/ // Control code /*-----------------------------------------------------------*/ /** * Raises the onEnabledChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._onEnabledChanged = function(sender, e) { //log("ComboBox._onEnabledChanged"); // Call baseclass this.baseclassComboBox._onEnabledChanged.call(this, sender, e); this._lblText.enabled = this.enabled; this._comboBox_setComboBoxState(); } /** * Raises the onFontChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._onFontChanged = function(sender, e) { //log("ComboBox._onFontChanged"); // Call baseclass this.baseclassComboBox._onFontChanged.call(this, sender, e); this._lblText.font = this.font; } /** * Raises the onForeColorChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._onForeColorChanged = function(sender, e) { //log("ComboBox._onForeColorChanged"); // Call baseclass this.baseclassComboBox._onForeColorChanged.call(this, sender, e); this._lblText.foreColor = this.foreColor; } /** * Raises the onResize event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._onResize = function(sender, e) { //log("ComboBox._onResize"); // Call baseclass this.baseclassComboBox._onResize.call(this, sender, e); // Resize elements this._comboBox_setButtonLocation(); this._comboBox_setTextLocation(); } /** * Raises the onTextChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._onTextChanged = function(sender, e) { //log("ComboBox._onTextChanged"); // Call baseclass this.baseclassComboBox._onTextChanged.call(this, sender, e); // Set text this._lblText.text = this.text; } /** * Raises the onToolTipChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._onToolTipChanged = function(sender, e) { //log("ComboBox._onToolTipChanged"); // Call baseclass this.baseclassComboBox._onToolTipChanged.call(this, sender, e); // Set tooltip this._lblText.toolTip = this.toolTip; } /** * Handles onEnter event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._onEnter = function(sender, e) { //log("ComboBox._onEnter"); // Cancel enter event if we entered from / left one of our subcontrols if((this._isMouseOver == false) || this.displayRectangle.contains(system.event.x + this.left, system.event.y + this.top) == false) { // Call baseclass this.baseclassComboBox._onEnter.call(this, sender, e); this._comboBox_setComboBoxState(); } } /** * Handles onLeave event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._onLeave = function(sender, e) { //log("ComboBox._onLeave"); // Cancel leave event if we entered one of our subcontrols if(this.displayRectangle.contains(system.event.x + this.left, system.event.y + this.top) == false) { // Call baseclass this.baseclassComboBox._onLeave.call(this, sender, e); this._comboBox_setComboBoxState(); } } /** * Handles onMouseDown event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._comboBox_onMouseDown = function(sender, e) { //log("ComboBox._comboBox_onMouseDown"); sender._comboBox_setComboBoxState(); } /** * Handles onMouseUp event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._comboBox_onMouseUp = function(sender, e) { //log("ComboBox._comboBox_onMouseUp"); sender._comboBox_setComboBoxState(); } /** * Raises the onSelectedIndexChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._onSelectedIndexChanged = function(sender, e) { //log("ComboBox._onSelectedIndexChanged"); if(this._selectedIndex!=-1) { this._lblText.text = this._items.item(this._selectedIndex).toString(); } else { this._lblText.text = ""; } // Raise event Yahoo.raiseEvent(sender, sender._onSelectedIndexChangedEventHandlers, e); } /** * Raises the onThemeChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._onThemeChanged = function(sender, e) { //log("ComboBox._onThemeChanged"); // Call base class this.baseclassComboBox._onThemeChanged.call(this, sender, e); this._comboBox_loadTheme(); } /** * Handles onMouseEnter event for label. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._comboBox_lblText_onEnter = function(sender, e) { //log("ComboBox._comboBox_lblText_onEnter"); sender.parent._onEnter.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles onMouseExit event for label. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._comboBox_lblText_onLeave = function(sender, e) { //log("ComboBox._comboBox_lblText_onLeave"); // Don't forward this if we are still within the parent control if(sender.parent.displayRectangle.contains(system.event.x + sender.left + sender.parent.left, system.event.y + sender.top + sender.parent.top) == false) { sender.parent._onLeave.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } } /** * Handles onMouseDown event for label. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._comboBox_lblText_onMouseDown = function(sender, e) { //log("ComboBox._comboBox_lblText_onMouseDown"); sender.parent._comboBox_onMouseDown.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles onMouseUp event for label. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._comboBox_lblText_onMouseUp = function(sender, e) { //log("ComboBox._comboBox_lblText_onMouseUp"); sender.parent._comboBox_onMouseUp.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles onMouseEnter event for image. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._comboBox_btnDropDown_onEnter = function(sender, e) { //log("ComboBox._comboBox_btnDropDown_onEnter"); sender.parent._onEnter.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles onMouseExit event for imagebutton. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._comboBox_btnDropDown_onLeave = function(sender, e) { //log("ComboBox._comboBox_btnDropDown_onLeave"); // Don't forward this if we are still within the parent control if(sender.parent.displayRectangle.contains(system.event.x + sender.left + sender.parent.left, system.event.y + sender.top + sender.parent.top) == false) { sender.parent._onLeave.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } } /** * Handles onMouseDown event for imagebutton. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._comboBox_btnDropDown_onMouseDown = function(sender, e) { //log("ComboBox._comboBox_btnDropDown_onMouseDown"); sender.parent._comboBox_onMouseDown.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles onMouseUp event for imagebutton. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._comboBox_btnDropDown_onMouseUp = function(sender, e) { //log("ComboBox._comboBox_btnDropDown_onMouseUp"); sender.parent._comboBox_onMouseUp.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles onClick event for imagebutton. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ComboBox.prototype._comboBox_btnDropDown_onClick = function(sender, e) { //log("ComboBox._comboBox_btnDropDown_onClick"); sender.parent._comboBox_showMenu.call(sender.parent); } /** * Handles click event for comboitem. */ Yahoo.Controls.ComboBox.prototype._comboBox_item_onClick = function() { //log("ComboBox._comboBox_item_onClick"); this.tag.selectedIndex = this.index; } /*---------------------------------------------------------------------*/ // Private code /*---------------------------------------------------------------------*/ /** * Disposes native Widget Engine objects. * @private */ Yahoo.Controls.ComboBox.prototype._comboBox_disposeNativeObjects = function() { //log("ComboBox._comboBox_disposeNativeObjects"); // These aren't native objects, but we still dispose them here if(this._lblText!=null) { this._lblText.dispose(); this._lblText = null; } if(this._btnDropDown!=null) { this._btnDropDown.dispose(); this._btnDropDown = null; } } /** * Loads control elements based on current theme. * @private */ Yahoo.Controls.ComboBox.prototype._comboBox_loadTheme = function() { var text; if(this._lblText != null) { text = this._lblText.text; } else { text = this.text; } // Remove any current objects this._comboBox_disposeNativeObjects(); this._lblText = new Yahoo.Controls.Label(this._theme); this._lblText.fromTextObject(this._theme.getItem("comboBoxLabel")); this._lblText.textAlign = Yahoo.Drawing.ContentAlignment.MiddleLeft; this._lblText.addEventHandler(this._comboBox_lblText_onEnter, "Enter"); this._lblText.addEventHandler(this._comboBox_lblText_onLeave, "Leave"); this._lblText.addEventHandler(this._comboBox_lblText_onMouseDown, "MouseDown"); this._lblText.addEventHandler(this._comboBox_lblText_onMouseUp, "MouseUp"); this._lblText.zOrder = 4; this.addControl(this._lblText); this._btnDropDown = new Yahoo.Controls.ImageButton(this._theme, "comboBoxButtonNormal", "comboBoxButtonOver", "comboBoxButtonDown", "comboBoxButtonDisabled"); this._btnDropDown.addEventHandler(this._comboBox_btnDropDown_onEnter, "Enter"); this._btnDropDown.addEventHandler(this._comboBox_btnDropDown_onLeave, "Leave"); this._btnDropDown.addEventHandler(this._comboBox_btnDropDown_onMouseDown, "MouseDown"); this._btnDropDown.addEventHandler(this._comboBox_btnDropDown_onMouseUp, "MouseUp"); this._btnDropDown.addEventHandler(this._comboBox_btnDropDown_onClick, "Click"); this._btnDropDown.zOrder = 5; this.addControl(this._btnDropDown); // Get options for comboBox from theme this._textMargins = this._theme.getParameter("comboBoxTextMargins"); this._buttonMargins = this._theme.getParameter("comboBoxButtonMargins"); this._paramDisabled = this._theme.getParameter("comboBoxDisabled"); this._paramDown = this._theme.getParameter("comboBoxDown"); this._paramNormal = this._theme.getParameter("comboBoxNormal"); this._paramOver = this._theme.getParameter("comboBoxOver"); // Restore text this._lblText.text = text; this._comboBox_setButtonLocation(); this._comboBox_setTextLocation(); this._comboBox_setComboBoxStyle(this._paramNormal); } /** * Sets the location and size for the text label. * @private */ Yahoo.Controls.ComboBox.prototype._comboBox_setTextLocation = function() { if(this._lblText!=null) { this._lblText.left = parseInt(this._textMargins.left); this._lblText.top = parseInt(this._textMargins.top); this._lblText.width = this._btnDropDown.left - (parseInt(this._textMargins.left) + parseInt(this._textMargins.right)); this._lblText.height = this.height - (parseInt(this._textMargins.top) + parseInt(this._textMargins.bottom)); } } /** * Sets the location and size for the dropdown button. * @private */ Yahoo.Controls.ComboBox.prototype._comboBox_setButtonLocation = function() { if(this._btnDropDown!=null) { this._btnDropDown.width = this.height - (parseInt(this._buttonMargins.left) + parseInt(this._buttonMargins.right)); this._btnDropDown.left = this.width - this._btnDropDown.width - parseInt(this._buttonMargins.right); this._btnDropDown.top = parseInt(this._buttonMargins.top); this._btnDropDown.height = this.height - (parseInt(this._buttonMargins.top) + parseInt(this._buttonMargins.bottom)); } } /** * Sets the comboBox state. * @private */ Yahoo.Controls.ComboBox.prototype._comboBox_setComboBoxState = function() { if(this.enabled==false) { this._comboBox_setComboBoxStyle(this._paramDisabled); } else { if(this._isMouseOver==true && this._isMouseDown==true) { this._comboBox_setComboBoxStyle(this._paramDown); } else if(this._isMouseOver==true && this._isMouseDown==false) { this._comboBox_setComboBoxStyle(this._paramOver); } else { this._comboBox_setComboBoxStyle(this._paramNormal); } } // if enabled } /** * Sets comboBox elements to match current state. * @private * @param {Object} params Object that contains the control style parameters. */ Yahoo.Controls.ComboBox.prototype._comboBox_setComboBoxStyle = function(params) { this._imgBackground.colorize = params.colorize; this._imgBackground.hslAdjustment = params.hslAdjustment; this._imgBackground.hslTinting = params.hslTinting; this._imgBackground.opacity = params.opacity; this._imgCornerTopLeft.colorize = params.colorize; this._imgCornerTopLeft.hslAdjustment = params.hslAdjustment; this._imgCornerTopLeft.hslTinting = params.hslTinting; this._imgCornerTopLeft.opacity = params.opacity; this._imgCornerTopRight.colorize = params.colorize; this._imgCornerTopRight.hslAdjustment = params.hslAdjustment; this._imgCornerTopRight.hslTinting = params.hslTinting; this._imgCornerTopRight.opacity = params.opacity; this._imgCornerBottomLeft.colorize = params.colorize; this._imgCornerBottomLeft.hslAdjustment = params.hslAdjustment; this._imgCornerBottomLeft.hslTinting = params.hslTinting; this._imgCornerBottomLeft.opacity = params.opacity; this._imgCornerBottomRight.colorize = params.colorize; this._imgCornerBottomRight.hslAdjustment = params.hslAdjustment; this._imgCornerBottomRight.hslTinting = params.hslTinting; this._imgCornerBottomRight.opacity = params.opacity; this._imgBorderTop.colorize = params.colorize; this._imgBorderTop.hslAdjustment = params.hslAdjustment; this._imgBorderTop.hslTinting = params.hslTinting; this._imgBorderTop.opacity = params.opacity; this._imgBorderBottom.colorize = params.colorize; this._imgBorderBottom.hslAdjustment = params.hslAdjustment; this._imgBorderBottom.hslTinting = params.hslTinting; this._imgBorderBottom.opacity = params.opacity; this._imgBorderLeft.colorize = params.colorize; this._imgBorderLeft.hslAdjustment = params.hslAdjustment; this._imgBorderLeft.hslTinting = params.hslTinting; this._imgBorderLeft.opacity = params.opacity; this._imgBorderRight.colorize = params.colorize; this._imgBorderRight.hslAdjustment = params.hslAdjustment; this._imgBorderRight.hslTinting = params.hslTinting; this._imgBorderRight.opacity = params.opacity; this._lblText.opacity = params.opacity; this._btnDropDown.opacity = params.opacity; } /** * Displays menu. * @private */ Yahoo.Controls.ComboBox.prototype._comboBox_showMenu = function() { var count; var menu = new Array(); var point; for(count=0; count0) { point = this.pointToClient(new Yahoo.Drawing.Point(0, this.height)); popupMenu(menu, point.x, point.y); } } /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. */ Yahoo.Controls.ComboBox.prototype.initialize = function(theme) { //log("ComboBox.initialize()"); // Call baseclass constructor this.baseclassComboBox.initialize.call(this, theme, "comboBox"); // Includes lib.include("Yahoo.Controls.Label"); lib.include("Yahoo.Controls.ImageButton"); // Initialize variables/controls this._items = new Yahoo.Controls.ComboBox.ObjectCollection(); this._selectedIndex = -1 // Hook into mouse events for whole control this.addEventHandler(this._comboBox_onMouseDown, "MouseDown"); this.addEventHandler(this._comboBox_onMouseUp, "MouseUp"); this._onSelectedIndexChangedEventHandlers = new Array(); this._comboBox_loadTheme(); } /** * Adds an event handler. Supported events are: SelectedIndexChanged. * @param {Function} eventHandler The function that is to be called when the event is raised. * @param {String} eventName The name of the event that is being listened to. */ Yahoo.Controls.ComboBox.prototype.addEventHandler = function(eventHandler, eventName) { // Call baseclass this.baseclassComboBox.addEventHandler.call(this, eventHandler, eventName) switch(eventName) { case "SelectedIndexChanged": this._onSelectedIndexChangedEventHandlers.push(eventHandler); break; } } /** * Disposes control's resources. */ Yahoo.Controls.ComboBox.prototype.dispose = function() { this._comboBox_disposeNativeObjects(); // Call baseclass this.baseclassComboBox.dispose.call(this); // Baseclass disposes our custom controls } /*---------------------------------------------------------------------*/ // Public properties /*---------------------------------------------------------------------*/ /** * Gets the collection of items in the combobox. * @type Yahoo.Controls.ComboBox.ObjectCollection */ Yahoo.Controls.ComboBox.prototype.items getter = function() { return this._items; } Yahoo.Controls.ComboBox.prototype.items setter = function(value) { throw new Error("items is read-only"); } /** * Gets or sets the selected item index. * @type Integer */ Yahoo.Controls.ComboBox.prototype.selectedIndex getter = function() { return this._selectedIndex; } Yahoo.Controls.ComboBox.prototype.selectedIndex setter = function(value) { if(value!=null) { if(this._selectedIndex!=value) { if(value<-1 || value>=this._items.count) { throw new Yahoo.ArgumentOutOfRangeException("value"); } else { this._selectedIndex = value; this._onSelectedIndexChanged(this, new Yahoo.EventArgs()); } } } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets the alignment of the text on the comboBox. * @type Yahoo.Drawing.ContentAlignment */ Yahoo.Controls.ComboBox.prototype.textAlign getter = function() { return this._lblText.textAlign; } Yahoo.Controls.ComboBox.prototype.textAlign setter = function(value) { if(value!=null) { this._lblText.textAlign = value; } else { throw new Yahoo.ArgumentNullException("value"); } } /*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * ComboBoxCollection control. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Namespace /*---------------------------------------------------------------------*/ // Create namespace Yahoo.Controls if it doesn't already exist if(Yahoo==undefined) { var Yahoo = new Object(); } if(Yahoo.Controls==undefined) { Yahoo.Controls = new Object(); } /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. */ Yahoo.Controls.ComboBox.ObjectCollection = function() { //log("ComboBox.ObjectCollection.ctor()"); this.initialize(); } /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. */ Yahoo.Controls.ComboBox.ObjectCollection.prototype.initialize = function() { //log("ComboBox.ObjectCollection.initialize()"); this._items = new Array(); } /** * Adds an item to the collection. * @param {Object} item The item to add to the collection. * @type Integer */ Yahoo.Controls.ComboBox.ObjectCollection.prototype.add = function(item) { var result = -1; if(item!=null) { result = this._items.push(item) - 1; } else { throw new Yahoo.ArgumentNullException("item"); } return result; } /** * Removes all items from the collection. */ Yahoo.Controls.ComboBox.ObjectCollection.prototype.clear = function() { delete this._items; this._items = new Array(); } /** * Gets the index of the given item. * @param {Object} item The item to to find in the collection. * @type Integer */ Yahoo.Controls.ComboBox.ObjectCollection.prototype.indexOf = function(item) { var count; var result = -1; if(item!=null) { // Find the item for(count=0; count=0 && index=0 && index /// (C) Copyright 2005-2007 Yahoo! Inc. All Rights Reserved. /// /** * Base class for all controls. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Namespace /*---------------------------------------------------------------------*/ // Create namespace if it doesn't already exist if(Yahoo==undefined) { var Yahoo = new Object(); } if(Yahoo.Controls==undefined) { Yahoo.Controls = new Object(); } /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. */ Yahoo.Controls.Control = function(theme) { if(arguments.length>0) { this.initialize(theme); } } /*-----------------------------------------------------------*/ // Control code /*-----------------------------------------------------------*/ /** * Raises the onBackColorChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Control.prototype._onBackColorChanged = function(sender, e) { //log("Control._onBackColorChanged"); this._frame.style.backgroundColor = this._backColor; Yahoo.raiseEvent(sender, sender._onBackColorChangedEventHandlers, e); } /** * Raises the onClick event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Control.prototype._onClick = function(sender, e) { //log("Control._onClick"); if(this.enabled == true) { Yahoo.raiseEvent(sender, sender._onClickEventHandlers, e); } } /** * Raises the onEnabledChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Control.prototype._onEnabledChanged = function(sender, e) { //log("Control._onEnabledChanged"); Yahoo.raiseEvent(sender, sender._onEnabledChangedEventHandlers, e); } /** * Raises the onEnter event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Control.prototype._onEnter = function(sender, e) { //log("Control._onEnter"); this._isMouseOver = true; if(this.enabled == true) { Yahoo.raiseEvent(sender, sender._onEnterEventHandlers, e); } } /** * Raises the onFontChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Control.prototype._onFontChanged = function(sender, e) { //log("Control._onFontChanged"); Yahoo.raiseEvent(sender, sender._onFontChangedEventHandlers, e); } /** * Raises the onForeColorChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Control.prototype._onForeColorChanged = function(sender, e) { //log("Control._onForeColorChanged"); Yahoo.raiseEvent(sender, sender._onForeColorChangedEventHandlers, e); } /** * Raises the onLeave event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Control.prototype._onLeave = function(sender, e) { //log("Control._onLeave"); this._isMouseOver = false; if(this.enabled == true) { Yahoo.raiseEvent(sender, sender._onLeaveEventHandlers, e); } } /** * Raises the onLocationChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Control.prototype._onLocationChanged = function(sender, e) { //log("Control._onLocationChanged"); Yahoo.raiseEvent(this, this._onLocationChangedEventHandlers, new Yahoo.EventArgs()); } /** * Raises the onMouseDown event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Control.prototype._onMouseDown = function(sender, e) { //log("Control._onMouseDown"); this._isMouseDown = true; if(this.enabled == true) { Yahoo.raiseEvent(sender, sender._onMouseDownEventHandlers, e); } } /** * Raises the onMouseDrag event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Control.prototype._onMouseDrag = function(sender, e) { //log("Control._onMouseDrag"); if(this.enabled == true) { Yahoo.raiseEvent(sender, sender._onMouseDragEventHandlers, e); } } /** * Raises the onMouseUp event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Control.prototype._onMouseUp = function(sender, e) { //log("Control._onMouseUp"); this._isMouseDown = false; // Raise click event if(this._isMouseOver==true) { this._onClick.call(sender, sender, new Yahoo.EventArgs()); } if(this.enabled == true) { Yahoo.raiseEvent(sender, sender._onMouseUpEventHandlers, e); } } /** * Raises the onOpacityChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Control.prototype._onOpacityChanged = function(sender, e) { //log("Control._onOpacityChanged"); Yahoo.raiseEvent(this, this._onOpacityChangedEventHandlers, new Yahoo.EventArgs()); } /** * Raises the onResize event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Control.prototype._onResize = function(sender, e) { //log("Control._onResize"); Yahoo.raiseEvent(sender, sender._onResizeEventHandlers, e); } /** * Raises the onTextChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Control.prototype._onTextChanged = function(sender, e) { //log("Control._onTextChanged"); Yahoo.raiseEvent(sender, sender._onTextChangedEventHandlers, e); } /** * Raises the onThemeChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Control.prototype._onThemeChanged = function(sender, e) { //log("Control._onThemeChanged"); // TODO: Check if this points to the correct object (should be changed to the control from here on) Yahoo.raiseEvent(this, this._onThemeChangedEventHandlers, e); } /** * Raises the onToolTipChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Control.prototype._onToolTipChanged = function(sender, e) { //log("Control._onToolTipChanged"); Yahoo.raiseEvent(sender, sender._onToolTipChangedChangedEventHandlers, e); } /** * Raises the onVisibleChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Control.prototype._onVisibleChanged = function(sender, e) { //log("Control._onVisibleChanged"); Yahoo.raiseEvent(sender, sender._onVisibleChangedEventHandlers, e); } /** * Handles onMouseDown event for control objects. */ Yahoo.Controls.Control.prototype._control_onMouseDown = function() { //log("Control._control_onMouseDown"); this.tag._onMouseDown.call(this.tag, this.tag, new Yahoo.EventArgs()); } /** * Handles onMouseEnter event for control objects. */ Yahoo.Controls.Control.prototype._control_onMouseEnter = function() { //log("Control._control_onMouseEnter"); this.tag._onEnter.call(this.tag, this.tag, new Yahoo.EventArgs()); } /** * Handles onMouseExit event for control objects. */ Yahoo.Controls.Control.prototype._control_onMouseExit = function() { //log("Control._control_onMouseExit"); this.tag._onLeave.call(this.tag, this.tag, new Yahoo.EventArgs()); } /** * Handles onMouseDrag event for control objects. */ Yahoo.Controls.Control.prototype._control_onMouseDrag = function() { //log("Control._control_onMouseDrag"); this.tag._onMouseDrag.call(this.tag, this.tag, new Yahoo.EventArgs()); } /** * Handles onMouseUp event for control objects. */ Yahoo.Controls.Control.prototype._control_onMouseUp = function() { //log("Control._control_onMouseUp"); this.tag._onMouseUp.call(this.tag, this.tag, new Yahoo.EventArgs()); } /*---------------------------------------------------------------------*/ // Private code /*---------------------------------------------------------------------*/ /** * Disposes controls. * @private */ Yahoo.Controls.Control.prototype._control_disposeControls = function() { var count; // Tell Widget Class Library controls to dispose for(count=0; count0) { return true; } else { return false; } return this._controls; } Yahoo.Controls.Control.prototype.hasChildren setter = function(value) { throw new Error("hasChildren is read-only"); } /** * Gets or sets the x-coordinate of the left edge of this control. * @type Integer */ Yahoo.Controls.Control.prototype.left getter = function() { if(this._disposing==false) { return this._frame.hOffset; } } Yahoo.Controls.Control.prototype.left setter = function(value) { if(value!=null) { this._control_setLocation(value, this.top); } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets the height of the control. * @type Integer */ Yahoo.Controls.Control.prototype.height getter = function() { if(this._disposing==false) { return this._frame.height; } } Yahoo.Controls.Control.prototype.height setter = function(value) { if(value!=null) { if(this._frame.height != value) { this._control_setSize(this._frame.width, value); } } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets the control frame's id. * @type String */ Yahoo.Controls.Control.prototype.id getter = function() { return this._frame.id; } Yahoo.Controls.Control.prototype.id setter = function(value) { this._frame.id = value; } /** * Gets or sets a value specifying opacity of the control. * @type Integer */ Yahoo.Controls.Control.prototype.opacity getter = function() { if(this._disposing==false) { return this._frame.opacity; } } Yahoo.Controls.Control.prototype.opacity setter = function(value) { if(value!=null) { if(this._frame.opacity!=value) { this._frame.opacity = value; this._onOpacityChanged(this, new Yahoo.EventArgs()); } } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets the parent of this control. * @type Yahoo.Controls.Control */ Yahoo.Controls.Control.prototype.parent getter = function() { return this._parent; } Yahoo.Controls.Control.prototype.parent setter = function(value) { if(value!=null) { this._parent = value; } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets the width & height of the control. * @type Yahoo.Drawing.Size */ Yahoo.Controls.Control.prototype.size getter = function() { if(this._disposing==false) { return new Yahoo.Drawing.Size(this._frame.width, this._frame.height); } } Yahoo.Controls.Control.prototype.size setter = function(value) { if(value!=null) { this._control_setSize(value.width, value.height); } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets the control text. * @type String */ Yahoo.Controls.Control.prototype.text getter = function() { return this._text; } Yahoo.Controls.Control.prototype.text setter = function(value) { if(this._text!=value) { this._text = value; this._onTextChanged(this, new Yahoo.EventArgs()); } } /** * Gets or sets the control theme. * @type Yahoo.Controls.Theme */ Yahoo.Controls.Control.prototype.theme getter = function() { return this._theme; } Yahoo.Controls.Control.prototype.theme setter = function(value) { if(value!=null) { //if(this._theme!=value) { this._theme = value; this._onThemeChanged(this, new Yahoo.EventArgs()); //} } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets the tooltip displayed for this control. * @type String */ Yahoo.Controls.Control.prototype.toolTip getter = function() { return this._toolTip; } Yahoo.Controls.Control.prototype.toolTip setter = function(value) { if(value!=null) { if(this._toolTip!=value) { this._toolTip = value; this._onToolTipChanged(this, new Yahoo.EventArgs()); } } else { this._toolTip = ""; } } /** * Gets or sets the y-coordinate of the top edge of this control. * @type Integer */ Yahoo.Controls.Control.prototype.top getter = function() { if(this._disposing==false) { return this._frame.vOffset; } } Yahoo.Controls.Control.prototype.top setter = function(value) { if(value!=null) { this._control_setLocation(this.left, value); } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets a value specifying whether the control is visible. * @type Boolean */ Yahoo.Controls.Control.prototype.visible getter = function() { if(this._disposing==false) { return this._frame.visible; } } Yahoo.Controls.Control.prototype.visible setter = function(value) { if(value!=null) { if(this._frame.visible!=value) { this._frame.visible = value; this._onVisibleChanged(this, new Yahoo.EventArgs()); } } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets the width of the control. * @type Integer */ Yahoo.Controls.Control.prototype.width getter = function() { if(this._disposing==false) { return this._frame.width; } } Yahoo.Controls.Control.prototype.width setter = function(value) { if(value!=null) { if(this._frame.width != value) { this._control_setSize(value, this._frame.height); } } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets the Window that contains this control. * @type Window */ Yahoo.Controls.Control.prototype.window getter = function() { if(this._disposing==false) { return this._frame.window; } } Yahoo.Controls.Control.prototype.window setter = function(value) { this._frame.window = value; } /** * Gets or sets the zOrder of this control. * @type Integer */ Yahoo.Controls.Control.prototype.zOrder getter = function() { if(this._disposing==false) { return this._frame.zOrder; } } Yahoo.Controls.Control.prototype.zOrder setter = function(value) { if(value!=null) { this._frame.zOrder = value; } else { throw new Yahoo.ArgumentNullException("value"); } } ܞ4R/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * Form control. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. */ Yahoo.Controls.Form = function(theme) { //log("Form.ctor()"); if(arguments.length>0) { this.initialize(theme); } } /** * Define inheritance chain. */ Yahoo.Controls.Form.prototype = new Yahoo.Controls.Control(); Yahoo.Controls.Form.prototype.constructor = Yahoo.Controls.Form; Yahoo.Controls.Form.prototype.baseclassForm = Yahoo.Controls.Control.prototype; /*---------------------------------------------------------------------*/ // Public enums /*---------------------------------------------------------------------*/ /** * Available return codes for a form. */ Yahoo.Controls.DialogResult = { None: 0, OK: 1, Cancel: 2, Abort: 3, Retry: 4, Ignore: 5, Yes: 6, No: 7 } /** * Available border styles for forms. */ Yahoo.Controls.FormBorderStyle = { None: 0, FixedSingle: 1, Fixed: 2, Sizable: 4 } /*-----------------------------------------------------------*/ // Control code /*-----------------------------------------------------------*/ /** * Raises the onBackColorChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._onBackColorChanged = function(sender, e) { //log("Form._onBackColorChanged"); // Override base class so we don't change the whole frame's background color //this.baseclassForm._onBackColorChanged.call(this, sender, e); Yahoo.raiseEvent(sender, sender._onBackColorChangedEventHandlers, e); this._clientFrame.style.backgroundColor = this._backColor; } /** * Raises the onBorderColorChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._onBorderColorChanged = function(sender, e) { //log("Form._onBorderColorChanged"); this._imgBorderBottom.colorize = this._borderColor; this._imgBorderLeft.colorize = this._borderColor; this._imgBorderRight.colorize = this._borderColor; this._imgBorderTop.colorize = this._borderColor; Yahoo.raiseEvent(sender, sender._onBorderColorChangedEventHandlers, e); } /** * Raises the onClosing event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._onClosing = function(sender, e) { //log("Form._onClosing"); Yahoo.raiseEvent(sender, sender._onClosingEventHandlers, e); } /** * Raises the onClosed event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._onClosed = function(sender, e) { //log("Form._onClosed"); Yahoo.raiseEvent(sender, sender._onClosedEventHandlers, e); } /** * Raises the onResize event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._onResize = function(sender, e) { //log("Form._onResize"); var count; // sender = top level control that inherits from us // this = Form // Set client frame size if(this._disposing==false) { this._form_setClientFrameSize(); // Resize borders and background this._form_resizePaintBackground(); } // Call base class this.baseclassForm._onResize.call(this, sender, e); } /** * Raises the onFormBorderStyleChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._onFormBorderStyleChanged = function(sender, e) { //log("Form._onFormBorderStyleChanged"); this._form_loadTheme(); // Default to movable this._imgBorderTop.onMouseDown = this._border_onMouseDown; this._imgBorderTop.onMouseDrag = this._borderTop_onMouseDrag; switch(this._formBorderStyle) { case Yahoo.Controls.FormBorderStyle.None: case Yahoo.Controls.FormBorderStyle.FixedSingle: this._imgBorderTop.onMouseDown = ""; this._imgBorderTop.onMouseDrag = ""; // Falls thru to the following case Yahoo.Controls.FormBorderStyle.Fixed: this._imgBorderBottom.onMouseDown = ""; this._imgBorderBottom.onMouseDrag = ""; this._imgBorderLeft.onMouseDown = ""; this._imgBorderLeft.onMouseDrag = ""; this._imgBorderRight.onMouseDown = ""; this._imgBorderRight.onMouseDrag = ""; this._imgCornerBottomLeft.onMouseDown = ""; this._imgCornerBottomLeft.onMouseDrag = ""; this._imgCornerBottomRight.onMouseDown = ""; this._imgCornerBottomRight.onMouseDrag = ""; this._imgCornerTopLeft.onMouseDown = ""; this._imgCornerTopLeft.onMouseDrag = ""; this._imgCornerTopRight.onMouseDown = ""; this._imgCornerTopRight.onMouseDrag = ""; break; case Yahoo.Controls.FormBorderStyle.Sizable: this._imgBorderBottom.onMouseDown = this._border_onMouseDown; this._imgBorderBottom.onMouseDrag = this._borderBottom_onMouseDrag; this._imgBorderLeft.onMouseDown = this._border_onMouseDown; this._imgBorderLeft.onMouseDrag = this._borderLeft_onMouseDrag; this._imgBorderRight.onMouseDown = this._border_onMouseDown; this._imgBorderRight.onMouseDrag = this._borderRight_onMouseDrag; this._imgBorderTop.onMouseDown = this._border_onMouseDown; this._imgBorderTop.onMouseDrag = this._borderTop_onMouseDrag; this._imgCornerBottomLeft.onMouseDown = this._border_onMouseDown; this._imgCornerBottomLeft.onMouseDrag = this._cornerBottomLeft_onMouseDrag; this._imgCornerBottomRight.onMouseDown = this._border_onMouseDown; this._imgCornerBottomRight.onMouseDrag = this._cornerBottomRight_onMouseDrag; this._imgCornerTopLeft.onMouseDown = this._border_onMouseDown; this._imgCornerTopLeft.onMouseDrag = this._cornerTopLeft_onMouseDrag; this._imgCornerTopRight.onMouseDown = this._border_onMouseDown; this._imgCornerTopRight.onMouseDrag = this._cornerTopRight_onMouseDrag; break; } // switch Yahoo.raiseEvent(sender, sender._onFormBorderStyleChangedEventHandlers, e); Yahoo.raiseEvent(sender, sender._onResizeEventHandlers, new Yahoo.EventArgs()); } /** * Raises the onOpacityChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._onOpacityChanged = function(sender, e) { //log("Form._onOpacityChanged"); // Call base class this.baseclassForm._onOpacityChanged.call(this, sender, e); this._window.opacity = this.opacity; } /** * Raises the onTextChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._onTextChanged = function(sender, e) { //log("Form._onTextChanged"); // Call base class this.baseclassForm._onTextChanged.call(this, sender, e); this._lblCaption.text = this.text; } /** * Handles onMouseDown event for border elements that can move or resize the window. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._border_onMouseDown = function() { //log("Form._border_onMouseDown"); this.tag._sizeStartX = system.event.x; this.tag._sizeStartY = system.event.y; } /** * Handles onMouseDrag event for a border element. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._borderBottom_onMouseDrag = function() { //log("Form._borderBottom_onMouseDrag"); this.tag._form_setSize(this.tag.width, (this.tag._sizeStartY + system.event.vOffset)); } /** * Handles onMouseDrag event for a border element. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._borderLeft_onMouseDrag = function() { //log("Form._borderLeft_onMouseDrag"); this.tag._form_setSize((this.tag.width - system.event.hOffset), this.tag.height); this.tag.left = this.tag.left + system.event.hOffset; } /** * Handles onMouseDrag event for a border element. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._borderRight_onMouseDrag = function() { //log("Form._borderRight_onMouseDrag"); this.tag._form_setSize((this.tag._sizeStartX + system.event.hOffset), this.tag.height); } /** * Handles onMouseDrag event for a border element. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._borderTop_onMouseDrag = function() { //log("Form._borderTop_onMouseDrag"); // Move window this.tag.left = this.tag.left + system.event.hOffset - this.tag._sizeStartX; this.tag.top = this.tag.top + system.event.vOffset - this.tag._sizeStartY; } /** * Handles onMouseDrag event for a border element. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._cornerBottomLeft_onMouseDrag = function() { //log("Form._cornerBottomLeft_onMouseDrag"); this.tag._form_setSize((this.tag.width - system.event.hOffset), (this.tag._sizeStartY + system.event.vOffset)); this.tag.left = this.tag.left + system.event.hOffset; } /** * Handles onMouseDrag event for a border element. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._cornerBottomRight_onMouseDrag = function() { //log("Form._cornerBottomRight_onMouseDrag"); this.tag._form_setSize((this.tag._sizeStartX + system.event.hOffset), (this.tag._sizeStartY + system.event.vOffset)); } /** * Handles onMouseDrag event for a border element. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._cornerTopLeft_onMouseDrag = function() { //log("Form._cornerTopLeft_onMouseDrag"); this.tag._form_setSize((this.tag.width - system.event.hOffset), (this.tag.height - system.event.vOffset)); this.tag.top = this.tag.top + system.event.vOffset; this.tag.left = this.tag.left + system.event.hOffset; } /** * Handles onMouseDrag event for a border element. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._cornerTopRight_onMouseDrag = function() { //log("Form._cornerTopRight_onMouseDrag"); this.tag._form_setSize((this.tag._sizeStartX + system.event.hOffset), (this.tag.height - system.event.vOffset)); this.tag.top = this.tag.top + system.event.vOffset; } /** * Handles onMouseEnter event for label. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._form_lblCaption_onEnter = function(sender, e) { //log("Form._form_lblCaption_onEnter"); sender.parent._onEnter.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles onMouseExit event for label. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._form_lblCaption_onLeave = function(sender, e) { //log("Form._form_lblCaption_onLeave"); // Don't forward this if we are still within the parent control if(sender.parent.displayRectangle.contains(system.event.x + sender.left + sender.parent.left, system.event.y + sender.top + sender.parent.top) == false) { sender.parent._onLeave.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } } /** * Handles onMouseDown event for label. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._form_lblCaption_onMouseDown = function(sender, e) { //log("Form._form_lblCaption_onMouseDown"); sender.parent._sizeStartX = system.event.x; sender.parent._sizeStartY = system.event.y; } /** * Handles onMouseDrag event for label. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._form_lblCaption_onMouseDrag = function(sender, e) { //log("Form._form_lblCaption_onMouseDrag"); // Move window sender.parent.left = sender.parent.left + system.event.hOffset - sender.parent._sizeStartX; sender.parent.top = sender.parent.top + system.event.vOffset - sender.parent._sizeStartY; } /** * Handles onClick event for button. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._form_btnClose_onClick = function(sender, e) { //log("Form._form_btnClose_onClick"); sender.parent.close(); } /** * Raises the onThemeChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Form.prototype._onThemeChanged = function(sender, e) { //log("Form._onThemeChanged"); // Call base class this.baseclassForm._onThemeChanged.call(this, sender, e); // Load style and theme this._onFormBorderStyleChanged(this, new Yahoo.EventArgs()); // Loop all contained controls and set theme for(count=0; count0) { itemPaddingLeft += parseInt(this._buttonMargins.left); } this._btnClose.left = itemPaddingLeft; itemPaddingLeft += this._btnClose.width + parseInt(this._buttonMargins.right); itemCountLeft +=1; } else { if(itemCountRight>0) { itemPaddingRight += parseInt(this._buttonMargins.right); } this._btnClose.left = width - this._btnClose.width - itemPaddingRight; itemPaddingRight += this._btnClose.width + parseInt(this._buttonMargins.left); itemCountRight +=1; } // alignment } //showButtonClose // Caption this._lblCaption.left = itemPaddingLeft; this._lblCaption.top = parseInt(this._titlebarMargins.top) + parseInt(this._captionMargins.top); this._lblCaption.width = width - (itemPaddingLeft + itemPaddingRight); this._lblCaption.height = this._imgBorderTop.height - (parseInt(this._titlebarMargins.top) + parseInt(this._captionMargins.top)) - (parseInt(this._titlebarMargins.bottom) + parseInt(this._captionMargins.bottom)); } /** * Resizes window border elements. * @private */ Yahoo.Controls.Form.prototype._form_paintBackground = function() { var width = this.width; var height = this.height; this._imgCornerTopLeft.hOffset = 0; this._imgCornerTopLeft.vOffset = 0; // Size from image this._imgCornerTopRight.vOffset = 0; // Size from image this._imgCornerBottomLeft.hOffset = 0; // Size from image // Top border width is width - (corner widths) this._imgBorderTop.vOffset = 0; // Height from image // Left border height is height - (corner heights) this._imgBorderLeft.hOffset = 0; this._imgBorderLeft.vOffset = this._imgCornerTopLeft.height; // Width from image // Right border height is height - (corner heights) this._imgBorderRight.vOffset = this._imgCornerTopRight.height; // Width from image this._form_resizePaintBackground(); } /** * Changes the control size. * @private * @param {Integer} width The width of the form. * @param {Integer} height The height of the form. */ Yahoo.Controls.Form.prototype._form_setSize = function(width, height) { // NOTE: This function overrides baseclass var notify = false; //log("Form._form_setSize()"); // Check against constraints if(this._minimumWidth != -1) { if(width < this._minimumWidth) { width = this._minimumWidth } } if(this._minimumHeight != -1) { if(height < this._minimumHeight) { height = this._minimumHeight } } if(this._maximumWidth != -1) { if(width > this._maximumWidth) { width = this._maximumWidth } } if(this._maximumHeight != -1) { if(height > this._maximumHeight) { height = this._maximumHeight } } if(width!=this._frame.width) { this._window.width = width; this._frame.width = width; notify = true; } if(height!=this._window.height) { this._window.height = height; this._frame.height = height; notify = true; } if(notify==true) { this._onResize(this, new Yahoo.EventArgs()); } } /** * Changes the control location. * @private * @param {Integer} left The left edge of the form. * @param {Integer} top The top edge of the form. */ Yahoo.Controls.Form.prototype._form_setLocation = function(left, top) { // NOTE: This function overrides baseclass var notify = false; //log("Form._form_setLocation()"); if(left!=this._window.hOffset) { this._window.hOffset = left; notify = true; } if(top!=this._window.vOffset) { this._window.vOffset = top; notify = true; } if(notify==true) { this._onLocationChanged(this, new Yahoo.EventArgs()); } } /*-----------------------------------------------------------*/ // Public code /*-----------------------------------------------------------*/ /** * Initializes control. * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. */ Yahoo.Controls.Form.prototype.initialize = function(theme) { //log("Form.initialize()"); // Call base class this.baseclassForm.initialize.call(this, theme); // Includes lib.include("Yahoo.InvalidEnumArgumentException"); lib.include("Yahoo.Controls.Label"); lib.include("Yahoo.Controls.ImageButton"); // Internal objects this._window = new Window(); // There is a bug in the Mac version and weird things happen if you try to set options to a window that is not visible //this._window.visible = false; this._window.locked = true; this._window.alignment = "left"; this._window.shadow = false; // Move base controls frame into our window this._frame.window = this._window; this._frame.zOrder = 0; // Create a frame for the client area this._clientFrame = new Frame(); this._clientFrame.zOrder = 1000; this._frame.addSubview(this._clientFrame); // Misc this._sizeStartX = 0; this._sizeStartX = 0; // Form properties this._backColor = null; this._clientFrame.style.backgroundColor = this._backColor; this._borderColor = "#000000"; this._formBorderStyle = Yahoo.Controls.FormBorderStyle.Sizable; this._minimumWidth = -1; this._minimumHeight = -1; this._maximumWidth = -1; this._maximumHeight = -1; this._closeBox = true; this._dialogResult = Yahoo.Controls.DialogResult.None; // Events this._onBorderColorChangedEventHandlers = new Array(); this._onClosingEventHandlers = new Array(); this._onClosedEventHandlers = new Array(); // Load image objects this._form_loadTheme(); // Update styles and theme this._onFormBorderStyleChanged(this, new Yahoo.EventArgs()); // Resize window to position all elements this._form_setSize(300,300); } /** * Adds a control to the controls collection. * @param {Yahoo.Controls.Control} value The control to add to this form. */ Yahoo.Controls.Form.prototype.addControl = function(value) { //log("Form.addControl"); // NOTE: Overrides baseclass if(value!=null) { value.parent = this; this._controls.push(value); this._clientFrame.addSubview(value.frame); } // if(null) } /** * Adds an event handler. Supported events are: BorderColorChanged, Closing, Closed. * @param {Function} eventHandler The function that is to be called when the event is raised. * @param {String} eventName The name of the event that is being listened to. */ Yahoo.Controls.Form.prototype.addEventHandler = function(eventHandler, eventName) { // Call baseclass this.baseclassForm.addEventHandler.call(this, eventHandler, eventName) switch(eventName) { case "BorderColorChanged": this._onBorderColorChangedEventHandlers.push(eventHandler); break; case "Closing": this._onClosingEventHandlers.push(eventHandler); break; case "Closed": this._onClosedEventHandlers.push(eventHandler); break; } } /** * Closes the form. */ Yahoo.Controls.Form.prototype.close = function() { var cancelEventArgs = new Yahoo.EventArgs(); this._onClosing.call(this, this, cancelEventArgs); if(cancelEventArgs.cancel==false) { this.dispose(); this._onClosed.call(this, this, new Yahoo.EventArgs()); } } /** * Disposes control's resources. */ Yahoo.Controls.Form.prototype.dispose = function() { // Dispose native items this._form_disposeNativeObjects(); // Call base class, removes all native items from _frame, too this.baseclassForm.dispose.call(this); // Clean up other items if(this._clientFrame!=null) { this._clientFrame = null; } this._window.visible = false; // DEBUG: This will crash Widget Engine //this._window = null; } /** * Hides the control. */ Yahoo.Controls.Form.prototype.hide = function() { // NOTE: Overrides baseclass this._window.visible = false; } /** * Displays the control. */ Yahoo.Controls.Form.prototype.show = function() { // NOTE: Overrides baseclass if(this._window.opacity==0) { this._window.opacity = 255; } this._window.visible = true; } /*-----------------------------------------------------------*/ // Public properties /*-----------------------------------------------------------*/ /** * Gets or sets the form border color. * @type String */ Yahoo.Controls.Form.prototype.borderColor getter = function() { return this._borderColor; } Yahoo.Controls.Form.prototype.borderColor setter = function(value) { if(value!=this._bordercolor) { this._borderColor = value; this._onBorderColorChanged(this, new Yahoo.EventArgs()); } } /** * Gets or sets the height and width of the client area. * @type Yahoo.Drawing.Size */ Yahoo.Controls.Form.prototype.clientSize getter = function() { // NOTE: Overrides base class if(this._disposing==false) { return new Yahoo.Drawing.Size(this._clientFrame.width, this._clientFrame.height); } } Yahoo.Controls.Form.prototype.clientSize setter = function(value) { // NOTE: Overrides base class throw new Error("clientSize is read-only"); } /** * Gets or sets a value indicating whether the close button is displayed. * @type Boolean */ Yahoo.Controls.Form.prototype.closeBox getter = function() { return this._closeBox; } Yahoo.Controls.Form.prototype.closeBox setter = function(value) { if(this._closeBox!=value) { this._closeBox = value; this._form_paintBackground(); } } /** * Gets or sets the style of the form border. * @type Yahoo.Controls.FormBorderStyle */ Yahoo.Controls.Form.prototype.formBorderStyle getter = function() { return this._formBorderStyle; } Yahoo.Controls.Form.prototype.formBorderStyle setter = function(value) { // TODO: Check input for valid type / compare to enum this._formBorderStyle = value; // Tell form to update its style this._onFormBorderStyleChanged(this, new Yahoo.EventArgs()); } /** * Gets or sets the dialog result for the form. * @type Integer */ Yahoo.Controls.Form.prototype.dialogResult getter = function() { return this._dialogResult; } Yahoo.Controls.Form.prototype.dialogResult setter = function(value) { this._dialogResult = value; } /** * Gets the the frame of the control. * @type Frame */ Yahoo.Controls.Form.prototype.frame getter = function() { // NOTE: Overrides baseclass return this._clientFrame; } Yahoo.Controls.Form.prototype.frame setter = function(value) { // NOTE: Overrides baseclass throw new Error("frame is read-only"); } /** * Gets or sets the height of the control. * @type Integer */ Yahoo.Controls.Form.prototype.height getter = function() { // NOTE: Overrides baseclass if(this._disposing==false) { return this._window.height; } } Yahoo.Controls.Form.prototype.height setter = function(value) { // NOTE: Overrides baseclass if(value!=null) { if(this._window.height != value) { this._form_setSize(this._window.width, value); } } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets the x-coordinate of the left edge of this control. * @type Integer */ Yahoo.Controls.Form.prototype.left getter = function() { // NOTE: Overrides baseclass if(this._disposing==false) { return this._window.hOffset; } } Yahoo.Controls.Form.prototype.left setter = function(value) { // NOTE: Overrides baseclass if(value!=null) { this._form_setLocation(value, this.top); } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets the form maximum height. * @type Integer */ Yahoo.Controls.Form.prototype.maximumHeight getter = function() { return this._maximumHeight; } Yahoo.Controls.Form.prototype.maximumHeight setter = function(value) { this._maximumHeight = value; // Make sure the form size is within bounds if(this.height > value) { this.height = value; } } /** * Gets or sets the form maximum size. * @type Yahoo.Drawing.Size */ Yahoo.Controls.Form.prototype.maximumSize getter = function() { return new Yahoo.Drawing.Size(this._maximumWidth, this._maximumHeight); } Yahoo.Controls.Form.prototype.maximumSize setter = function(value) { this._maximumWidth = value.width; this._maximumHeight = value.height; // Make sure the form size is within bounds if(this.width > value.width || this.height > value.height) { // Check which value we need to modify (the logic is a little reversed) if(this.width < value.width) { value.width = this.width; } if(this.height < value.height) { value.height = this.height; } this._form_setSize(value.width, value.height); } } /** * Gets or sets the form maximum width. * @type Integer */ Yahoo.Controls.Form.prototype.maximumWidth getter = function() { return this._maximumWidth; } Yahoo.Controls.Form.prototype.maximumWidth setter = function(value) { this._maximumWidth = value; // Make sure the form size is within bounds if(this.width > value) { this.width = value; } } /** * Gets or sets the form minimum height. * @type Integer */ Yahoo.Controls.Form.prototype.minimumHeight getter = function() { return this._minimumHeight; } Yahoo.Controls.Form.prototype.minimumHeight setter = function(value) { this._minimumHeight = value; // Make sure the form size is within bounds if(this.height < value) { this.height = value; } } /** * Gets or sets the form minimum size. * @type Yahoo.Drawing.Size */ Yahoo.Controls.Form.prototype.minimumSize getter = function() { return new Yahoo.Drawing.Size(this._minimumWidth, this._minimumHeight); } Yahoo.Controls.Form.prototype.minimumSize setter = function(value) { this._minimumWidth = value.width; this._minimumHeight = value.height; // Make sure the form size is within bounds if(this.width < value.width || this.height < value.height) { // Check which size we need to modify if(this.width > value.width) { value.width = this.width; } if(this.height > value.height) { value.height = this.height; } this._form_setSize(value.width, value.height); } } /** * Gets or sets the form minimum width. * @type Integer */ Yahoo.Controls.Form.prototype.minimumWidth getter = function() { return this._minimumWidth; } Yahoo.Controls.Form.prototype.minimumWidth setter = function(value) { this._minimumWidth = value; // Make sure the form size is within bounds if(this.width <= value) { this.width = value; } } /** * Gets or sets the y-coordinate of the top edge of this control. * @type Integer */ Yahoo.Controls.Form.prototype.top getter = function() { // NOTE: Overrides baseclass if(this._disposing==false) { return this._window.vOffset; } } Yahoo.Controls.Form.prototype.top setter = function(value) { // NOTE: Overrides baseclass if(value!=null) { this._form_setLocation(this.left, value); } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets the width of the control. * @type Integer */ Yahoo.Controls.Form.prototype.width getter = function() { // NOTE: Overrides baseclass if(this._disposing==false) { return this._window.width; } } Yahoo.Controls.Form.prototype.width setter = function(value) { // NOTE: Overrides baseclass if(value!=null) { if(this._window.width != value) { this._form_setSize(value, this._window.height); } } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets the Window of this form. * @type Window */ Yahoo.Controls.Form.prototype.window getter = function() { if(this._disposing==false) { return this._frame.window; } } Yahoo.Controls.Form.prototype.window setter = function(value) { throw new Error("window is read-only"); } (c( v//*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * ImageButton control. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. * param {Image} normal The image to use in the rest state. * param {Image} over The image to use in the mouse over state. * param {Image} down The image to use in the mouse down state. * param {Image} disabled The image to use in the disabled state. */ Yahoo.Controls.ImageButton = function(theme, normal, over, down, disabled) { //log("ImageButton.ctor()"); if(arguments.length>0) { this.initialize(theme, normal, over, down, disabled); } } /** * Define inheritance chain. */ Yahoo.Controls.ImageButton.prototype = new Yahoo.Controls.Control(); Yahoo.Controls.ImageButton.prototype.constructor = Yahoo.Controls.ImageButton; Yahoo.Controls.ImageButton.prototype.baseclassImageButton = Yahoo.Controls.Control.prototype; /*-----------------------------------------------------------*/ // Control code /*-----------------------------------------------------------*/ /** * Raises the onEnabledChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ImageButton.prototype._onEnabledChanged = function(sender, e) { //log("ImageButton._onEnabledChanged"); // Call baseclass this.baseclassImageButton._onEnabledChanged.call(this, sender, e); this._imageButton_setButtonState(); } /** * Raises the onToolTipChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ImageButton.prototype._onToolTipChanged = function(sender, e) { //log("ImageButton._onToolTipChanged"); // Call baseclass this.baseclassImageButton._onToolTipChanged.call(this, sender, e); // Set tooltip this._imgDisabled.tooltip = this.toolTip; this._imgDown.tooltip = this.toolTip; this._imgNormal.tooltip = this.toolTip; this._imgOver.tooltip = this.toolTip; } /** * Handles onEnter event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ImageButton.prototype._onEnter = function(sender, e) { //log("ImageButton._onEnter"); // Call baseclass this.baseclassImageButton._onEnter.call(this, sender, e); this._imageButton_setButtonState(); } /** * Handles onLeave event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ImageButton.prototype._onLeave = function(sender, e) { //log("ImageButton._onLeave"); // Call baseclass this.baseclassImageButton._onLeave.call(this, sender, e); this._imageButton_setButtonState(); } /** * Handles onMouseDown event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ImageButton.prototype._imageButton_onMouseDown = function(sender, e) { //log("ImageButton._imageButton_onMouseDown"); sender._imageButton_setButtonState(); } /** * Handles onMouseUp event for whole control. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ImageButton.prototype._imageButton_onMouseUp = function(sender, e) { //log("ImageButton._imageButton_onMouseUp"); sender._imageButton_setButtonState(); } /** * Raises the onResize event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ImageButton.prototype._onResize = function(sender, e) { //log("ImageButton._onResize"); // Call baseclass this.baseclassImageButton._onResize.call(this, sender, e); var width = this.width; var height = this.height; // Resize images this._imgDisabled.width = width; this._imgDisabled.height = height; this._imgDown.width = width; this._imgDown.height = height; this._imgNormal.width = width; this._imgNormal.height = height; this._imgOver.width = width; this._imgOver.height = height; } /** * Handles the onThemeChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ImageButton.prototype._onThemeChanged = function(sender, e) { //log("Button._onThemeChanged"); // Call base class this.baseclassImageButton._onThemeChanged.call(this, sender, e); this._imageButton_loadTheme(); } /*---------------------------------------------------------------------*/ // Private code /*---------------------------------------------------------------------*/ /** * Disposes native Widget Engine objects. * @private */ Yahoo.Controls.ImageButton.prototype._imageButton_disposeNativeObjects = function() { //log("ImageButton._imageButton_disposeNativeObjects"); if(this._imgDisabled!=null) { this._imgDisabled.removeFromSuperview(); this._imgDisabled = null; } if(this._imgDown!=null) { this._imgDown.removeFromSuperview(); this._imgDown = null; } if(this._imgNormal!=null) { this._imgNormal.removeFromSuperview(); this._imgNormal = null; } if(this._imgOver!=null) { this._imgOver.removeFromSuperview(); this._imgOver = null; } } /** * Loads control elements based on current theme. * @private */ Yahoo.Controls.ImageButton.prototype._imageButton_loadTheme = function() { // Load images this._imgDisabled = this._imageButton_getButton(this._disabledItem); this._imgDown = this._imageButton_getButton(this._downItem); this._imgNormal = this._imageButton_getButton(this._normalItem); this._imgOver = this._imageButton_getButton(this._overItem); this._imageButton_setButtonState(); } /** * Sets the button state. * @private */ Yahoo.Controls.ImageButton.prototype._imageButton_setButtonState = function() { if(this.disposing==false) { // Hide all buttons this._imgDisabled.visible = false; this._imgDown.visible = false; this._imgNormal.visible = false; this._imgOver.visible = false; if(this.enabled==false) { this._imgDisabled.visible = true; } else { if(this._isMouseOver==true && this._isMouseDown==true) { this._imgDown.visible = true; } else if(this._isMouseOver==true && this._isMouseDown==false) { this._imgOver.visible = true; } else { this._imgNormal.visible = true; } } // if enabled } // if disposing } /** * Loads an image from the theme. * @private * @param {String} itemName The style name to retrieve. * @type Image */ Yahoo.Controls.ImageButton.prototype._imageButton_getButton = function(itemName) { var result; result = this._theme.getItem(itemName); result.visible = false; result.tooltip = this.toolTip; result.tag = this; this._frame.addSubview(result); return result; } /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. * param {Image} normal The image to use in the rest state. * param {Image} over The image to use in the mouse over state. * param {Image} down The image to use in the mouse down state. * param {Image} disabled The image to use in the disabled state. */ Yahoo.Controls.ImageButton.prototype.initialize = function(theme, normal, over, down, disabled) { //log("ImageButton.initialize()"); // Call base class constructor this.baseclassImageButton.initialize.call(this, theme); this._normalItem = normal; this._overItem = over; this._downItem = down; this._disabledItem = disabled; // Hook into mouse events for whole control this.addEventHandler(this._imageButton_onMouseDown, "MouseDown"); this.addEventHandler(this._imageButton_onMouseUp, "MouseUp"); this._imageButton_loadTheme(); } /** * Disposes control's resources. */ Yahoo.Controls.ImageButton.prototype.dispose = function() { this._imageButton_disposeNativeObjects(); // Call base class this.baseclassImageButton.dispose.call(this); } /*---------------------------------------------------------------------*/ // Public properties /*---------------------------------------------------------------------*/ /** * Gets or sets the height of the control. * @type Integer */ Yahoo.Controls.ImageButton.prototype.height getter = function() { var result; // NOTE: Overrides baseclass if(this._frame.height!=-1) { result = this._frame.height; } else { result = this._imgNormal.height; } return result; } Yahoo.Controls.ImageButton.prototype.height setter = function(value) { if(value!=null) { this._control_setSize(this.width, value); } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets the width of the control. * @type Integer */ Yahoo.Controls.ImageButton.prototype.width getter = function() { var result; // NOTE: Overrides baseclass if(this._frame.width!=-1) { result = this._frame.width; } else { result = this._imgNormal.width; } return result; } Yahoo.Controls.ImageButton.prototype.width setter = function(value) { if(value!=null) { this._control_setSize(value, this.height); } else { throw new Yahoo.ArgumentNullException("value"); } } )@ @47R/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2006 Yahoo! Inc. All Rights Reserved. /// /** * ImageComboBox control. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. * @param {String} themePrefix The prefix used to retrieve styles from the theme for this control. */ Yahoo.Controls.ImageComboBox = function(theme, themePrefix) { //log("ImageComboBox.ctor()"); if(arguments.length>0) { this.initialize(theme, themePrefix); } } /** * Define inheritance chain. */ Yahoo.Controls.ImageComboBox.prototype = new Yahoo.Controls.Control(); Yahoo.Controls.ImageComboBox.prototype.constructor = Yahoo.Controls.ImageComboBox; Yahoo.Controls.ImageComboBox.prototype.baseclassImageComboBox = Yahoo.Controls.Control.prototype; /*-----------------------------------------------------------*/ // Control code /*-----------------------------------------------------------*/ /** * Raises the onEnabledChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ImageComboBox.prototype._onEnabledChanged = function(sender, e) { //log("ImageComboBox._onEnabledChanged"); // Call baseclass this.baseclassImageComboBox._onEnabledChanged.call(this, sender, e); this._btnDropDown.enabled = this.enabled; } /** * Raises the onToolTipChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ImageComboBox.prototype._onToolTipChanged = function(sender, e) { //log("ImageComboBox._onToolTipChanged"); // Call baseclass this.baseclassImageComboBox._onToolTipChanged.call(this, sender, e); // Set tooltip this._btnDropDown.toolTip = this.toolTip; } /** * Raises the onSelectedIndexChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ImageComboBox.prototype._onSelectedIndexChanged = function(sender, e) { //log("ImageComboBox._onSelectedIndexChanged"); if(this._selectedIndex!=-1) { this._text = this._items.item(this._selectedIndex).toString(); } else { this._text = ""; } // Raise event Yahoo.raiseEvent(sender, sender._onSelectedIndexChangedEventHandlers, e); } /** * Raises the onThemeChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ImageComboBox.prototype._onThemeChanged = function(sender, e) { //log("ImageComboBox._onThemeChanged"); // Call base class this.baseclassImageComboBox._onThemeChanged.call(this, sender, e); this._imageComboBox_loadTheme(); } /** * Handles onMouseEnter event for image. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ImageComboBox.prototype._imageComboBox_btnDropDown_onEnter = function(sender, e) { //log("ImageComboBox._imageComboBox_btnDropDown_onEnter"); sender.parent._onEnter.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles onMouseExit event for imagebutton. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ImageComboBox.prototype._imageComboBox_btnDropDown_onLeave = function(sender, e) { //log("ImageComboBox._imageComboBox_btnDropDown_onLeave"); // Don't forward this if we are still within the parent control if(sender.parent.displayRectangle.contains(system.event.x + sender.left + sender.parent.left, system.event.y + sender.top + sender.parent.top) == false) { sender.parent._onLeave.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } } /** * Handles onMouseDown event for imagebutton. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ImageComboBox.prototype._imageComboBox_btnDropDown_onMouseDown = function(sender, e) { //log("ImageComboBox._imageComboBox_btnDropDown_onMouseDown"); sender.parent._onMouseDown.call(sender.parent, sender.parent, new Yahoo.EventArgs()); // Opening the menu will mess with the buttons mouse state flags, reset them here sender.parent._btnDropDown._isMouseOver = false; sender.parent._btnDropDown._isMouseDown = false; sender.parent._btnDropDown._imageButton_setButtonState(); sender.parent._imageComboBox_showMenu.call(sender.parent); } /** * Handles onMouseUp event for imagebutton. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ImageComboBox.prototype._imageComboBox_btnDropDown_onMouseUp = function(sender, e) { //log("ImageComboBox._imageComboBox_btnDropDown_onMouseUp"); sender.parent._onMouseUp.call(sender.parent, sender.parent, new Yahoo.EventArgs()); } /** * Handles click event for comboitem. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ImageComboBox.prototype._imageComboBox_item_onClick = function() { //log("ComboBox._imageComboBox_item_onClick"); this.tag.selectedIndex = this.index; } /*---------------------------------------------------------------------*/ // Private code /*---------------------------------------------------------------------*/ /** * Disposes native Widget Engine objects. * @private */ Yahoo.Controls.ImageComboBox.prototype._imageComboBox_disposeNativeObjects = function() { //log("ImageComboBox._imageComboBox_disposeNativeObjects"); // These aren't native objects, but we still dispose them here if(this._btnDropDown!=null) { this._btnDropDown.dispose(); this._btnDropDown = null; } } /** * Loads control elements based on current theme. * @private */ Yahoo.Controls.ImageComboBox.prototype._imageComboBox_loadTheme = function() { // Remove any current objects this._imageComboBox_disposeNativeObjects(); this._btnDropDown = new Yahoo.Controls.ImageButton(this._theme, this._themePrefix + "Normal", this._themePrefix + "Over", this._themePrefix + "Down", this._themePrefix + "Disabled"); this._btnDropDown.addEventHandler(this._imageComboBox_btnDropDown_onEnter, "Enter"); this._btnDropDown.addEventHandler(this._imageComboBox_btnDropDown_onLeave, "Leave"); this._btnDropDown.addEventHandler(this._imageComboBox_btnDropDown_onMouseDown, "MouseDown"); this._btnDropDown.addEventHandler(this._imageComboBox_btnDropDown_onMouseUp, "MouseUp"); this._btnDropDown.zOrder = 5; this.addControl(this._btnDropDown); } /** * Displays menu. * @private */ Yahoo.Controls.ImageComboBox.prototype._imageComboBox_showMenu = function() { var count; var menu = new Array(); var point; for(count=0; count0) { point = this.pointToClient(new Yahoo.Drawing.Point(0, this.height)); popupMenu(menu, point.x, point.y); } } /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. * @param {String} themePrefix The prefix used to retrieve styles from the theme for this control. */ Yahoo.Controls.ImageComboBox.prototype.initialize = function(theme, themePrefix) { //log("ImageComboBox.initialize()"); // Call baseclass constructor this.baseclassImageComboBox.initialize.call(this, theme, "comboBox"); this._themePrefix = themePrefix; this._showCheckmark = true; // Includes handled by baseclass //lib.include("Yahoo.ArgumentNullException"); //lib.include("Yahoo.ArgumentOutOfRangeException"); //lib.include("Yahoo.Controls.Theme"); //lib.include("Yahoo.Drawing.Rectangle"); // Includes lib.include("Yahoo.Controls.ImageButton"); // Initialize variables/controls this._items = new Yahoo.Controls.ImageComboBox.ObjectCollection(); this._selectedIndex = -1 this._onSelectedIndexChangedEventHandlers = new Array(); this._imageComboBox_loadTheme(); } /** * Adds an event handler. Supported events are: SelectedIndexChanged. * @param {Function} eventHandler The function that is to be called when the event is raised. * @param {String} eventName The name of the event that is being listened to. */ Yahoo.Controls.ImageComboBox.prototype.addEventHandler = function(eventHandler, eventName) { // Call baseclass this.baseclassImageComboBox.addEventHandler.call(this, eventHandler, eventName) switch(eventName) { case "SelectedIndexChanged": this._onSelectedIndexChangedEventHandlers.push(eventHandler); break; } } /** * Disposes control's resources. */ Yahoo.Controls.ImageComboBox.prototype.dispose = function() { this._imageComboBox_disposeNativeObjects(); // Call baseclass this.baseclassImageComboBox.dispose.call(this); // Baseclass disposes our custom controls } /*---------------------------------------------------------------------*/ // Public properties /*---------------------------------------------------------------------*/ /** * Gets the collection of items in the combobox. * @type Yahoo.Controls.ImageComboBox.ObjectCollection */ Yahoo.Controls.ImageComboBox.prototype.items getter = function() { return this._items; } Yahoo.Controls.ImageComboBox.prototype.items setter = function(value) { throw new Error("items is read-only"); } /** * Gets or sets the selected item index. * @type Integer */ Yahoo.Controls.ImageComboBox.prototype.selectedIndex getter = function() { return this._selectedIndex; } Yahoo.Controls.ImageComboBox.prototype.selectedIndex setter = function(value) { if(value!=null) { if(this._selectedIndex!=value) { if(value<-1 || value>=this._items.count) { throw new Yahoo.ArgumentOutOfRangeException("value"); } else { this._selectedIndex = value; this._onSelectedIndexChanged(this, new Yahoo.EventArgs()); } } } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets a value indicating whether the selected item will have a checkmark. * @type Boolean */ Yahoo.Controls.ImageComboBox.prototype.showCheckmark getter = function() { return this._showCheckmark; } Yahoo.Controls.ImageComboBox.prototype.showCheckmark setter = function(value) { if(value!=null) { this._showCheckmark = value; } else { throw new Yahoo.ArgumentNullException("value"); } } /*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * ImageComboBoxCollection control. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Namespace /*---------------------------------------------------------------------*/ // Create namespace Yahoo.Controls if it doesn't already exist if(Yahoo==undefined) { var Yahoo = new Object(); } if(Yahoo.Windows==undefined) { Yahoo.Windows = new Object(); } if(Yahoo.Controls==undefined) { Yahoo.Controls = new Object(); } /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. */ Yahoo.Controls.ImageComboBox.ObjectCollection = function() { //log("ImageComboBox.ObjectCollection.ctor()"); this.initialize(); } /*---------------------------------------------------------------------*/ // Private code /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. */ Yahoo.Controls.ImageComboBox.ObjectCollection.prototype.initialize = function() { //log("ImageComboBox.ObjectCollection.initialize()"); this._items = new Array(); } /** * Adds an item to the collection. * @param {Object} item The item to add to the collection. */ Yahoo.Controls.ImageComboBox.ObjectCollection.prototype.add = function(item) { var result = -1; if(item!=null) { result = this._items.push(item) - 1; } else { throw new Yahoo.ArgumentNullException("item"); } return result; } /** * Removes all items from the collection. */ Yahoo.Controls.ImageComboBox.ObjectCollection.prototype.clear = function() { delete this._items; this._items = new Array(); } /** * Gets the index of the given item. * @param {Object} item The item to to find in the collection. */ Yahoo.Controls.ImageComboBox.ObjectCollection.prototype.indexOf = function(item) { var count; var result = -1; if(item!=null) { // Find the item for(count=0; count=0 && index=0 && index /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * Label control. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. */ Yahoo.Controls.Label = function(theme) { //log("Label.ctor()"); if(arguments.length>0) { this.initialize(theme); } } /** * Define inheritance chain. */ Yahoo.Controls.Label.prototype = new Yahoo.Controls.Control(); Yahoo.Controls.Label.prototype.constructor = Yahoo.Controls.Label; Yahoo.Controls.Label.prototype.baseclassLabel = Yahoo.Controls.Control.prototype; /*-----------------------------------------------------------*/ // Control code /*-----------------------------------------------------------*/ /** * Raises the onFontChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Label.prototype._onFontChanged = function(sender, e) { //log("Label._onFontChanged"); // Call base class this.baseclassLabel._onFontChanged.call(this, sender, e); this._lblText.style.fontFamily = this.font.name; this._lblText.style.fontSize = this.font.size + "px"; this._label_setTextLocation(); } /** * Raises the onForeColorChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Label.prototype._onForeColorChanged = function(sender, e) { //log("Label._onForeColorChanged"); // Call base class this.baseclassLabel._onForeColorChanged.call(this, sender, e); this._lblText.color = this.foreColor; } /** * Raises the onResize event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Label.prototype._onResize = function(sender, e) { //log("Label._onResize"); // Call base class this.baseclassLabel._onResize.call(this, sender, e); // Resize text this._label_setTextLocation(); } /** * Raises the onTextChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Label.prototype._onTextChanged = function(sender, e) { //log("Label._onTextChanged"); // Call base class this.baseclassLabel._onTextChanged.call(this, sender, e); // Set text this._lblText.data = this.text; // Set/Update location this._label_setTextLocation(); } /** * Raises the onToolTipChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Label.prototype._onToolTipChanged = function(sender, e) { //log("Label._onToolTipChanged"); // Call base class this.baseclassLabel._onToolTipChanged.call(this, sender, e); // Set tooltip this._lblText.tooltip = this.toolTip; } /** * Raises the onThemeChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Label.prototype._onThemeChanged = function(sender, e) { log("Label._onThemeChanged"); // Call base class this.baseclassLabel._onThemeChanged.call(this, sender, e); this._label_loadTheme(); } /*---------------------------------------------------------------------*/ // Private code /*---------------------------------------------------------------------*/ /** * Disposes native Widget Engine objects. * @private */ Yahoo.Controls.Label.prototype._label_disposeNativeObjects = function() { //log("Label._label_disposeNativeObjects"); if(this._lblText!=null) { this._lblText.removeFromSuperview(); this._lblText = null; } } /** * Loads control elements based on current theme. * @private */ Yahoo.Controls.Label.prototype._label_loadTheme = function() { //log("_label_loadTheme"); // Remove any current objects this._label_disposeNativeObjects(); this._lblText = this._theme.getItem("labelLabel"); this._lblText.anchorStyle = "topLeft"; // Change tracking for label so we can use it to detect when the mouse is over the whole Label this._lblText.tracking = "rectangle"; this._frame.addSubview(this._lblText); this._lblText.data = this.text; this._label_setTextLocation(); } /** * Sets the hOffset for the text label. * @private */ Yahoo.Controls.Label.prototype._label_setTextLocation = function() { //log("Label._label_setTextLocation"); var width; var height; if(this._isInitializing==false) { width = this.width; height = this.height; if(this._autoSize==true) { this._lblText.width = -1; } else { this._lblText.width = width; } // This takes care of aligning the text in a way that is more familiar for programmers switch(this._textAlign) { // Do vertical alignment case Yahoo.Drawing.ContentAlignment.BottomCenter: case Yahoo.Drawing.ContentAlignment.BottomLeft: case Yahoo.Drawing.ContentAlignment.BottomRight: this._lblText.vOffset = (height - this._lblText.height); break; case Yahoo.Drawing.ContentAlignment.MiddleCenter: case Yahoo.Drawing.ContentAlignment.MiddleLeft: case Yahoo.Drawing.ContentAlignment.MiddleRight: this._lblText.vOffset = ((height / 2) - (this._lblText.height / 2)); break; case Yahoo.Drawing.ContentAlignment.TopCenter: case Yahoo.Drawing.ContentAlignment.TopLeft: case Yahoo.Drawing.ContentAlignment.TopRight: this._lblText.vOffset = 0; break; default: throw new Yahoo.InvalidEnumArgumentException(); break; } switch(this._textAlign) { // Do horizontal alignment case Yahoo.Drawing.ContentAlignment.BottomCenter: case Yahoo.Drawing.ContentAlignment.MiddleCenter: case Yahoo.Drawing.ContentAlignment.TopCenter: this._lblText.alignment = "center"; this._lblText.hOffset = width / 2; break; case Yahoo.Drawing.ContentAlignment.BottomLeft: case Yahoo.Drawing.ContentAlignment.MiddleLeft: case Yahoo.Drawing.ContentAlignment.TopLeft: this._lblText.alignment = "left"; this._lblText.hOffset = 0; break; case Yahoo.Drawing.ContentAlignment.BottomRight: case Yahoo.Drawing.ContentAlignment.MiddleRight: case Yahoo.Drawing.ContentAlignment.TopRight: this._lblText.alignment = "right"; this._lblText.hOffset = width; break; //default: //throw new Yahoo.InvalidEnumArgumentException(); //break; } } // isInitializing } /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. */ Yahoo.Controls.Label.prototype.initialize = function(theme) { //log("Label.initialize()"); var params; // Call base class constructor this.baseclassLabel.initialize.call(this, theme); this._isInitializing = true; // Includes lib.include("Yahoo.InvalidEnumArgumentException"); lib.include("Yahoo.Drawing.ContentAlignment"); // Initialize variables (optimized version) this._autoSize = false; this._textAlign = Yahoo.Drawing.ContentAlignment.MiddleLeft; this._label_loadTheme(); this._isInitializing = false; } /** * Disposes control's resources. */ Yahoo.Controls.Label.prototype.dispose = function() { // Dispose native items this._label_disposeNativeObjects(); // Call base class this.baseclassLabel.dispose.call(this); } /** * Sets the label properties based on a Widget Engine Text-object. * @param {Text} text The Text object to set the label style from. */ Yahoo.Controls.Label.prototype.fromTextObject = function(text) { if(text!=null) { this._lblText.style.fontFamily = text.style.fontFamily; this._lblText.style.fontSize = text.style.fontSize; this._lblText.style.fontWeight = text.style.fontWeight; if(text.style.KonTextTruncation != "") { this._lblText.style.KonTextTruncation = text.style.KonTextTruncation; } this._backColor = text.bgColor; this._frame.style.backgroundColor = this._backColor; this._foreColor = text.color; this._lblText.color = this._foreColor; this._text = text.data; this._lblText.data = this.text; this.opacity = text.opacity; this._lblText.scrolling = text.scrolling; this._toolTip = text.tooltip; this._lblText.tooltip = this._toolTip; this.visible = text.visible; this.zOrder = text.zOrder; this._control_setSize(text.width, text.height) // This will call setLocation this.font = new Yahoo.Drawing.Font(text.font, text.size); } else { throw new Yahoo.ArgumentNullException("text"); } } /*---------------------------------------------------------------------*/ // Public properties /*---------------------------------------------------------------------*/ /** * Gets or sets a value indicating whether the label resizes to fit its contents. * @type Boolean */ Yahoo.Controls.Label.prototype.autoSize getter = function() { return this._autoSize; } Yahoo.Controls.Label.prototype.autoSize setter = function(value) { if(value!=null) { this._autoSize = value; this._label_setTextLocation(); } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets the alignment of the text on the Label. * @type Yahoo.Drawing.ContentAlignment */ Yahoo.Controls.Label.prototype.textAlign getter = function() { return this._textAlign; } Yahoo.Controls.Label.prototype.textAlign setter = function(value) { if(value!=null) { this._textAlign = value; this._label_setTextLocation(); } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets a value indicating whether the text should scroll if it does not fit. * @type Boolean */ Yahoo.Controls.Label.prototype.scrolling getter = function() { return this._lblText.scrolling; } Yahoo.Controls.Label.prototype.scrolling setter = function(value) { if(value!=null) { this._lblText.scrolling = value; } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets the style object for this text label. * @type Style */ Yahoo.Controls.Label.prototype.style getter = function() { return this._lblText.style; } Yahoo.Controls.Label.prototype.style setter = function(value) { throw new Error("style is read-only"); } "}47/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * ProgressBar control. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. */ Yahoo.Controls.ProgressBar = function(theme) { //log("ProgressBar.ctor()"); if(arguments.length>0) { this.initialize(theme); } } /** * Define inheritance chain. */ Yahoo.Controls.ProgressBar.prototype = new Yahoo.Controls.SizableControlBase(); Yahoo.Controls.ProgressBar.prototype.constructor = Yahoo.Controls.ProgressBar; Yahoo.Controls.ProgressBar.prototype.baseclassProgressBar = Yahoo.Controls.SizableControlBase.prototype; /*-----------------------------------------------------------*/ // Control code /*-----------------------------------------------------------*/ /** * Raises the onResize event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ProgressBar.prototype._onResize = function(sender, e) { //log("ProgressBar._onResize"); // Call base class this.baseclassProgressBar._onResize.call(this, sender, e); // Resize fill image this._progressBar_setFillImageHeight(); this._progressBar_setFill(); } /** * Raises the onThemeChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.ProgressBar.prototype._onThemeChanged = function(sender, e) { //log("ProgressBar._onThemeChanged"); // Call base class this.baseclassProgressBar._onThemeChanged.call(this, sender, e); // TODO: //this._progressBar_loadTheme(); } /*---------------------------------------------------------------------*/ // Private code /*---------------------------------------------------------------------*/ /** * Sets the hOffset for the fill image. * @private */ Yahoo.Controls.ProgressBar.prototype._progressBar_setFillImageLeft = function() { if(this._imgFill!=null) { this._imgFill.hOffset = this._fillMarginLeft; } } /** * Sets the vOffset for the fill image. * @private */ Yahoo.Controls.ProgressBar.prototype._progressBar_setFillImageTop = function() { if(this._imgFill!=null) { this._imgFill.vOffset = this._fillMarginTop; } } /** * Sets the height for the fill image. * @private */ Yahoo.Controls.ProgressBar.prototype._progressBar_setFillImageHeight = function() { if(this._imgFill!=null) { this._imgFill.height = this.height - this._fillMarginTop - this._fillMarginBottom; } } /** * Sets the size of the fill image to match the current value. * @private */ Yahoo.Controls.ProgressBar.prototype._progressBar_setFill = function() { var width; if(this._imgFill!=null) { try { if(this._maximum!=0) { width = (this._value / this._maximum) * (this.width - this._fillMarginLeft - this._fillMarginRight); } else { width = 0; } if(isNaN(width)==false) { this._imgFill.width = Math.round(width); } } catch(e) { log(e); } } } /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. */ Yahoo.Controls.ProgressBar.prototype.initialize = function(theme) { //log("ProgressBar.initialize()"); var params; // Call base class constructor this.baseclassProgressBar.initialize.call(this, theme, "progressBar"); // Initialize variables this._maximum = 0; this._minimum = 0; this._value = 0; this._imgFill = this._theme.getItem("progressBarFill"); this._frame.addSubview(this._imgFill); // Get margins for fill image from theme params = this._theme.getParameter("progressBarFillMargins"); this._fillMarginLeft = parseInt(params.left); this._fillMarginRight = parseInt(params.right); this._fillMarginTop = parseInt(params.top); this._fillMarginBottom = parseInt(params.bottom); this._progressBar_setFillImageLeft(); this._progressBar_setFillImageTop(); this._progressBar_setFillImageHeight(); this._progressBar_setFill(); } /** * Disposes control's resources. */ Yahoo.Controls.ProgressBar.prototype.dispose = function() { // Dispose native items // TODO: This should be moved elsewhere once we support changing themes on the fly if(this._imgFill!=null) { this._imgFill.removeFromSuperview(); this._imgFill = null; } // Call base class this.baseclassProgressBar.dispose.call(this); } /*---------------------------------------------------------------------*/ // Public properties /*---------------------------------------------------------------------*/ /** * Gets or sets the maximum value. * @type Integer */ Yahoo.Controls.ProgressBar.prototype.maximum getter = function() { return this._maximum; } Yahoo.Controls.ProgressBar.prototype.maximum setter = function(value) { if(value!=null) { this._maximum = value; } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets the minimimum value. * @type Integer */ Yahoo.Controls.ProgressBar.prototype.minimum getter = function() { return this._minimum; } Yahoo.Controls.ProgressBar.prototype.minimum setter = function(value) { if(value!=null) { this._minimum = value; } else { throw new Yahoo.ArgumentNullException("value"); } } /** * Gets or sets the current value. * @type Integer */ Yahoo.Controls.ProgressBar.prototype.value getter = function() { return this._value; } Yahoo.Controls.ProgressBar.prototype.value setter = function(value) { if(value!=null) { if((valuethis._maximum)) { throw new Yahoo.ArgumentOutOfRangeException("value"); } else { this._value = value; this._progressBar_setFill(); } } else { throw new Yahoo.ArgumentNullException("value"); } } 7}H~cPNG  IHDRpcHtIME  = pHYs  ~gAMA a IDATxc```IENDB`}~}PNG  IHDRpcHtIME :S pHYs  d_gAMA a IDATxchhhu.IENDB`|H~PNG  IHDRhtIME 6dR pHYsN N }gAMA a IDATxc`IENDB`}~PNG  IHDRpcHtIME 4k= pHYs  ~gAMA a IDATxc?3IENDB`5a44 PNG  IHDRvtIME 88' pHYsaa?igAMA a-IDATxe1jP',l#eAB &-Ϳ=nMJx&1M^QG gAeXSIENDB`4PNG  IHDRtIME : pHYsaa?igAMA abIDATxMʡ ϗ4 LD af`PъSMZ+B؇H)m3z1f#Ƹ콃/K)A!ďI$myIENDB`HPNG  IHDRvtIME :4&K pHYsaa?igAMA a'IDATxeP@[3EQ"0 9@_?m۾\I8N}EI hw`wz#=Ǫz4 -l6{11Yu,(%Jr9XRgL&8)m4M{`RIA, `0(K&B^Y:6p8bfr!BPxZ&`aDض0͞ jEKVׅ0N=pLh4d~}zQ/oUxc0 fM:$y(fZ,5 ]6 ;j5{>_}@dr}`&@[Oh'u]UqYzNIENDB`ܿPNG  IHDRl$"tIME 7 Y pHYs  gAMA aIDATxc>e('řIENDB``4PNG  IHDR tIME 4( pHYs  gAMA a!IDATxc # RRR uVBr#IENDB`ܿPNG  IHDR8g<tIME  4 pHYs  gAMA aIDATxc`@.\AΝ@޽ @5dKccc"z?ڵX7R"E#+\`˗?핑ϟ?pݯ ikk:4gf0-kIENDB`PNG  IHDRhstIME 5p6 pHYs  gAMA aaIDATxc)πX@(ҥAAA3߼yc VPPӡR&**sʕE)iPYq 1o<Zu[.1IENDB`FPNG  IHDRhstIME 6ZD} pHYs  gAMA adIDATxc;ua`!A^^3e@?#HY@k=GG3@3rrrLPcs<))P FFƗ+η\IENDB`yPNG  IHDRhstIME 4f pHYs  gAMA a^IDATxc` qccG ]fQYS"o3ihh3B8_pp+W\AjgbaM, IENDB`jPNG  IHDRhstIME 6!3 pHYs  gAMA a`IDATxc ?]99` V(//ca(ePSS r1H ??#455JCi+~IENDB`- >yPNG  IHDRP*tIMElys pHYsN N }gAMA aCIDATxc`cc{_@3++{ˌ(LY F,;3PD KIIENDB`u jPNG  IHDR=GtIME &kI< pHYsN N }gAMA aDIDATxc066~(A:4Ag NWQL7qydrL&*id(1J KIENDB` ">PNG  IHDR׀tIME#{ pHYsN N }gAMA a~IDATxc```e #aK H,4.~6.Ib%˂  L)bd 1R$b@@Iq /(:PR;\ %f)VFCq -n9oϨ2?D?;c#IENDB` PNG  IHDR }tIME*' pHYsN N }gAMA aQIDATxXQ0 -_㕼|11PFXu]Fy~e ,"4e!nf MSˡMˠ)̠2Pc"=g;}D`UfPDe(oP(ξKB1/rz̉fY>sd"I3OGlJ`1fI8H9qA ix+B'\돊r#:XSc|\|s<}{^g{s~=!V0mxG+/~+@*w*ȖO^, h鞆6$L²E, CoGC SJyI 3([PKe Y61Oy/`rƾo1żԤl[ y,\כq @U>EJ ߔ+O>UFiezuU4tzhH{)) PSWϋaЙB•dL%Q3t+42S/FiP5 =s4@aH!!{52B6qJ ?)@̟&mt3+ L EuƕmQ>qk:5lNg߆g Yl*Zռ,.goֶk: vy(V'4H(y4Fc"4Qڒcaڢ.ByP!U&ⅫgeJJJ+gJQaVPf*R5&`lҨԌYn8\ kЁШ~ +Y XWq1l քڀ(TWܑb Xrf,uU+[M*ңNfLgjAy1 ڛ۽d&,q; %?v:B87w ڍ뢔"1n= nSB/FK&7l/ s_n?|: v) c Y`WFAQuFmY)q rVՊ sd^]{vd[612m]4\8-L9$&c ;-'B^V6bsyGzQKt٥j=%P٩ .B=C!]kc%H3 2 jG2[w?'8ZޓqIENDB`5 PNG  IHDR ldtIME_ pHYsN N }gAMA a[IDATxڕRAJ@fc ]=M~ħ!<EE<Όա;Nq2tg1){e4?fxӍ%<*"+uJ7!e 8^n6Igj80<H.kLXiz52P-1 =P''/HrPMD Sd% bM'"/MS!n 1h@K`)Կ\j ݜA42f5p{be|ฝ̏}U񍅠N|WyQZIԲ gW T]EIENDB`K~ +PNG  IHDRtIME8+UJ pHYsN N }gAMA aIDATxڅRJCAݛ@ Shk#E?K l,BEQoA,ٻr>l]Y"Xޤq_7p\I{_:y\p's~\PYlb>gmu g&d('5rpίX{Dْ]s㧟+eJ4$F,-p}2E(pE+'w$3ҧ_%Lo:KIENDB` PNG  IHDR KwztIME8;XF pHYs  gAMA aNIDATxڕU@]?@ ED(E ~&Qt$U|J>E蚷@͌@2Y{윳t:`WyXob8l6k^\VBgUSF|µZ S9˥œB!JZ D)L914*`Ox Iw@<\ Gjv_@B8Rc6MgeF~F|&n/lq`Ep7Hz@d{q)uu0ƨs(&v #\T>u0 Sn]D8@h۞Vt:ĵ` Sy!C C)-(  R—kX nEm`r,,y/(B4Yv-\.,L* ??jr#5973R)"+ٌG< W 6 Lgk4uXT'|+$I.0*=@[.O=A,mk$ud'M/wI(*~SMlAIENDB` PNG  IHDRWtIME3VeD pHYs  gAMA a&IDATxڕUMOAJhB I=i1D.#1"!=?ћń@H0E4RZ>nӝ},Jca LMMPYyq2SX\Fȋ D]k\U...766~cNfvww߰Fs,$JmZfn`} b}}2دtML&Z.mDbGD?@hqkfbьFy,-EB :&Bv$Hd^hꑠI-LӴ[V&5>>T*}55z7G$r"ά d>=88DtLUJB04L~{:OC"1`D%>ett eL-& Wp7%fonOp|(R9T޳YTI˲@sD7[7UQ7koon]~"wGGGV&:/BL&E<BVq|8<<|u\fRfdUrYZOOOH$bI?UyK.]WEnP+AS@}׭A <7EPL\J ikQ ؔ~1 L}T5j:g?yeOHcĕ/5n5PyfvP}1o 9"&|9h{|PN#/=k(wÄݑ9'euIENDB`qY Q PNG  IHDRVΎW pHYs  gAMAOX2tEXtSoftwareAdobe ImageReadyqe<IDATxb` FlR ̉&?322~F@L<AVPPXE @Ȇ)Y˗/w31?pMǏ38p`5P1u@lcŋ;/_29s̬|ˁ= S*_p‚߿ ?~j??? :Mv#аOsDNN@iiiŋ o޼a]xƍZ *+3aaa??2|Ç ޽_>>>ϟ  X3%61̜9|!,,ٳg ~9$@01¿Njj*8`\2YX@0X c 6HA|@0}SQQ9pqqq+=zĐg&J2PRR Eoց~ ,RRֶd@] $ <H ɓ' mX|y(%;w0ܽ{3  @虖 ]V񤦦;EE&jZdQR@MpL@޹  =6;/=cIENDB` PNG  IHDR8etIME 3~i pHYsN N }gAMA aIDATxchhh_~Q< kSIENDB`  PNG  IHDR"8tIME 2! $ pHYsN N }gAMA aTIDATxcgd``@_=\$**$""%и 3H* vvv`L\\\d0(ԎaVw{ɣIENDB`= nPNG  IHDR"8tIME 202 pHYsN N }gAMA aCIDATxc```$, gb`fpD*aYngg ˓̠P;9 sIENDB` PNG  IHDR8etIME 3 礽{ pHYsN N }gAMA aIDATxcPPPghhh,7 kIENDB` nPNG  IHDRhstIME 5I pHYsN N }gAMA ahIDATxcxY=CCCW=CYY+Ç@uuu~,ܹT# b|uh(_qyTTT(/MIENDB`PNG  IHDRhstIME 5HV pHYsN N }gAMA aaIDATxchhhٳz_~3@^^/?P*Ơ 5@,b8rȿ={0~/++Kk!17XyIENDB`kPNG  IHDRhstIME 6  pHYsN N }gAMA alIDATxc`zFz/)((hV PQQF07ׯ(./_NabTUUI}W333d/xb? fY|"w* pcO*W%fCIENDB`aPNG  IHDRvf4tIME оr pHYs``zxEgAMA a@IDATxc```b /  BBB̏?37fff~a*  KfIENDB`/3PNG  IHDRvf4tIME  ?I pHYs``zxEgAMA aBIDATxc`gg! 3Pfff{!!k׮)U0_r})H H9##c Z$r.IENDB`~uPNG  IHDRhtIME  ,~ pHYs``zxEgAMA a IDATxc`85_>IENDB`IPNG  IHDRatIME : @A pHYsN N }gAMA aCIDATxc`Hff0ca2 CC7/? L L L L`q C ?J>IENDB`uPNG  IHDRCtIME 73/9g pHYs  gAMA aIDATxc?(D$w:IENDB`h}IPNG  IHDRpcHtIME 95wϱ pHYs  gAMA a IDATxc?3IENDB`}'PNG  IHDRpcHtIME 8hy pHYs  gAMA a IDATxc000$?IENDB`}PNG  IHDRpcHtIME 9 w pHYs  gAMA a IDATxcx#IENDB`In'PNG  IHDRtIME 8 F8 pHYs  gAMA aIDATxc000`sݻ>|4~&XӃIENDB`*PNG  IHDR!/)tIME 7۔ pHYs  gAMA a+IDATxc@>3_~#[$uunIENDB`nPNG  IHDR!/)tIME 84Ӱ pHYs  gAMA a)IDATxc vvv#p̏? b ? Vy}IENDB`,*PNG  IHDRtIME 64P pHYs  gAMA a6IDATxc``Ν;`?æMEk2p.IENDB`xPNG  IHDRtIME 9"4 pHYs  gAMA aGIDATxc000`ggWxΝnb` }ݻw Ê+^Ç PtH IENDB`} PNG  IHDRpcHtIME  = pHYs  ~gAMA a IDATxc```IENDB` }PNG  IHDRpcHtIME :S pHYs  d_gAMA a IDATxchhhu.IENDB`O|Y PNG  IHDRhtIME 6dR pHYsN N }gAMA a IDATxc`IENDB`}PNG  IHDRpcHtIME 4k= pHYs  ~gAMA a IDATxc?3IENDB`YPNG  IHDRvtIME 88' pHYsaa?igAMA a-IDATxe1jP',l#eAB &-Ϳ=nMJx&1M^QG gAeXSIENDB`!PNG  IHDRtIME : pHYsaa?igAMA abIDATxMʡ ϗ4 LD af`PъSMZ+B؇H)m3z1f#Ƹ콃/K)A!ďI$myIENDB`j_PNG  IHDRvtIME :4&K pHYsaa?igAMA a'IDATxeP@[3EQ"0 9@_?m۾\I8N}EI hw`wz#=Ǫz4 -l6{11Yu,(%Jr9XRgL&8)m4M{`RIA, `0(K&B^Y:6p8bfr!BPxZ&`aDض0͞ jEKVׅ0N=pLh4d~}zQ/oUxc0 fM:$y(fZ,5 ]6 ;j5{>_}@dr}`&@[Oh'u]Uq>޼O  -$фlVfQVZb].XJ239kll,Ԕ}(FGGÙ~vpp~hrt(H"Ss...+++S$DONNѨfcA:ڊX$I R$A1T,EQXR|/CG!-(W)H0^b3 lmyEE/RlPUUURG1%(1>O *ApVQTydttccNPUrYP[XX;;;k@iCp$M>Ba:G`8![5z>Vrf###dhhH2Y/!! !sT!J!J#tvv2Z%CDg0/1ʻOR}=<<4[O&(M_3фR^YN|O]ZQ\%m|A<8,KKKq BjU*᭻}? bc4!=; dB?ֳ*n%N|Tfv]& z$s85fCեBۙC?ѥz?,ʕ@hqK}ԕr֒ tCCC#nY#]b#877'MR ?2w}-[b7}GsUo TIENDB`? PNG  IHDR}MtIME [ pHYsN N }gAMA a]IDATxcxY=~?ï_b?|yʕ qڵ@Y Օї֬Y(ׯ@+W~޼ys1'c50IENDB`6- Q PNG  IHDR}MtIME  pHYsN N }gAMA a]IDATxc_~U3x{{w!<<<~}$ b`2khh yܹS!$$듾~ZļH.M!6IENDB`~# ? PNG  IHDRhstIME  5= pHYsN N }gAMA aeIDATxc`z@2~?VW( T`ddbŊ ^^^?A:UUU9AR\\\kȠ_w|ѢEC.yIIENDB`& - PNG  IHDRhstIME 2Cb pHYsN N }gAMA arIDATxcPPPg@uV7Ã3|kJYYY3 .2,]A HFoooݻ7ϟ@0ߺu%22R({o߾ [_21}IENDB` # PNG  IHDRKtIME 1[P pHYsN N }gAMA aIDATxcPcP D0Lf \돊r#:XSc|\|s<}{^g{s~=!V0mxG+/~+@*w*ȖO^, h鞆6$L²E, CoGC SJyI 3([PKe Y61Oy/`rƾo1żԤl[ y,\כq @U>EJ ߔ+O>UFiezuU4tzhH{)) PSWϋaЙB•dL%Q3t+42S/FiP5 =s4@aH!!{52B6qJ ?)@̟&mt3+ L EuƕmQ>qk:5lNg߆g Yl*Zռ,.goֶk: vy(V'4H(y4Fc"4Qڒcaڢ.ByP!U&ⅫgeJJJ+gJQaVPf*R5&`lҨԌYn8\ kЁШ~ +Y XWq1l քڀ(TWܑb Xrf,uU+[M*ңNfLgjAy1 ڛ۽d&,q; %?v:B87w ڍ뢔"1n= nSB/FK&7l/ s_n?|: v) c Y`WFAQuFmY)q rVՊ sd^]{vd[612m]4\8-L9$&c ;-'B^V6bsyGzQKt٥j=%P٩ .B=C!]kc%H3 2 jG2[w?'8ZޓqIENDB`PNG  IHDRxtIME 9U pHYsN N }gAMA aOIDATxc````dPgP| BD0%xX 0DفXH01+aV 恚) d@RhL *PIENDB`PNG  IHDRxtIME   pHYsN N }gAMA aOIDATxc`  DA 0 3.3@$‰Aj?)c߁TnL s2IENDB`8PNG  IHDR tIME 2 pHYsN N }gAMA anIDATxUkA~3dkZ?z-45)"hPrkiC zAūgDz RJ#6&1nT屳3ۙ7sOM\yjB"vT^l@J~ӡsZl.uq[w[ es/C)Yڌsgw^oaƪj}A7]gD퐩d9CDBF{Mb-%hG>^^7e~ 7/AډG,T 0Ym>q :7/`0 hP;n | \A_g(*/AVY2IENDB`!| PNG  IHDR tIME   pHYsN N }gAMA aIDATxVMhAv36xhkz"^^ Q Gɏ(8O`*nO!vk!yQUWsPt[/sz/D)F&E%׹;q#&?Zb!L`z(ߜfl"z7'oGD0.Sb%hN\%@ό2Wdde|HhfYōJH kUw5R+N4i:S-"n;(݀0uo4ȪiA<~-_G /ޔ`UNaf篿OO'PBZ&Hvpч}zq J^anRJ¬aOYc "lo(n`>"<E0Զ|hiԅ w S3V$?dJB|#P܈D7;_toʟ<:\o &*|=IENDB`qQ6$PNG  IHDRVΎW pHYs  gAMAOX2tEXtSoftwareAdobe ImageReadyqe<IDATxb` FlR ̉&?322~F@L<AVPPXE @Ȇ)Y˗/w31?pMǏ38p`5P1u@lcŋ;/_29s̬|ˁ= S*_p‚߿ ?~j??? :Mv#аOsDNN@iiiŋ o޼a]xƍZ *+3aaa??2|Ç ޽_>>>ϟ  X3%61̜9|!,,ٳg ~9$@01¿Njj*8`\2YX@0X c 6HA|@0}SQQ9pqqq+=zĐg&J2PRR Eoց~ ,RRֶd@] $ <H ɓ' mX|y(%;w0ܽ{3  @虖 ]V񤦦;EE&jZdQR@MpL@޹  =6;/=cIENDB` $ PNG  IHDR8etIME 3~i pHYsN N }gAMA aIDATxchhh_~Q< kSIENDB`O%6$PNG  IHDR"8tIME 2! $ pHYsN N }gAMA aTIDATxcgd``@_=\$**$""%и 3H* vvv`L\\\d0(ԎaVw{ɣIENDB`&$PNG  IHDR"8tIME 202 pHYsN N }gAMA aCIDATxc```$, gb`fpD*aYngg ˓̠P;9 sIENDB`B'%PNG  IHDR8etIME 3 礽{ pHYsN N }gAMA aIDATxcPPPghhh,7 kIENDB`!;(&PNG  IHDRhstIME 5I pHYsN N }gAMA ahIDATxcxY=CCCW=CYY+Ç@uuu~,ܹT# b|uh(_qyTTT(/MIENDB`h-)B'PNG  IHDRhstIME 5HV pHYsN N }gAMA aaIDATxchhhٳz_~3@^^/?P*Ơ 5@,b8rȿ={0~/++Kk!17XyIENDB`**;(PNG  IHDRhstIME 6  pHYsN N }gAMA alIDATxc`zFz/)((hV PQQF07ׯ(./_NabTUUI}W333d/xb? fY|"w* pcO*W%fCIENDB` .0.PNG  IHDRvf4tIME оr pHYs``zxEgAMA a@IDATxc```b /  BBB̏?37fff~a*  KfIENDB`F!1]/PNG  IHDRvf4tIME  ?I pHYs``zxEgAMA aBIDATxc`gg! 3Pfff{!!k׮)U0_r})H H9##c Z$r.IENDB`!~1.0PNG  IHDRhtIME  ,~ pHYs``zxEgAMA a IDATxc`85_>IENDB`4!4f1 "]g1PNG  IHDRatIME : @A pHYsN N }gAMA aCIDATxc`Hff0ca2 CC7/? L L L L`q C ?J>IENDB`h" hfPNG  IHDR tIME Y pHYsN N }gAMA aIDATxc_~3IENDB`"h]gPNG  IHDR"fHtIME \ pHYsN N }gAMA aIDATxc?2f@cyb0@ 1?DIENDB`"i hPNG  IHDR"8tIME I1 pHYsN N }gAMA aZIDATxcgd``@_=\$**$""%и ?P`h`f sqqP;9–].IENDB`:#yjhPNG  IHDR"8tIME : pHYsN N }gAMA aCIDATxcpssh \YZZ3qqq10qss3@X8 "0,XbIfP Bǒ1IENDB`#!kiPNG  IHDR tIME a pHYsN N }gAMA aIDATxcPPPg ,\IENDB`#lyjPNG  IHDR}MtIME [ pHYsN N }gAMA a]IDATxcxY=~?ï_b?|yʕ qڵ@Y Օї֬Y(ׯ@+W~޼ys1'c50IENDB` $l!kPNG  IHDR}MtIME  pHYsN N }gAMA a]IDATxc_~U3x{{w!<<<~}$ b`2khh yܹS!$$듾~ZļH.M!6IENDB`T$mlPNG  IHDRhstIME  5= pHYsN N }gAMA aeIDATxc`z@2~?VW( T`ddbŊ ^^^?A:UUU9AR\\\kȠ_w|ѢEC.yIIENDB`$nlPNG  IHDRhstIME 2Cb pHYsN N }gAMA arIDATxcPPPg@uV7Ã3|kJYYY3 .2,]A HFoooݻ7ϟ@0ߺu%22R({o߾ [_21}IENDB`^$>Tm/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * Three part sizable rectangular control base. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. * @param {String} themePrefix The prefix used to retrieve styles from the theme for this control. */ Yahoo.Controls.Sizable3PartControlBase = function(theme, themePrefix) { //log("Sizable3PartControlBase.ctor()"); if(arguments.length>0) { this.initialize(theme, themePrefix); } } /** * Define inheritance chain. */ Yahoo.Controls.Sizable3PartControlBase.prototype = new Yahoo.Controls.Control(); Yahoo.Controls.Sizable3PartControlBase.prototype.constructor = Yahoo.Controls.Sizable3PartControlBase; Yahoo.Controls.Sizable3PartControlBase.prototype.baseclassSizable3PartControlBase = Yahoo.Controls.Control.prototype; /*-----------------------------------------------------------*/ // Control code /*-----------------------------------------------------------*/ /** * Raises the onBackColorChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Sizable3PartControlBase.prototype._onBackColorChanged = function(sender, e) { //log("Sizable3PartControlBase._onBackColorChanged"); // Call base class this.baseclassSizable3PartControlBase._onBackColorChanged.call(this, sender, e); this._imgMiddle.colorize = this._backColor; } /** * Control's internal resize handler. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Sizable3PartControlBase.prototype._onResize = function(sender, e) { //log("Sizable3PartControlBase._onResize"); // sender = top level control that inherits from us // this = Sizable3PartControlBase // Call base class this.baseclassSizable3PartControlBase._onResize.call(this, sender, e); // Resize borders and background sender._Sizable3PartControlBase_paintBackground(); } /** * Raises the onThemeChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Sizable3PartControlBase.prototype._onThemeChanged = function(sender, e) { //log("Sizable3PartControlBase._onThemeChanged"); // Call base class this.baseclassSizable3PartControlBase._onThemeChanged.call(this, sender, e); this._Sizable3PartControlBase_loadTheme(); this._Sizable3PartControlBase_paintBackground(); } /** * Raises the onToolTipChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.Sizable3PartControlBase.prototype._onToolTipChanged = function(sender, e) { //log("Sizable3PartControlBase._onToolTipChanged"); // Call base class this.baseclassSizable3PartControlBase._onToolTipChanged.call(this, sender, e); // Set tooltip this._imgMiddle.tooltip = this.tooltip; this._imgLeft.tooltip = this.tooltip; this._imgRight.tooltip = this.tooltip; } /*-----------------------------------------------------------*/ // Private code /*-----------------------------------------------------------*/ /** * Disposes native Widget Engine objects. * @private */ Yahoo.Controls.Sizable3PartControlBase.prototype._Sizable3PartControlBase_disposeNativeObjects = function() { //log("Sizable3PartControlBase._Sizable3PartControlBase_disposeNativeObjects"); if(this._imgMiddle!=null) { this._imgMiddle.removeFromSuperview(); this._imgMiddle = null; } if(this._imgLeft!=null) { this._imgLeft.removeFromSuperview(); this._imgLeft = null; } if(this._imgRight!=null) { this._imgRight.removeFromSuperview(); this._imgRight = null; } } /** * Loads control elements based on current theme. * @private */ Yahoo.Controls.Sizable3PartControlBase.prototype._Sizable3PartControlBase_loadTheme = function() { //log("Sizable3PartControlBase._Sizable3PartControlBase_loadTheme"); // Remove any current objects this._Sizable3PartControlBase_disposeNativeObjects(); // Load objects using current theme this._imgMiddle = this._theme.getItem(this._themePrefix + "Middle"); this._imgMiddle.tag = this; this._frame.addSubview(this._imgMiddle); this._imgLeft = this._theme.getItem(this._themePrefix + "Left"); this._imgLeft.tag = this; this._frame.addSubview(this._imgLeft); this._imgRight = this._theme.getItem(this._themePrefix + "Right"); this._imgRight.tag = this; this._frame.addSubview(this._imgRight); } /** * Resizes control border elements. * @private */ Yahoo.Controls.Sizable3PartControlBase.prototype._Sizable3PartControlBase_paintBackground = function() { var width; var height; width = this.width; height = this.height; this._imgLeft.height = height; this._imgMiddle.hOffset = this._imgLeft.width; this._imgMiddle.width = width - (this._imgLeft.width + this._imgRight.width); this._imgMiddle.height = height; this._imgRight.hOffset = width - this._imgRight.width; this._imgRight.height = height; } /*-----------------------------------------------------------*/ // Public code /*-----------------------------------------------------------*/ /** * Initializes control. * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. * @param {String} themePrefix The prefix used to retrieve styles from the theme for this control. */ Yahoo.Controls.Sizable3PartControlBase.prototype.initialize = function(theme, themePrefix) { //log("Sizable3PartControlBase.initialize()"); if(themePrefix==null) { throw new Yahoo.ArgumentNullException("themePrefix"); } // Call base class this.baseclassSizable3PartControlBase.initialize.call(this, theme); this._isInitializing = true; this._themePrefix = themePrefix; // Internal objects this._imgMiddle = null; this._imgLeft = null; this._imgRight = null; // Load image objects this._Sizable3PartControlBase_loadTheme(); // Set locations/sizes that do not change this._imgLeft.hOffset = 0; this._imgLeft.vOffset = 0; // Size from image this._imgMiddle.vOffset = 0; this._imgRight.vOffset = 0; // Size from image // We don't resize since we must be inherited //this._onResize(this, new Yahoo.EventArgs()); this._isInitializing = false; } /** * Disposes control's resources. */ Yahoo.Controls.Sizable3PartControlBase.prototype.dispose = function() { // Call base class this.baseclassSizable3PartControlBase.dispose.call(this); // Dispose native items this._Sizable3PartControlBase_disposeNativeObjects(); } /*-----------------------------------------------------------*/ // Public properties /*-----------------------------------------------------------*/ ,$%+Wn/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * Sizable rectangular control base. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. */ Yahoo.Controls.SizableControlBase = function(theme, themePrefix) { //log("SizableControlBase.ctor()"); if(arguments.length>0) { this.initialize(theme, themePrefix); } } /** * Define inheritance chain. */ Yahoo.Controls.SizableControlBase.prototype = new Yahoo.Controls.Control(); Yahoo.Controls.SizableControlBase.prototype.constructor = Yahoo.Controls.SizableControlBase; Yahoo.Controls.SizableControlBase.prototype.baseclassSizableControlBase = Yahoo.Controls.Control.prototype; /*-----------------------------------------------------------*/ // Control code /*-----------------------------------------------------------*/ /** * Raises the onBackColorChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.SizableControlBase.prototype._onBackColorChanged = function(sender, e) { //log("SizableControlBase._onBackColorChanged"); // Call base class this.baseclassSizableControlBase._onBackColorChanged.call(this, sender, e); this._imgBackground.colorize = this._backColor; } /** * Control's internal resize handler. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.SizableControlBase.prototype._onResize = function(sender, e) { //log("SizableControlBase._onResize"); // sender = top level control that inherits from us // this = SizableControlBase // Call base class this.baseclassSizableControlBase._onResize.call(this, sender, e); // Resize borders and background sender._sizableControlBase_paintBackground(); } /** * Raises the onThemeChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.SizableControlBase.prototype._onThemeChanged = function(sender, e) { //log("SizableControlBase._onThemeChanged"); // Call base class this.baseclassSizableControlBase._onThemeChanged.call(this, sender, e); this._sizableControlBase_loadTheme(); this._sizableControlBase_paintBackground(); } /** * Raises the onToolTipChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.SizableControlBase.prototype._onToolTipChanged = function(sender, e) { //log("SizableControlBase._onToolTipChanged"); // Call base class this.baseclassSizableControlBase._onToolTipChanged.call(this, sender, e); // Set tooltip this._imgBackground.tooltip = this.tooltip; this._imgCornerTopLeft.tooltip = this.tooltip; this._imgCornerTopRight.tooltip = this.tooltip; this._imgCornerBottomLeft.tooltip = this.tooltip; this._imgCornerBottomRight.tooltip = this.tooltip; this._imgBorderTop.tooltip = this.tooltip; this._imgBorderBottom.tooltip = this.tooltip; this._imgBorderLeft.tooltip = this.tooltip; this._imgBorderRight.tooltip = this.tooltip; } /*-----------------------------------------------------------*/ // Private code /*-----------------------------------------------------------*/ /** * Disposes native Widget Engine objects. * @private */ Yahoo.Controls.SizableControlBase.prototype._sizableControlBase_disposeNativeObjects = function() { //log("SizableControlBase._sizableControlBase_disposeNativeObjects"); if(this._imgBackground!=null) { this._imgBackground.removeFromSuperview(); this._imgBackground = null; } if(this._imgCornerTopLeft!=null) { this._imgCornerTopLeft.removeFromSuperview(); this._imgCornerTopLeft = null; } if(this._imgCornerTopRight!=null) { this._imgCornerTopRight.removeFromSuperview(); this._imgCornerTopRight = null; } if(this._imgCornerBottomLeft!=null) { this._imgCornerBottomLeft.removeFromSuperview(); this._imgCornerBottomLeft = null; } if(this._imgCornerBottomRight!=null) { this._imgCornerBottomRight.removeFromSuperview(); this._imgCornerBottomRight = null; } if(this._imgBorderTop!=null) { this._imgBorderTop.removeFromSuperview(); this._imgBorderTop = null; } if(this._imgBorderBottom!=null) { this._imgBorderBottom.removeFromSuperview(); this._imgBorderBottom = null; } if(this._imgBorderLeft!=null) { this._imgBorderLeft.removeFromSuperview(); this._imgBorderLeft = null; } if(this._imgBorderRight!=null) { this._imgBorderRight.removeFromSuperview(); this._imgBorderRight = null; } } /** * Loads control elements based on current theme. * @private */ Yahoo.Controls.SizableControlBase.prototype._sizableControlBase_loadTheme = function() { //log("SizableControlBase._sizableControlBase_loadTheme"); // Remove any current objects this._sizableControlBase_disposeNativeObjects(); // Load objects using current theme this._imgBackground = this._theme.getItem(this._themePrefix + "Background"); this._imgBackground.tag = this; this._frame.addSubview(this._imgBackground); this._imgCornerTopLeft = this._theme.getItem(this._themePrefix + "CornerTopLeft"); this._imgCornerTopLeft.tag = this; this._frame.addSubview(this._imgCornerTopLeft); this._imgCornerTopRight = this._theme.getItem(this._themePrefix + "CornerTopRight"); this._imgCornerTopRight.tag = this; this._frame.addSubview(this._imgCornerTopRight); this._imgCornerBottomLeft = this._theme.getItem(this._themePrefix + "CornerBottomLeft"); this._imgCornerBottomLeft.tag = this; this._frame.addSubview(this._imgCornerBottomLeft); this._imgCornerBottomRight = this._theme.getItem(this._themePrefix + "CornerBottomRight"); this._imgCornerBottomRight.tag = this; this._frame.addSubview(this._imgCornerBottomRight); this._imgBorderTop = this._theme.getItem(this._themePrefix + "BorderTop"); this._imgBorderTop.tag = this; this._frame.addSubview(this._imgBorderTop); this._imgBorderBottom = this._theme.getItem(this._themePrefix + "BorderBottom"); this._imgBorderBottom.tag = this; this._frame.addSubview(this._imgBorderBottom); this._imgBorderLeft = this._theme.getItem(this._themePrefix + "BorderLeft"); this._imgBorderLeft.tag = this; this._frame.addSubview(this._imgBorderLeft); this._imgBorderRight = this._theme.getItem(this._themePrefix + "BorderRight"); this._imgBorderRight.tag = this; this._frame.addSubview(this._imgBorderRight); } /** * Resizes control border elements. * @private */ Yahoo.Controls.SizableControlBase.prototype._sizableControlBase_paintBackground = function() { var width; var height; width = this.width; height = this.height; this._imgCornerTopRight.hOffset = width - this._imgCornerTopRight.width; this._imgCornerBottomLeft.vOffset = height - this._imgCornerBottomLeft.height; this._imgCornerBottomRight.hOffset = width - this._imgCornerBottomRight.width; this._imgCornerBottomRight.vOffset = height - this._imgCornerBottomRight.height; // Size from image // Top border width is width - (corner widths) this._imgBorderTop.hOffset = this._imgCornerTopLeft.hOffset + this._imgCornerTopLeft.width; this._imgBorderTop.width = width - (this._imgCornerTopLeft.width + this._imgCornerTopRight.width); // Height from image // Left border height is height - (corner heights) this._imgBorderLeft.vOffset = this._imgCornerTopLeft.height; // Width from image this._imgBorderLeft.height = height - (this._imgCornerTopLeft.height + this._imgCornerBottomLeft.height); // Right border height is height - (corner heights) this._imgBorderRight.hOffset = width - this._imgBorderRight.width; this._imgBorderRight.vOffset = this._imgCornerTopRight.height; // Width from image this._imgBorderRight.height = height - (this._imgCornerTopRight.height + this._imgCornerBottomRight.height); // Bottom border width is width - (corner widths) this._imgBorderBottom.hOffset = this._imgCornerBottomLeft.hOffset + this._imgCornerBottomLeft.width; this._imgBorderBottom.vOffset = height - this._imgBorderBottom.height; this._imgBorderBottom.width = width - (this._imgCornerBottomLeft.width + this._imgCornerBottomRight.width); // Height from image this._imgBackground.hOffset = this._imgBorderLeft.width + this._imgBorderLeft.hOffset; this._imgBackground.vOffset = this._imgBorderTop.height + this._imgBorderTop.vOffset; this._imgBackground.width = width - (this._imgBorderLeft.width + this._imgBorderRight.width); this._imgBackground.height = height - (this._imgBorderTop.height + this._imgBorderBottom.height); } /*-----------------------------------------------------------*/ // Public code /*-----------------------------------------------------------*/ /** * Initializes control. * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. */ Yahoo.Controls.SizableControlBase.prototype.initialize = function(theme, themePrefix) { //log("SizableControlBase.initialize()"); if(themePrefix==null) { throw new Yahoo.ArgumentNullException("themePrefix"); } // Call base class this.baseclassSizableControlBase.initialize.call(this, theme); this._isInitializing = true; this._themePrefix = themePrefix; // Internal objects this._imgBackground = null; this._imgCornerTopLeft = null; this._imgCornerTopRight = null; this._imgCornerBottomLeft = null; this._imgCornerBottomRight = null; this._imgBorderTop = null; this._imgBorderBottom = null; this._imgBorderLeft = null; this._imgBorderRight = null; // Load image objects this._sizableControlBase_loadTheme(); // Set locations/sizes that do not change this._imgCornerTopLeft.hOffset = 0; this._imgCornerTopLeft.vOffset = 0; // Size from image this._imgCornerTopRight.vOffset = 0; // Size from image this._imgCornerBottomLeft.hOffset = 0; // Size from image this._imgBorderTop.vOffset = 0; this._imgBorderLeft.hOffset = 0; // We don't resize since we must be inherited //this._onResize(this, new Yahoo.EventArgs()); this._isInitializing = false; } /** * Disposes control's resources. */ Yahoo.Controls.SizableControlBase.prototype.dispose = function() { // Call base class this.baseclassSizableControlBase.dispose.call(this); // Dispose native items this._sizableControlBase_disposeNativeObjects(); } /*-----------------------------------------------------------*/ // Public properties /*-----------------------------------------------------------*/ 4a%4T/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * TextBox control. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. */ Yahoo.Controls.TextBox = function(theme) { //log("TextBox.ctor()"); if(arguments.length>0) { this.initialize(theme); } } /** * Define inheritance chain. */ Yahoo.Controls.TextBox.prototype = new Yahoo.Controls.SizableControlBase(); Yahoo.Controls.TextBox.prototype.constructor = Yahoo.Controls.TextBox; Yahoo.Controls.TextBox.prototype.baseclassTextBox = Yahoo.Controls.SizableControlBase.prototype; /*-----------------------------------------------------------*/ // Control code /*-----------------------------------------------------------*/ /** * Raises the onEnabledChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.TextBox.prototype._onEnabledChanged = function(sender, e) { //log("TextBox._onEnabledChanged"); // Call baseclass this.baseclassTextBox._onEnabledChanged.call(this, sender, e); this._textBox_setTextBoxState(); } /** * Raises the onFontChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.TextBox.prototype._onFontChanged = function(sender, e) { //log("TextBox._onFontChanged"); // Call baseclass this.baseclassTextBox._onFontChanged.call(this, sender, e); this._txtTextBox.font = this.font; } /** * Raises the onForeColorChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.TextBox.prototype._onForeColorChanged = function(sender, e) { //log("TextBox._onForeColorChanged"); // Call baseclass this.baseclassTextBox._onForeColorChanged.call(this, sender, e); this._txtTextBox.foreColor = this.foreColor; } /** * Raises the onKeyDown event. * @param {Object} sender The source of the event. * @param {Yahoo.KeyPressEventArgs} e The KeyPressEventArgs object that contains event details. */ Yahoo.Controls.TextBox.prototype._onKeyDown = function(sender, e) { //log("TextBox._onKeyDown"); Yahoo.raiseEvent(this, this._onKeyDownEventHandlers, e); } /** * Raises the onKeyUp event. * @param {Object} sender The source of the event. * @param {Yahoo.KeyPressEventArgs} e The KeyPressEventArgs object that contains event details. */ Yahoo.Controls.TextBox.prototype._onKeyUp = function(sender, e) { //log("TextBox._onKeyUp"); Yahoo.raiseEvent(this, this._onKeyUpEventHandlers, e); } /** * Raises the onKeyPress event. * @param {Object} sender The source of the event. * @param {Yahoo.KeyPressEventArgs} e The KeyPressEventArgs object that contains event details. */ Yahoo.Controls.TextBox.prototype._onKeyPress = function(sender, e) { //log("TextBox._onKeyPress"); Yahoo.raiseEvent(this, this._onKeyPressEventHandlers, e); } /** * Raises the onResize event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.TextBox.prototype._onResize = function(sender, e) { //log("TextBox._onResize"); // Call baseclass this.baseclassTextBox._onResize.call(this, sender, e); // Resize elements this._textBox_setTextLocation(); } /** * Raises the onTextChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.TextBox.prototype._onTextChanged = function(sender, e) { //log("TextBox._onTextChanged"); if(this._previousText != this.text) { this._previousText = this.text; this._txtTextBox.data = this._previousText; // Call baseclass this.baseclassTextBox._onTextChanged.call(this, sender, e); } } /** * Raises the onThemeChanged event. * @param {Object} sender The source of the event. * @param {Yahoo.EventArgs} e The EventArgs object that contains event details. */ Yahoo.Controls.TextBox.prototype._onThemeChanged = function(sender, e) { //log("TextBox._onThemeChanged"); // Call base class this.baseclassTextBox._onThemeChanged.call(this, sender, e); this._textBox_loadTheme(); } /** * Handles the onKeyDown event for the native TextArea control. */ Yahoo.Controls.TextBox.prototype._textBox_onKeyDown = function() { //log("TextBox._textBox_onKeyDown"); var e = this.tag._getKeyPressEventArgs(); this.tag._onKeyDown.call(this.tag, this.tag, e); } /** * Handles the onKeyUp event for the native TextArea control. */ Yahoo.Controls.TextBox.prototype._textBox_onKeyUp = function() { //log("TextBox._textBox_onKeyUp"); var e = this.tag._getKeyPressEventArgs(); this.tag._onKeyUp.call(this.tag, this.tag, e); this.tag.text = this.tag._txtTextBox.data; } /** * Handles the onKeyPress event for the native TextArea control. */ Yahoo.Controls.TextBox.prototype._textBox_onKeyPress = function() { //log("TextBox._textBox_onKeyPress"); var e = this.tag._getKeyPressEventArgs(); this.tag._onKeyPress.call(this.tag, this.tag, e); // Check if we should cancel the keystroke if(e.cancel == true) { this.rejectKeyPress(); // Check if the key was changed if(system.event.key != e.key) { this.replaceSelection(e.key); } } } /*---------------------------------------------------------------------*/ // Private code /*---------------------------------------------------------------------*/ /** * Disposes native Widget Engine objects. * @private */ Yahoo.Controls.TextBox.prototype._textBox_disposeNativeObjects = function() { //log("TextBox._textBox_disposeNativeObjects"); if(this._txtTextBox!=null) { this._txtTextBox.removeFromSuperview(); this._txtTextBox = null; } } /** * Loads control elements based on current theme. * @private */ Yahoo.Controls.TextBox.prototype._textBox_loadTheme = function() { var text = ""; if(this._txtTextBox != null) { text = this._txtTextBox.text; } // Remove any current objects this._textBox_disposeNativeObjects(); // Add native TextArea control this._txtTextBox = new TextArea(); this._txtTextBox.zOrder = 999; this._txtTextBox.lines = 1; this._txtTextBox.scrollbar = false; this._txtTextBox.tag = this; this._txtTextBox.onKeyDown = this._textBox_onKeyDown; this._txtTextBox.onKeyUp = this._textBox_onKeyUp; this._txtTextBox.onKeyPress = this._textBox_onKeyPress; this.frame.addSubview(this._txtTextBox); this._textMargins = this._theme.getParameter("textBoxTextMargins"); this._txtTextBox.text = text; this._textBox_setTextLocation(); this._textBox_setTextBoxState(); } /** * Sets the size and location of the native TextArea control. * @private */ Yahoo.Controls.TextBox.prototype._textBox_setTextLocation = function() { this._txtTextBox.hOffset = parseInt(this._textMargins.left); this._txtTextBox.vOffset = parseInt(this._textMargins.top); this._txtTextBox.width = this.width - (parseInt(this._textMargins.left) + parseInt(this._textMargins.right)); this._txtTextBox.height = this.height - (parseInt(this._textMargins.top) + parseInt(this._textMargins.bottom)); } /** * Sets the textbox state. * @private */ Yahoo.Controls.TextBox.prototype._textBox_setTextBoxState = function() { if(this.enabled==false) { this._txtTextBox.enabled = false; } else { this._txtTextBox.enabled = true; } // if enabled } /** * Returns a prefilled KeyPressEventArgs class. * @private */ Yahoo.Controls.TextBox.prototype._getKeyPressEventArgs = function() { var result = new Yahoo.Controls.KeyPressEventArgs(); result.key = system.event.key; result.keyString = system.event.keyString; result.modifiers = system.event.modifiers; return result; } /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. * @param {Yahoo.Controls.Theme} theme The theme this control should use or null to create an instance of the default theme. */ Yahoo.Controls.TextBox.prototype.initialize = function(theme) { //log("TextBox.initialize()"); // Call baseclass constructor this.baseclassTextBox.initialize.call(this, theme, "textBox"); this._previousText = ""; // Initialize variables/controls this._onKeyDownEventHandlers = new Array(); this._onKeyUpEventHandlers = new Array(); this._onKeyPressEventHandlers = new Array(); this._onTextChangedEventHandlers = new Array(); this._textBox_loadTheme(); } /** * Adds an event handler. Supported events are: KeyDown, KeyUp, KeyPress. * @param {Function} eventHandler The function that is to be called when the event is raised. * @param {String} eventName The name of the event that is being listened to. */ Yahoo.Controls.TextBox.prototype.addEventHandler = function(eventHandler, eventName) { // Call baseclass this.baseclassTextBox.addEventHandler.call(this, eventHandler, eventName) switch(eventName) { case "KeyDown": this._onKeyDownEventHandlers.push(eventHandler); break; case "KeyUp": this._onKeyUpEventHandlers.push(eventHandler); break; case "KeyPress": this._onKeyPressEventHandlers.push(eventHandler); break; } } /** * Disposes control's resources. */ Yahoo.Controls.TextBox.prototype.dispose = function() { this._textBox_disposeNativeObjects(); // Call baseclass this.baseclassTextBox.dispose.call(this); // Baseclass disposes our custom controls } /** * Moves the keyboard focus to the textbox. */ Yahoo.Controls.TextBox.prototype.focus = function() { this._txtTextBox.focus(); } /*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * KeyPressEventArgs class. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. */ Yahoo.Controls.KeyPressEventArgs = function() { this.initialize(); } /** * Define inheritance chain. */ Yahoo.Controls.KeyPressEventArgs.prototype = new Yahoo.EventArgs(); Yahoo.Controls.KeyPressEventArgs.prototype.constructor = Yahoo.Controls.KeyPressEventArgs; Yahoo.Controls.KeyPressEventArgs.prototype.baseclassKeyPressEventArgs = Yahoo.EventArgs.prototype; /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. */ Yahoo.Controls.KeyPressEventArgs.prototype.initialize = function() { //log("KeyPressEventArgs.initialize()"); // Call baseclass constructor this.baseclassKeyPressEventArgs.initialize.call(); this._key = ""; this._keyString = ""; this._modifiers = ""; } /** * Returns a string representation of this class. */ Yahoo.Controls.KeyPressEventArgs.prototype.toString = function() { return "{Cancel=" + this.cancel + ", key='" + this._key + "', keyString='" + this._keyString + "', modifiers=" + this._modifiers + "}"; } /*---------------------------------------------------------------------*/ // Public properties /*---------------------------------------------------------------------*/ /** * Gets or sets the key that was pressed. * @type String */ Yahoo.Controls.KeyPressEventArgs.prototype.key getter = function() { return this._key; } Yahoo.Controls.KeyPressEventArgs.prototype.key setter = function(value) { this._key = value; } /** * Gets or sets the name of the key that was pressed. * @type String */ Yahoo.Controls.KeyPressEventArgs.prototype.keyString getter = function() { return this._keyString; } Yahoo.Controls.KeyPressEventArgs.prototype.keyString setter = function(value) { this._keyString = value; } /** * Gets or sets the modifier keys that were pressed. * @type String */ Yahoo.Controls.KeyPressEventArgs.prototype.modifiers getter = function() { return this._modifiers; } Yahoo.Controls.KeyPressEventArgs.prototype.modifiers setter = function(value) { this._modifiers = value; } V%UBW/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2007 Yahoo! Inc. All Rights Reserved. /// /** * Theme class for local (non-shared) installation of the library. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Namespace /*---------------------------------------------------------------------*/ // Create namespace if it doesn't already exist if(Yahoo==undefined) { var Yahoo = new Object(); } if(Yahoo.Controls==undefined) { Yahoo.Controls = new Object(); } /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {String} themePath The path to the theme folder. */ Yahoo.Controls.Theme = function(themePath) { if(arguments.length > 0) { this.initialize(themePath); } //arguments.length > 0 } /*---------------------------------------------------------------------*/ // Private code /*---------------------------------------------------------------------*/ /** * Loads themes from given widgetPath into internal array. * @private */ Yahoo.Controls.Theme.prototype._theme_getThemes = function() { var contents; var count; this._themes = new Array(); // HACK: Hard coded values for flat file support this._themes.push("Purple"); this._themes.push("Black Glass"); } /** * Returns a Widget Engine Image object based on given theme style. * @private * @param {DOMNode} itemNode The item node in the theme definition. Styles from this will override styleNode definitions. * @param {DOMNode} styleNode The item node in the theme definition. * @type Image */ Yahoo.Controls.Theme.prototype._theme_getImageObject = function(itemNode, styleNode) { var src; var result; if(itemNode!=null && styleNode!=null) { result = new Image(); // Required properties from style src = styleNode.getAttribute("src"); if(src!="") { if(src.substring(1,7)=="http://") { result.src = src } // If have URL else { // Have a filename, prefix with themes folder path result.src = this._themePath + "/" + this.themeName + "/" + src; } // If have URL } else { throw new Error("Missing src on style '" + styleNode.getAttribute("id") + "'"); } // Set attributes from style this._theme_setImageAttributes(result, styleNode); // Override attributes from item, if any this._theme_setImageAttributes(result, itemNode); } else { throw new Error("Missing itemNode or styleNode."); } return result; } /** * Returns a Widget Engine Text object based on given theme style. * @private * @param {DOMNode} itemNode The item node in the theme definition. Styles from this will override styleNode definitions. * @param {DOMNode} styleNode The item node in the theme definition. * @type Text */ Yahoo.Controls.Theme.prototype._theme_getLabelObject = function(itemNode, styleNode) { var result; if(itemNode!=null && styleNode!=null) { result = new Text(); // Set attributes from style this._theme_setLabelAttributes(result, styleNode); // Override attributes from item, if any this._theme_setLabelAttributes(result, itemNode); } else { throw new Error("Missing itemNode or styleNode."); } return result; } /** * Returns a Widget Engine TextArea object based on given theme style. * @private * @param {DOMNode} itemNode The item node in the theme definition. Styles from this will override styleNode definitions. * @param {DOMNode} styleNode The item node in the theme definition. * @type TextArea */ Yahoo.Controls.Theme.prototype._theme_getTextBoxObject = function(itemNode, styleNode) { var result; if(itemNode!=null && styleNode!=null) { result = new TextArea(); // Set attributes from style this._theme_setTextBoxAttributes(result, styleNode); // Override attributes from item, if any this._theme_setTextBoxAttributes(result, itemNode); } else { throw new Error("Missing itemNode or styleNode."); } return result; } /** * Sets label (Text) attributes from given node. * @private * @param {Text} label Text object which will be modified. * @param {DOMNode} node The style node used to set properties. */ Yahoo.Controls.Theme.prototype._theme_setLabelAttributes = function(label, node) { if(node.getAttribute("alignment") != "") { label.alignment = node.getAttribute("alignment"); } if(node.getAttribute("background-color") != "") { label.style.backgroundColor = node.getAttribute("background-color"); } if(node.getAttribute("bgColor") != "") { label.bgColor = node.getAttribute("bgColor"); } if(node.getAttribute("bgOpacity") != "") { label.bgOpacity = node.getAttribute("bgOpacity"); } if(node.getAttribute("color") != "") { label.color = node.getAttribute("color"); } if(node.getAttribute("data") != "") { label.data = node.getAttribute("data"); } if(node.getAttribute("font") != "") { label.font = node.getAttribute("font"); } if(node.getAttribute("font-family") != "") { label.style.fontFamily = node.getAttribute("font-family"); } if(node.getAttribute("font-size") != "") { label.style.fontSize = node.getAttribute("font-size"); } if(node.getAttribute("font-weight") != "") { label.style.fontWeight = node.getAttribute("font-weight"); } if(node.getAttribute("hAlign") != "") { label.hAlign = node.getAttribute("hAlign"); } if(node.getAttribute("height") != "") { label.height = node.getAttribute("height"); } if(node.getAttribute("hOffset") != "") { label.hOffset = node.getAttribute("hOffset"); } if(node.getAttribute("opacity") != "") { label.opacity = node.getAttribute("opacity"); } if(node.getAttribute("scrolling") != "") { label.scrolling = node.getAttribute("scrolling"); } if(node.getAttribute("size") != "") { label.size = node.getAttribute("size"); } if(node.getAttribute("tooltip") != "") { label.tooltip = node.getAttribute("tooltip"); } if(node.getAttribute("visible") != "") { if(node.getAttribute("visible")=="true") { label.visible = true; } else { label.visible = false; } } if(node.getAttribute("vOffset") != "") { label.vOffset = node.getAttribute("vOffset"); } if(node.getAttribute("width") != "") { label.width = node.getAttribute("width"); } if(node.getAttribute("kon-text-truncation") != "") { label.style.KonTextTruncation = node.getAttribute("kon-text-truncation"); } if(node.getAttribute("zOrder") != "") { label.zOrder = node.getAttribute("zOrder"); } } /** * Sets textBox (TextArea) attributes from given node. * @private * @param {TextArea} textBox TextArea object which will be modified. * @param {DOMNode} node The style node used to set properties. */ Yahoo.Controls.Theme.prototype._theme_setTextBoxAttributes = function(textBox, node) { if(node.getAttribute("alignment") != "") { textBox.alignment = node.getAttribute("alignment"); } if(node.getAttribute("background-color") != "") { textBox.style.backgroundColor = node.getAttribute("background-color"); } if(node.getAttribute("bgColor") != "") { textBox.bgColor = node.getAttribute("bgColor"); } if(node.getAttribute("bgOpacity") != "") { textBox.bgOpacity = node.getAttribute("bgOpacity"); } if(node.getAttribute("color") != "") { textBox.color = node.getAttribute("color"); } if(node.getAttribute("columns") != "") { textBox.columns = node.getAttribute("columns"); } if(node.getAttribute("data") != "") { textBox.data = node.getAttribute("data"); } if(node.getAttribute("editable") != "") { if(node.getAttribute("editable")=="true") { textBox.editable = true; } else { textBox.editable = false; } } if(node.getAttribute("font") != "") { textBox.font = node.getAttribute("font"); } if(node.getAttribute("font-family") != "") { textBox.style.fontFamily = node.getAttribute("font-family"); } if(node.getAttribute("font-size") != "") { textBox.style.fontSize = node.getAttribute("font-size"); } if(node.getAttribute("font-weight") != "") { textBox.style.fontWeight = node.getAttribute("font-weight"); } if(node.getAttribute("hAlign") != "") { textBox.hAlign = node.getAttribute("hAlign"); } if(node.getAttribute("height") != "") { textBox.height = node.getAttribute("height"); } if(node.getAttribute("hOffset") != "") { textBox.hOffset = node.getAttribute("hOffset"); } if(node.getAttribute("opacity") != "") { textBox.opacity = node.getAttribute("opacity"); } if(node.getAttribute("scrollbar") != "") { if(node.getAttribute("scrollbar")=="true") { textBox.scrollbar = true; } else { textBox.scrollbar = false; } } if(node.getAttribute("secure") != "") { if(node.getAttribute("secure")=="true") { textBox.secure = true; } else { textBox.secure = false; } } if(node.getAttribute("size") != "") { textBox.size = node.getAttribute("size"); } if(node.getAttribute("spellcheck") != "") { if(node.getAttribute("spellcheck")=="true") { textBox.spellcheck = true; } else { textBox.spellcheck = false; } } if(node.getAttribute("thumbColor") != "") { textBox.thumbColor = node.getAttribute("thumbColor"); } if(node.getAttribute("tooltip") != "") { textBox.tooltip = node.getAttribute("tooltip"); } if(node.getAttribute("visible") != "") { if(node.getAttribute("visible")=="true") { textBox.visible = true; } else { textBox.visible = false; } } if(node.getAttribute("vAlign") != "") { textBox.vAlign = node.getAttribute("vAlign"); } if(node.getAttribute("vOffset") != "") { textBox.vOffset = node.getAttribute("vOffset"); } if(node.getAttribute("width") != "") { textBox.width = node.getAttribute("width"); } if(node.getAttribute("zOrder") != "") { textBox.zOrder = node.getAttribute("zOrder"); } } /** * Sets image attributes from given node. * @private * @param {Image} image Image object which will be modified. * @param {DOMNode} node The style node used to set properties. */ Yahoo.Controls.Theme.prototype._theme_setImageAttributes = function(image, node) { if(node.getAttribute("colorize") != "") { image.colorize = node.getAttribute("colorize"); } if(node.getAttribute("fillMode") != "") { image.fillMode = node.getAttribute("fillMode"); } if(node.getAttribute("height") != "") { image.height = node.getAttribute("height"); } if(node.getAttribute("hOffset") != "") { image.hOffset = node.getAttribute("hOffset"); } if(node.getAttribute("hRegistrationPoint") != "") { image.hRegistrationPoint = node.getAttribute("hRegistrationPoint"); } if(node.getAttribute("hslAdjustment") != "") { image.hslAdjustment = node.getAttribute("hslAdjustment"); } if(node.getAttribute("hslTinting") != "") { image.hslTinting = node.getAttribute("hslTinting"); } if(node.getAttribute("opacity") != "") { image.opacity = node.getAttribute("opacity"); } if(node.getAttribute("rotation") != "") { image.rotation = node.getAttribute("rotation"); } if(node.getAttribute("tileOrigin") != "") { image.tileOrigin = node.getAttribute("tileOrigin"); } if(node.getAttribute("tooltip") != "") { image.tooltip = node.getAttribute("tooltip"); } if(node.getAttribute("tracking") != "") { image.tracking = node.getAttribute("tracking"); } if(node.getAttribute("visible") != "") { if(node.getAttribute("visible")=="true") { image.visible = true; } else { image.visible = false; } } if(node.getAttribute("vOffset") != "") { image.vOffset = node.getAttribute("vOffset"); } if(node.getAttribute("vRegistrationPoint") != "") { image.vRegistrationPoint = node.getAttribute("vRegistrationPoint"); } if(node.getAttribute("width") != "") { image.width = node.getAttribute("width"); } if(node.getAttribute("zOrder") != "") { image.zOrder = node.getAttribute("zOrder"); } } /** * Adds an item to the cache. * @private * @param {Object} item Object to add to the cache. * @param {String} itemName The item name of this object. It is used as the key in the cache. * @param {String} type The type name of the object. */ Yahoo.Controls.Theme.prototype._theme_addToCache = function(item, itemName, type) { var prop; var result = new Object(); result.style = new Object(); //log("Theme._theme_addToCache"); result.___cacheType = type; for(prop in item) { if((item[prop]!="" && item[prop]!=null)) { switch(prop.toLowerCase()) { case "colour": case "columns": case "id": case "lines": case "name": case "window": case "srcheight": case "srcwidth": case "superview": break; case "style": if(item.style!=null) { for(style in item.style) { if((item.style[style]!="" && item.style[style]!=null)) { result.style[style] = item.style[style]; } } } break; default: result[prop] = item[prop]; break; } // switch } // if value != null } // for prop this._cache[itemName] = result; } /** * Gets an item from the cache. * @private * @param {String} itemName The item name of the object to retrieve. * @type Object */ Yahoo.Controls.Theme.prototype._theme_getFromCache = function(itemName) { var prop; var propItem; var result; //log("Theme._theme_getFromCache"); propItem = this._cache[itemName]; if(propItem!=null) { //log("** Got item from cache"); switch(propItem.___cacheType) { case "image": result = new Image(); break; case "label": result = new Text(); break; case "textBox": result = new TextArea(); break; } //log("getting from cache"); if(result!=null) { // Copy properties from cached item for(prop in propItem) { switch(prop.toLowerCase()) { case "___cachetype": break; case "style": for(style in propItem.style) { result.style[style] = propItem.style[style]; } break; default: try { //log(prop + "=" + propItem[prop]); result[prop] = propItem[prop]; } catch(e) { log(e); } break; } // switch } } // if result!=null } // if propItem!=null return result; } /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * Initializes component. * @param {string} themePath The path to the theme folder. */ Yahoo.Controls.Theme.prototype.initialize = function(themePath) { // Includes lib.include("Yahoo.ArgumentNullException"); lib.include("Yahoo.EventArgs"); // Events this._onThemeChangedEventHandlers = new Array(); if(themePath!="") { // Private variables this._themePath = themePath; this._themes = null; this._themeName = null; this._themeDoc = null; // Load available themes this._theme_getThemes(); } // themePath = "" else { throw new Yahoo.ArgumentNullException("themePath"); } // themePath = "" } /** * Adds an event handler. Supported events are: ThemeChanged. * @param {Function} eventHandler The function that is to be called when the event is raised. * @param {String} eventName The name of the event that is being listened to. */ Yahoo.Controls.Theme.prototype.addEventHandler = function(eventHandler, eventName) { // Validate input if(eventHandler==null) { throw new Yahoo.ArgumentNullException("eventHandler"); return; } if(eventName==null) { throw new Yahoo.ArgumentNullException("eventName"); return; } switch(eventName) { case "ThemeChanged": this._onThemeChangedEventHandlers.push(eventHandler); break; default: throw new Error("Invalid eventName."); break; } } /** * Loads the given theme. * @param {String} themeName The name of the theme to load. */ Yahoo.Controls.Theme.prototype.loadTheme = function(themeName) { var file; this._themeName = themeName; try { // Clear cache for(item in this._cache) { this._cache[item] = null; } this._cache = null; // Load the file file = filesystem.readFile(this._themePath + "/" + this._themeName + "/" + this._themeName + ".xml"); this._themeDoc = XMLDOM.parse(file); this._cache = new Object(); } catch(e) { this._themeName = null; this._themeDoc = null; } // Raise event Yahoo.raiseEvent(this, this._onThemeChangedEventHandlers, new Yahoo.EventArgs()); } /** * Returns the given GUI element based on the currently loaded theme. * @param {String} itemName The item name to retrieve. * @param {Window} window The window object to add the returned item to or null. * @type Object */ Yahoo.Controls.Theme.prototype.getItem = function(itemName, window) { var nodes; var styleName; var styleNode; var itemNode; var result; if(this._themeDoc!=null) { result = this._theme_getFromCache(itemName) if(result==null) { // Find the element that describe the GUI item requested nodes = this._themeDoc.evaluate("/theme/items/" + itemName); if(nodes.length==1) { itemNode = nodes.item(0); // Get the style definition for the item styleName = itemNode.getAttribute("style"); nodes = this._themeDoc.evaluate("/theme/styles/*[@id='" + styleName + "']"); if(nodes.length==1) { styleNode = nodes.item(0); if(styleNode!=null) { // Get the style and create a Widget Engine object populated with correct properties switch(styleNode.nodeName) { case "image": result = this._theme_getImageObject(itemNode, styleNode); this._theme_addToCache(result, itemName, "image"); break; case "label": result = this._theme_getLabelObject(itemNode, styleNode); this._theme_addToCache(result, itemName, "label"); break; case "textBox": result = this._theme_getTextBoxObject(itemNode, styleNode); this._theme_addToCache(result, itemName, "textBox"); break; } // switch } else { throw new Error("Theme error: Style '" + styleName + "' not found for element '" + itemName + "'."); } //node!=null } else { throw new Error("Theme error: Incorrect number of styles of the type '" + styleName + "' (" + nodes.length + ")."); } // nodes.length==1 (styles) } else { throw new Error("Theme error: Incorrect number of elements of the type '" + itemName + "' (" + nodes.length + ")."); } // nodes.length==1 (items) } // result == null (from cache) } else { throw new Error("Theme not loaded."); } if(window!=null) { result.window = window; } return result; } /** * Returns the parameter as an object based on the currently loaded theme. * @param {String} itemName The parameter item name to retrieve. */ Yahoo.Controls.Theme.prototype.getParameter = function(itemName) { var nodes; var itemNode; var itemAttrib; var attribCount; var result; if(this._themeDoc!=null) { // Find the element that describe the GUI item requested nodes = this._themeDoc.evaluate("/theme/parameters/" + itemName); if(nodes.length==1) { itemNode = nodes.item(0); // Create new object result = new Object(); result["itemName"] = itemNode.nodeName; // Loop all attributes in this element for(attribCount=0; attribCount /// (C) Copyright 2005-2007 Yahoo! Inc. All Rights Reserved. /// /** * Theme class for local (non-shared) installation of the library. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Namespace /*---------------------------------------------------------------------*/ // Create namespace if it doesn't already exist if(Yahoo==undefined) { var Yahoo = new Object(); } if(Yahoo.Controls==undefined) { Yahoo.Controls = new Object(); } /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {String} themePath The path to the theme folder. */ Yahoo.Controls.Theme = function(themePath) { if(arguments.length > 0) { this.initialize(themePath); } //arguments.length > 0 } /*---------------------------------------------------------------------*/ // Private code /*---------------------------------------------------------------------*/ /** * Loads themes from given widgetPath into internal array. * @private */ Yahoo.Controls.Theme.prototype._theme_getThemes = function() { var contents; var count; this._themes = new Array(); // HACK: Hard coded values for flat file support this._themes.push("Purple"); this._themes.push("Black Glass"); } /** * Returns a Widget Engine Image object based on given theme style. * @private * @param {DOMNode} itemNode The item node in the theme definition. Styles from this will override styleNode definitions. * @param {DOMNode} styleNode The item node in the theme definition. * @type Image */ Yahoo.Controls.Theme.prototype._theme_getImageObject = function(itemNode, styleNode) { var src; var result; if(itemNode!=null && styleNode!=null) { result = new Image(); // Required properties from style src = styleNode.getAttribute("src"); if(src!="") { if(src.substring(1,7)=="http://") { result.src = src } // If have URL else { // Have a filename, prefix with themes folder path result.src = this._themePath + "/" + this.themeName + "/" + src; } // If have URL } else { throw new Error("Missing src on style '" + styleNode.getAttribute("id") + "'"); } // Set attributes from style this._theme_setImageAttributes(result, styleNode); // Override attributes from item, if any this._theme_setImageAttributes(result, itemNode); } else { throw new Error("Missing itemNode or styleNode."); } return result; } /** * Returns a Widget Engine Text object based on given theme style. * @private * @param {DOMNode} itemNode The item node in the theme definition. Styles from this will override styleNode definitions. * @param {DOMNode} styleNode The item node in the theme definition. * @type Text */ Yahoo.Controls.Theme.prototype._theme_getLabelObject = function(itemNode, styleNode) { var result; if(itemNode!=null && styleNode!=null) { result = new Text(); // Set attributes from style this._theme_setLabelAttributes(result, styleNode); // Override attributes from item, if any this._theme_setLabelAttributes(result, itemNode); } else { throw new Error("Missing itemNode or styleNode."); } return result; } /** * Returns a Widget Engine TextArea object based on given theme style. * @private * @param {DOMNode} itemNode The item node in the theme definition. Styles from this will override styleNode definitions. * @param {DOMNode} styleNode The item node in the theme definition. * @type TextArea */ Yahoo.Controls.Theme.prototype._theme_getTextBoxObject = function(itemNode, styleNode) { var result; if(itemNode!=null && styleNode!=null) { result = new TextArea(); // Set attributes from style this._theme_setTextBoxAttributes(result, styleNode); // Override attributes from item, if any this._theme_setTextBoxAttributes(result, itemNode); } else { throw new Error("Missing itemNode or styleNode."); } return result; } /** * Sets label (Text) attributes from given node. * @private * @param {Text} label Text object which will be modified. * @param {DOMNode} node The style node used to set properties. */ Yahoo.Controls.Theme.prototype._theme_setLabelAttributes = function(label, node) { if(node.getAttribute("alignment") != "") { label.alignment = node.getAttribute("alignment"); } if(node.getAttribute("background-color") != "") { label.style.backgroundColor = node.getAttribute("background-color"); } if(node.getAttribute("bgColor") != "") { label.bgColor = node.getAttribute("bgColor"); } if(node.getAttribute("bgOpacity") != "") { label.bgOpacity = node.getAttribute("bgOpacity"); } if(node.getAttribute("color") != "") { label.color = node.getAttribute("color"); } if(node.getAttribute("data") != "") { label.data = node.getAttribute("data"); } if(node.getAttribute("font") != "") { label.font = node.getAttribute("font"); } if(node.getAttribute("font-family") != "") { label.style.fontFamily = node.getAttribute("font-family"); } if(node.getAttribute("font-size") != "") { label.style.fontSize = node.getAttribute("font-size"); } if(node.getAttribute("font-weight") != "") { label.style.fontWeight = node.getAttribute("font-weight"); } if(node.getAttribute("hAlign") != "") { label.hAlign = node.getAttribute("hAlign"); } if(node.getAttribute("height") != "") { label.height = node.getAttribute("height"); } if(node.getAttribute("hOffset") != "") { label.hOffset = node.getAttribute("hOffset"); } if(node.getAttribute("opacity") != "") { label.opacity = node.getAttribute("opacity"); } if(node.getAttribute("scrolling") != "") { label.scrolling = node.getAttribute("scrolling"); } if(node.getAttribute("size") != "") { label.size = node.getAttribute("size"); } if(node.getAttribute("tooltip") != "") { label.tooltip = node.getAttribute("tooltip"); } if(node.getAttribute("visible") != "") { if(node.getAttribute("visible")=="true") { label.visible = true; } else { label.visible = false; } } if(node.getAttribute("vOffset") != "") { label.vOffset = node.getAttribute("vOffset"); } if(node.getAttribute("width") != "") { label.width = node.getAttribute("width"); } if(node.getAttribute("kon-text-truncation") != "") { label.style.KonTextTruncation = node.getAttribute("kon-text-truncation"); } if(node.getAttribute("zOrder") != "") { label.zOrder = node.getAttribute("zOrder"); } } /** * Sets textBox (TextArea) attributes from given node. * @private * @param {TextArea} textBox TextArea object which will be modified. * @param {DOMNode} node The style node used to set properties. */ Yahoo.Controls.Theme.prototype._theme_setTextBoxAttributes = function(textBox, node) { if(node.getAttribute("alignment") != "") { textBox.alignment = node.getAttribute("alignment"); } if(node.getAttribute("background-color") != "") { textBox.style.backgroundColor = node.getAttribute("background-color"); } if(node.getAttribute("bgColor") != "") { textBox.bgColor = node.getAttribute("bgColor"); } if(node.getAttribute("bgOpacity") != "") { textBox.bgOpacity = node.getAttribute("bgOpacity"); } if(node.getAttribute("color") != "") { textBox.color = node.getAttribute("color"); } if(node.getAttribute("columns") != "") { textBox.columns = node.getAttribute("columns"); } if(node.getAttribute("data") != "") { textBox.data = node.getAttribute("data"); } if(node.getAttribute("editable") != "") { if(node.getAttribute("editable")=="true") { textBox.editable = true; } else { textBox.editable = false; } } if(node.getAttribute("font") != "") { textBox.font = node.getAttribute("font"); } if(node.getAttribute("font-family") != "") { textBox.style.fontFamily = node.getAttribute("font-family"); } if(node.getAttribute("font-size") != "") { textBox.style.fontSize = node.getAttribute("font-size"); } if(node.getAttribute("font-weight") != "") { textBox.style.fontWeight = node.getAttribute("font-weight"); } if(node.getAttribute("hAlign") != "") { textBox.hAlign = node.getAttribute("hAlign"); } if(node.getAttribute("height") != "") { textBox.height = node.getAttribute("height"); } if(node.getAttribute("hOffset") != "") { textBox.hOffset = node.getAttribute("hOffset"); } if(node.getAttribute("opacity") != "") { textBox.opacity = node.getAttribute("opacity"); } if(node.getAttribute("scrollbar") != "") { if(node.getAttribute("scrollbar")=="true") { textBox.scrollbar = true; } else { textBox.scrollbar = false; } } if(node.getAttribute("secure") != "") { if(node.getAttribute("secure")=="true") { textBox.secure = true; } else { textBox.secure = false; } } if(node.getAttribute("size") != "") { textBox.size = node.getAttribute("size"); } if(node.getAttribute("spellcheck") != "") { if(node.getAttribute("spellcheck")=="true") { textBox.spellcheck = true; } else { textBox.spellcheck = false; } } if(node.getAttribute("thumbColor") != "") { textBox.thumbColor = node.getAttribute("thumbColor"); } if(node.getAttribute("tooltip") != "") { textBox.tooltip = node.getAttribute("tooltip"); } if(node.getAttribute("visible") != "") { if(node.getAttribute("visible")=="true") { textBox.visible = true; } else { textBox.visible = false; } } if(node.getAttribute("vAlign") != "") { textBox.vAlign = node.getAttribute("vAlign"); } if(node.getAttribute("vOffset") != "") { textBox.vOffset = node.getAttribute("vOffset"); } if(node.getAttribute("width") != "") { textBox.width = node.getAttribute("width"); } if(node.getAttribute("zOrder") != "") { textBox.zOrder = node.getAttribute("zOrder"); } } /** * Sets image attributes from given node. * @private * @param {Image} image Image object which will be modified. * @param {DOMNode} node The style node used to set properties. */ Yahoo.Controls.Theme.prototype._theme_setImageAttributes = function(image, node) { if(node.getAttribute("colorize") != "") { image.colorize = node.getAttribute("colorize"); } if(node.getAttribute("fillMode") != "") { image.fillMode = node.getAttribute("fillMode"); } if(node.getAttribute("height") != "") { image.height = node.getAttribute("height"); } if(node.getAttribute("hOffset") != "") { image.hOffset = node.getAttribute("hOffset"); } if(node.getAttribute("hRegistrationPoint") != "") { image.hRegistrationPoint = node.getAttribute("hRegistrationPoint"); } if(node.getAttribute("hslAdjustment") != "") { image.hslAdjustment = node.getAttribute("hslAdjustment"); } if(node.getAttribute("hslTinting") != "") { image.hslTinting = node.getAttribute("hslTinting"); } if(node.getAttribute("opacity") != "") { image.opacity = node.getAttribute("opacity"); } if(node.getAttribute("rotation") != "") { image.rotation = node.getAttribute("rotation"); } if(node.getAttribute("tileOrigin") != "") { image.tileOrigin = node.getAttribute("tileOrigin"); } if(node.getAttribute("tooltip") != "") { image.tooltip = node.getAttribute("tooltip"); } if(node.getAttribute("tracking") != "") { image.tracking = node.getAttribute("tracking"); } if(node.getAttribute("visible") != "") { if(node.getAttribute("visible")=="true") { image.visible = true; } else { image.visible = false; } } if(node.getAttribute("vOffset") != "") { image.vOffset = node.getAttribute("vOffset"); } if(node.getAttribute("vRegistrationPoint") != "") { image.vRegistrationPoint = node.getAttribute("vRegistrationPoint"); } if(node.getAttribute("width") != "") { image.width = node.getAttribute("width"); } if(node.getAttribute("zOrder") != "") { image.zOrder = node.getAttribute("zOrder"); } } /** * Adds an item to the cache. * @private * @param {Object} item Object to add to the cache. * @param {String} itemName The item name of this object. It is used as the key in the cache. * @param {String} type The type name of the object. */ Yahoo.Controls.Theme.prototype._theme_addToCache = function(item, itemName, type) { var prop; var result = new Object(); result.style = new Object(); //log("Theme._theme_addToCache"); result.___cacheType = type; for(prop in item) { if((item[prop]!="" && item[prop]!=null)) { switch(prop.toLowerCase()) { case "colour": case "columns": case "id": case "lines": case "name": case "window": case "srcheight": case "srcwidth": case "superview": break; case "style": if(item.style!=null) { for(style in item.style) { if((item.style[style]!="" && item.style[style]!=null)) { result.style[style] = item.style[style]; } } } break; default: result[prop] = item[prop]; break; } // switch } // if value != null } // for prop this._cache[itemName] = result; } /** * Gets an item from the cache. * @private * @param {String} itemName The item name of the object to retrieve. * @type Object */ Yahoo.Controls.Theme.prototype._theme_getFromCache = function(itemName) { var prop; var propItem; var result; //log("Theme._theme_getFromCache"); propItem = this._cache[itemName]; if(propItem!=null) { //log("** Got item from cache"); switch(propItem.___cacheType) { case "image": result = new Image(); break; case "label": result = new Text(); break; case "textBox": result = new TextArea(); break; } //log("getting from cache"); if(result!=null) { // Copy properties from cached item for(prop in propItem) { switch(prop.toLowerCase()) { case "___cachetype": break; case "style": for(style in propItem.style) { result.style[style] = propItem.style[style]; } break; default: try { //log(prop + "=" + propItem[prop]); result[prop] = propItem[prop]; } catch(e) { log(e); } break; } // switch } } // if result!=null } // if propItem!=null return result; } /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * Initializes component. * @param {string} themePath The path to the theme folder. */ Yahoo.Controls.Theme.prototype.initialize = function(themePath) { // Includes lib.include("Yahoo.ArgumentNullException"); lib.include("Yahoo.EventArgs"); // Events this._onThemeChangedEventHandlers = new Array(); if(themePath!="") { // Private variables this._themePath = themePath; this._themes = null; this._themeName = null; this._themeDoc = null; // Load available themes this._theme_getThemes(); } // themePath = "" else { throw new Yahoo.ArgumentNullException("themePath"); } // themePath = "" } /** * Adds an event handler. Supported events are: ThemeChanged. * @param {Function} eventHandler The function that is to be called when the event is raised. * @param {String} eventName The name of the event that is being listened to. */ Yahoo.Controls.Theme.prototype.addEventHandler = function(eventHandler, eventName) { // Validate input if(eventHandler==null) { throw new Yahoo.ArgumentNullException("eventHandler"); return; } if(eventName==null) { throw new Yahoo.ArgumentNullException("eventName"); return; } switch(eventName) { case "ThemeChanged": this._onThemeChangedEventHandlers.push(eventHandler); break; default: throw new Error("Invalid eventName."); break; } } /** * Loads the given theme. * @param {String} themeName The name of the theme to load. */ Yahoo.Controls.Theme.prototype.loadTheme = function(themeName) { var file; this._themeName = themeName; try { // Clear cache for(item in this._cache) { this._cache[item] = null; } this._cache = null; // Load the file file = filesystem.readFile(this._themePath + "/" + this._themeName + "/" + this._themeName + ".xml"); this._themeDoc = XMLDOM.parse(file); this._cache = new Object(); } catch(e) { this._themeName = null; this._themeDoc = null; } // Raise event Yahoo.raiseEvent(this, this._onThemeChangedEventHandlers, new Yahoo.EventArgs()); } /** * Returns the given GUI element based on the currently loaded theme. * @param {String} itemName The item name to retrieve. * @param {Window} window The window object to add the returned item to or null. * @type Object */ Yahoo.Controls.Theme.prototype.getItem = function(itemName, window) { var nodes; var styleName; var styleNode; var itemNode; var result; if(this._themeDoc!=null) { result = this._theme_getFromCache(itemName) if(result==null) { // Find the element that describe the GUI item requested nodes = this._themeDoc.evaluate("/theme/items/" + itemName); if(nodes.length==1) { itemNode = nodes.item(0); // Get the style definition for the item styleName = itemNode.getAttribute("style"); nodes = this._themeDoc.evaluate("/theme/styles/*[@id='" + styleName + "']"); if(nodes.length==1) { styleNode = nodes.item(0); if(styleNode!=null) { // Get the style and create a Widget Engine object populated with correct properties switch(styleNode.nodeName) { case "image": result = this._theme_getImageObject(itemNode, styleNode); this._theme_addToCache(result, itemName, "image"); break; case "label": result = this._theme_getLabelObject(itemNode, styleNode); this._theme_addToCache(result, itemName, "label"); break; case "textBox": result = this._theme_getTextBoxObject(itemNode, styleNode); this._theme_addToCache(result, itemName, "textBox"); break; } // switch } else { throw new Error("Theme error: Style '" + styleName + "' not found for element '" + itemName + "'."); } //node!=null } else { throw new Error("Theme error: Incorrect number of styles of the type '" + styleName + "' (" + nodes.length + ")."); } // nodes.length==1 (styles) } else { throw new Error("Theme error: Incorrect number of elements of the type '" + itemName + "' (" + nodes.length + ")."); } // nodes.length==1 (items) } // result == null (from cache) } else { throw new Error("Theme not loaded."); } if(window!=null) { result.window = window; } return result; } /** * Returns the parameter as an object based on the currently loaded theme. * @param {String} itemName The parameter item name to retrieve. */ Yahoo.Controls.Theme.prototype.getParameter = function(itemName) { var nodes; var itemNode; var itemAttrib; var attribCount; var result; if(this._themeDoc!=null) { // Find the element that describe the GUI item requested nodes = this._themeDoc.evaluate("/theme/parameters/" + itemName); if(nodes.length==1) { itemNode = nodes.item(0); // Create new object result = new Object(); result["itemName"] = itemNode.nodeName; // Loop all attributes in this element for(attribCount=0; attribCount /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * Defines a format for text. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ // Create namespace Yahoo.Drawing if it doesn't already exist if(Yahoo==undefined) { var Yahoo = new Object(); } if(Yahoo.Drawing==undefined) { Yahoo.Drawing = new Object(); } if(Yahoo.Drawing.Common==undefined) { Yahoo.Drawing.Common = new Object(); } /** * Default constructor. * @constructor * @param {String} familyName The font family name of this font object. * @param {String} size The size of this font. */ Yahoo.Drawing.Font = function(familyName, size) { //log("Font.ctor()"); if(arguments.length>0) { this.initialize(familyName, size); } } /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. * @param {String} familyName The font family name of this font object. * @param {String} size The size of this font. */ Yahoo.Drawing.Font.prototype.initialize = function(familyName, size) { //log("Font.initialize()"); if(familyName==null || size==null) { throw new Yahoo.ArgumentNullException(); } else { this._name = familyName; this._size = parseInt(size); } // arguments == null } /** * Returns a human-readable version of this object. */ Yahoo.Drawing.Font.prototype.toString = function() { return "[name=" + this.name + ", size=" + this.size + "]"; } /*---------------------------------------------------------------------*/ // Public properties /*---------------------------------------------------------------------*/ /** * Gets the family of this font. * @type String */ Yahoo.Drawing.Font.prototype.name getter = function() { return this._name; } Yahoo.Drawing.Font.prototype.name setter = function(value) { throw new Error("name is read-only"); } /** * Gets the size of this font. * @type Integer */ Yahoo.Drawing.Font.prototype.size getter = function() { return this._size; } Yahoo.Drawing.Font.prototype.size setter = function(value) { throw new Error("size is read-only"); } /*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * Stores a set of numbers describing a two-dimensional location. */ /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {Integer} x The x-coordinate of this point. * @param {Integer} y The y-coordinate of this point. */ Yahoo.Drawing.Point = function(x, y) { this.x = x; this.y = y; } Yahoo.Drawing.Point.prototype.toString = function() { return "{x=" + this.x + ", y=" + this.y + "}"; } /*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * Stores a set of numbers describing the location and size of a rectangle. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {Integer} x The x-coordinate of this rectangle. * @param {Integer} y The y-coordinate of this rectangle. * @param {Integer} width The width of the rectangle. * @param {Integer} height The height of the rectangle. */ Yahoo.Drawing.Rectangle = function(x, y, width, height) { this._x = x; this._y = y; this.width = width; this.height = height; } /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * Returns a value indicating whether the given co-ordinates are within the rectangle. * @param {Integer} x The x-coordinate of the point to check. * @param {Integer} y The y-coordinate of the point to check. * @type Boolean */ Yahoo.Drawing.Rectangle.prototype.contains = function(x, y) { var result = false; if((this.x <= x) && (x <= (this.x + this.width)) && (this.y <= y) && (y < (this.y + this.height))) { result = true } return result; } /** * Returns the object in a human-readable format. */ Yahoo.Drawing.Rectangle.prototype.toString = function() { return "{x=" + this.x + ", y=" + this.y + ", width=" + this.width + ", height=" + this.height + "}"; } /*---------------------------------------------------------------------*/ // Public properties /*---------------------------------------------------------------------*/ /** * Gets or sets the x-coordinate of this Rectangle. * @type Integer */ Yahoo.Drawing.Rectangle.prototype.x getter = function() { return this._x; } Yahoo.Drawing.Rectangle.prototype.x setter = function(x) { this._x = x; } /** * Gets or sets the y-coordinate of this Rectangle. * @type Integer */ Yahoo.Drawing.Rectangle.prototype.y getter = function() { return this._y; } Yahoo.Drawing.Rectangle.prototype.y setter = function(y) { this._y = y; } /** * Gets the x-coordinate of the top-left corner of this Rectangle. * @type Integer */ Yahoo.Drawing.Rectangle.prototype.left getter = function() { return this._x; } Yahoo.Drawing.Rectangle.prototype.left setter = function() { throw new Error("'left' is read-only"); } /** * Gets the y-coordinate of the top edge of this Rectangle. * @type Integer */ Yahoo.Drawing.Rectangle.prototype.top getter = function() { return this._x; } Yahoo.Drawing.Rectangle.prototype.top setter = function() { throw new Error("'top' is read-only"); } /** * Gets the x-coordinate of the right edge of this Rectangle. * @type Integer */ Yahoo.Drawing.Rectangle.prototype.right getter = function() { return this._x + this.width; } Yahoo.Drawing.Rectangle.prototype.right setter = function() { throw new Error("'right' is read-only"); } /** * Gets the y-coordinate of the bottom edge of this Rectangle. * @type Integer */ Yahoo.Drawing.Rectangle.prototype.bottom getter = function() { return this._y + this.height; } Yahoo.Drawing.Rectangle.prototype.bottom setter = function() { throw new Error("'bottom' is read-only"); } /*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * Stores a set of numbers describing the size of a rectangle. */ /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {Integer} width The width of the size object. * @param {Integer} height The height of the size object. */ Yahoo.Drawing.Size = function(width, height) { this.width = width; this.height = height; } Yahoo.Drawing.Size.prototype.toString = function() { return "{width=" + this.width + ", height=" + this.height + "}"; } t)&T/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * Describes available alignment options for controls. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Namespace /*---------------------------------------------------------------------*/ // Create namespace Yahoo.Drawing if it doesn't already exist if(Yahoo==undefined) { var Yahoo = new Object(); } if(Yahoo.Drawing==undefined) { Yahoo.Drawing = new Object(); } /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. */ Yahoo.Drawing.ContentAlignment = { BottomCenter: 512, BottomLeft: 256, BottomRight: 1024, MiddleCenter: 32, MiddleLeft: 16, MiddleRight: 64, TopCenter: 2, TopLeft: 1, TopRight: 4 } c&b/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * EventArgs. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Namespace /*---------------------------------------------------------------------*/ // Create namespace if it doesn't already exist if(Yahoo==undefined) { var Yahoo = new Object(); } /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor for EventArgs. * @constructor */ Yahoo.EventArgs = function() { this.initialize(); } /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called when this class is overridden. */ Yahoo.EventArgs.prototype.initialize = function() { this.cancel = false; } /*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * raiseEvent function. */ /*---------------------------------------------------------------------*/ /** * Raises an event to all subscribed listeners. * @param {Object} sender The object that raised this event. * @param {Array} eventHandlers The array of event handlers to call. * @param {Yahoo.EventArgs} e The event details. */ Yahoo.raiseEvent = function(sender, eventHandlers, e) { var count; if(eventHandlers!=null) { for(count=0;count /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * The exception that is thrown when an argument is outside the valid range for an enumerator. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Namespace /*---------------------------------------------------------------------*/ // Create namespace Yahoo if it doesn't already exist if(Yahoo==undefined) { var Yahoo = new Object() } /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ /** * Default constructor. * @constructor * @param {String} paramName The name of the parameter. * @param {String} message The error text for this exception. * @param {String} type The type of the enumeration this exception is related to. */ Yahoo.InvalidEnumArgumentException = function(paramName, message, type) { this.initialize(paramName, message, type); } /** * Define inheritance chain. */ Yahoo.InvalidEnumArgumentException.prototype = new Error(); Yahoo.InvalidEnumArgumentException.prototype.constructor = Yahoo.InvalidEnumArgumentException ; Yahoo.InvalidEnumArgumentException.prototype.baseclass = Error.prototype; /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. * @param {String} paramName The name of the parameter. * @param {String} message The error text for this exception. * @param {String} type The type of the enumeration this exception is related to. */ Yahoo.InvalidEnumArgumentException.prototype.initialize = function(paramName, message, type) { this.paramName = paramName; if(message!=null && message!="") { this.message = message; } else { this.message = paramName; } this.name = "InvalidEnumArgumentException "; this.type = type; } &H/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * format function. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Namespace /*---------------------------------------------------------------------*/ // Create namespace Yahoo if it doesn't already exist if(Yahoo==undefined) { var Yahoo = new Object(); } if(Yahoo.Utility==undefined) { Yahoo.Utility = new Object(); } /** * Replaces the format item in the given string with the text equivalent of the corresponding object instance in the array. * Replaces "{n}" with arguments[n]. Currently does not do any formatting on the values. * @param {String} text The template text to format. * @param {Object} args The content to fill the template with. */ Yahoo.Utility.format = function(text, args) { var result; // Do format result = text.replace(/\{(\d+)\}/g, function(match, count) { return args[count]; }); return result; } }&]m/*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2007 Yahoo! Inc. All Rights Reserved. /// /** * Library management class for a local (non-shared) installation of library. Does not support modifying the library. */ /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ // Create namespace Yahoo.Utility if it doesn't already exist if(Yahoo==undefined) { var Yahoo = new Object() } if(Yahoo.Utility==undefined) { Yahoo.Utility = new Object() } /** * Default constructor. * @constructor * @param {String} libraryPath The path to the library root folder. */ Yahoo.Utility.Library = function(libraryPath) { if(arguments.length > 0) { this.initialize(libraryPath); } //arguments.length > 0 } /*---------------------------------------------------------------------*/ // Global constants /*---------------------------------------------------------------------*/ // These are defined here to provide hardcoded default settings to all items in the library Yahoo.Utility.Library.prototype.defaultTheme = "Purple"; /*---------------------------------------------------------------------*/ // Private code /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. * @param {String} libraryPath The path to the library root folder. */ Yahoo.Utility.Library.prototype.initialize = function(libraryPath) { if(libraryPath!="") { this._libraryPath = libraryPath; } // libraryPath = "" else { throw new Error("Required parameter 'libraryPath' missing."); } // libraryPath = "" } /** * Includes the given class into the currently running widget. * @param {String} className The full name of the class to include into the currently running widget. * @param {String} version The version of the class to include into the currently running widget. * @param {Boolean} exactVersion A value indicating whether the exact version should be included. If false, the latest version will be used. */ Yahoo.Utility.Library.prototype.include = function(className, version, exactVersion) { var classPath; var classExists; if(className!="") { // Check if the given class has already been included try { if(eval(className)==undefined) { classExists = false } else { classExists = true; } // className==undefined } // try catch(e) { classExists = false; } if(classExists==false) { classPath = this.getClass(className, version, exactVersion) if(classPath!="") { include(classPath); } // classPath!="" } // class already included } // className = "" else { throw new Error("Required parameter 'className' missing."); } // className = "" return classPath; } /** * Gets the path to the class to include. * @param {String} className The full name of the class to get the file name for. * @param {String} version Not implemented! This parameter is only used in the shared version of this class. */ Yahoo.Utility.Library.prototype.getClass = function(className, version) { var count; var classPath; var names; var library; var fullPath = ""; var dirContents; var file; var versions; var result = ""; if(className!="") { // Get full path to folder where this class should be located classPath = this._libraryPath; names = className.split("."); for(count=0; count /// (C) Copyright 2005-2007 Yahoo! Inc. All Rights Reserved. /// /** * Library management class. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Constructor /*---------------------------------------------------------------------*/ // Create namespace Yahoo.Utility if it doesn't already exist if(Yahoo==undefined) { var Yahoo = new Object() } if(Yahoo.Utility==undefined) { Yahoo.Utility = new Object() } /** * Default constructor. * @constructor * @param {String} libraryPath The path to the library root folder. */ Yahoo.Utility.Library = function(libraryPath) { if(arguments.length > 0) { this.initialize(libraryPath); } //arguments.length > 0 } /*---------------------------------------------------------------------*/ // Global constants /*---------------------------------------------------------------------*/ // These are defined here to provide hardcoded default settings to all items in the library Yahoo.Utility.Library.prototype.defaultTheme = "Purple"; /*---------------------------------------------------------------------*/ // Private code /*---------------------------------------------------------------------*/ /** * Recursively creates given directory structure. * @private * @param {String} path The path to directory to create. */ Yahoo.Utility.Library.prototype._createDirectory = function(path) { var count; var parts; var part; var currentPath = ""; try { parts = path.split("/"); for(count=0; count 1) { result = match[1] -0; } else { result = 0; } return result; } /*---------------------------------------------------------------------*/ // Public code /*---------------------------------------------------------------------*/ /** * True constructor. Must be called if this class is overridden. * @param {String} libraryPath The path to the library root folder. */ Yahoo.Utility.Library.prototype.initialize = function(libraryPath) { if(libraryPath!="") { this._libraryPath = libraryPath; } // libraryPath = "" else { throw new Error("Required parameter 'libraryPath' missing."); } // libraryPath = "" } /** * Adds the given file as a shared class in the library. * @param {String} className The full name of the class to add to the library. * @param {String} version The version of the class to add to the library. * @param {String} fileName The file name of the class to add to the library. * @param {replace} replace A value indicating whether an existing class with the same name and version should be overwritten. * @returns * -1 = Unknown error. * 0 = Library added. * 1 = Library already exists. */ Yahoo.Utility.Library.prototype.addClass = function(className, version, filename, replace) { var count; var classPath; var names; var library; var destFilename; var skip = false; var result = -1; if(className!="" && version!="" && filename!="") { // Get full path to folder where this class should be located classPath = this._libraryPath; names = className.split("."); for(count=0; count 0) { // Sort array versions.sort(this._numericCompare); // Get path to the library fullPath = classPath + "/" + library + ".v" + versions[versions.length-1].toFixed(2) + ".js"; } // if versions.length > 0 } // for dirContents } // if version!=null // Check if library file exists if(filesystem.itemExists(fullPath) == true) { result = fullPath; } } // if classPath exists } // className = "" else { throw new Error("Required parameter 'className' missing."); } // className = "" return result; } /** * Adds a resources path for the class. * @param {String} className The full name of the class to add to resources to. * @param {String} version The version of the class to add to resources to. * @returns * -1 = Unknown error. * 0 = Path added. * 1 = Path already exists. */ Yahoo.Utility.Library.prototype.addClassResourcePath = function(className, version) { var count; var classPath; var names; var library; var result = -1; if(className!="" && version!="") { // Get full path to folder where the resources for this class should be located classPath = this._libraryPath + "/" + className.replace(/\./g, "/") + "/res/" + version.toFixed(2); // Check if path for this namespace exists if(filesystem.itemExists(classPath)==false) { // Create path for this namespace this._createDirectory(classPath); // Check if we succeeded if(filesystem.itemExists(classPath)==true) { result = 0; } // If success else { result = -1; } // If success } // If exists already else { result = 1; } // If exists already } // parameters != "" else { throw new Error("Required parameter missing."); } // parameters != "" } /** * Gets the path to the class resources. * @param {String} className The full name of the class to get the path to resources. * @param {String} version The version of the class to get the path to resources. */ Yahoo.Utility.Library.prototype.getClassResourcePath = function(className, version) { var count; var classPath; var fullPath = ""; var dirContents; var folder; var versions; var result = ""; if(className!="") { // Get full path to folder where the resources for this class should be located classPath = this._libraryPath + "/" + className.replace(/\./g, "/") + "/res"; // Check if path for this namespace exists if(filesystem.itemExists(classPath)==true) { // If asked for exact version, check for correct file if(version!=null) { // Path is in the form "library/my/name/space/res/1.00" fullPath = classPath + "/" + version.toFixed(2); } // if version!=null else { // Not asked for exact version, get newest available version dirContents = filesystem.getDirectoryContents(classPath); // Get version number for each folder and add to an array versions = new Array(); for(count=0; count 0) { // Sort array versions.sort(this._numericCompare); // Get path to the library fullPath = classPath + "/" + versions[versions.length-1].toFixed(2); } // if versions.length > 0 } // for dirContents } // if exactVersion==false // Check if library folder exists if(filesystem.itemExists(fullPath) == true) { result = fullPath; } } // if classPath exists } // className = "" else { throw new Error("Required parameter 'className' missing."); } // className = "" return result; } /*---------------------------------------------------------------------*/ // Public properties /*---------------------------------------------------------------------*/ /** * Gets the base path for libraries. * @type String */ Yahoo.Utility.Library.prototype.libraryPath getter = function() { return this._libraryPath; } Yahoo.Utility.Library.prototype.libraryPath setter = function() { throw new Error("libraryPath is read-only."); } d'//*---------------------------------------------------------------------*/ /// /// (C) Copyright 2005-2006 Yahoo! Inc. All Rights Reserved. /// /** * stripHtml function. */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ // Namespace /*---------------------------------------------------------------------*/ // Create namespace Yahoo if it doesn't already exist if(Yahoo==undefined) { var Yahoo = new Object(); } if(Yahoo.Utility==undefined) { Yahoo.Utility = new Object(); } Yahoo.Utility.HtmlEntities = {'nbsp':160,'iexcl':161,'cent':162,'pound':163,'curren':164,'yen':165,'brvbar':166,'sect':167, 'uml':168,'copy':169,'ordf':170,'laquo':171,'not':172,'shy':173,'reg':174,'macr':175,'deg':176,'plusmn':177, 'sup2':178,'sup3':179,'acute':180,'micro':181,'para':182,'middot':183,'cedil':184,'sup1':185,'ordm':186, 'raquo':187,'frac14':188,'frac12':189,'frac34':190,'iquest':191,'agrave':192,'aacute':193,'acirc':194, 'atilde':195,'auml':196,'aring':197,'aelig':198,'ccedil':199,'egrave':200,'eacute':201,'ecirc':202, 'euml':203,'igrave':204,'iacute':205,'icirc':206,'iuml':207,'eth':208,'ntilde':209,'ograve':210,'oacute':211, 'ocirc':212,'otilde':213,'ouml':214,'times':215,'oslash':216,'ugrave':217,'uacute':218,'ucirc':219,'uuml':220, 'yacute':221,'thorn':222,'szlig':223,'agrave':224,'aacute':225,'acirc':226,'atilde':227,'auml':228,'aring':229, 'aelig':230,'ccedil':231,'egrave':232,'eacute':233,'ecirc':234,'euml':235,'igrave':236,'iacute':237,'icirc':238, 'iuml':239,'eth':240,'ntilde':241,'ograve':242,'oacute':243,'ocirc':244,'otilde':245,'ouml':246,'divide':247, 'oslash':248,'ugrave':249,'uacute':250,'ucirc':251,'uuml':252,'yacute':253,'thorn':254,'yuml':255,'lt':38,'gt':62, 'amp':38,'apos':39,'quot':34,'oelig':338,'oelig':339,'scaron':352,'scaron':353,'yuml':376,'circ':710,'tilde':732, 'ensp':8194,'emsp':8195,'thinsp':8201,'zwnj':8204,'zwj':8205,'lrm':8206,'rlm':8207,'ndash':8211,'mdash':8212, 'lsquo':8216,'rsquo':8217,'sbquo':8218,'ldquo':8220,'rdquo':8221,'bdquo':8222,'dagger':8224,'dagger':8225, 'permil':8240,'lsaquo':8249,'rsaquo':8250,'euro':8364,'fnof':402,'alpha':913,'beta':914,'gamma':915,'delta':916, 'epsilon':917,'zeta':918,'eta':919,'theta':920,'iota':921,'kappa':922,'lambda':923,'mu':924,'nu':925,'xi':926, 'omicron':927,'pi':928,'rho':929,'sigma':931,'tau':932,'upsilon':933,'phi':934,'chi':935,'psi':936,'omega':937, 'alpha':945,'beta':946,'gamma':947,'delta':948,'epsilon':949,'zeta':950,'eta':951,'theta':952,'iota':953, 'kappa':954,'lambda':955,'mu':956,'nu':957,'xi':958,'omicron':959,'pi':960,'rho':961,'sigmaf':962,'sigma':963, 'tau':964,'upsilon':965,'phi':966,'chi':967,'psi':968,'omega':969,'thetasym':977,'upsih':978,'piv':982, 'bull':8226,'hellip':8230,'prime':8242,'prime':8243,'oline':8254,'frasl':8260,'weierp':8472,'image':8465, 'real':8476,'trade':8482,'alefsym':8501,'larr':8592,'uarr':8593,'rarr':8594,'darr':8595,'harr':8596, 'crarr':8629,'larr':8656,'uarr':8657,'rarr':8658,'darr':8659,'harr':8660,'forall':8704,'part':8706, 'exist':8707,'empty':8709,'nabla':8711,'isin':8712,'notin':8713,'ni':8715,'prod':8719,'sum':8721, 'minus':8722,'lowast':8727,'radic':8730,'prop':8733,'infin':8734,'ang':8736,'and':8743,'or':8744, 'cap':8745,'cup':8746,'int':8747,'there4':8756,'sim':8764,'cong':8773,'asymp':8776,'ne':8800, 'equiv':8801,'le':8804,'ge':8805,'sub':8834,'sup':8835,'nsub':8836,'sube':8838,'supe':8839,'oplus':8853, 'otimes':8855,'perp':8869,'sdot':8901,'lceil':8968,'rceil':8969,'lfloor':8970,'rfloor':8971,'lang':9001, 'rang':9002,'loz':9674,'spades':9824,'clubs':9827,'hearts':9829,'diams':9830} /** * Strips all HTML code and returns a plain text string. * @param {String} text The HTML string to convert into plain text. * @param {Boolean} brToLineFeed A value indicating whether BR tags should be converted into line feeds. * @param {Boolean} doublePass A value indicating whether a double pass of HTML decoding should be done. */ Yahoo.Utility.stripHtml = function(text, brToLineFeed, doublePass) { var result; result = text; // Remove any newline characters result = result.replace(/[\r]+/, ""); // Convert
tags to linefeeds \n if(brToLineFeed==true) { result = result.replace(/<\/?br[^<>]*>/g, "\n"); } // Strip HTML tags result = result.replace(/<\/?[a-z][a-z0-9]*[^<>]*>/g, ""); // Convert HTML entities result = Yahoo.Utility.decodeHtmlEntities(result); if(doublePass==true) { result = Yahoo.Utility.decodeHtmlEntities(result); } // Remove double whitespaces result = result.replace(/[ \t]{2,}/g, " "); // Remove whitespaces from start and end of string result = result.replace(/^[ \t]+|[ \t]+$/mg, ""); return result; } /** * Converts HTML entities into text. * @param {String} text The HTML string that contains encoded HTML entities that should be decoded. * @type String */ Yahoo.Utility.decodeHtmlEntities = function(text) { var charRegEx = /&(?:(\w{2,7})|#(\d{2,4}));/g; var hit; var charCode; var lastHit = 0; var result = ""; while((hit=charRegEx.exec(text))!=null) { // Decimal values are always in group 2 charCode = new Number(hit[2]); if(isNaN(charCode)==true) { // Not a decimal number, get from entity map charCode = Yahoo.Utility.HtmlEntities[hit[1].toLowerCase()]; } result += text.substring(lastHit, hit.index) + String.fromCharCode(charCode); lastHit = hit.index + hit[0].length; } result += text.substring(lastHit); return result; } 'QAGIF89a!1^333>hၘ2X|̙bfff#KrRrrBeMMM@@@ٍ򿿿YYYsss! NETSCAPE2.0!!,@pH,Ȥrl:ШtJZجvzxL.zn|N۽A 00j{d~^z{[WS{OKGB_  h]  g[ Cv D  fYFD̻`6#ܫpaXb2$qc(N!NuJrQS՝鎌s&@wG%".̀\|6)x#H@@EP" c#b6:HVHYtLK;$4 Wj:,2W"8UR/XvJK3biLW}8@-(_ y kU,D51KYb$; `e$$H(My~$zJ[Q)ҍ78A$C=Z۵E}GLq褖܃CDglpaHDJ@ D&y 6! IHi%c\D^;5hZQ.R\D̻x폍P T'VGuMpI.(ܕ]axRsq y w)u'14Qn3&j +bOI&+~:2[17Y25sYO<}䕄\ϜYD$C][%_D]X0؃=PU6W.Xo^T:O;aROSnR0F}ZJw>`נ#IpK$8$$SEe|I˄a_Cw=A`ǵjF8#quX!zAԨ Ed-^ߍ(,1xf<&hPx#9:тv<G'M=An\h3d5E:򑐌$'IJZ̤&c!ND:uR (PJ2_yThlI deJ41;[r`rO,BP le'7N&6br6p @M"SPk۬6p@'; v,B:e!  Cyэ IO~f+(i$JSR3Ee0PL @uО:TfK3WL:4@@cyҲ>ԡ0΋U+)r@;HeSڕ”EZ] ౐E^pT :džYtJV5dpp-e+"\-uI j{mo: !!,c#@pH, dq @Fء5d; |y&*puSr~T {b{ofm rr}~mSW~r~rertmyg^rmgm{ {x~{CippDTB _A!!,gF) A@pH,H#08Шt BrBwLvͲ:S7|Dm}}ld`YL\VCA!!,c[ #@pH,H` O @ < ЬP}3|@5Y2.>|N|U_|Tg|nt|S |n `uw||~uupڇcykBA!!,He )P@0`lC3Y35r_m:]o:pn7{-qB&0l!c0e XUш! !!, F) S@ȤrD!`00جvea -pnM260wkzqidnSU~v_aBDFMNPBA!!,#@ 1(rdbiZE8(`$DVB, hcr q yBIW y a_f[Wdn`npvxWyM `h^agUo`YywKq`Wt`yػNĨJijyٙ`뗬{x6dҼ~T1'&D ;|HP;'A/GIF89a; !,; ^Lڋ\Lb'"Bm\r^ť?~DKx20DJW4Vu.F VyT Ql O};"' HQAGIF89a?мնӿǼżƱз±ʣȬȥȤȤɤȣǢšũܜܛۛÚۘ{wvvvwvyuyqnmmnmlmlnj{rjev}dds}c~d~i}j|pz`{_{jz\{jxax[y[xZxcv\wZw[wYu^tTvVs^qYrYqRpNqblyZlZhyVh}JiIjIiYdrEeVbrPbyAcAbU_lAbS_n=aR^mI^yR]jI]u9\IYm?[|9[9[5\7ZBXr7Y7Z{LUb1V8Uy2V1U:Ts2UGQ^APc?Pe1Ot*P~+O~*O~4Nm*O$Jz#Jy6H]$Jy#Jz$Iz#Iy#Iz/Gf;EQ7DS6CSEwEvEv*Cb6AODvDwDv+A]0@U1=M@s?r?s@s@r-:L>q$:U!,? c*\Ȑa#Cb3jȱǏנ@K7R\ɲ˗0uȜIS%{Nϟ@ :$>eTHӧOJ Xj݊(dવM,UҪMZ :BݻxRڿU.aîs&mcNMy1s./BSZLȨ>|װaI8M@L3mt$/lDuKu ƖCnq cLҁνMA=ÇgT34<oX`z3`_&`A8! x8"K4H I2Ѭ{QВ|:!#^8N_a#86aA㏞HL ;DK7 F1P'׏'EcA)3@6D"jpj<30LMK(P0裭DZN "R p !22' J5{˪B߂O_@kA X#삊 * Ux;b-.)<A}ǭZ. c c .12̽3nA,l'\=CD,?lSKL-'$l(,.H>s8<7˃S> C;H'L# PG-TGM HC\wB,P@;(JA 8(J HGIF89a fF kD eE hC 4k!, 5HD2  uuqtحžѵMb,M@;j({CLJ BuyDomains.com 1.1 c39cf510-d630-11dc-95ff-0800200c9a66 (c) 2008 BuyDomains.com C;u(#;Jvar lib; var mainForm; var searchInput; var theme; var requestTimer; var requestCanceled; var canvas; var resultsFrame; var searchInputText = ""; var searchHint; var noResultsHint; var goToBuyDomains; var goToBuyDomainsArrow; var searchIndicator; var requestInProgress = false; var lastSearchKeywords = null; var RESULT_ROW_HEIGHT = 26; include("Resources/Library/Library.js"); lib = new Yahoo.Utility.Library("Resources/Library"); // Includes lib.include("Yahoo.Drawing.ContentAlignment"); lib.include("Yahoo.Drawing.Common"); lib.include("Yahoo.EventArgs"); lib.include("Yahoo.Controls.Theme"); lib.include("Yahoo.Controls.Control"); lib.include("Yahoo.Controls.SizableControlBase"); lib.include("Yahoo.Controls.Sizable3PartControlBase"); lib.include("Yahoo.Controls.CheckBoxBase"); lib.include("Yahoo.Controls.CheckBox"); lib.include("Yahoo.Controls.Label"); lib.include("Yahoo.Controls.Button"); lib.include("Yahoo.Controls.ComboBox"); lib.include("Yahoo.Controls.ImageComboBox"); lib.include("Yahoo.Controls.CheckedListBox"); lib.include("Yahoo.Controls.ProgressBar"); lib.include("Yahoo.Controls.TextBox"); lib.include("Yahoo.Controls.Form"); // Create a named theme theme = new Yahoo.Controls.Theme("Resources/Themes"); theme.loadTheme("Default"); // Link definition var Link = function(url) { this.url = url; this.label = new Text(); this.label.color = "#3333CC"; this.label.font = "\"Arial\" sans-serif"; this.label.size = 11; this.label.style.textDecoration = "underline"; this.label.style.cursor = "pointer"; var _this = this; this.label.onClick = function() { openURL(_this.url); } this.getControl = function() { return _this.label; } } // END: Link definition function widget_onLoad() { mainForm = new Yahoo.Controls.Form(null); mainForm.text = "Buydomains.com Widget"; mainForm.width = 400; mainForm.height = 230; mainForm.formBorderStyle = Yahoo.Controls.FormBorderStyle.Fixed; mainForm.window.level = "topmost"; mainForm.left = (screen.availWidth / 2) - (mainForm.width / 2); mainForm.top = (screen.availHeight / 2) - (mainForm.height / 2); mainForm.addEventHandler(function(sender, e) { widget.visible = false; e.cancel = true; }, "Closing"); var logoImage = new Image(); logoImage.src = "Resources/buydomains_logo_264x72.gif"; logoImage.vOffset = 29; logoImage.hOffset = 400 / 2 - 264 / 2; logoImage.style.cursor = "pointer"; logoImage.onClick = function() { openURL("http://www.buydomains.com"); } var findYourDomainLabel = new Yahoo.Controls.Label(null); findYourDomainLabel.autoSize = true; findYourDomainLabel.text = "Find Your Domain Name:"; findYourDomainLabel.style.fontWeight = 'bold'; findYourDomainLabel.style.fontSize = '11px'; findYourDomainLabel.top = 72; findYourDomainLabel.left = 6; searchHint = new Yahoo.Controls.Label(null); searchHint.autoSize = true; searchHint.text = "Search results will appear as you type..."; searchHint.top = 143; searchHint.left = 400 / 2 - searchHint.width / 2; noResultsHint = new Yahoo.Controls.Label(null); noResultsHint.autoSize = true; noResultsHint.top = 143; noResultsHint.visible = false; searchInput = new Yahoo.Controls.TextBox(null); searchInput.text = ""; searchInput.width = 255; searchInput.height = 22; searchInput.left = 6; searchInput.top = 85; searchInput.addEventHandler(function(sender, e) { if (e.keyString == "Return") { searchInput._txtTextBox.rejectKeyPress(); } }, "KeyPress"); searchInput.addEventHandler(function(sender, e) { if (!requestInProgress & searchInput.text != lastSearchKeywords) { doSearch(searchInput.text); } }, "TextChanged"); requestTimer = new Timer(); requestTimer.interval = 30.0; requestTimer.ticking = false; requestTimer.onTimerFiler = function() { requestCanceled = true; requestInProgress = false; displayErrorMessage("Request timeout."); if (searchInput.text != lastSearchKeywords) { doSearch(searchInput.text); } } resultsFrame = new Yahoo.Controls.Control(null); resultsFrame.hide(); canvas = new Canvas(); canvas.vOffset = 139; canvas.hOffset = 0; canvas.width = 390; canvas.height = 0; resultsFrame._frame.addSubview(canvas); var advancedSearchLink = new Link("http://www.buydomains.com/find-premium-domains/index.jsp?searchType=advanced"); advancedSearchLink.getControl().data = "Advanced search"; advancedSearchLink.getControl().style.fontWeight = "bold"; advancedSearchLink.getControl().vOffset = 156; advancedSearchLink.getControl().hOffset = 56; var separator1 = new Yahoo.Controls.Label(null); separator1.text = "|"; separator1.top = 145; separator1.left = 157; var domainAlerts = new Link("http://www.buydomains.com/alerts/alerts-manager.jsp?utm_source=Yahoo&utm_medium=Widget&utm_content=YahooWidget&utm_campaign=2008"); domainAlerts.getControl().data = "Sign Up For Domain Alerts"; domainAlerts.getControl().vOffset = 156; domainAlerts.getControl().hOffset = 168; var separator2 = new Yahoo.Controls.Label(null); separator2.text = "|"; separator2.top = 145; separator2.left = 308; var chat = new Link("http://livechat.boldchat.com/aid/2882483596352441248/bc.chat?cwdid=12463179486054040&wdid=2943214817915460751&rdid=588609688268638540"); chat.getControl().data = "Chat"; chat.getControl().vOffset = 156; chat.getControl().hOffset = 320; goToBuyDomains = new Link("http://www.buydomains.com"); goToBuyDomains.getControl().data = "Go To BuyDomains"; goToBuyDomains.getControl().style.fontWeight = "bold"; goToBuyDomains.getControl().hOffset = 13; goToBuyDomains.getControl().vOffset = mainForm.height - 22; goToBuyDomainsArrow = new Yahoo.Controls.Label(null); goToBuyDomainsArrow.text = "\u00bb"; goToBuyDomainsArrow.style.fontWeight = "bold"; goToBuyDomainsArrow.style.color = "#c00"; goToBuyDomainsArrow.left = 123; goToBuyDomainsArrow.top = mainForm.height - 33; searchIndicator = new Image(); searchIndicator.src = "Resources/loading_indicator.gif"; searchIndicator.vOffset = 157; searchIndicator.hOffset = 400 / 2 - searchIndicator.width / 2; searchIndicator.visible = false; mainForm._frame.addSubview(logoImage); mainForm.addControl(findYourDomainLabel); mainForm.addControl(searchInput); mainForm.addControl(resultsFrame); mainForm.addControl(searchHint); mainForm.addControl(noResultsHint); mainForm._frame.addSubview(searchIndicator); mainForm._frame.addSubview(advancedSearchLink.getControl()); mainForm._frame.addSubview(separator1.frame); mainForm._frame.addSubview(domainAlerts.getControl()); mainForm._frame.addSubview(separator2.frame); mainForm._frame.addSubview(chat.getControl()); mainForm._frame.addSubview(goToBuyDomains.getControl()); mainForm._frame.addSubview(goToBuyDomainsArrow.frame); mainForm.show(); searchInput.focus(); } function doSearch(keywords) { var url = "http://search.buydomains.com/broker?id=yahoo-widget&keywords="+keywords+"&maxResults=10"; try { requestCanceled = false; requestTimer.ticking = true; requestInProgress = true; lastSearchKeywords = keywords; resultsFrame.hide(); searchHint.visible = false; noResultsHint.visible = false; mainForm.height = Math.max(mainForm.height, 157 + 175 + 30); goToBuyDomains.getControl().vOffset = mainForm.height - 22; goToBuyDomainsArrow.top = mainForm.height - 33; searchIndicator.visible = true; var request = new XMLHttpRequest(); request.open("GET", url, true); request.onreadystatechange = function() { if (request.status == 200 && !requestCanceled) { requestTimer.ticking = false; requestInProgress = false; if (searchInput.text != lastSearchKeywords) { doSearch(searchInput.text); } else { var resultsList = request.responseXML.evaluate("brokerageSearch/response/premiumdomain"); if (resultsList.length == 0) { resultsFrame.hide(); if (lastSearchKeywords == "") { noResultsHint.visible = false; searchHint.visible = true; } else { searchHint.visible = false; noResultsHint.text = "No exact matches found for keyword \'" + unescape(lastSearchKeywords) + "\'"; noResultsHint.left = 400 / 2 - noResultsHint.width / 2; noResultsHint.visible = true; } searchIndicator.visible = false; mainForm.height = 230; goToBuyDomains.getControl().vOffset = mainForm.height - 22; goToBuyDomainsArrow.top = mainForm.height - 33; } else { searchHint.visible = false; noResultsHint.visible = false; searchIndicator.visible = false; displaySearchResults(resultsList); } } } } request.send(); } catch (e) { requestTimer.ticking = false; displayErrorMessage("Request error. " + e); } } function displaySearchResults(results) { clearResultsTable(); var colWidth = [170, 54, 83]; var ctx = canvas.getContext("2d"); canvas.height = results.length * RESULT_ROW_HEIGHT; mainForm.height = 230 - 25 + results.length * RESULT_ROW_HEIGHT; // Table for (var i = 0; i < results.length; i++) { ctx.fillStyle = (i % 2) == 0 ? "#c9daee" : "#fff"; ctx.fillRect(0, i * RESULT_ROW_HEIGHT, canvas.width, RESULT_ROW_HEIGHT); } var xoffset = 0; ctx.fillStyle="#fff"; for (var i = 0; i < colWidth.length; i++) { xoffset += colWidth[i]; ctx.fillRect(xoffset, 0, 1, RESULT_ROW_HEIGHT * results.length); } // Data for (var i = 0; i < results.length; i++) { var domainName = results.item(i).firstChild.nodeValue; var domainPrice = parseFloat(results.item(i).getAttribute("price")); if (isNaN(domainPrice)) { domainPrice = 0.0; } var domain = new Text(); domain.data = domainName; domain.vOffset = canvas.vOffset + i * RESULT_ROW_HEIGHT + 17; domain.hOffset = 10; resultsFrame._frame.addSubview(domain); var find_similar = new Yahoo.Controls.ImageButton(theme, "findSimilarButton", "findSimilarButton", "findSimilarButton", "findSimilarButton"); find_similar.text = domainName; find_similar.addEventHandler(function(sender) { openURL("http://www.buydomains.com/find-premium-domains/search-results.jsp?style=s&domain=" + sender.text); }, "MouseUp"); find_similar.top = canvas.vOffset + i * RESULT_ROW_HEIGHT + 6; find_similar.left = 190; resultsFrame.addControl(find_similar); var price = new Text(); price.data = domainPrice == 0 ? "" : formatCurrency(domainPrice); price.vOffset = canvas.vOffset + i * RESULT_ROW_HEIGHT + 17; price.hOffset = 297 - price.width; resultsFrame._frame.addSubview(price); if (domainPrice != 0) { var buy_now = new Yahoo.Controls.ImageButton(theme, "buyNowButton", "buyNowButton", "buyNowButton", "buyNowButton"); buy_now.text = domainName; buy_now.addEventHandler(function(sender) { openURL("http://www.buydomains.com/AddToCart.do?selectedDomains=" + sender.text); }, "MouseUp"); buy_now.top = canvas.vOffset + i * RESULT_ROW_HEIGHT + 6; buy_now.left = 318; resultsFrame.addControl(buy_now); } else { var request_price = new Link("http://www.buydomains.com/AddToCart.do?selectedDomains=" + domainName); request_price.getControl().data = "Request Price"; request_price.getControl().vOffset = canvas.vOffset + i * RESULT_ROW_HEIGHT + 16; request_price.getControl().hOffset = 314; resultsFrame._frame.addSubview(request_price.getControl()); } } goToBuyDomains.getControl().vOffset = mainForm.height - 22; goToBuyDomainsArrow.top = mainForm.height - 33; resultsFrame.show(); } function displayErrorMessage(error) { alert(error); } function formatCurrency(value) { var result; var number = Math.floor(value); var fraction = value - number; if (fraction != 0 && fraction < 10) { fraction = "0" + fraction; } result = fraction > 0 ? "." + fraction : ""; while (number > 999) { var k = Math.round((number / 1000.0 - Math.floor(number / 1000.0)) * 1000); var k_str = ""; if (k < 10) { k_str = "00" + k; } else if (k < 100) { k_str = "0" + k; } else { k_str = k; } result = "," + k_str + result; number -= k; number /= 1000; } result = "$" + number + result; return result; } function clearResultsTable() { var ctx = canvas.getContext("2d"); ctx.clearRect(0, 0, canvas.width, canvas.height); // Tell Widget Class Library controls to dispose for (var count = 0; count < resultsFrame._controls.length; count++) { if (resultsFrame._controls[count].dispose != undefined) { resultsFrame._controls[count].dispose(); } resultsFrame._controls = null; resultsFrame._controls = new Array(); } // Remove any other items that are left over in the frame if (resultsFrame._frame != null) { if (resultsFrame._frame.subviews != null) { for (var count = 0; count < resultsFrame._frame.subviews.length; count++) { try { resultsFrame._frame.subviews[count].removeFromSuperview(); } catch(e) { log(e); } if (resultsFrame._frame.subviews == null) { break; } } } } if (resultsFrame._frame != null) { resultsFrame._frame.addSubview(canvas); } } TH4{Gd"%,5,Pi_M4v/cR 47c7}H~~a4H»0|4`ܿFy- ju >  "M   5 ~   Y   =  n kRN?a3/uIh'In*,x  OY!j_CwM8_ Q 6? ~- # & Q ,f8|  6$O$%&!B'h;(-)**=(++x, -e - . ]/F!.0!1!1 "fh"]g" h"h:#i#yj#!k $lT$l$m$n$%Ta%W%%B%)&c&&&m&H-'d''/'QA'A( H8(Jj(Ju(CL(( T buydomains.konResources/buydomains_logo_264x72.gifResources/dock.pngResources/Library/Library.jsResources/Library/LibraryShared.jsResources/Library/Yahoo/ArgumentNullException.v1.01.jsResources/Library/Yahoo/ArgumentOutOfRangeException.v1.01.jsResources/Library/Yahoo/Controls/Button.v1.01.jsResources/Library/Yahoo/Controls/CheckBox.v1.01.jsResources/Library/Yahoo/Controls/CheckBoxBase.v1.01.jsResources/Library/Yahoo/Controls/CheckedListBox.v1.01.jsResources/Library/Yahoo/Controls/ComboBox.v1.01.jsResources/Library/Yahoo/Controls/Control.v1.01.jsResources/Library/Yahoo/Controls/Form.v1.01.jsResources/Library/Yahoo/Controls/ImageButton.v1.01.jsResources/Library/Yahoo/Controls/ImageComboBox.v1.01.jsResources/Library/Yahoo/Controls/Label.v1.01.jsResources/Library/Yahoo/Controls/ProgressBar.v1.01.jsResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/1x1Black.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/1x1Grey50.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/1x1Transp.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/1x1White.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/Black Glass.xmlResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ButtonLeft.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ButtonMiddle.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ButtonRight.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/CheckBoxBg.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/CheckBoxCheck.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ComboBoxBB.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ComboBoxBg.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ComboBoxBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ComboBoxBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ComboBoxBT.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ComboBoxBtn.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ComboBoxCBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ComboBoxCBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ComboBoxCTL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ComboBoxCTR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/FormBB.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/FormBg.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/FormBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/FormBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/FormBT.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/FormButtonClose.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/FormButtonMin.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/FormCBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/FormCBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/FormCTL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/FormCTR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ImgCboButton.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ListBoxBB.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ListBoxBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ListBoxBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ListBoxBT.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ListBoxCBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ListBoxCBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ListBoxCTL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ListBoxCTR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ProgressBarBB.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ProgressBarBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ProgressBarBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ProgressBarBT.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ProgressBarCBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ProgressBarCBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ProgressBarCTL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ProgressBarCTR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/ProgressBarFill.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/StatusBarBG.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/TextBoxBB.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/TextBoxBg.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/TextBoxBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/TextBoxBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/TextBoxBT.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/TextBoxCBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/TextBoxCBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/TextBoxCTL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Black Glass/TextBoxCTR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/1x1Black.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/1x1Grey50.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/1x1Transp.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/1x1White.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ButtonLeft.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ButtonMiddle.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ButtonRight.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/CheckBoxBg.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/CheckBoxCheck.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ComboBoxBB.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ComboBoxBg.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ComboBoxBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ComboBoxBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ComboBoxBT.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ComboBoxBtn.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ComboBoxCBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ComboBoxCBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ComboBoxCTL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ComboBoxCTR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/FormBB.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/FormBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/FormBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/FormBT.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/FormButtonClose.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/FormButtonMin.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/FormCBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/FormCBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/FormCTL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/FormCTR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ImgCboButton.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ListBoxBB.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ListBoxBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ListBoxBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ListBoxBT.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ListBoxCBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ListBoxCBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ListBoxCTL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ListBoxCTR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ProgressBarBB.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ProgressBarBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ProgressBarBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ProgressBarBT.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ProgressBarCBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ProgressBarCBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ProgressBarCTL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ProgressBarCTR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/ProgressBarFill.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/Purple.xmlResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/StatusBarBG.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/TextBoxBB.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/TextBoxBg.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/TextBoxBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/TextBoxBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/TextBoxBT.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/TextBoxCBL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/TextBoxCBR.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/TextBoxCTL.pngResources/Library/Yahoo/Controls/res/1.01/Themes/Purple/TextBoxCTR.pngResources/Library/Yahoo/Controls/Sizable3PartControlBase.v1.01.jsResources/Library/Yahoo/Controls/SizableControlBase.v1.01.jsResources/Library/Yahoo/Controls/TextBox.v1.01.jsResources/Library/Yahoo/Controls/Theme.v1.01.jsResources/Library/Yahoo/Controls/ThemeShared.v1.01.jsResources/Library/Yahoo/Drawing/Common.v1.01.jsResources/Library/Yahoo/Drawing/ContentAlignment.v1.01.jsResources/Library/Yahoo/EventArgs.v1.01.jsResources/Library/Yahoo/InvalidEnumArgumentException.v1.01.jsResources/Library/Yahoo/Utility/format.v1.01.jsResources/Library/Yahoo/Utility/Library.v1.01.jsResources/Library/Yahoo/Utility/LibraryShared.v1.01.jsResources/Library/Yahoo/Utility/stripHtml.v1.01.jsResources/loading_indicator.gifResources/Themes/Default/button_buynow.gifResources/Themes/Default/button_search_clear.gifResources/Themes/Default/Default.xmlResources/Themes/Default/icon_magnifyingglass.gifwidget.xmlyahoo_widget.js