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