Beispiel #1
0
        public override bool SendCommand(QCommand Command)
        {
            switch (Command.CommandCode)
            {
            case CommandCode.LeftArrow:
                cursorIndex = (cursorIndex - 1 + 8) % 8;
                return(true);

            case CommandCode.RightArrow:
                cursorIndex = (cursorIndex + 1) % 8;
                return(true);

            case CommandCode.UpArrow:
                ChangeValue(true);
                return(true);

            case CommandCode.DownArrow:
                ChangeValue(false);
                return(true);

            case CommandCode.Enter:
            case CommandCode.Escape:
                closeCallback();
                return(true);

            default:
                return(false);
            }
        }
Beispiel #2
0
        public override bool SendCommand(QCommand Command)
        {
            switch (Command.CommandCode)
            {
            case CommandCode.Enter:
            case CommandCode.Escape:
            case CommandCode.F1:
                closeCallback();
                return(true);

            default:
                return(false);
            }
        }
Beispiel #3
0
 private AdjustmentAmount getAdjustmentCode(QCommand Command)
 {
     if (Command.Control && Command.Shift)
     {
         return(AdjustmentAmount.All);
     }
     else if (Command.Control)
     {
         return(AdjustmentAmount.Fine);
     }
     else if (Command.Shift)
     {
         return(AdjustmentAmount.Large);
     }
     else
     {
         return(AdjustmentAmount.Normal);
     }
 }
Beispiel #4
0
 public abstract bool SendCommand(QCommand Key);
Beispiel #5
0
        public override bool SendCommand(QCommand Command)
        {
            string txt = Command.Shift ? Command.String.ToUpper() : Command.String.ToLower();

            switch (Command.CommandCode)
            {
            case CommandCode.Enter:
                if (FoundItem != null)
                {
                    if (Command.Shift)
                    {
#if NO_WAIT_FOR_ENTER
                        findCallback(currentItem, false);
#endif
                        findCallback(FoundItem, true);
                    }
                    else
                    {
                        findCallback(FoundItem, false);
                    }
                    closeCallback();
                }
                return(true);

            case CommandCode.Escape:
#if NO_WAIT_FOR_ENTER
                findCallback(currentItem, false);
#endif
                closeCallback();
                return(true);

            case CommandCode.Backspace:
                if (userText.Length > 0)
                {
                    userText = userText.Substring(0, userText.Length - 1);
                }
                updateSearch();
                selectIndex = 0;
                return(true);

            case CommandCode.Space:
                if (userText.Length > 0)
                {
                    userText = userText + " ";
                }
                selectIndex = 0;
                updateSearch();
                return(true);

            case CommandCode.Tab:
                if (Command.Shift)
                {
                    selectIndex--;
                }
                else
                {
                    selectIndex++;
                }
                selectIndex = Math.Max(0, selectIndex);
                updateSearch();
                return(true);

            default:
                if (Command.String.Length == 1)
                {
                    selectIndex = 0;
                    userText   += txt;
                    updateSearch();
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
Beispiel #6
0
        public bool SendCommand(QCommand Command)
        {
            if (Command.CommandCode == CommandCode.MouseClick)
            {
                CelestialBody cb = findClosestBody(Command.Point, renderer.RenderLocations, renderer.NumRenderLocations);
                if (cb != null)
                {
                    ResetPanningAdjustments();
                    if (Command.Shift)
                    {
                        setHome(cb);
                    }
                    else
                    {
                        setViewTarget(cb);
                    }

                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            if (currentDialog != null)
            {
                if (currentDialog.SendCommand(Command))
                {
                    return(true);
                }
            }

            switch (Command.CommandCode)
            {
            case CommandCode.MouseHorizontal:
                if (Command.Shift)
                {
                    tilt(Command.Data);
                }
                else if (!Command.Control)
                {
                    panHorizontal(Command.Data);
                }
                break;

            case CommandCode.MouseVertical:
                if (Command.Control)
                {
                    zoom(Command.Data);
                }
                else if (!Command.Shift)
                {
                    panVertical(Command.Data);
                }
                break;

            case CommandCode.MouseWheel:
                zoom(Command.Data);
                break;

            case CommandCode.Escape:
                if (screenSaverMode != ScreenSaverMode.ScreenSaverPreview)
                {
                    shutdownCallback();
                }
                break;

            case CommandCode.Enter:
                this.settle();
                break;

            case CommandCode.UpArrow:
                this.setHome(Forward: true);
                break;

            case CommandCode.DownArrow:
                this.setHome(Forward: false);
                break;

            case CommandCode.LeftArrow:
                this.setViewTarget(Forward: false);
                break;

            case CommandCode.RightArrow:
                this.setViewTarget(Forward: true);
                break;

            case CommandCode.Five:
                this.ShowEclipticGrid = !this.ShowEclipticGrid;
                break;

            case CommandCode.Six:
                this.ShowEquatorialGrid = !this.ShowEquatorialGrid;
                break;

            case CommandCode.Seven:
                this.ShowLocalGrid = !this.ShowLocalGrid;
                break;

            case CommandCode.F1:
                this.InHelpMode = !this.InHelpMode;
                break;

            case CommandCode.F2:
                this.ShowData = !this.ShowData;
                break;

            case CommandCode.F3:
                this.InFindMode = !this.InFindMode;
                break;

            case CommandCode.F4:

                if (Command.Alt)
                {
                    return(false);
                }

                this.ShowInstruments = !this.ShowInstruments;
                break;

            case CommandCode.F5:
                this.switchCaptionMode();
                break;

            case CommandCode.F6:
                this.WireFrameBodyRender = !this.WireFrameBodyRender;
                break;

            case CommandCode.F7:
                this.adjustMinBrightness(-1f);
                break;

            case CommandCode.F8:
                this.adjustMinBrightness(1f);
                break;

            case CommandCode.F9:
                this.switchConstellationMode();
                break;

            case CommandCode.F10:
                this.switchConstellationSet();
                break;

            case CommandCode.F11:
                this.ShowConstellationBoundaries = !this.ShowConstellationBoundaries;
                break;

            case CommandCode.PageDown:
                this.ZoomOut(getAdjustmentCode(Command));
                break;

            case CommandCode.PageUp:
                this.zoomIn(getAdjustmentCode(Command));
                break;

            case CommandCode.End:
                this.ZoomOut(AdjustmentAmount.All);
                break;

            case CommandCode.Home:
                this.zoomIn(AdjustmentAmount.All);
                break;

            case CommandCode.P:
            case CommandCode.Pause:
                if (!this.InDateTimeAdjustMode)
                {
                    this.UserPaused = !this.UserPaused;
                }
                break;

            case CommandCode.Backspace:
                this.InLatLongAdjustaMode = !this.InLatLongAdjustaMode;
                break;

            case CommandCode.BackslashPipe:
                if (physicsStartupDone)
                {
                    this.InDateTimeAdjustMode = !this.InDateTimeAdjustMode;
                }
                break;

            case CommandCode.PlusEquals:
                this.DisplayTimeUTC = !this.DisplayTimeUTC;
                break;

            case CommandCode.One:
                this.ViewMode = ViewMode.Ecliptic;
                break;

            case CommandCode.Two:
                this.ViewMode = ViewMode.Surface;
                break;

            case CommandCode.Three:
                this.ViewMode = ViewMode.TopDown;
                break;

            case CommandCode.Four:
                this.ViewMode = ViewMode.Follow;
                break;

            case CommandCode.T:
                goToToday();
                break;

            case CommandCode.Z:
                slowDown(getAdjustmentCode(Command));
                break;

            case CommandCode.X:
                speedUp(getAdjustmentCode(Command));
                break;

            case CommandCode.R:
                swapViewAndHome();
                break;

            case CommandCode.C:
                reverseTime();
                break;

            case CommandCode.A:
                panLeft(getAdjustmentCode(Command));
                break;

            case CommandCode.D:
                panRight(getAdjustmentCode(Command));
                break;

            case CommandCode.W:
                panUp(getAdjustmentCode(Command));
                break;

            case CommandCode.S:
                panDown(getAdjustmentCode(Command));
                break;

            case CommandCode.Q:
                tiltLeft(getAdjustmentCode(Command));
                break;

            case CommandCode.E:
                tiltRight(getAdjustmentCode(Command));
                break;

            case CommandCode.Space:
                ResetPanningAdjustments();
                break;

            case CommandCode.TildeBackTick:
                switchProjectionMode();
                break;

            case CommandCode.Insert:
                HighQualityRender = !HighQualityRender;
                break;

            case CommandCode.CommaLeftAngle:
                findTarget();
                break;

            case CommandCode.PeriodRightAngle:
                findHome();
                break;

            case CommandCode.F12:
                this.HighlightSunlitAreas = !this.HighlightSunlitAreas;
                break;

            default:
                return(false);
            }
            return(true);
        }