• 弹窗位置


    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009" 
                   xmlns:s="library://ns.adobe.com/flex/spark" 
                   xmlns:mx="library://ns.adobe.com/flex/mx" 
                   width="300" layout="vertical" showCloseButton="true" close="closeMe()"
                   >
        <fx:Script>
            <![CDATA[
                import mx.managers.PopUpManager;
                protected function closeMe():void{
                PopUpManager.removePopUp(this);
                }
                
                protected function moveWindow(location:String):void{
                var newX:Number = 0;
                var newY:Number = 0;
                var padding:Number = 10;
                if(location== "center"){
                    PopUpManager.centerPopUp(this);
                    return;
                }
                if(location.indexOf("bottom") >-1)
                {newY=(parent.height - this.height )- padding;}
                if(location.indexOf("top") >-1)
                {newY= padding;}
                if(location.indexOf("left") >-1)
                {newX= padding;}
                if(location.indexOf("right") >-1)
                {newX=(parent.width - this.width )- padding;}
                
                move(newX,newY);//移动弹窗位置
                
                }
            ]]>
        </fx:Script>
        <s:HGroup width="100%">
            <s:Button label="Top left" width="100%" click="moveWindow('topleft');"/>
            <s:Button label="Top right" width="100%" click="moveWindow('topright');"/>        
        </s:HGroup>
        <s:VGroup width="100%">
            <s:Button label="Bottom left" width="100%" click="moveWindow('bottomleft');"/>
                <s:Button label="Bottom right" width="100%" click="moveWindow('bottomright');"/>
        </s:VGroup>
    </mx:TitleWindow>
    View Code
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                   xmlns:s="library://ns.adobe.com/flex/spark" 
                   xmlns:mx="library://ns.adobe.com/flex/mx" 
                  width="900" height="1000" backgroundColor="#ff00ed"
                 >
        
    
        <mx:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009" 
                        xmlns:s="library://ns.adobe.com/flex/spark" 
                        xmlns:mx="library://ns.adobe.com/flex/mx" 
                        width="300" layout="vertical" showCloseButton="true" close="closeMe()"
                        >
            <fx:Script>
                <![CDATA[
                    import mx.managers.PopUpManager;
                    protected function closeMe():void{
                        PopUpManager.removePopUp(this);
                    }
                    
                    protected function moveWindow(location:String):void{
                        var newX:Number = 0;
                        var newY:Number = 0;
                        var padding:Number = 10;
                        if(location== "center"){
                            PopUpManager.centerPopUp(this);
                            return;
                        }
                        if(location.indexOf("bottom") >-1)
                        {newY=padding;}
                        if(location.indexOf("top") >-1)
                        {newY= (parent.height - this.height )- padding;}
                        if(location.indexOf("left") >-1)
                        {newX= (parent.width - this.width )- padding;}
                        if(location.indexOf("right") >-1)
                        {newX=padding;}
                        
                        move(newX,newY);//移动弹窗位置
                        
                    }
                ]]>
            </fx:Script>
            <s:HGroup width="100%">
                <s:Button label="Top left" width="100%" click="moveWindow('topleft');"/>
                <s:Button label="Top right" width="100%" click="moveWindow('topright');"/>        
            </s:HGroup>
            <s:VGroup width="100%">
                <s:Button label="Bottom left" width="100%" click="moveWindow('bottomleft');"/>
                <s:Button label="Bottom right" width="100%" click="moveWindow('bottomright');"/>
            </s:VGroup>
        </mx:TitleWindow>
    </s:Application>
    View Code

  • 相关阅读:
    C#如何用OpenFileDialog控件打开图片显示到PictureBox这个控件
    C# winform 禁止窗体移动
    linux 硬链接和软链接(转)
    linux 源码编译(转)
    linux 压缩与解压缩
    硬盘分区(来自百度百科)
    arp:地址解析协议(Address Resolution Protocol)(来自维基百科)
    c++学习笔记(1)
    ProbS CF matlab源代码(二分系统)(原创作品,转载注明出处,谢谢!)
    [eclipse]UML之AmaterasUML 插件
  • 原文地址:https://www.cnblogs.com/zhugexiaobei/p/3231849.html
Copyright © 2020-2023  润新知