5/6/2010 4:49:28 AM
Title:
Flex - Popuup Window size
Hi All I am using title window and to set the width and size I am using it in init() function It is working fine But in the laptop which I bought recently with windows 7 and system resolution 1280*768 . The following code is not adjusting the height . Could some body please shed some light on this .
width = Capabilities.screenResolutionX-200;
height = Capabilities.screenResolutionY-200;
Thanks and Regards
Kiran
5/6/2010 5:06:00 AM
I tested with following code and it works absolutely fine. My Laptop is Windows7 resolution 1280*768 , Browser Firefox and IE.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="1024" minHeight="768" applicationComplete="init()">
<mx:Script>
<![CDATA[
private function init():void{
tWin.width = Capabilities.screenResolutionX-200;
tWin.height = Capabilities.screenResolutionY-200;
}
]]>
</mx:Script>
<mx:TitleWindow id="tWin" x="98" y="53" width="250" height="200" layout="absolute">
</mx:TitleWindow>
</mx:Application>
5/6/2010 6:12:57 AM
Thanks for your response Kevin
what I did was My title windows is a component ( just small component with data grid) and I am setting the size in Title window . Here is my code . Do you see any problem with the below code ?
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
initialize="init()" close="closeUserDisplay()"
>
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
private function closeUserDisplay():void{
PopUpManager.removePopUp(this);
}
private function init():void{
width = Capabilities.screenResolutionX-200;
height = Capabilities.screenResolutionY-200;
}
]]>
</mx:Script>
<mx:DataGrid id="userDetails" x="10" y="10" width="98%" height="97%">
<mx:columns>
<mx:DataGridColumn dataField="name1"/>
<mx:DataGridColumn dataField="name2"/>
<mx:DataGridColumn dataField="name3"/>
<mx:DataGridColumn dataField="name4"/>
<mx:DataGridColumn dataField="name5"/>
<mx:DataGridColumn dataField="name6"/>
<mx:DataGridColumn dataField="name7"/>
<mx:DataGridColumn dataField="name8"/>
<mx:DataGridColumn dataField="name9"/>
</mx:columns>
</mx:DataGrid>
</mx:TitleWindow>
5/6/2010 7:09:01 AM
there is no problem in your code , I checked it with both browsers . Actually it looks like its not working because of less vertical area availabel due to tabs on the browser.It lokked better in IE but was cutting from bottom in firefox. You can instead use 220 for y or more to see the effect.
height = Capabilities.screenResolutionY-220;