Set minWidth and minHeight to a small number
On 1/17/12 6:28 AM, "Isabelle Loyer Perso" <isa_lo...@yahoo.fr> wrote: As I made a mistake in last message, I resend it. Hi, I have a window witch is resizing on creationcomplete phase according user preference. This part woks well. But inside this window a s:Group (maincontainer2) exists and even if width and height is in percent, the s:Group size is bigger that the new window measure. I try to solve that with percentheigt and percentwidth but no result. If somebody know how to solve that, I'll happy to read. Thanks a lot ************************************************************ <?xml version="1.0" encoding="utf-8"?> <windowSkin:wCustomWindow xmlns:fx="http://ns.adobe.com/mxml/2009" <http://ns.adobe.com/mxml/2009> xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" skinClass="fr.interis.ui.windowSkin.CustomWindowSkin" resizable="true" creationComplete="wcustomwindow1_creationCompleteHandler(event)" preinitialize="wContactPat_loadServices(event)" xmlns:windowSkin="fr.interis.ui.windowSkin.*" minWidth="400" minHeight="300" xmlns:customNavTab="fr.interis.component.customNavTab.*" xmlns:componentGlob="fr.interis.ui.componentGlob.*"> <fx:Declarations> <!-- Placer ici les éléments non visuels (services et objets de valeur, par exemple). --> <s:HTTPService id = "phpContactPat" fault = "serviceFault(event)" method="POST" resultFormat="e4x" result = "resultContactPat(event)"/> </fx:Declarations> <fx:Script> <![CDATA[ import fr.interis.config.urlManager; import fr.interis.ui.componentGlob.IconManager; import fr.interis.util.DateUtility; import fr.interis.util.FileSerializer; import fr.interis.util.UserPrefs; import fr.interis.util.windowPlace; import fr.kapit.flex.ui.spark.loginBox.RetrievePasswordSkin; import mx.collections.XMLListCollection; import mx.controls.Button; import mx.events.FlexEvent; import mx.events.ItemClickEvent; import mx.events.ResizeEvent; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; import spark.events.GridSelectionEvent; private var pg:UserPrefs; private function closeMyWindow():void { stage.nativeWindow.dispatchEvent(new Event("myEventClose", true)); stage.nativeWindow.close(); } private function onMyEventClose(e:Event):void { pg = new UserPrefs(); this.pg.appPosX = stage.nativeWindow.x; this.pg.appPosY = stage.nativeWindow.y; this.pg.appWidth = stage.nativeWindow.width; this.pg.appHeight = stage.nativeWindow.height; FileSerializer.writeObjectToFile(this.pg, "prefcontactPat.up"); } private function serviceFault(event:FaultEvent):void { trace("Erreur "+ event.fault.message); } protected function wcustomwindow1_creationCompleteHandler(event:FlexEvent):void { stage.nativeWindow.addEventListener("myEventClose",onMyEventClose); var pos:windowPlace = new windowPlace("prefcontactPat.up"); stage.nativeWindow.x = pos.windowX; stage.nativeWindow.y = pos.windowY; stage.nativeWindow.height = pos.windowH; stage.nativeWindow.width = pos.windowW; } ]]> </fx:Script> <s:VGroup paddingLeft="7" paddingRight="7" id="mainContainer" left="7" right="7" top="40" bottom="4"> <s:HGroup width="100%" height="53" id="titleWin"> <s:Image x="0" y="0" width="53" height="53" /> <s:VGroup width="40%"> <s:HGroup width="100%" height="50%"> <!-- Nom prenom--> <s:Label text="{_patientNomPrenom}" id="lNomPrenom" fontWeight="bold"/> </s:HGroup> <s:HGroup width="100%" height="50%"> <!-- Naissance--> <s:Label text="{_patientNaissance}" id="lNaissance" /> </s:HGroup> </s:VGroup> <s:VGroup width="40%"> <!-- Modif--> <s:Label id="ldhCrea" textAlign="left" styleName="dataCreaModif"/> <s:Label id="ldhModif" textAlign="left" styleName="dataCreaModif"/> </s:VGroup> </s:HGroup> <s:Group id="mainContainer2" width="100%"> <s:layout> <s:VerticalLayout paddingLeft="10" paddingRight="10" paddingTop="5" paddingBottom="15"/> </s:layout> <!-- partie centrale--> <s:DataGrid id="dgContactPat" fontWeight="normal" dataProvider="{xmlCollContacts}" width="100%" height="80%" selectionChange="dgContactPat_selectionChangeHandler(event)"> <s:columns> <s:ArrayList> <s:GridColumn dataField="crIndex" visible="false"/> <s:GridColumn dataField="ctTTypeCorrP" headerText="Relation" /> <s:GridColumn dataField="crCorrespNP" headerText="Correspondant" /> <s:GridColumn dataField="crTSpecialiteP" headerText="Spécialité" /> <s:GridColumn dataField="crNumTel1" headerText="Téléphone" /> <s:GridColumn dataField="crTelecopie" headerText="Fax" /> <s:GridColumn dataField="crCodePostal" headerText="CP" /> <s:GridColumn dataField="crTVilleP" headerText="Ville" /> </s:ArrayList> </s:columns> </s:DataGrid> </s:Group> </s:VGroup> </windowSkin:wCustomWindow> Le 17/01/12 13:31, Tandon, Rishi a écrit : Could you send over your code? ________________________________ From: isa_loyer <isa_lo...@yahoo.fr> <mailto:isa_lo...@yahoo.fr> To: flexcoders@yahoogroups.com Sent: Tuesday, January 17, 2012 5:22 PM Subject: [flexcoders] AIR - Content resize according window Hi, I have a window witch is resizing on creationcomplete phase according user preference. This part woks well. But inside this window a s:Group exists and even if width and height is in percent, the s:Group size is bigger that the new window measure. I try to solve that with percentheigt and percentwidth but no result. If somebody know how to solve that, I'll happy to read. Thanks a lot -- Alex Harui Flex SDK Team Adobe Systems, Inc. http://blogs.adobe.com/aharui