uidesigner/com.nokia.sdt.series60.componentlibrary/components/transient/GlobalNote_visual.js
changeset 2 d760517a8095
equal deleted inserted replaced
-1:000000000000 2:d760517a8095
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 include("../renderLibrary.js")
       
    20 include("../messageLibrary.js")
       
    21 include("popupDialogLibrary.js")
       
    22 
       
    23 function GlobalNoteVisual() {
       
    24 }
       
    25 
       
    26 GlobalNoteVisual.prototype.draw = function(instance, laf, graphics) {
       
    27 
       
    28 	var flags = 0;
       
    29 	var properties = instance.properties;
       
    30 	if (properties.textProcessing) {
       
    31 		flags |= Font.WRAPPING_ENABLED;
       
    32 	}
       
    33 	flags |= Font.ALIGN_LEFT;
       
    34 
       
    35 	var bounds = new Rectangle(0, 0, instance.properties.size.width, instance.properties.size.height);
       
    36 	drawPopupDialog(instance, laf, graphics, flags, bounds, getIconRect(0, laf), 0);
       
    37 }
       
    38 
       
    39 GlobalNoteVisual.prototype.getPreferredSize = function(instance, laf, wHint, hHint) {
       
    40 	return null;
       
    41 }
       
    42 
       
    43 
       
    44 // IDirectLabelEdit
       
    45 GlobalNoteVisual.prototype.getPropertyPaths = function(instance) {
       
    46 	return new Array("text");
       
    47 }
       
    48 
       
    49 GlobalNoteVisual.prototype.getLabelBounds = function(instance, propertyPath, laf) {
       
    50 	var properties = instance.properties;
       
    51 	var iconRect = getIconRect(0, laf);
       
    52 
       
    53 	return new Rectangle(0, 0, iconRect.x, properties.size.height);
       
    54 }
       
    55 
       
    56 GlobalNoteVisual.prototype.getLabelFont = function(instance, propertyPath, laf) {
       
    57 	return laf.getFont("message.font");
       
    58 }
       
    59