HView

Description

HView is the foundation class for all views. HView is useful for any type of view and control grouping. It is designed for easy extension and it's the foundation for HControl and all other controls.

The major differences between HView and HControl is that HView handles only visual representation and structurization. In addition to HView's features, HControl handles labels, values, events, states and such. However, HControl is more complex, so use HView instead whenever you don't need the additional features of HControl. HView implements the HMarkupView interface for template-related task.

Usage

var myAppInstance = HApplication.nu();
var rect1 = [10, 10, 100, 100];
var myViewInstance = HView.nu( rect1, myAppInstance );
var myViewInstance.setStyle('background-color','#ffcc00');
var rect2 = [10, 10, 70, 70];
var mySubView1 = HView.nu( rect2, myViewIntance );
var rect3 [20, 20, 50, 50];
var mySubView2 = HView.nu( rect3, mySubView1 );

Inherits from:

Implements:

Extended by:

Constructor Method

The constructor is invoked, when a new instance of HView is created.

To create a new instance use HView.nu( rect, parent, options ) or new HView( rect, parent, options ).

constructor( rect, parent, options )

Description

Constructs the logic part of a HView. The view still needs to be drawn on screen. To do that, call draw after subcomponents of the view are initialized.

Parameters

rect An instance of HRect, defines the position and size of views. It can be also defined with an array, see below.
parent The parent instance this instance will be contained within. A valid parent can be another HView compatible instance, an HApplication instance, a HControl or a similar extended HView instance. The origin of the rect is the same as the parent's offset. For HApplication instances, the web browser's window's left top corner is the origin.

The rect dimensions as arrays

Instead of an instance of HRect, dimensions can also be supplied as arrays. The array length must be either 4 or 6. If the length is 4, the dimensions are specified as follows: [ x, y, width, height ]. Note that this is different from the construction parameters of HRect that takes the coordinates as two points, like: ( left, top, right, bottom ). Arrays with 6 items are a bit more complex (and powerful) as they can specify the flexible offsets too.

The array indexes for a rect configured as an 4-item array:

Always left/top aligned, all items must be specified.
Index Description
0 The X-coordinate (measured from the parent's left edge)
1 The Y-coordinate (measured from the parent's top edge)
2 The width.
3 The height.

The array indexes a rect configured as an 6-item array:

Can be any configuration of left/top/right/bottom alignment and supports flexible widths. At least 4 items must be specified.
Index Description
0 The left-aligned X-coordinate or null if the view is right-aligned and using a right-aligned X-coordinate at index 4 as well as the width specified at index 2.
1 The top-aligned Y-coordinate or null if the view is bottom-aligned and using a right-aligned X-coordinate at index 5 as well as the height specified at index 3.
2 The width, if only one X-coordinate specifies the position (at indexes 0 or 4). If both X-coordinates (at indexes 0 and 4) are specified, the width can be specified with a null for automatic (flexible) width. If the width is specified, it's used as the minimum width.
3 The height, if only one Y-coordinate specifies the position (at indexes 1 or 5). If both Y-coordinates (at indexes 1 and 5) are specified, the height can be specified with a null for automatic (flexible) height. if the height is specified, it's used as the minimum height.
4 The right-aligned X-coordinate or null if the view is left-aligned and using a left-aligned X-coordinate at index 0 as well as the width specified at index 2.
5 The bottom-aligned Y-coordinate or null if the view is top-aligned and using a top-aligned X-coordinate at index 1 as well as the height specified at index 3.

Usage examples of rect:

Specified as two instances of HPoint, x: 23, y: 75, width: 200, height: 100:
HRect.nu( HPoint.nu( 23, 75 ), HPoint.nu( 223, 175 ) )
The same as above, but without HPoint instances:
HRect.nu( 23, 75, 223, 175 )
The same as above, but with an array as the constructor parameter for HRect:
HRect.nu( [ 23, 75, 223, 175 ] )
The same as above, but with an array instead of a HRect instance:
[ 23, 75, 200, 100 ]
The same as above, but with a 6-item array:
[ 23, 75, 200, 100, null, null ]
The same as above, but aligned to the right instead of left:
[ null, 75, 200, 100, 23, null ]
The same as above, but aligned to the right/bottom edges:
[ null, null, 200, 100, 23, 75 ]
The same as above, but aligned to the left/bottom edges:
[ 23, null, 200, 100, null, 75 ]
Flexible width (based on the parent's dimensions):
[ 23, 75, null, 100, 23, null ]
Flexible height (based on the parent's dimensions):
[ 23, 75, 200, null, null, 75 ]
Flexible width and height (based on the parent's dimensions):
[ 23, 75, null, null, 23, 75 ]
Flexible width and height, but limited to a minimum width of 200 and a minimum height of 100 (based on the parent's dimensions):
[ 23, 75, 200, 100, 23, 75 ]

Class Methods

implement( interface )

Inherited from: HClass

Description

Copies the members of interface to a HClass or a class inherited from HClass.

Usage:

Defines an interface:
// Create an interface class that calculates the area
var AreaInterface = HClass.extend({
  constructor: null,
  area: function() {
    return this.getWidth() * this.getHeight();
  }
});

// Create a class that contains the coordinates of a rectangle. var Rectangle = HClass.extend({ constructor: function( x, y, width, height ) { this.x = x; this.y = y; this.width = width; this.height = height; }, getWidth: function() { return this.width; }, getHeight: function() { return this.height; } });

// Makes the Rectangle class implement the AreaInterface Rectangle.implement( AreaInterface );

nu( )

Inherited from: HClass

Class members:

Description

nu is a protected class method.

It does the same thing as the new keyword, but it is a class method.

Parameters:

Any parameters are passed on to the constructor method.

Usage:

Creates a class MyClass, then creates two instances of it: myClassInstance1 and myClassInstance2. The end result is the same.
var MyClass = HClass.extend({
  name: 'Foo',
  constructor: function( param1, param2 ){
    var logMsg = [ 'param1:', param1,
                   'param2:', param2,
                   'name:', this.name ];
    console.log( logMsg.join(' ') );
  }
});
// Construction using the new keyword:
var myClassInstance1 = new MyClass( 'one', 'two' );
// Construction using the nu method:
var myClassInstance2 = MyClass.nu( 'one', 'two' );
However, when extending in place, the benefits of the nu method become obvious.

// Extending in place with the new keyword:
var myExtendedClassInstance1 = new (
  MyClass.extend({
    name: 'Bar'
  })
)( 'one', 'two' );
// The same as above, but using the nu method:
var myExtendedClassInstance2 = MyClass.extend({
  name: 'Bar'
}).nu( 'one', 'two' );

extend( instance, static )

Inherited from: HClass

Description

The class method used to extend a class.

If the member name constructor is defined as null instead of a function block in the instance object block, the class is defined as a singleton (single instance class).

Parameters:

instance The object that defines the class instance members.
static The object that defines the static class members.

Returns:

Returns the extended class object.

Usage:

var Point = HClass.extend({
  constructor: function( x, y ) {
    this.x = x;
    this.y = y;
  }
});
var Rectangle = Point.extend({
  // Instance members:
  constructor: function( x, y, width, height ) {
    this.base( x, y );
    this.width = width;
    this.height = height;
  },
  getWidth: function() {
    return this.width;
  },
  getHeight: function() {
    return this.height;
  }
},

// Class Members { description: "this is a Rectangle", getClass: function() { return this; } });


Instance Methods

moveBy( )

Description

Alias method for offsetBy.

Returns

self (HView#)


buildParents( viewId )

Used by addView to build a parents array of parent classes.


bounds( )

Description

Returns bounds rectangle that defines the size and coordinate system of the component. This should be identical to the rectangle used in constructing the object, unless it has been changed after construction.

Returns

A new <HRect> instance with identical values to this component's rect.


destroyView( viewId )

Description

Call this if you need to remove a child view from this view, destroying its child elements recursively and removing all DOM elements too.

Parameters

viewId The parent-specific view id. Actually an array index.

Returns

self (HView#)


show( )

Description

Restores the visibility of the component's main DOM element (and its children).

Return

self (HView#)


setFlexLeft( flag, px )

Description

When the flag is true, the view will be aligned to the left (default). The px offset defines how many pixels from the parent's left edge the left edge of this view will be. If both setFlexLeft and setFlexRight are set, the width is flexible. Use the constructor or setRect instead of calling this method directly.

Parameters

flag Boolean flag (true/false). Enables left-alignment when true.
px The amount of pixels to offset from the left edge of the parent's left edge.

Returns

self (HView#)


hide( )

Description

Hides the component's main DOM element (and its children).

Returns

self (HView#)


bringToFrontOf( view )

Description

Brings itself to the front of the given view by changing its Z-Index. Only works on sibling views.

Parameters

view The view to bring to the front of.

Returns

self (HView#)


unbindDomElement( elementId )

Description

Removes a DOM element from the ELEM cache. This is a wrapper for the ELEM#elem_del. This is used for safely removing DOM nodes from the cache.

Parameters

elementId The id of the element in the element manager's cache that is to be removed from the cache.


invalidatePositionCache( )

Description

Invalidates event manager's element position cache for this view and its subviews. Actual functionality is implemented in HControl.

Returns

self (HView#)


addView( view )

Description

Adds a sub-view/component to the view. Called from inside the HView#constructor and should be automatic for all components that accept the 'parent' parameter, usually the second argument, after the HRect. May also be used to attach a freely floating component (removed with remove) to another component.

Parameter

view Usually this inside HView derivate components.

Returns

The view id.


pageLocation( )

Returns the HPoint that has the scrolled position calculated.


drawRect( )

Description

The drawRect method refreshes the dimensions of the view. It needs to be called to affect changes in the rect. It enables the drawn flag.

Returns

self (HView#)


styleOfPart( partName, name )

Description

Returns a style of a specified markup element that has been bound to this view.

Parameters

partName The identifier of the markup element.
name The style name

Returns

The style of a specified markup element.


firstDraw( )

Description

Called once, before the layout of the view is initially drawn. Doesn't do anything by itself, but provides an extension point.


stringSize( string, length, elemId, wrap, extraCss )

Description

Measures the characters encoded in length bytes of the string - or, if no length is specified, the entire string up to the null character, '0', which terminates it. The return value totals the width of all the characters in coordinate units; it's the length of the baseline required to draw the string.

Parameters

string The string to measure.
length Optional, How many characters to count.
elemId Optional, The element ID where the temporary string is created in.
wrap Optional boolean value, wrap whitespaces?
extraCss Optional, extra css to add.

Returns

The width in pixels required to draw a string in the font.


setFlexBottom( flag, px )

Description

When the flag is true, the view will be aligned to the bottom. The px offset defines how many pixels from the parent's bottom edge the bottom edge of this view will be. If both setFlexBottom and setFlexTop are set, the height is flexible. Use the constructor or setRect instead of calling this method directly.

Parameters

flag Boolean flag (true/false). Enables bottom-alignment when true.
px The amount of pixels to offset from the bottom edge of the parent's bottom edge.

Returns

self (HView#)


setStyle( name, value, cacheOverride )

Description

Sets any arbitary style of the main DOM element of the component. Utilizes Element Manager's drawing queue/cache to perform the action.

Parameters

name The style name (css syntax, eg. 'background-color')
value The style value (css syntax, eg. 'rgb(255,0,0)')
cacheOverride Cache override flag.

Returns

self (HView#)


setLabel( label )

Description

Sets the label on a control component: the text that's displayed in HControl extensions. Visual functionality is implemented in component theme templates and refreshLabel method extensions.

Avoid extending directly, extend refreshLabel instead.

Parameters

label The text the component should display.

Returns

self (HView#)


stringHeight( string, length, elemId, extraCss )

Returns the string height.


draw( )

Description

The higher level draw wrapper for drawRect, drawMarkup and drawSubviews. Finally calls refresh.

Returns

self (HView#)


bindDomElement( domElementId )

Description

Binds a DOM element to the ELEM cache. This is a wrapper for the ELEM#elem_bind that keeps track of the bound elements and frees them from the element manager when the view is destroyed.

Parameters

domElementId The value of the DOM element's id attribute that is to be bound to the element cache.

Returns

The element index id of the bound element.


parentSize( )

Gets the size of the parent. If the parent is the document body, uses the browser window size.


setFlexRight( flag, px )

Description

When the flag is true, the view will be aligned to the right. The px offset defines how many pixels from the parent's right edge the right edge of this view will be. If both setFlexRight and setFlexLeft are set, the width is flexible. Use the constructor or setRect instead of calling this method directly.

Parameters

flag Boolean flag (true/false). Enables right-alignment when true.
px The amount of pixels to offset from the right edge of the parent's right edge.

Returns

self (HView#)


drawMarkup( )


setMinHeight( minHeight )


stringWidth( string, length, elemId, extraCss )

Returns the string width


setAbsolute( flag )

Description

The flag enables or disables the absolute positioning mode. (It's enabled by default). If absolute positioning mode is off, the coordinate system has little or no effect.

Parameters

flag Boolean flag (true/false). Enables absolute positioning when true. Enables relative positioning when false.

Returns

self (HView#)


sendBackward( )

Description

Sends itself one step backward by changing its Z-Index.

Returns

self (HView#)


maxRect( )

Returns the maximum rect using the #parentSize.


style( name )

Description

Returns a style of the main DOM element of the component. Utilizes ELEM cache to perform the action.

Parameters

name The style name (css syntax, eg. 'background-color')

Returns

The style property value (css syntax, eg. 'rgb(255,0,0)')


getThemeGfxFile( fileName )

Description

Used by html theme templates to get the theme-specific full path of the fileName given.

Returns

The full path of the file.


sendToBackOf( view )

Description

Sends itself to the back of the given view by changing its Z-Index. Only works on sibling views.

Parameters

view The view to send to the back of.

Returns

self (HView#)


die( )

Description

Deletes the component and all its children. Should normally be called from the parent.


setStyles( styles )


refresh( )

Description

This method should be extended in order to redraw only specific parts. The base implementation calls optimizeWidth when optimizeWidthOnRefresh is set to true.

Returns

self (HView#)


toggle( )

Description

Toggles between hide and show.

Returns

self (HView#)


onIdle( )

Recursive idle poller. Should be extended if functionality is desired.


refreshLabel( )

Description

Called when the HView#label has been changed. By default tries to update the label element defined in the theme of the component. Of course, the HControl itself doesn't define a theme, so without a theme doesn't do anything.

Returns

self (HView#)


setHTML( html )

Description

Replaces the contents of the view's DOM element with custom html.

Parameters

html The HTML (string-formatted) to replace the content with.

Returns

self (HView#)


drawSubviews( )

Description

Called once, when the layout of the view is initially drawn. Doesn't do anything by itself, but provides an extension point for making subviews.


escapeHTML( html )

Description

Method to escape HTML from text.

Converts < to < and > to > and&to &

Parameters

html The html to escape.

Returns

A string with the html escaped.


setRect( rect )

Description

Replaces the rect of the component with a new HRect instance and then refreshes the display.

Parameters

rect The new HRect instance to replace the old rect instance with.
rect Array format, see HView#constructor for further details.

Returns

self (HView#)


offsetTo( )

Descripion

This method moves the view to a new coordinate. It adjusts the left and top components of the frame rectangle accordingly. Since a View's frame rectangle must be aligned on screen pixels, only integral values should be passed to this method. Values with fractional components will be rounded to the nearest whole integer. If the View is attached to a window, this method causes its parent view to be updated, so the View is immediately displayed in its new size. If it doesn't have a parent or isn't attached to a window, this method merely alter its frame and bounds rectangle.

Parameters

x The new x-coordinate of the view.
y The new y-coordinate of the view.

point The new coordinate point of the view.

Returns

self (HView#)


resizeTo( width, height )

Description

This method makes the view width units wide and height units high. This method adjust the right and bottom components of the frame rectangle accordingly. Since a View's frame rectangle must be aligned on screen pixels, only integral values should be passed to this method. Values with fractional components will be rounded to the nearest whole integer. If the View is attached to a window, this method causes its parent view to be updated, so the View is immediately displayed in its new size. If it doesn't have a parent or isn't attached to a window, this method merely alter its frame and bounds rectangle.

Parameters

width The new width of the view.
height The new height of the view.

Returns

self (HView#)


offsetBy( horizontal, vertical )

Description

This method re-positions the view without changing its size. It adds horizontal coordinate units to the x coordinate and vertical units to the y coordinate of the view. Since a View's frame rectangle must be aligned on screen pixels, only integral values should be passed to this method. Values with fractional components will be rounded to the nearest whole integer. If the View is attached to a window, this method causes its parent view to be updated, so the View is immediately displayed in its new size. If it doesn't have a parent or isn't attached to a window, this method merely alter its frame and bounds rectangle.

Parameters

horizonal Horizonal units to change the x coordinate (negative units subtract)
vertical Vertical units to add to change the y coordinate (negative units subtract)

Returns

self (HView#)


resizeBy( horizontal, vertical )

Description

This method resizes the view, without moving its left and top sides. It adds horizontal coordinate units to the width and vertical units to the height of the view. Since a View's frame rectangle must be aligned on screen pixels, only integral values should be passed to this method. Values with fractional components will be rounded to the nearest whole integer. If the View is attached to a window, this method causes its parent view to be updated, so the View is immediately displayed in its new size. If it doesn't have a parent or isn't attached to a window, this method merely alter its frame and bounds rectangle.

Parameters

horizonal Horizonal units to add to the width (negative units subtract)
vertical Vertical units to add to the height (negative units subtract)

Returns

self (HView#)


pageX( )

Returns the X coordinate that has the scrolled position calculated.


bringForward( )

Description

Brings itself one step forward by changing its Z-Index.

Returns

self (HView#)


setRelative( flag )

Description

The flag enables or disables the relative positioning mode. (It's disabled by default). If relative positioning mode is on, the coordinate system has little or no effect.

Parameters

flag Boolean flag (true/false). Enables absolute relative when true. Enables absolute positioning when false.

Returns

self (HView#)


setMinWidth( minWidth )


sendToBack( )

Description

Sends the view to the back by changing its Z-Index.

Returns

self (HView#)


pageY( )

Returns the Y coordinate that has the scrolled position calculated.


zIndex( )

Description

Use this method to get the Z-Index of itself.

Returns

The current Z-Index value.


getThemeGfxPath( )

Description

Used by html theme templates to get the theme-specific full image path.

Returns

The full path of the theme-specific gfx path as a string.


remove( )

Description

Call this if you need to remove a component from its parent's views array without destroying the DOM element itself, making it in effect a view without parent. Useful, for example, for moving a view from one parent component to another.

Returns

self (HView#)


removeView( viewId )

Description

Call this if you need to remove a child view from this view without destroying its element, making it in effect a view without parent. Useful, for example, for moving a view from one parent component to another.

Parameters

viewId The parent-specific view id. Actually an array index.

Returns

self (HView#)


setMarkupOfPart( partName, value )

Description

Sets a style of a specified markup element that has been bound to this view.

Parameters

partName The identifier of the markup element.
value Value for markup element.

Returns

self (HView#)


markupOfPart( partName )

Description

Returns a style of a specified markup element that has been bound to this view.

Parameters

partName The identifier of the markup element.

Returns

The style of a specified markup element.


setText( text )

Description

Wrapper for setHTML, sets escaped html, if tags and such are present.

Parameters

text The text to set. If it contains any html, it's escaped.

Returns

self (HView#)


moveTo( )

Description

Alias method for offsetTo.

Returns

self (HView#)


setStyleOfPart( partName, name, value, cacheOverride )

Description

Sets a style for a specified markup element that has been bound to this view.

Parameters

partName The identifier of the markup element.
name The style name
value The style value

Returns

self (HView#)


bringToFront( )

Description

Brings the view to the front by changing its Z-Index.

Returns

self (HView#)


setFlexTop( flag, px )

Description

When the flag is true, the view will be aligned to the top (default). The px offset defines how many pixels from the parent's top edge the top edge of this view will be. If both setFlexTop and setFlexBottom are set, the height is flexible. Use the constructor or setRect instead of calling this method directly.

Parameters

flag Boolean flag (true/false). Enables top-alignment when true.
px The amount of pixels to offset from the top edge of the parent's top edge.

Returns

self (HView#)


optimizeWidth( )

Description

An abstract method that derived classes may implement, if they are able to resize themselves so that their content fits nicely inside. Similar to pack, might be renamed when components are written to be savvy of this feature.


onAnimationCancel( )

Inherited from: HMorphAnimation

Extend this method if functionality is desired upon cancellation of animation.


stopAnimation( target )

Inherited from: HMorphAnimation

Description

Stops the current animation for this view. If the view is not being animated, this method has no effect. The onAnimationEnd event on the view gets called when the animation finishes (reaches the end position/size), but onAnimationCancel gets called when this method is called while the animation is still in action.

onAnimationStart( )

Inherited from: HMorphAnimation

Description

Extend the onAnimationStart method, if you want to do something special when this view starts animating.

Usage:

HView.extend({
   onAnimationStart: function() {
     this.setStyle('background-color','green')
   }, 
   onAnimationEnd: function() {
     this.setStyle('background-color','grey')}
   }).nu(
     [0,0,300,300],
     HApplication.nu()
   ).setStyle(
     'background-color','blue'
   ).animateTo(
     HRect.nu(
       300,300,700,700
     )
   );

animateTo( obj, duration, fps )

Inherited from: HMorphAnimation

Description

Moves the view smoothly into another location and/or size. The onAnimationStart event on the view gets called when the animation starts.

Parameters:

obj An instance of <HPoint> or <HRect>, depending on the desired animation result. When a point is passed, the view is moved in that position. When a rect is passed, the view can also be resized with or without moving to different coordinates.

duration optional_ The duration of the animation in milliseconds. The default duration is 500 ms.

fps optional_ The frame rate for the animation. The default fps is 50.

Returns:

self (HView#)
HView.extend({
  onAnimationEnd: function(){
    this.die();
  }
}).nu(
  [ 0, 0, 300, 300 ],
  HApplication.nu()
).setStyle(
  'background-color', 'red'
).animateTo(
  HRect.nu( 300, 300, 500, 500 )
);


onAnimationEnd( )

Inherited from: HMorphAnimation

Extend the onAnimationEnd method, if you want to do something special when an animation on this view is finished.


evalMarkupVariable( strToEval, isAssignment )

Inherited from: HMarkupView

Description

Evaluates a string and throws an error into console.log if the string doesn't pass evaluation. If isAssignment flag is set to true returns empty string. if isAssignment is set to false will return string if it passes evaluation.

Parameters

strToEval A String to evaluate.

isAssignment Flag to indicate return the String upon passed evaluation(false) or return of an empty String(true).

Returns

String


toggleCSSClass( elementId, cssClass, setOn )

Inherited from: HMarkupView

Description

Sets or unsets the cssClass into a DOM element that goes by the ID elementId.

Parameters

elementId ID of the DOM element, or the element itself, to be modified.
cssClass Name of the CSS class to be added or removed.
setOn Boolean value that tells should the CSS class be added or removed.

Returns

self (HView#)


bindMarkupVariables( )

Inherited from: HMarkupView

Description

Evaluates the pieces of code defined in the markup template marked with syntax #{}. Can't use } characters in the code though.

Places the resulting markup in the instance variable.


base( )

Inherited from: HClass

This method can be called from any other method to invoke that method's parent


valueOf( )

Inherited from: HClass

Protected instance method, returns the value of an instance.


toString( )

Inherited from: HClass

Protected instance method, returns the instance represented as a String.



Other Instance Members

label = null

The visual value of a component, usually a String. See #setLabel.


isHidden = false

The isHidden flog reflects the visibility of the view.


isAbsolute = true

True, if the component using absolute positioning. False, if the component is using relative positioning.


refreshOnLabelChange = true

When true, calls the refreshLabel method whenever HView#label is changed.


flexBottomOffset = 0

The amount of pixels to offset from the bottom edge when flexBottom is true.Defined with 6-item arrays for the rect parameter of setRect or the constructor. Can be set directly using the setFlexBottom method.


drawn = false

The drawn flag is false before the component is visually drawn, it's true after it's drawn.


parent = null

The parent is the parent supplied to the constructor. This is a complete object reference to the parent's namespace.


app = null

The app is the reference of the app process acting as the root controller of the view tree of which this view is a member. This is a complete object reference to the app's namespace.


viewDefaults = HViewDefaults

The viewDefaults is a HViewDefaults object that is extended in the constructor with the options block given. The format of it is an Object. It's only used when not extended via HControl, see HControl#controlDefaults.


theme = null

The theme the component is constructed with. By default, uses the HThemeManager.currentTheme specified at the time of construction.


parents = null

The parents is an array containing parent instances up to the root controller level. The root controller is almost always an instance of HApplication.


viewId = null

The viewId is the unique ID (serial number) of this view. This means the view can be looked up globally based on its id by using the HSystem.views array.


minHeight = 0


flexLeft = true

True, if the coordinates are left-aligned. False, if the coordinates are right-aligned. Uses the X-coordinate of rect, if true. Disabled using 6-item arrays with null x-coordinate for the rect parameter of setRect or the constructor. Can be set directly using the setFlexLeft method.


flexRightOffset = 0

The amount of pixels to offset from the right edge when flexRight is true. Defined with 6-item arrays for the rect parameter of setRect or the constructor. Can be set directly using the setFlexRight method.


themePath = null

Component specific theme path.


displayMode = 'block'

The display mode to use. Defaults to 'block'. The other sane alternative is 'inline'.


views = null

The views array contains a list of subviews of this view by id. To access the object reference, use the HSystem.views array with the id.


viewsZOrder = null

The viewsZOrder array contains a list of subviews ordered by zIndex. To change the order, use the bringToFront, sendToBack, bringForwards, sendBackwards, bringToFrontOf and sentToBackOf methods.


flexRight = false

True, if the coordinates are right-aligned. False, if the coordinates are left-aligned. Uses flexRightOffset if true. Defined with 6-item arrays for the rect parameter of setRect or the constructor. Can be set directly using the setFlexRight method.


preserveTheme = false

The preserveTheme flag prevents the view from being redrawn if HThemeManager.currentTheme is changed after the view has been drawn. Is true, if theme has been set.


flexTop = true

True, if the coordinates are top-aligned. False, if the coordinates are bottom-aligned. Uses the Y-coordinate of rect, if true. Disabled using 6-item arrays with null x-coordinate for the rect parameter of setRect or the constructor. Can be set directly using the setFlexTop method.


flexBottom = false

True, if the coordinates are bottom-aligned. False, if the coordinates are top-aligned. Uses flexBottomOffset if true. Defined with 6-item arrays for the rect parameter of setRect or the constructor. Can be set directly using the setFlexRight method.


appId = null

The appId is the unique ID (serial number) of the app process acting as the root controller of the view tree of which this view is a member. This means the app can be looked up globally based on this id by using the HSystem.apps array.


rect = null

The HRect instance bound to self (HView#) using the constructor or setRect.


minWidth = 0


escapeLabelHTML = false

Escapes HTML in the label when true.


optimizeWidthOnRefresh = true

The optimizeWidthOnRefresh flag, when enabled, allows automatic width calculation for components that support that feature.


options = null

An reference to the options block given as the constructor parameter options.


markupElemNames = ['bg', 'label', 'state', 'control', 'value', 'subview']

Description

Replaces the contents of the view's DOM element with html from the theme specific html file.

Returns

self (HView#)


prototype = { }

Inherited from: Object

Description

The prototype member of Object defines the instance members. These are copied to the instance object when the new keyword is called.