source: EDIS/tags/ed/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/PatientCellRenderer.mxml@ 1240

Last change on this file since 1240 was 1240, checked in by George Lilly, 13 years ago

new version from the VA

File size: 2.0 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<mx:HBox
3 xmlns:mx="http://www.adobe.com/2006/mxml"
4 implements="mx.controls.listClasses.IListItemRenderer, mx.controls.listClasses.IDropInListItemRenderer"
5 horizontalScrollPolicy="off" verticalScrollPolicy="off">
6
7 <mx:Script>
8 <![CDATA[
9 import mx.controls.listClasses.BaseListData;
10 import gov.va.med.edp.model.TrackingModelLocator;
11
12 [Bindable]
13 private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
14
15 // Internal variable for the property value.
16 private var _listData: BaseListData;
17
18 [Bindable("dataChange")] // Make the listData property bindable.
19 public function get listData():BaseListData {return _listData;}
20 public function set listData(value:BaseListData):void {_listData = value;}
21
22 override public function set data(value:Object):void
23 {
24 super.data = value;
25 if (value != null)
26 {
27 setStyle("color", model.boardSpec.cellColor(_listData["dataField"], value).text);
28 if (model.appName == TrackingModelLocator.APP_NAME_BIGBOARD) {
29 nmLbl.setStyle("fontSize", model.boardSpec.displayBoardProperties.squishFontSize);
30 }
31 nmImg.visible = (value.@similar == "1");
32 nmLbl.text = (_listData["dataField"] == "@last4") ? value.@last4 : value.@ptNm;
33 }
34 }
35
36 override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
37 {
38 super.updateDisplayList(unscaledWidth, unscaledHeight);
39
40 if (data != null) {
41 var backColor: uint = model.boardSpec.cellColor(_listData["dataField"], data).back;
42 var g:Graphics = graphics;
43 g.clear();
44 g.beginFill(backColor);
45 //g.drawRect(0, -2, unscaledWidth, unscaledHeight+4);
46 g.drawRect(0, 0, unscaledWidth, unscaledHeight);
47 g.endFill();
48 }
49 }
50
51 ]]>
52 </mx:Script>
53 <mx:Image
54 id="nmImg"
55 left="2" top="0"
56 source="@Embed(source='kuser.png')"
57 toolTip="{nmLbl.text + ' is similar to another patient name.'}" />
58 <mx:Label
59 id="nmLbl"
60 left="18" verticalCenter="0"/>
61</mx:HBox>
Note: See TracBrowser for help on using the repository browser.