예제 #1
0
        protected virtual void SetDialogWindowBGDrawable()
        {
            var andColor = _dialogConfig.BackgroundColor.ToAndroid();
            var dw       = new ColorDrawable(andColor);

            DWindow.SetBackgroundDrawable(dw);
        }
예제 #2
0
파일: Program.cs 프로젝트: sgnls/Darkstar
        static void Main(string[] args)
        {
            PrintHerald();

            // Cons up a system to run stuff on.
            DSystem system = new DSystem();

            system.Reset();

            //
            // Start the UI, this will not return from ShowDialog
            // until the window is closed.
            //
            DWindow mainWindow = new DWindow(system);

            system.AttachDisplay(mainWindow);
            DialogResult res = mainWindow.ShowDialog();

            //
            // Main window is now closed: shut down the system.
            // Ensure the system is stopped.
            //
            system.StopExecution();

            //
            // Commit disks on normal exit
            //
            system.Shutdown(res == DialogResult.OK);

            Console.WriteLine("Goodbye...");
        }
예제 #3
0
 void SetDialogWindowFlags(WindowManagerLayoutParams attrs)
 {
     if (_dialogConfig.NotTouchModal)
     {
         DWindow.ClearFlags(WindowManagerFlags.DimBehind);
         DWindow.AddFlags(WindowManagerFlags.NotTouchModal);
     }
     else
     {
         attrs.DimAmount = _dialogConfig.DimAmount;
     }
 }
예제 #4
0
        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            //dWindow = new DesktopWindow(_graphics, this, new OSInterface(), null, GroupBehaviorCollection.PlasmaDesktop);

            dWindow = new DesktopWindow(_graphics, this, new OSInterface(), null, GroupBehaviorCollection.PlasmaDesktop);
            dWindow.DisplayWidget = Widgets.EditorWidgets.UIEditor(Args);

            //dWindow.DisplayWidget = TestWidgets.ExplorerTest();
            //dWindow.DisplayWidget = TestWidgets.BrokenStuff();
            //dWindow.DisplayWidget = TestWidgets.BrokenFixedSize();
        }
예제 #5
0
        /// <summary> Set this UIUnputState's values to the typical input from a mouse + keyboard. </summary>
        public void UpdateAll(DWindow dwindow, GameTime game_time)
        {
            _previous_mouse_state    = _mouse_state;
            _mouse_state             = Mouse.GetState(dwindow.ParentGame.Window);
            _previous_keyboard_state = _keyboard_state;
            _keyboard_state          = Keyboard.GetState();

            PrimaryClick   = _mouse_state.LeftButton == ButtonState.Pressed;
            SecondaryClick = _mouse_state.RightButton == ButtonState.Pressed;

            PrimaryClickTriggered   = PrimaryClick && _previous_mouse_state.LeftButton == ButtonState.Released;
            SecondaryClickTriggered = SecondaryClick && _previous_mouse_state.RightButton == ButtonState.Released;

            CursorPosition = _mouse_state.Position;

            Scroll = new Vector2(_mouse_state.HorizontalScrollWheelValue, _mouse_state.ScrollWheelValue) - _previous_mouse_wheel_scroll;
            _previous_mouse_wheel_scroll = new Vector2(_mouse_state.HorizontalScrollWheelValue, _mouse_state.ScrollWheelValue);

            UpdateKeyboardInput(dwindow, game_time);
        }
예제 #6
0
 public UINavigator(DWindow parent) =>
예제 #7
0
 public void AttachDisplay(DWindow display)
 {
     _display = display;
 }
예제 #8
0
        /// <summary> Set this UIUnputState's values to the typical input from a keyboard. Doesn't update cursor values. </summary>
        public void UpdateKeyboardInput(DWindow dwindow, GameTime game_time)
        {
            buffered_keyboard.Update(game_time.GetElapsedSeconds());

            TextCursorMovement.Left  = buffered_keyboard.IsKeyTriggered(Keys.Left);
            TextCursorMovement.Right = buffered_keyboard.IsKeyTriggered(Keys.Right);
            TextCursorMovement.Up    = buffered_keyboard.IsKeyTriggered(Keys.Up);
            TextCursorMovement.Down  = buffered_keyboard.IsKeyTriggered(Keys.Down);

            Shift    = _keyboard_state.IsKeyDown(Keys.LeftShift) || _keyboard_state.IsKeyDown(Keys.RightShift);
            Control  = _keyboard_state.IsKeyDown(Keys.LeftControl) || _keyboard_state.IsKeyDown(Keys.RightControl);
            Delete   = buffered_keyboard.IsKeyTriggered(Keys.Delete);
            Home     = buffered_keyboard.IsKeyTriggered(Keys.Home);
            End      = buffered_keyboard.IsKeyTriggered(Keys.End);
            Tab      = buffered_keyboard.IsKeyTriggered(Keys.Tab);
            CapsLock = _keyboard_state.CapsLock;
            NumLock  = _keyboard_state.NumLock;

            Text      = dwindow.InputText.ToString();
            SelectAll = false;
            Copy      = false;
            Cut       = false;
            Paste     = false;
            Save      = false;
            New       = false;
            Undo      = false;
            Redo      = false;

            foreach (char c in dwindow.CommandText.ToString())
            {
                //Console.WriteLine((int)c);
                if (c == 1)
                {
                    SelectAll = true;
                }
                if (c == 3)
                {
                    Copy = true;
                }
                if (c == 24)
                {
                    Cut = true;
                }
                if (c == 22)
                {
                    Paste = true;
                }
                if (c == 19)
                {
                    Save = true;
                }
                if (c == 14)
                {
                    New = true;
                }
                if (c == 26)
                {
                    Undo = true;
                }
                if (c == 25)
                {
                    Redo = true;
                }

                Debug.WriteLine("UpdateKeyboardInput UpdateInputstate");
            }

            _previous_insert_key_down = _insert_key_down;
            _insert_key_down          = buffered_keyboard.IsKeyTriggered(Keys.Insert);
            if (_insert_key_down && !_previous_insert_key_down)
            {
                Insert = !Insert;
            }
        }
예제 #9
0
        static void Main(string[] args)
        {
            //
            // Check for command-line arguments.
            //
            if (args.Length > 0)
            {
                for (int i = 0; i < args.Length; i++)
                {
                    switch (args[i++].ToLowerInvariant())
                    {
                    case "-config":
                        if (i < args.Length)
                        {
                            StartupOptions.ConfigurationFile = args[i];
                        }
                        else
                        {
                            PrintUsage();
                            return;
                        }
                        break;

                    case "-rompath":
                        if (i < args.Length)
                        {
                            StartupOptions.RomPath = args[i];
                        }
                        else
                        {
                            PrintUsage();
                            return;
                        }
                        break;

                    default:
                        PrintUsage();
                        return;
                    }
                }
            }

            PrintHerald();

            // Cons up a system to run stuff on.
            DSystem system = new DSystem();

            system.Reset();

            //
            // Start the UI, this will not return from ShowDialog
            // until the window is closed.
            //
            DWindow mainWindow = new DWindow(system);

            system.AttachDisplay(mainWindow);
            DialogResult res = mainWindow.ShowDialog();

            //
            // Main window is now closed: shut down the system.
            // Ensure the system is stopped.
            //
            system.StopExecution();

            //
            // Commit disks on normal exit
            //
            system.Shutdown(res == DialogResult.OK);

            Console.WriteLine("Goodbye...");
        }
예제 #10
0
 // Sets up some of the references so they can be used
 private void Start()
 {
     talk     = FindObjectOfType <DWindow>().GetComponent <DWindow>();
     qManager = FindObjectOfType <QuestManager>().GetComponent <QuestManager>();
 }