You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Kessler CTR Mark J <ma...@usmc.mil> on 2016/01/07 12:19:26 UTC
RE: [Non-DoD Source] Scaleing and Center popups
> PopUpManager.addPopUp(_class3, this.parentApplication as DisplayObject, true);
On a side note, have you experienced that null parenting issues in the popup while using the parentApplication object as a DisplayObject? I've experienced things like custom itemRenderers in datagrids in popups giving me null parent checks on groups.
-Mark
-----Original Message-----
From: scott matheson [mailto:scott@matheson.it]
Sent: Wednesday, January 06, 2016 4:27 PM
To: <us...@flex.apache.org>
Subject: [Non-DoD Source] Scaleing and Center popups
Hi
I use this code to centre my popups
var _class3:ReportsDialogDictation = new ReportsDialogDictation();
PopUpManager.addPopUp(_class3, this.parentApplication as DisplayObject, true);
PopUpManager.centerPopUp(_class3);
}
this works fine
when i let the user scale the application
var visibleWidth:Number = systemManager.getVisibleApplicationRect().width;
var visibleHeight:Number = systemManager.getVisibleApplicationRect().height;
var smallestScale:Number = Math.min(visibleHeight / 768, visibleWidth / 1024); appHolder.scaleX = smallestScale; appHolder.scaleY = smallestScale;
I still end up with centre popups, but these are popups are small
when i scale the popup it self with this code in the creationComplete
private function init():void {
var visibleWidth:Number = systemManager.getVisibleApplicationRect().width;
var visibleHeight:Number = systemManager.getVisibleApplicationRect().height;
var smallestScale:Number = Math.min(visibleHeight / 768, visibleWidth / 1024);
this.scaleX = smallestScale;
this.scaleY = smallestScale;
}
I end up with the popup not centred
any ideas ?
scott
Re: [Non-DoD Source] Scaleing and Center popups
Posted by scott matheson <sc...@matheson.it>.
Hi
Sorry for the delay i have not been coding this week, i have not see the problem, however i use different code in my item renders
protected function showTestResults(event:Event):void {
var popupMem:MemoryTestResults;
popupMem = PopUpManager.createPopUp(FlexGlobals.topLevelApplication as DisplayObject, MemoryTestResults, true) as MemoryTestResults;
PopUpManager.centerPopUp(popupMem as IFlexDisplayObject);
}
> On 7 Jan 2016, at 11:19, Kessler CTR Mark J <ma...@usmc.mil> wrote:
>
>> PopUpManager.addPopUp(_class3, this.parentApplication as DisplayObject, true);
>
> On a side note, have you experienced that null parenting issues in the popup while using the parentApplication object as a DisplayObject? I've experienced things like custom itemRenderers in datagrids in popups giving me null parent checks on groups.
>
>
> -Mark
>
>
> -----Original Message-----
> From: scott matheson [mailto:scott@matheson.it]
> Sent: Wednesday, January 06, 2016 4:27 PM
> To: <us...@flex.apache.org>
> Subject: [Non-DoD Source] Scaleing and Center popups
>
> Hi
> I use this code to centre my popups
> var _class3:ReportsDialogDictation = new ReportsDialogDictation();
> PopUpManager.addPopUp(_class3, this.parentApplication as DisplayObject, true);
> PopUpManager.centerPopUp(_class3);
> }
>
>
> this works fine
>
>
> when i let the user scale the application
>
> var visibleWidth:Number = systemManager.getVisibleApplicationRect().width;
> var visibleHeight:Number = systemManager.getVisibleApplicationRect().height;
> var smallestScale:Number = Math.min(visibleHeight / 768, visibleWidth / 1024); appHolder.scaleX = smallestScale; appHolder.scaleY = smallestScale;
>
>
> I still end up with centre popups, but these are popups are small
>
> when i scale the popup it self with this code in the creationComplete
>
>
>
>
> private function init():void {
> var visibleWidth:Number = systemManager.getVisibleApplicationRect().width;
> var visibleHeight:Number = systemManager.getVisibleApplicationRect().height;
> var smallestScale:Number = Math.min(visibleHeight / 768, visibleWidth / 1024);
> this.scaleX = smallestScale;
> this.scaleY = smallestScale;
>
> }
>
> I end up with the popup not centred
>
> any ideas ?
>
> scott
>