rendered paste body<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.events.ListEvent;
import mx.effects.Dissolve;
[Bindable]
private var patients:ArrayCollection = new ArrayCollection([
{OR:"X", Time:"10:34 AM", Patient:"Anthony", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"},
{OR:"X", Time:"10:34 AM", Patient:"John", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"},
{OR:"X", Time:"10:34 AM", Patient:"Larry", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"},
{OR:"X", Time:"10:34 AM", Patient:"Moe", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"},
{OR:"X", Time:"10:34 AM", Patient:"Bob", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"},
{OR:"X", Time:"10:34 AM", Patient:"Mary", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"},
{OR:"X", Time:"10:34 AM", Patient:"Katie", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"},
{OR:"X", Time:"10:34 AM", Patient:"Fonze", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"},
{OR:"X", Time:"10:34 AM", Patient:"Frank", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"},
{OR:"X", Time:"10:34 AM", Patient:"Susan", PTRM:"1024", Surgeon:"Bob", Attending:"John", ANESType:"??"}
]);
private var ticker:Timer;
private var currentTime:Date;
public function setup():void {
ticker = new Timer(1000);
ticker.addEventListener(TimerEvent.TIMER, onTick);
ticker.start();
}
public function onTick(event:TimerEvent):void
{
currentTime = new Date();
var seconds:uint = currentTime.getSeconds();
var minutes:uint = currentTime.getMinutes();
var hours:uint = currentTime.getHours();
this.clock.headerText = "Time: " + timeFormatter.format(currentTime);
this.date.headerText = dateFormatter.format(currentTime);
}
private function rowClick(event:ListEvent):void
{
//Alert.show("I believe you wanted information about " + patients[event.rowIndex.toString()].Patient);
this.currentState = 'mode2';
this.mode1cont.visible = false;
this.mode2cont.visible = true;
}
private function mainPage(event:MouseEvent):void
{
this.mode1cont.visible = true;
this.mode2cont.visible = false;
}
]]>
</mx:Script>
<mx:states>
<mx:State name="mode2">
</mx:State>
</mx:states>
<mx:transitions>
<mx:Transition toState="mode2">
<mx:Parallel target="{mode1cont}">
<mx:Dissolve duration="1000" alphaFrom="1" alphaTo="0" />
</mx:Parallel>
</mx:Transition>
</mx:transitions>
<mx:DateFormatter id="dateFormatter" formatString="EEEE, MMM. D, YYYY"/>
<mx:DateFormatter id="timeFormatter" formatString="H:NN:SS A"/>
<mx:Panel title="Operating Room Schedule" id="mode1cont" height="100%" width="100%" paddingTop="5" paddingBottom="5" paddingLeft="5" paddingRight="5" layout="absolute">
<mx:AdvancedDataGrid width="100%" height="100%" id="mode1" dataProvider="{patients}" fontSize="15" initialize="setup()" selectionMode="singleRow" itemClick="rowClick(event)">
<mx:groupedColumns>
<mx:AdvancedDataGridColumnGroup id="hospname" fontSize="20" headerText="Lawrence Memorial Hospital">
<mx:AdvancedDataGridColumn width="15" resizable="false" sortable="false" dataField="OR"/>
<mx:AdvancedDataGridColumn width="35" resizable="false" sortable="false" dataField="Time"/>
<mx:AdvancedDataGridColumn width="75" resizable="false" sortable="false" dataField="Patient"/>
<mx:AdvancedDataGridColumn width="30" resizable="false" sortable="false" dataField="PTRM" headerText="PT. RM."/>
</mx:AdvancedDataGridColumnGroup>
<mx:AdvancedDataGridColumnGroup id="clock" fontSize="20">
<mx:AdvancedDataGridColumn width="50" resizable="false" sortable="false" dataField="Surgeon"/>
<mx:AdvancedDataGridColumn width="50" resizable="false" sortable="false" dataField="Attending"/>
<mx:AdvancedDataGridColumn width="50" resizable="false" sortable="false" dataField="ANESType" headerText="ANES Type"/>
</mx:AdvancedDataGridColumnGroup>
<mx:AdvancedDataGridColumnGroup id="date" fontSize="20">
<mx:AdvancedDataGridColumn width="50" resizable="false" sortable="false" dataField="Procedure"/>
<mx:AdvancedDataGridColumn width="50" resizable="false" sortable="false" dataField="Remarks"/>
<mx:AdvancedDataGridColumn width="50" resizable="false" sortable="false" dataField="Anesthetist"/>
<mx:AdvancedDataGridColumn width="50" resizable="false" sortable="false" dataField="R.N."/>
<mx:AdvancedDataGridColumn width="50" resizable="false" sortable="false" dataField="Scrub"/>
<mx:AdvancedDataGridColumn width="50" resizable="false" sortable="false" dataField="Circ."/>
</mx:AdvancedDataGridColumnGroup>
</mx:groupedColumns>
</mx:AdvancedDataGrid>
</mx:Panel>
<mx:Panel title="Patient Breakdown" id="mode2cont" height="100%" width="100%" paddingTop="5" paddingBottom="5" paddingLeft="5" paddingRight="5" layout="absolute" visible="false">
<mx:Label text="Dr. Arvan Agah" x="100" y="5"/>
<mx:Image source="agah_color.jpg" width="77" height="101" x="5" y="5"/>
<mx:Label text="Go Back" mouseDown="mainPage(event)" y="200" x="5" />
</mx:Panel>
</mx:Application>