Sha256: 2b76f99719ae188a1cd9c0b30bd956c01288b8d2809eda913b26066e325e6826

Contents?: true

Size: 1.52 KB

Versions: 76

Compression:

Stored size: 1.52 KB

Contents

/*   RSence
 *   Copyright 2009 Riassence Inc.
 *   http://riassence.com/
 *
 *   You should have received a copy of the GNU General Public License along
 *   with this software package. If not, contact licensing@riassence.com
 */

/*** = Description
  ** HAlertSheet is a simple alert notification control.
  ***/

var//RSence.Controls
HAlertSheet = HSheet.extend({

/** = Description
  * Refreshes the label of text if this['alertText'] is set.
  *
  **/
  refreshLabel: function(){
    this.base();
    if(this['alertText']){
      this.alertText.setValue( this.label );
    }
  },
  
/** = Description
  * Draws the warning text (this.label) as a HStringView and a warning image 
  * and an alert button.
  **/
  drawSubviews: function(){
    this.icon = HImageView.nu(
      [ 16, 16, 48, 48 ],
      this, {
        value: this.getThemeGfxFile('sheet_warning.png')
      }
    );
    this.alertText = HStringView.nu(
      [ 80, 16, null, null, 8, 48 ],
      this, {
        value: this.label
      }
    );
    this.alertButtons();
  },

/** = Description
  * Draws an alert button.
  *
  **/
  alertButtons: function(){
    this.okButton = HClickButton.nu(
      [ null, null, 60, 23, 8, 8 ],
      this, {
        label: 'OK',
        valueObj: this.valueObj,
        events: {
          click: true
        }
      }
    );
  },

/** = Description
  * Binds the same value to okButton.
  *
  **/  
  setValueObj: function( valueObj ){
    this.base( valueObj );
    if ( this['okButton'] ) {
      valueObj.bind( this.okButton ); 
    }
  }
  
});

Version data entries

76 entries across 76 versions & 2 rubygems

Version Path
rsence-pre-2.2.0.21 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-pre-2.2.0.20 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-pre-2.2.0.19 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-pre-2.2.0.18 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-pre-2.2.0.17 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-pre-2.2.0.16 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-pre-2.2.0.15 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-pre-2.2.0.14 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-pre-2.2.0.13 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-pre-2.2.0.12 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-pre-2.2.0.11 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-pre-2.2.0.10 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-pre-2.2.0.9 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-pre-2.2.0.8 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-pre-2.2.0.7 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-pre-2.2.0.5 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-pre-2.2.0.4 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-2.1.11 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-pre-2.2.0.3 js/controls/dialogs/alert_sheet/alert_sheet.js
rsence-pre-2.2.0.2 js/controls/dialogs/alert_sheet/alert_sheet.js