Exemplo n.º 1
0
 public override void Render()
 {
     if (disposing || !IsVisible())
     {
         return;
     }
     gradient.Render();
     Gorgon.CurrentRenderTarget.Rectangle(titleArea.X, titleArea.Y, titleArea.Width, titleArea.Height,
                                          Color.Black);
     base.Render();
     title.Render();
     if (closeButtonVisible)
     {
         closeButton.Render();
     }
 }
Exemplo n.º 2
0
        public override void Render() // Renders the main window
        {
            if (disposing || !IsVisible())
            {
                return;
            }
            gradient.Render();

            //TODO RenderTargetRectangle
            // CluwneLib.CurrentRenderTarget.Rectangle(titleArea.X, titleArea.Y, titleArea.Width, titleArea.Height, Color.Black);
            base.Render();
            title.Render();
            if (closeButtonVisible)
            {
                closeButton.Render();
            }
        }
Exemplo n.º 3
0
        public override void Render()
        {
            if (_items.Count > 0)
            {
                if (Selected < 0 || Selected > _items.Count - 1)
                {
                    Selected = 0;
                }
                else
                {
                    if (_selectionGlow != null)
                    {
                        _selectionGlow.Position =
                            new Point(
                                ClientArea.Left + (int)(ClientArea.Width / 2f - _selectionGlow.ClientArea.Width / 2f),
                                ClientArea.Top + (int)(ClientArea.Height / 2f - _selectionGlow.ClientArea.Height / 2f));
                        _selectionGlow.Render();
                    }

                    KeyValuePair <ImageButton, Object> selected = _items[Selected];
                    selected.Key.Position =
                        new Point(ClientArea.Left + (int)(ClientArea.Width / 2f - selected.Key.ClientArea.Width / 2f),
                                  ClientArea.Top + (int)(ClientArea.Height / 2f - selected.Key.ClientArea.Height / 2f));
                    if (FadeItems)
                    {
                        ctemp = Color.FromArgb(255, Color.White);
                    }
                    selected.Key.Color = new SFML.Graphics.Color(ctemp.R, ctemp.G, ctemp.B, ctemp.A);
                    selected.Key.Render();

                    int lastPosLeft  = selected.Key.ClientArea.Left - ItemSpacing;
                    int lastPosRight = selected.Key.ClientArea.Right + ItemSpacing;

                    for (int i = 1; i <= AdditionalColumns; i++)
                    {
                        float       alphaAdj  = 1 + AdditionalColumns - (AdditionalColumns / (float)i);
                        const float baseAlpha = 200;

                        //Left
                        if ((Selected - i) >= 0 && (Selected - i) <= _items.Count - 1)
                        {
                            KeyValuePair <ImageButton, Object> selectedLeft = _items[(Selected - i)];
                            selectedLeft.Key.Position = new Point(lastPosLeft - selectedLeft.Key.ClientArea.Width,
                                                                  ClientArea.Top +
                                                                  (int)
                                                                  (ClientArea.Height / 2f -
                                                                   selectedLeft.Key.ClientArea.Height / 2f));
                            lastPosLeft = selectedLeft.Key.ClientArea.Left - ItemSpacing;

                            if (FadeItems)
                            {
                                ctemp = Color.FromArgb((int)(baseAlpha / alphaAdj), Color.White);
                            }
                            selectedLeft.Key.Color = new SFML.Graphics.Color(ctemp.R, ctemp.G, ctemp.B, ctemp.A);

                            selectedLeft.Key.Render();
                        }

                        //Right
                        if ((Selected + i) >= 0 && (Selected + i) <= _items.Count - 1)
                        {
                            KeyValuePair <ImageButton, Object> selectedRight = _items[(Selected + i)];
                            selectedRight.Key.Position = new Point(lastPosRight,
                                                                   ClientArea.Top +
                                                                   (int)
                                                                   (ClientArea.Height / 2f -
                                                                    selectedRight.Key.ClientArea.Height / 2f));
                            lastPosRight = selectedRight.Key.ClientArea.Right + ItemSpacing;

                            if (FadeItems)
                            {
                                ctemp = Color.FromArgb((int)(baseAlpha / alphaAdj), Color.White);
                            }
                            selectedRight.Key.Color = new SFML.Graphics.Color(ctemp.R, ctemp.G, ctemp.B, ctemp.A);
                            selectedRight.Key.Render();
                        }
                    }
                }
            }

            if (ShowArrows)
            {
                _buttonLeft.Render();
                _buttonRight.Render();
            }

            //Gorgon.CurrentRenderTarget.Rectangle(ClientArea.X, ClientArea.Y, ClientArea.Width, ClientArea.Height, System.Drawing.Color.DarkOrange);
        }