Exemple #1
0
        private void GameDemoMainWindowClosing(Windows.Window sender, EventArgs args)
        {
            this.activeDesktop = null;

            var window = this.demoSelectionDesktop.FindWindow("main_menu");

            window.Animations.Add(new LinearPropertyAnimation(800, 0, 0.5, (x) => { window.X = x; }));
        }
        //-----------------------------------------------------------------
        public void ZoomNextAndPreviousRemoveWindow(int windowID)
        {
            Windows.Window mapWindow = new Windows.Window(windowID);
            if (mapWindow.Type != Windows.Window.WindowType.Mapper)
                return;

            int index = _mapWindowExtents.FindWindow(mapWindow);
            if (index >= 0)
                _mapWindowExtents.RemoveAt(index);
        }
        //-----------------------------------------------------------------
        public void ZoomNextAndPreviousAddWindow(int windowID)
        {
            try
            {
                Windows.Window mapWindow = new Windows.Window(windowID);
                if (mapWindow.Type != Windows.Window.WindowType.Mapper)
                    return;

                if (_mapWindowExtents.WindowExists(mapWindow) == false)
                {
                    Windows.MapWindowExtents mapExtent = new Windows.MapWindowExtents(mapWindow);
                    _mapWindowExtents.Add(mapExtent);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(string.Format("{0} Exception caught.", e));
            }
        }
        //-----------------------------------------------------------------
        public void ZoomNextAndPreviousAddExtent(int windowID)
        {
            try
            {

                Windows.Window mapWindow = new Windows.Window(windowID);
                if (mapWindow.Type != Windows.Window.WindowType.Mapper)
                    return;

                int index = _mapWindowExtents.FindWindow(mapWindow);
                if (index >= 0)
                {
                    int extentIndex = _mapWindowExtents[index].MapExtentList.AddExtent(mapWindow);
                }
            }
            catch (Exception e)
            {
                WindowHelper.InteropHelper.PrintMessage(string.Format("{0} Exception caught.", e));
            }
        }
        //-----------------------------------------------------------------
        public void SetActiveWindow(int windowID)
        {
            Windows.Window window = new Windows.Window(windowID);
            _activeWindow = window;

            UpdateWindowsButtons();
        }
        //-----------------------------------------------------------------
        public void ResetActiveWindow()
        {
            if (_activeWindow != null)
                _activeWindow = null;

            UpdateWindowsButtons();
        }
 //-----------------------------------------------------------------
 public void AddToOrUpdateInWindowLists(int windowID, string windowName, int windowType)
 {
     Windows.Window window = new Windows.Window(windowID, windowName, windowType);
     if (AddToOrUpdateInWindowLists(window) == true)
         RefreshWindowsList();
 }
Exemple #8
0
        /// <summary>
        /// MVC平台兼容silverlight弹出窗体特殊处理
        /// (窗体默认最大化)
        /// Author:傅意成
        /// Date:2012-07-12
        /// </summary>
        /// <param name="Title"></param>
        /// <param name="IocPath"></param>
        /// <param name="windowID"></param>
        /// <param name="content"></param>
        /// <param name="isResizeable"></param>
        /// <param name="isSysApp"></param>
        /// <param name="param"></param>
        /// <returns></returns>
        public static Window ShowMvcProgram(string Title, string IocPath, string windowID, object content, bool isResizeable, bool isSysApp, object param)
        {
            //当前应用程序窗口是否已经存在,如果存在则激活应用程序
            if (Windows.WindowsManager.WindowList.ContainsKey(windowID))
            {
                Windows.WindowsManager.ActiveWindow(Windows.WindowsManager.WindowList[windowID]);
                return(null);
            }
            else
            {
                Windows.Window window = null;
                if (!isSysApp)
                {
                    window = new Windows.Window(false, isResizeable);
                }
                else
                {
                    window = new Windows.Window(false, isResizeable);
                }

                window.scrollcontent.Content = content;
                window.Content = content;
                bool prload = true;
                //应用程序标题
                window.Caption = Title;
                if (IocPath == null || IocPath.Length == 0)
                {
                    IocPath = "/SMT.SAAS.Controls.Toolkit.Windows;component/images/default.png";
                }

                //应用程序任务栏以及窗口小图标地址
                window.IocPath = IocPath;
                window.ID      = windowID;
                //初始化窗口位置/大小
                double width = !double.IsNaN(((Control)content).Width) ? ((Control)content).Width : ((Control)content).MinWidth;
                if ((width == 0.0) || double.IsNaN(width))
                {
                    width = 760.0;
                }
                double height = !double.IsNaN(((Control)content).Height) ? ((Control)content).Height : ((Control)content).MinHeight;
                if ((height == 0.0) || double.IsNaN(height))
                {
                    height = 550.0;
                }

                window.Height = height; window.Width = width;
                if (content is Control)
                {
                    //根据内容大小从新计算窗口大小
                    ((Control)content).SizeChanged += (obj, args) =>
                    {
                        if (prload)
                        {
                            window.Height = args.NewSize.Height + 60;
                            window.Width  = args.NewSize.Width + 30;
                            prload        = false;
                        }
                    };
                }
                //加载应用程序窗口
                //Windows.WindowsManager.MaxWindow(window);
                Windows.WindowsManager.ShowMvcPlatWindow(window, new Point(Wrapper.ActualWidth * 0.01, Wrapper.ActualHeight * 0.01), isResizeable, isSysApp, windowID);
                return(window);
            }
        }
Exemple #9
0
 /// <summary>
 /// Update a texture from the contents of a window
 /// </summary>
 /// <param name="window">Window to copy to the texture</param>
 /// <param name="x">X offset in the texture where to copy the source pixels</param>
 /// <param name="y">Y offset in the texture where to copy the source pixels</param>
 internal void Update(Windows.Window window, uint x, uint y)
 {
     sfTexture_updateFromWindow(CPointer, window.CPointer, x, y);
 }
Exemple #10
0
 /// <summary>
 /// Update a texture from the contents of a window
 /// </summary>
 /// <param name="window">Window to copy to the texture</param>
 internal void Update(Windows.Window window)
 {
     Update(window, 0, 0);
 }
 public Win32Window(int windowID)
 {
     this.ID = windowID;
     _window = new Windows.Window(windowID);
 }