示例#1
0
        public void Test_GetCurrentWindow()
        {
            var wm = new WindowManager(IntPtr.Zero);

            wm.Add(this.LaunchSampleApplication());
            var windowInfoWithHandle = this.LaunchSampleApplication();

            wm.Add(windowInfoWithHandle);

            Assert.IsTrue(wm.GetCurrentWindow().Equals(windowInfoWithHandle));

            this.CloseSampleApplications(wm);
        }
示例#2
0
        public void Test_RemoveAndCountRight()
        {
            var wm = new WindowManager(IntPtr.Zero);

            var windowInfoWithHandle = this.LaunchSampleApplication();

            wm.Add(windowInfoWithHandle);
            wm.Remove(windowInfoWithHandle);

            Assert.AreEqual(0, wm.WindowCount());

            wm.Add(windowInfoWithHandle);
            this.CloseSampleApplications(wm);
        }
示例#3
0
 private static void InitWindowPackage(Type binderType, string packageName, List <Window> windowList)
 {
     binderType.GetMethod("BindAll").Invoke(null, null);
     foreach (Window window in windowList)
     {
         WindowManager.Add(window.windowId, packageName, window.windowType, window.frameType, window.canClose);
     }
 }
示例#4
0
        /// <summary>
        ///     Creates and or clears data sets required for game simulation and attaches the travel menu and the main menu to make
        ///     the program completely restarted as if fresh.
        /// </summary>
        public override void Restart()
        {
            // Resets the window manager in the base simulation.
            base.Restart();

            // Attach example window after the first tick.
            WindowManager.Add(typeof(LabelAnnotatorWindow));
        }
示例#5
0
        public void Test_SetWindowPreviousOfTop()
        {
            var wm = new WindowManager(IntPtr.Zero);

            var windowInfoWithHandle = this.LaunchSampleApplication();

            wm.Add(windowInfoWithHandle);
            wm.Add(this.LaunchSampleApplication());
            wm.Add(this.LaunchSampleApplication());

            wm.SetCurrentWindowIndex(0);

            Assert.AreEqual(0, wm.GetCurrentWindowIndex());
            wm.SetWindowPrevious();
            Assert.AreEqual(0, wm.GetCurrentWindowIndex());
            Assert.IsTrue(wm.GetCurrentWindow().Equals(windowInfoWithHandle));

            this.CloseSampleApplications(wm);
        }
        /// <summary>
        ///     Creates and or clears data sets required for game simulation and attaches the travel menu and the main menu to make
        ///     the program completely restarted as if fresh.
        /// </summary>
        public override void Restart()
        {
            // Resets the module to default start.
            ModuleExample.Restart();

            // Resets the window manager in the base simulation.
            base.Restart();

            // Attach example window after the first tick.
            WindowManager.Add(typeof(ExampleWindow));
        }
示例#7
0
        public void Test_MoveCurrentFocusPrevious()
        {
            var wm = new WindowManager(IntPtr.Zero);

            wm.Add(this.LaunchSampleApplication());
            var windowInfoWithHandle = this.LaunchSampleApplication();

            wm.Add(windowInfoWithHandle);
            wm.Add(this.LaunchSampleApplication());

            wm.SetCurrentWindowIndex(2);

            Assert.AreEqual(2, wm.GetCurrentWindowIndex());
            var previousWindowInfoWithHandle = wm.MoveCurrentFocusPrevious();

            Assert.AreEqual(1, wm.GetCurrentWindowIndex());
            Assert.IsTrue(previousWindowInfoWithHandle.Equals(windowInfoWithHandle));

            this.CloseSampleApplications(wm);
        }
示例#8
0
        public void Test_AddAndCountRight()
        {
            var wm = new WindowManager(IntPtr.Zero);

            Assert.AreEqual(0, wm.WindowCount());


            wm.Add(this.LaunchSampleApplication());
            Assert.AreEqual(1, wm.WindowCount());

            this.CloseSampleApplications(wm);
        }
示例#9
0
        public void Create(int lastZedIndex)
        {
            ZedIndex         = _currentZedIndex = lastZedIndex;
            Theme            = (Theme)Activator.CreateInstance(Application.ThemeType);
            _graphicsContext = _graphicsDriver.CreateWindow(Title, Size);
            _nativeWindow    = _graphicsContext.Window;

            NativeHandle          = _graphicsContext.NativeWindowHandle;
            Theme.GraphicsContext = _graphicsContext;

            WindowManager.Add(this);
            EventManager.RegisterEvents(_graphicsContext.Window);
        }
示例#10
0
        void _OnCreateWindow()
        {
            WindowManager.Add("Game", new WindowGameView());
            WindowManager.Add("Scene", new WindowSceneView());
            WindowManager.Add("Inspector", new WindowInspector());
            WindowManager.Add("Hierarchy", new WindowHierarchy());
            WindowManager.Add("Project", new WindowProject());
            var logger = WindowManager.Add("Console", new WindowConsole()).window as iLogger;

            Debug.SetLogger(logger);

            attr_about = WindowManager.Add("About", new WindowAbout(), false, false, false);
            attr_debug = WindowManager.Add("Debug", new WindowDebug(), false, false, false);
            WindowManager.GetAllWindowAttributes();
        }
示例#11
0
        /// <summary>
        /// Called on the first game tick. Used to setup and load base resources.
        /// </summary>
        protected override void OnFirstTick()
        {
            // Reset the turn counter.
            TotalTurns = 0;

            // Load the required modules.
            Trail         = new TrailModule();
            EventDirector = new EventDirector();
            Vehicle       = new Vehicle();

            // Reset the Window Manager, attach the main screens.
            base.Restart();
            WindowManager.Add(typeof(Travel));
            WindowManager.Add(typeof(MainMenu));
        }
示例#12
0
        /// <summary>
        ///     Creates and or clears data sets required for game simulation and attaches the travel menu and the main menu to make
        ///     the program completely restarted as if fresh.
        /// </summary>
        public override void Restart()
        {
            // Reset turn counter back to zero.
            TotalTurns = 0;

            // Linear time simulation (should tick first).
            Time = new TimeModule();

            // Vehicle, weather, conditions, climate, tail, stats, event director, etc.
            EventDirector = new EventDirectorModule();
            Trail         = new TrailModule();
            Vehicle       = new Vehicle();

            // Resets the window manager in the base simulation.
            base.Restart();

            // Attach traveling Windows since that is the default and bottom most game Windows.
            WindowManager.Add(typeof(Travel));

            // Add the new game configuration screen that asks for names, profession, and lets user buy initial items.
            WindowManager.Add(typeof(MainMenu));
        }
示例#13
0
        public override void Initialize()
        {
            base.Initialize();

            ScreenManager.MainWindow = new Window(WindowManager);
            ScreenManager.MainWindow.Init();
            ScreenManager.MainWindow.Text   = "InsaneRO Card Game - © 2010 by InsaneRO | Developed by Fischy, Jecky & GodLesZ";
            ScreenManager.MainWindow.Width  = Game.GraphicsDevice.Viewport.Width;
            ScreenManager.MainWindow.Height = Game.GraphicsDevice.Viewport.Height;
            ScreenManager.MainWindow.Center();
            ScreenManager.MainWindow.CloseButtonVisible = true;
            ScreenManager.MainWindow.Resizable          = false;
            ScreenManager.MainWindow.Movable            = false;
            ScreenManager.MainWindow.Shadow             = false;
            ScreenManager.MainWindow.Visible            = true;
            ScreenManager.MainWindow.MouseDown         += new MouseEventHandler(win_MouseDown);
            ScreenManager.MainWindow.MouseUp           += new MouseEventHandler(win_MouseUp);
            ScreenManager.MainWindow.MouseMove         += new MouseEventHandler(win_MouseMove);
            ScreenManager.MainWindow.Closing           += delegate(object sender, WindowClosingEventArgs e) {
                Game.Exit();
            };

            WindowManager.Add(ScreenManager.MainWindow);
        }