ContextWindow
Looking for an easy way to add window controls as a context menu to your AIR windows? Try my new ContextWindow class.

So this is not rocket science by any means, it is just a class that extends mx.core.Window and creates a NativeMenu within the constructor and assigns it to the contextMenu property.
This example creates an instance of a ContextWindow:
- private function createContextWindow():void{
- var w:ContextWindow = new ContextWindow();
- w.width=300;
- w.height=200;
- w.open();
- }
The code below shows how to subclass ContextWindow as an MXML object:
- <?xml version="1.0" encoding="utf-8"?>
- <ContextWindow xmlns="com.everythingflex.air.components.*"
- layout="absolute"
- xmlns:mx="http://www.adobe.com/2006/mxml"
- width="300" height="150">
- <mx:Label text="This is a ContextWindow"
- horizontalCenter="0" verticalCenter="0" />
- </ContextWindow>
Here is the full sample code for this demonstration of the AlertWindow component.
- <?xml version="1.0" encoding="utf-8"?>
- <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
- layout="absolute">
- <mx:Script>
- <![CDATA[
- import com.everythingflex.air.components.ContextWindow;
- private function createContextWindow():void{
- var w:ContextWindow = new ContextWindow();
- w.width=300;
- w.height=200;
- w.open();
- }
- private function openContextWindow():void{
- var w:Win1 = new Win1();
- w.open();
- }
- ]]>
- </mx:Script>
- <mx:Button click="createContextWindow()"
- label="Create ContextWindow" x="150.5"
- y="147" width="225"/>
- <mx:Button click="openContextWindow()"
- label="Open ContextWindow Component"
- x="150.5" y="177" width="225"/>
- </mx:WindowedApplication>



