uidesigner/com.nokia.sdt.series60.componentlibrary/components/transient/GlobalNote_layout.js
author timkelly
Thu, 23 Apr 2009 08:52:08 -0500
branchRCL_2_0
changeset 117 bac3606e1ea9
parent 2 d760517a8095
permissions -rw-r--r--
fix bug 8914. endless sdk refresh when devices.xml is empty or has xml format error
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("popupDialogLibrary.js")
cawthron
parents:
diff changeset
    20
cawthron
parents:
diff changeset
    21
function GlobalNoteLayout() {
cawthron
parents:
diff changeset
    22
}
cawthron
parents:
diff changeset
    23
cawthron
parents:
diff changeset
    24
GlobalNoteLayout.prototype.layout = function(instance, laf) {
cawthron
parents:
diff changeset
    25
	var properties = instance.properties;
cawthron
parents:
diff changeset
    26
	var flags = Font.ALIGN_LEFT;
cawthron
parents:
diff changeset
    27
	if (properties.textProcessing)
cawthron
parents:
diff changeset
    28
		flags |= Font.WRAPPING_ENABLED;
cawthron
parents:
diff changeset
    29
			
cawthron
parents:
diff changeset
    30
	var iconRect = getIconRect(0, laf);
cawthron
parents:
diff changeset
    31
	var rect = calculateBounds(properties, laf, flags, iconRect.x, 0);
cawthron
parents:
diff changeset
    32
cawthron
parents:
diff changeset
    33
	properties.location.x = rect.x;
cawthron
parents:
diff changeset
    34
	properties.location.y = rect.y;
cawthron
parents:
diff changeset
    35
	properties.size.width = rect.width;
cawthron
parents:
diff changeset
    36
	properties.size.height = rect.height;
cawthron
parents:
diff changeset
    37
}
cawthron
parents:
diff changeset
    38
cawthron
parents:
diff changeset
    39
GlobalNoteLayout.prototype.getPreferredSize = function(instance, laf, wHint, hHint) {
cawthron
parents:
diff changeset
    40
	return null;
cawthron
parents:
diff changeset
    41
}
cawthron
parents:
diff changeset
    42
cawthron
parents:
diff changeset
    43
GlobalNoteLayout.prototype.propertyChanged = function(instance, property) {
cawthron
parents:
diff changeset
    44
	if (property == "text" || property == "textProcessing") {
cawthron
parents:
diff changeset
    45
		instance.forceLayout();
cawthron
parents:
diff changeset
    46
	}
cawthron
parents:
diff changeset
    47
}