private void screen_OnMouseLeftUp(Point position)
 {
     if (this.screen.PeekUndoneWork().Kind == UndoneWorkKind.Frame)
     {
         this.Draging = false;
         if ((this.OKButtonEnabled && (this.OKButtonState == FrameButtonState.Pressed)) && StaticMethods.PointInRectangle(position, this.okbuttonRectangle))
         {
             this.screen.PlayNormalSound(this.OKSoundFile);
             this.OKButtonState = FrameButtonState.Selected;
             this.Result        = FrameResult.OK;
             if (this.frameContent.OKFunction != null)
             {
                 this.frameContent.OKFunction();
                 this.frameContent.OKFunction = null;
             }
             this.IsShowing = false;
         }
         if ((this.CancelButtonEnabled && (this.CancelButtonState == FrameButtonState.Pressed)) && StaticMethods.PointInRectangle(position, this.cancelbuttonRectangle))
         {
             this.screen.PlayNormalSound(this.CancelSoundFile);
             this.CancelButtonState = FrameButtonState.Selected;
             this.Result            = FrameResult.Cancel;
             this.IsShowing         = false;
         }
     }
 }
 private void screen_OnMouseLeftDown(Point position)
 {
     if (this.screen.PeekUndoneWork().Kind == UndoneWorkKind.Frame)
     {
         if (this.OKButtonEnabled)
         {
             if (StaticMethods.PointInRectangle(position, this.okbuttonRectangle))
             {
                 this.OKButtonState = FrameButtonState.Pressed;
             }
             else
             {
                 this.OKButtonState = FrameButtonState.Normal;
             }
         }
         if (this.CancelButtonEnabled)
         {
             if (StaticMethods.PointInRectangle(position, this.cancelbuttonRectangle))
             {
                 this.CancelButtonState = FrameButtonState.Pressed;
             }
             else
             {
                 this.CancelButtonState = FrameButtonState.Normal;
             }
         }
         if ((this.frameContent.MapViewSelectorButtonEnabled && StaticMethods.PointInRectangle(position, this.mapviewselectorButtonRectangle)) && (this.frameContent.MapViewSelectorFunction != null))
         {
             this.frameContent.MapViewSelectorFunction();
         }
     }
 }
Beispiel #3
0
 private void screen_OnMouseLeftDown(Point position)
 {
     if (this.screen.PeekUndoneWork().Kind == UndoneWorkKind.Frame)
     {
         if (this.OKButtonEnabled)
         {
             if (StaticMethods.PointInRectangle(position, this.okbuttonRectangle))
             {
                 this.OKButtonState = FrameButtonState.Pressed;
             }
             else
             {
                 this.OKButtonState = FrameButtonState.Normal;
             }
         }
         if (this.CancelButtonEnabled)
         {
             if (StaticMethods.PointInRectangle(position, this.cancelbuttonRectangle))
             {
                 this.CancelButtonState = FrameButtonState.Pressed;
             }
             else
             {
                 this.CancelButtonState = FrameButtonState.Normal;
             }
         }
     }
 }
Beispiel #4
0
        private void screen_OnMouseLeftUp(Point position)
        {
            if (Session.MainGame.mainGameScreen.PeekUndoneWork().Kind == UndoneWorkKind.Frame)
            {
                this.Draging = false;
                if ((this.OKButtonEnabled && (this.OKButtonState == FrameButtonState.Pressed)) && StaticMethods.PointInRectangle(position, this.okbuttonRectangle))
                {
                    Session.MainGame.mainGameScreen.PlayNormalSound(this.OKSoundFile);
                    this.OKButtonState = FrameButtonState.Selected;
                    this.Result        = FrameResult.OK;
                    if (this.frameContent.OKFunction != null)
                    {
                        this.frameContent.OKFunction();
                        this.frameContent.OKFunction = null;
                    }
                    this.IsShowing = false;
                }
                if ((this.CancelButtonEnabled && (this.CancelButtonState == FrameButtonState.Pressed)) && StaticMethods.PointInRectangle(position, this.cancelbuttonRectangle))
                {
                    Session.MainGame.mainGameScreen.PlayNormalSound(this.CancelSoundFile);
                    this.CancelButtonState = FrameButtonState.Selected;
                    this.Result            = FrameResult.Cancel;
                    this.IsShowing         = false;
                }
                //if ((this.frameContent.MapViewSelectorButtonEnabled && StaticMethods.PointInRectangle(position, this.mapviewselectorButtonRectangle)) && (this.frameContent.MapViewSelectorFunction != null))
                //{
                //    this.frameContent.MapViewSelectorFunction();
                //}

                /* if ((this.SelectAllButtonEnabled && (this.SelectAllButtonState == FrameButtonState.Pressed)) && StaticMethods.PointInRectangle(position, this.selectallbuttonRectangle))
                 * {
                 *   Session.MainGame.mainGameScreen.PlayNormalSound(this.SelectAllSoundFile);
                 *   this.SelectAllButtonState = FrameButtonState.Selected;
                 *   this.Result = FrameResult.SelectAll;
                 *   if (this.frameContent.SelectAllFunction != null)
                 *   {
                 *       this.frameContent.SelectAllFunction();
                 *       this.frameContent.SelectAllFunction = null;
                 *   }
                 *   this.IsShowing = false;
                 * }*/
            }
        }
Beispiel #5
0
        private void screen_OnMouseMove(Point position, bool leftDown)
        {
            if (Session.MainGame.mainGameScreen.PeekUndoneWork().Kind == UndoneWorkKind.Frame)
            {
                if (this.OKButtonEnabled)
                {
                    if (StaticMethods.PointInRectangle(position, this.okbuttonRectangle))
                    {
                        if (leftDown)
                        {
                            this.OKButtonState = FrameButtonState.Pressed;
                        }
                        else
                        {
                            this.OKButtonState = FrameButtonState.Selected;
                        }
                    }
                    else
                    {
                        this.OKButtonState = FrameButtonState.Normal;
                    }
                }
                if (this.CancelButtonEnabled)
                {
                    if (StaticMethods.PointInRectangle(position, this.cancelbuttonRectangle))
                    {
                        if (leftDown)
                        {
                            this.CancelButtonState = FrameButtonState.Pressed;
                        }
                        else
                        {
                            this.CancelButtonState = FrameButtonState.Selected;
                        }
                    }
                    else
                    {
                        this.CancelButtonState = FrameButtonState.Normal;
                    }
                }

                /* if (this.SelectAllButtonEnabled)
                 * {
                 *   if (StaticMethods.PointInRectangle(position, this.selectallbuttonRectangle))
                 *   {
                 *       if (leftDown)
                 *       {
                 *           this.SelectAllButtonState = FrameButtonState.Pressed;
                 *       }
                 *       else
                 *       {
                 *           this.SelectAllButtonState = FrameButtonState.Selected;
                 *       }
                 *   }
                 *   else
                 *   {
                 *       this.SelectAllButtonState = FrameButtonState.Normal;
                 *   }
                 * }*/
                if (this.frameContent.MapViewSelectorButtonEnabled)
                {
                    if (StaticMethods.PointInRectangle(position, this.mapviewselectorButtonRectangle))
                    {
                        this.MapViewSelectorButtonSelected = true;
                    }
                    else
                    {
                        this.MapViewSelectorButtonSelected = false;
                    }
                }
                if (leftDown)
                {
                    if (StaticMethods.PointInRectangle(position, this.titleRectangle))
                    {
                        this.Draging = true;
                    }
                    if (this.Draging)
                    {
                        this.frameContent.FramePosition = new Rectangle(this.frameContent.FramePosition.X + Session.MainGame.mainGameScreen.MouseOffset.X, this.frameContent.FramePosition.Y + Session.MainGame.mainGameScreen.MouseOffset.Y, this.frameContent.FramePosition.Width, this.frameContent.FramePosition.Height);
                        this.SetPosition(this.frameContent.FramePosition);
                        this.frameContent.ReCalculate();
                    }
                }
            }
        }
Beispiel #6
0
 private void screen_OnMouseMove(Point position, bool leftDown)
 {
     if (this.screen.PeekUndoneWork().Kind == UndoneWorkKind.Frame)
     {
         if (this.OKButtonEnabled)
         {
             if (StaticMethods.PointInRectangle(position, this.okbuttonRectangle))
             {
                 if (leftDown)
                 {
                     this.OKButtonState = FrameButtonState.Pressed;
                 }
                 else
                 {
                     this.OKButtonState = FrameButtonState.Selected;
                 }
             }
             else
             {
                 this.OKButtonState = FrameButtonState.Normal;
             }
         }
         if (this.CancelButtonEnabled)
         {
             if (StaticMethods.PointInRectangle(position, this.cancelbuttonRectangle))
             {
                 if (leftDown)
                 {
                     this.CancelButtonState = FrameButtonState.Pressed;
                 }
                 else
                 {
                     this.CancelButtonState = FrameButtonState.Selected;
                 }
             }
             else
             {
                 this.CancelButtonState = FrameButtonState.Normal;
             }
         }
         if (this.frameContent.MapViewSelectorButtonEnabled)
         {
             if (StaticMethods.PointInRectangle(position, this.mapviewselectorButtonRectangle))
             {
                 this.MapViewSelectorButtonSelected = true;
             }
             else
             {
                 this.MapViewSelectorButtonSelected = false;
             }
         }
         if (leftDown)
         {
             if (StaticMethods.PointInRectangle(position, this.titleRectangle))
             {
                 this.Draging = true;
             }
             if (this.Draging)
             {
                 this.frameContent.FramePosition = new Rectangle(this.frameContent.FramePosition.X + this.screen.MouseOffset.X, this.frameContent.FramePosition.Y + this.screen.MouseOffset.Y, this.frameContent.FramePosition.Width, this.frameContent.FramePosition.Height);
                 this.SetPosition(this.frameContent.FramePosition);
                 this.frameContent.ReCalculate();
             }
         }
     }
 }
Beispiel #7
0
 private void screen_OnMouseLeftUp(Point position)
 {
     if (this.screen.PeekUndoneWork().Kind == UndoneWorkKind.Frame)
     {
         this.Draging = false;
         if ((this.OKButtonEnabled && (this.OKButtonState == FrameButtonState.Pressed)) && StaticMethods.PointInRectangle(position, this.okbuttonRectangle))
         {
             this.screen.PlayNormalSound(this.OKSoundFile);
             this.OKButtonState = FrameButtonState.Selected;
             this.Result = FrameResult.OK;
             if (this.frameContent.OKFunction != null)
             {
                 this.frameContent.OKFunction();
                 this.frameContent.OKFunction = null;
             }
             this.IsShowing = false;
         }
         if ((this.CancelButtonEnabled && (this.CancelButtonState == FrameButtonState.Pressed)) && StaticMethods.PointInRectangle(position, this.cancelbuttonRectangle))
         {
             this.screen.PlayNormalSound(this.CancelSoundFile);
             this.CancelButtonState = FrameButtonState.Selected;
             this.Result = FrameResult.Cancel;
             this.IsShowing = false;
         }
         if ((this.frameContent.MapViewSelectorButtonEnabled && StaticMethods.PointInRectangle(position, this.mapviewselectorButtonRectangle)) && (this.frameContent.MapViewSelectorFunction != null))
         {
             this.frameContent.MapViewSelectorFunction();
         }
     }
 }
Beispiel #8
0
 private void screen_OnMouseLeftDown(Point position)
 {
     if (this.screen.PeekUndoneWork().Kind == UndoneWorkKind.Frame)
     {
         if (this.OKButtonEnabled)
         {
             if (StaticMethods.PointInRectangle(position, this.okbuttonRectangle))
             {
                 this.OKButtonState = FrameButtonState.Pressed;
             }
             else
             {
                 this.OKButtonState = FrameButtonState.Normal;
             }
         }
         if (this.CancelButtonEnabled)
         {
             if (StaticMethods.PointInRectangle(position, this.cancelbuttonRectangle))
             {
                 this.CancelButtonState = FrameButtonState.Pressed;
             }
             else
             {
                 this.CancelButtonState = FrameButtonState.Normal;
             }
         }
     }
 }
Beispiel #9
0
        private void screen_OnMouseMove(Point position, bool leftDown)
        {
            if (Session.MainGame.mainGameScreen.PeekUndoneWork().Kind == UndoneWorkKind.Frame)
            {
                if (this.OKButtonEnabled)
                {
                    if (StaticMethods.PointInRectangle(position, this.okbuttonRectangle))
                    {
                        if (leftDown)
                        {
                            this.OKButtonState = FrameButtonState.Pressed;
                        }
                        else
                        {
                            this.OKButtonState = FrameButtonState.Selected;
                        }
                    }
                    else
                    {
                        this.OKButtonState = FrameButtonState.Normal;
                    }
                }
                if (this.CancelButtonEnabled)
                {
                    if (StaticMethods.PointInRectangle(position, this.cancelbuttonRectangle))
                    {
                        if (leftDown)
                        {
                            this.CancelButtonState = FrameButtonState.Pressed;
                        }
                        else
                        {
                            this.CancelButtonState = FrameButtonState.Selected;
                        }
                    }
                    else
                    {
                        this.CancelButtonState = FrameButtonState.Normal;
                    }
                }

                /* if (this.SelectAllButtonEnabled)
                 * {
                 *   if (StaticMethods.PointInRectangle(position, this.selectallbuttonRectangle))
                 *   {
                 *       if (leftDown)
                 *       {
                 *           this.SelectAllButtonState = FrameButtonState.Pressed;
                 *       }
                 *       else
                 *       {
                 *           this.SelectAllButtonState = FrameButtonState.Selected;
                 *       }
                 *   }
                 *   else
                 *   {
                 *       this.SelectAllButtonState = FrameButtonState.Normal;
                 *   }
                 * }*/
                if (this.frameContent.MapViewSelectorButtonEnabled)
                {
                    if (StaticMethods.PointInRectangle(position, this.mapviewselectorButtonRectangle))
                    {
                        this.MapViewSelectorButtonSelected = true;
                    }
                    else
                    {
                        this.MapViewSelectorButtonSelected = false;
                    }
                }
            }
        }
Beispiel #10
0
 private void screen_OnMouseLeftDown(Point position)
 {
     if (this.screen.PeekUndoneWork().Kind == UndoneWorkKind.Frame)
     {
         if (this.OKButtonEnabled)
         {
             if (StaticMethods.PointInRectangle(position, this.okbuttonRectangle))
             {
                 this.OKButtonState = FrameButtonState.Pressed;
             }
             else
             {
                 this.OKButtonState = FrameButtonState.Normal;
             }
         }
         if (this.CancelButtonEnabled)
         {
             if (StaticMethods.PointInRectangle(position, this.cancelbuttonRectangle))
             {
                 this.CancelButtonState = FrameButtonState.Pressed;
             }
             else
             {
                 this.CancelButtonState = FrameButtonState.Normal;
             }
         }
         if ((this.frameContent.MapViewSelectorButtonEnabled && StaticMethods.PointInRectangle(position, this.mapviewselectorButtonRectangle)) && (this.frameContent.MapViewSelectorFunction != null))
         {
             this.frameContent.MapViewSelectorFunction();
         }
     }
 }