src/js/widgets.js
branchjsdoc
changeset 520 fe008e95a716
parent 287 5c7495102bd7
child 539 3ba5b82aebb6
equal deleted inserted replaced
519:46e21d060650 520:fe008e95a716
     1 /* the widget classes and definitions */
     1 /* the widget classes and definitions */
     2 
     2 
       
     3 /**
       
     4   * @class Widget is an "abstract" class. It's mostly used to define some properties common to every widget.
       
     5   *
       
     6   *  Note that widget constructors are never called directly by the user. Instead, the widgets are instantiated by functions
       
     7   *  defined in init.js
       
     8   *  
       
     9   * @constructor
       
    10   * @param Popcorn a reference to the popcorn Object
       
    11   * @param config configuration options for the widget
       
    12   * @param Serializer a serializer instance from which the widget reads data fromCharCode  
       
    13 */
     3 IriSP.Widget = function(Popcorn, config, Serializer) {
    14 IriSP.Widget = function(Popcorn, config, Serializer) {
     4 
    15 
     5   if (config === undefined || config === null) {
    16   if (config === undefined || config === null) {
     6     config = {}
    17     config = {}
     7   }
    18   }
    38      this.widthmax = config.widthmax;     
    49      this.widthmax = config.widthmax;     
    39   }
    50   }
    40   
    51   
    41 };
    52 };
    42 
    53 
       
    54 /**
       
    55   * This method responsible of drawing a widget on screen.
       
    56   */
    43 IriSP.Widget.prototype.draw = function() {
    57 IriSP.Widget.prototype.draw = function() {
    44   /* implemented by "sub-classes" */  
    58   /* implemented by "sub-classes" */  
    45 };
    59 };
    46 
    60 
       
    61 /**
       
    62   * Optional method if you want your widget to support redraws.
       
    63   */
    47 IriSP.Widget.prototype.redraw = function() {
    64 IriSP.Widget.prototype.redraw = function() {
    48   /* implemented by "sub-classes" */  
    65   /* implemented by "sub-classes" */  
    49 };
    66 };