Ejemplo n.º 1
0
    private static void TextBox()
    {
        // Contagem para a renderização da referência do último texto
        if (TextBox_Timer < Environment.TickCount)
        {
            TextBox_Timer    = Environment.TickCount + 500;
            TextBoxes.Signal = !TextBoxes.Signal;

            // Se necessário foca o digitalizador de novo
            TextBoxes.Focus();
        }

        // Chat
        if ((Chat.Text_Visible && !Panels.Get("Chat").Visible))
        {
            if (Chat_Timer < Environment.TickCount)
            {
                Chat.Text_Visible = false;
            }
        }
        else if (!Lists.Options.Chat)
        {
            Chat_Timer = Chat_Timer = Environment.TickCount + 10000;
        }
    }
        public PowerPoint.Shape ApplyRectOutlineEffect(PowerPoint.Shape imageShape, string overlayColor, int transparency)
        {
            TextBoxInfo tbInfo =
                new TextBoxes(Shapes.Range(), SlideWidth, SlideHeight)
                .GetTextBoxesInfo();

            if (tbInfo == null)
            {
                return(null);
            }

            TextBoxes.AddMargin(tbInfo, 10);

            PowerPoint.Shape overlayShape = ApplyOverlayEffect(overlayColor, transparency, tbInfo.Left, tbInfo.Top, tbInfo.Width,
                                                               tbInfo.Height);
            overlayShape.Fill.Visible = MsoTriState.msoFalse;
            overlayShape.Line.Visible = MsoTriState.msoTrue;

            ChangeName(overlayShape, EffectName.Banner);
            overlayShape.ZOrder(MsoZOrderCmd.msoSendToBack);
            if (imageShape != null)
            {
                imageShape.ZOrder(MsoZOrderCmd.msoSendToBack);
            }
            return(overlayShape);
        }
Ejemplo n.º 3
0
 private void Start()
 {
     isWaitingForFunction = null;
     instance             = this;
     // SendOkBox("Now, use your spell on the first enemy on your path.");
     // SendFctBox("Let's start by drawing a square function to reduce this square root.", "square");
 }
Ejemplo n.º 4
0
        public void TestTextPositionAndAlignment()
        {
            _designer.ApplyTextPositionAndAlignment(Position.Left, Alignment.Auto);
            var tbInfo = new TextBoxes(
                _contentSlide.Shapes.Range(),
                Pres.PageSetup.SlideWidth,
                Pres.PageSetup.SlideHeight)
                         .GetTextBoxesInfo();

            Assert.IsTrue(SlideUtil.IsRoughlySame(25f, tbInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(177.52f, tbInfo.Top));
            Assert.IsTrue(SlideUtil.IsRoughlySame(640.76f, tbInfo.Width));
            Assert.IsTrue(SlideUtil.IsRoughlySame(184.96f, tbInfo.Height));

            _designer.ApplyTextWrapping();
            tbInfo = new TextBoxes(
                _contentSlide.Shapes.Range(),
                Pres.PageSetup.SlideWidth,
                Pres.PageSetup.SlideHeight)
                     .GetTextBoxesInfo();
            Assert.IsTrue(SlideUtil.IsRoughlySame(25f, tbInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(119.2f, tbInfo.Top));
            Assert.IsTrue(SlideUtil.IsRoughlySame(418.505035f, tbInfo.Width));
            Assert.IsTrue(SlideUtil.IsRoughlySame(243.279984f, tbInfo.Height));
        }
Ejemplo n.º 5
0
        public void TestTextPositionAndAlignment()
        {
            _designer.ApplyTextPositionAndAlignment(Position.Left, Alignment.Auto);
            var tbInfo = new TextBoxes(
                _contentSlide.Shapes.Range(),
                Pres.PageSetup.SlideWidth,
                Pres.PageSetup.SlideHeight)
                         .GetTextBoxesInfo();

            Assert.IsTrue(SlideUtil.IsRoughlySame(25f, tbInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(159.559921f, tbInfo.Top));
            Assert.IsTrue(SlideUtil.IsRoughlySame(640.76f, tbInfo.Width));
            Assert.IsTrue(SlideUtil.IsRoughlySame(220.880081f, tbInfo.Height));

            _designer.ApplyTextWrapping();
            tbInfo = new TextBoxes(
                _contentSlide.Shapes.Range(),
                Pres.PageSetup.SlideWidth,
                Pres.PageSetup.SlideHeight)
                     .GetTextBoxesInfo();
            Assert.IsTrue(SlideUtil.IsRoughlySame(25f, tbInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(101.239922f, tbInfo.Top));
            Assert.IsTrue(SlideUtil.IsRoughlySame(418.505035f, tbInfo.Width));
            Assert.IsTrue(SlideUtil.IsRoughlySame(279.200073f, tbInfo.Height));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// CalculateButtonClick Method occurs when the draw button is pressed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DrawButtonClick(object sender, RoutedEventArgs e)
        {
            try
            {
                if (TextBoxes.All(t => t.TextBox.Text != ""))
                {
                    N  = int.Parse(TextBoxes[0].TextBox.Text);
                    X0 = int.Parse(TextBoxes[1].TextBox.Text);
                    ExtractEquation();

                    if (Diagram != null && Diagram.Polyline != null)
                    {
                        Diagram.Polyline.Points = null;
                        SinusDiagram            = null;
                        DrawSinusDiagram();
                    }
                    Diagram = new Diagram(ScrollViewers[0].Grid, Equation, EquationType.TaylorSeries,
                                          int.Parse(TextBoxes[0].TextBox.Text), int.Parse(TextBoxes[1].TextBox.Text),
                                          SinusDiagram);

                    ScrollViewers[0].ScrollViewer.Content = ScrollViewers[0].Grid;
                }
            }
            catch (Exception exception) { MessageBox.Show(exception.Message); TextBoxes.All(t => t.TextBox.Text == ""); }
        }
Ejemplo n.º 7
0
    private static void JoinGame()
    {
        // Reseta os valores
        Chat.Order                 = new System.Collections.Generic.List <Chat.Structure>();
        Chat.Lines_First           = 0;
        Loop.Chat_Timer            = Environment.TickCount + Chat.Sleep_Timer;
        TextBoxes.Get("Chat").Text = string.Empty;
        CheckBoxes.Get("Options_Sounds").Checked = Lists.Options.Sounds;
        CheckBoxes.Get("Options_Musics").Checked = Lists.Options.Musics;
        CheckBoxes.Get("Options_Chat").Checked   = Lists.Options.Chat;
        Game.Need_Information = 0;
        Loop.Chat_Timer       = Loop.Chat_Timer = Environment.TickCount + 10000;
        Player.Me.Party       = new byte[0];

        // Fecha os paineis
        Panels.Get("Menu_Character").Visible   = false;
        Panels.Get("Menu_Inventory").Visible   = false;
        Panels.Get("Menu_Options").Visible     = false;
        Panels.Get("Chat").Visible             = false;
        Panels.Get("Drop").Visible             = false;
        Panels.Get("Party_Invitation").Visible = false;

        // Abre o jogo
        Audio.Music.Stop();
        Tools.CurrentWindow = Tools.Windows.Game;
    }
Ejemplo n.º 8
0
 public void TestGetTextBoxInfoForEmptyTextBoxes()
 {
     Microsoft.Office.Interop.PowerPoint.ShapeRange shapes = PpOperations.SelectShapesByPrefix("TextBox");
     TextBoxes textBoxes = new TextBoxes(shapes, 
         Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight);
     TextBoxInfo textBoxInfo = textBoxes.GetTextBoxesInfo();
     Assert.AreEqual(null, textBoxInfo);
 }
Ejemplo n.º 9
0
 public static void OnKeyPressed(object sender, KeyEventArgs e)
 {
     // Define se um botão está sendo pressionado
     switch (e.Code)
     {
     case Keyboard.Key.Tab: TextBoxes.ChangeFocus(); return;
     }
 }
Ejemplo n.º 10
0
        public void TestStartBoxing()
        {
            PpOperations.SelectSlide(2);
            var shapes    = PpOperations.SelectShapesByPrefix("TextBox");
            var textBoxes = new TextBoxes(shapes,
                                          Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight);

            textBoxes
            .SetAlignment(Alignment.Centre)
            .SetPosition(Position.Left)
            .StartBoxing();
            var textBoxInfo = textBoxes.GetTextBoxesInfo();

            Assert.IsTrue(SlideUtil.IsRoughlySame(241.439987f, textBoxInfo.Height));
            Assert.IsTrue(SlideUtil.IsRoughlySame(25f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(149.279953f, textBoxInfo.Top));
            Assert.IsTrue(SlideUtil.IsRoughlySame(710.945068f, textBoxInfo.Width));

            textBoxes
            .SetAlignment(Alignment.Centre)
            .SetPosition(Position.Centre)
            .StartBoxing();
            textBoxInfo = textBoxes.GetTextBoxesInfo();
            Assert.IsTrue(SlideUtil.IsRoughlySame(124.527481f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(149.279953f, textBoxInfo.Top));

            textBoxes
            .SetAlignment(Alignment.Centre)
            .SetPosition(Position.BottomLeft)
            .StartBoxing();
            textBoxInfo = textBoxes.GetTextBoxesInfo();
            Assert.IsTrue(SlideUtil.IsRoughlySame(25f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(273.559875f, textBoxInfo.Top));

            textBoxes
            .SetAlignment(Alignment.Centre)
            .SetPosition(Position.Bottom)
            .StartBoxing();
            textBoxInfo = textBoxes.GetTextBoxesInfo();
            Assert.IsTrue(SlideUtil.IsRoughlySame(124.527481f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(273.560028f, textBoxInfo.Top));

            textBoxes
            .SetAlignment(Alignment.Centre)
            .SetPosition(Position.Right)
            .StartBoxing();
            textBoxInfo = textBoxes.GetTextBoxesInfo();
            Assert.IsTrue(SlideUtil.IsRoughlySame(224.054962f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(149.279953f, textBoxInfo.Top));

            textBoxes
            .SetAlignment(Alignment.Auto)
            .SetPosition(Position.Original)
            .StartBoxing();
            textBoxInfo = textBoxes.GetTextBoxesInfo();
            Assert.IsTrue(SlideUtil.IsRoughlySame(68.2f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(52.17752f, textBoxInfo.Top));
        }
Ejemplo n.º 11
0
 public SetupLevel(GraphicsDevice device)
     : base()
 {
     TextBoxes.Add(new TextBox(new Vector2(10, 10), false, true, "MAP WIDTH: ", 0));
     TextBoxes.Add(new TextBox(new Vector2(10, 50), false, true, "MAP HEIGHT: ", 1));
     TextBoxes.Add(new TextBox(new Vector2(10, 90), false, true, "TILE SIZE: ", 2));
     TextBoxes.Add(new TextBox(new Vector2(10, 120), true, false, "TILESET PATH: ", 3));
     Buttons.Add(new Button(new Vector2(10 + 64, 350), () => FinishCreatingMap(device), "CREATE MAP", ""));
 }
Ejemplo n.º 12
0
    private static void Connect_Ok()
    {
        // Salva o nome do usuário
        Lists.Options.Username = TextBoxes.Get("Connect_Username").Text;
        Write.Options();

        // Conecta-se ao jogo
        Game.SetSituation(Game.Situations.Connect);
    }
Ejemplo n.º 13
0
        public void TestGetTextBoxInfoForEmptyTextBoxes()
        {
            var shapes    = PpOperations.SelectShapesByPrefix("TextBox");
            var textBoxes = new TextBoxes(shapes,
                                          Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight);
            var textBoxInfo = textBoxes.GetTextBoxesInfo();

            Assert.AreEqual(null, textBoxInfo);
        }
Ejemplo n.º 14
0
 public Editor()
     : base()
 {
     Globals.currentTileset.RefreshTileset();
     TextBoxes.Clear();
     Buttons.Clear();
     Buttons.Add(new Button(new Vector2(660, 50), AddLayer, AssetManager.addButton, "Add new layer"));
     TextBoxes.Add(new TextBox(new Vector2(50, 430), true, false, " | SAVE PATH: ", 0));
     Buttons.Add(new Button(new Vector2(AssetManager.font.MeasureString("SAVE").X / 2, 430 + AssetManager.font.MeasureString("SAVE").Y / 2), SaveMap, "SAVE", "SAVES MAP TO PATH"));
 }
Ejemplo n.º 15
0
        public void Init()
        {
            Shapes.Add(new CPShape("Line"));
            Shapes.Add(new CPShape("ArrowLine"));
            Shapes.Add(new CPShape("BlockLine"));
            Shapes.Add(new CPShape("Square"));
            Shapes.Add(new CPShape("Circle"));

            TextBoxes.Add(new CPTextBox("Bubble"));
        }
Ejemplo n.º 16
0
    public static void Register()
    {
        NetOutgoingMessage Data = Socket.Device.CreateMessage();

        // Envia os dados
        Data.Write((byte)Packets.Register);
        Data.Write(TextBoxes.Get("Register_Username").Text);
        Data.Write(TextBoxes.Get("Register_Password").Text);
        Packet(Data);
    }
Ejemplo n.º 17
0
    public static void Connect()
    {
        NetOutgoingMessage Data = Socket.Device.CreateMessage();

        // Envia os dados
        Data.Write((byte)Packets.Connect);
        Data.Write(TextBoxes.Get("Connect_Username").Text);
        Data.Write(TextBoxes.Get("Connect_Password").Text);
        Data.Write(false); // Acesso pelo cliente
        Packet(Data);
    }
Ejemplo n.º 18
0
    public static void CreateCharacter()
    {
        NetOutgoingMessage Data = Socket.Device.CreateMessage();

        // Envia os dados
        Data.Write((byte)Packets.CreateCharacter);
        Data.Write(TextBoxes.Get("CreateCharacter_Name").Text);
        Data.Write(Game.CreateCharacter_Class);
        Data.Write(CheckBoxes.Get("GenderMale").Checked);
        Data.Write(Game.CreateCharacter_Tex);
        Packet(Data);
    }
Ejemplo n.º 19
0
    private static void TextBox()
    {
        // Contagem para a renderização da referência do último texto
        if (TextBox_Timer < Environment.TickCount)
        {
            TextBox_Timer    = Environment.TickCount + 500;
            TextBoxes.Signal = !TextBoxes.Signal;

            // Se necessário foca o digitalizador de novo
            TextBoxes.Focus();
        }
    }
Ejemplo n.º 20
0
    private static void Register_Ok()
    {
        // Regras de segurança
        if (TextBoxes.Get("Register_Password").Text != TextBoxes.Get("Register_Password2").Text)
        {
            MessageBox.Show("The password don't match.");
            return;
        }

        // Registra o jogador, se estiver tudo certo
        Game.SetSituation(Game.Situations.Registrar);
    }
Ejemplo n.º 21
0
    private static void CreateCharacter()
    {
        // Reseta os valores
        TextBoxes.Get("CreateCharacter_Name").Text = string.Empty;
        CheckBoxes.Get("GenderMale").Checked       = true;
        CheckBoxes.Get("GenderFemale").Checked     = false;
        Game.CreateCharacter_Class = 1;
        Game.CreateCharacter_Tex   = 0;

        // Abre o painel de criação de personagem
        Panels.Menu_Close();
        Panels.Get("CreateCharacter").Visible = true;
    }
Ejemplo n.º 22
0
        public void TestStartBoxing()
        {
            PpOperations.SelectSlide(2);
            Microsoft.Office.Interop.PowerPoint.ShapeRange shapes = PpOperations.SelectShapesByPrefix("TextBox");
            TextBoxes textBoxes = new TextBoxes(shapes,
                                                Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight);

            textBoxes
            .SetAlignment(Alignment.Centre)
            .SetPosition(Position.Left)
            .StartBoxing();
            TextBoxInfo textBoxInfo = textBoxes.GetTextBoxesInfo();

            Assert.IsTrue(SlideUtil.IsRoughlySame(57.5200043f, textBoxInfo.Height));
            Assert.IsTrue(SlideUtil.IsRoughlySame(25f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(241.240036f, textBoxInfo.Top));
            Assert.IsTrue(SlideUtil.IsRoughlySame(710.945068f, textBoxInfo.Width));

            textBoxes
            .SetAlignment(Alignment.Centre)
            .SetPosition(Position.Centre)
            .StartBoxing();
            textBoxInfo = textBoxes.GetTextBoxesInfo();
            Assert.IsTrue(SlideUtil.IsRoughlySame(124.527481f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(241.240036f, textBoxInfo.Top));

            textBoxes
            .SetAlignment(Alignment.Centre)
            .SetPosition(Position.BottomLeft)
            .StartBoxing();
            textBoxInfo = textBoxes.GetTextBoxesInfo();
            Assert.IsTrue(SlideUtil.IsRoughlySame(25f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(457.480042f, textBoxInfo.Top));

            textBoxes
            .SetAlignment(Alignment.Centre)
            .SetPosition(Position.Bottom)
            .StartBoxing();
            textBoxInfo = textBoxes.GetTextBoxesInfo();
            Assert.IsTrue(SlideUtil.IsRoughlySame(124.527481f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(457.480042f, textBoxInfo.Top));

            textBoxes
            .SetAlignment(Alignment.Centre)
            .SetPosition(Position.Right)
            .StartBoxing();
            textBoxInfo = textBoxes.GetTextBoxesInfo();
            Assert.IsTrue(SlideUtil.IsRoughlySame(224.054962f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(241.23996f, textBoxInfo.Top));
        }
Ejemplo n.º 23
0
        private TextBox AddTextboxes(int nrOfExercises)
        {
            TextBoxes      tbs   = new TextBoxes();
            List <TextBox> boxes = tbs.createTextBoxes(nrOfExercises);

            for (int i = 0; i < boxes.Count; i++)
            {
                this.Controls.Add(boxes[i]);
            }



            return(tb);
        }
Ejemplo n.º 24
0
    private static void Drop_Confirm()
    {
        // Quantidade
        short.TryParse(TextBoxes.Get("Drop_Amount").Text, out short Amount);

        // Verifica se o valor digitado é válidp
        if (Amount == 0)
        {
            MessageBox.Show("Enter a valid value!");
            return;
        }

        // Solta o item
        Send.DropItem(Game.Drop_Slot, Amount);
        Panels.Get("Drop").Visible = false;
    }
Ejemplo n.º 25
0
        public void ApplyPseudoTextWhenNoTextShapes()
        {
            var isTextShapesEmpty = new TextBoxes(
                Shapes.Range(), SlideWidth, SlideHeight)
                                    .IsTextShapesEmpty();

            if (!isTextShapesEmpty)
            {
                return;
            }

            try
            {
                if (_slide.Layout == PowerPoint.PpSlideLayout.ppLayoutBlank)
                {
                    _slide.Layout = PowerPoint.PpSlideLayout.ppLayoutTitleOnly;
                }
                Shapes.AddTitle().TextFrame2.TextRange.Text = "Picture Slides Lab";
            }
            catch
            {
                // title already exist
                foreach (PowerPoint.Shape shape in Shapes)
                {
                    try
                    {
                        if (shape.Type != MsoShapeType.msoPlaceholder)
                        {
                            continue;
                        }

                        switch (shape.PlaceholderFormat.Type)
                        {
                        case PowerPoint.PpPlaceholderType.ppPlaceholderTitle:
                        case PowerPoint.PpPlaceholderType.ppPlaceholderCenterTitle:
                        case PowerPoint.PpPlaceholderType.ppPlaceholderVerticalTitle:
                            shape.TextFrame2.TextRange.Text = "Picture Slides Lab";
                            break;
                        }
                    }
                    catch (Exception e)
                    {
                        Logger.LogException(e, "ApplyPseudoTextWhenNoTextShapes");
                    }
                }
            }
        }
        public Shape ApplyFrostedGlassBannerEffect(BannerDirection direction, Position textPos, Shape blurImage,
                                                   string overlayColor, int transparency)
        {
            TextBoxInfo tbInfo =
                new TextBoxes(Shapes.Range(), SlideWidth, SlideHeight)
                .GetTextBoxesInfo();

            if (tbInfo == null)
            {
                return(null);
            }

            TextBoxes.AddMargin(tbInfo);

            Shape overlayShape;
            Shape blurBanner = blurImage.Duplicate()[1];

            blurBanner.Left = blurImage.Left;
            blurBanner.Top  = blurImage.Top;
            direction       = HandleAutoDirection(direction, textPos);
            switch (direction)
            {
            case BannerDirection.Horizontal:
                overlayShape = ApplyOverlayEffect(overlayColor, transparency, 0, tbInfo.Top, SlideWidth,
                                                  tbInfo.Height);
                CropPicture(blurBanner, 0, tbInfo.Top, SlideWidth, tbInfo.Height);
                break;

            // case BannerDirection.Vertical:
            default:
                overlayShape = ApplyOverlayEffect(overlayColor, transparency, tbInfo.Left, 0, tbInfo.Width,
                                                  SlideHeight);
                CropPicture(blurBanner, tbInfo.Left, 0, tbInfo.Width, SlideHeight);
                break;
            }
            ChangeName(overlayShape, EffectName.Banner);
            ChangeName(blurBanner, EffectName.Banner);
            overlayShape.ZOrder(MsoZOrderCmd.msoSendToBack);
            Utils.ShapeUtil.MoveZToJustBehind(blurBanner, overlayShape);

            Microsoft.Office.Interop.PowerPoint.ShapeRange range = Shapes.Range(new[] { blurBanner.Name, overlayShape.Name });
            Shape resultShape = range.Group();

            ChangeName(resultShape, EffectName.Banner);
            return(resultShape);
        }
Ejemplo n.º 27
0
 private void FillinTextBoxes(UIElementCollection elementCollection)
 {
     try
     {
         foreach (var element in elementCollection)
         {
             if (element.GetType() == new TextBox().GetType())
             {
                 TextBoxes.Add((UIElement)element);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 28
0
        public void TestGetTextBoxInfo()
        {
            PpOperations.SelectSlide(2);
            Microsoft.Office.Interop.PowerPoint.ShapeRange shapes = PpOperations.SelectShapesByPrefix("TextBox");
            TextBoxes textBoxes = new TextBoxes(shapes,
                                                Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight);
            TextBoxInfo textBoxInfo = textBoxes.GetTextBoxesInfo();

            Assert.IsTrue(SlideUtil.IsRoughlySame(57.5200043f, textBoxInfo.Height));
            Assert.IsTrue(SlideUtil.IsRoughlySame(68.2f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(52.17752f, textBoxInfo.Top));
            Assert.IsTrue(SlideUtil.IsRoughlySame(710.945068f, textBoxInfo.Width));

            TextBoxes.AddMargin(textBoxInfo, 25);
            Assert.IsTrue(SlideUtil.IsRoughlySame(107.520004f, textBoxInfo.Height));
            Assert.IsTrue(SlideUtil.IsRoughlySame(43.1999969f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(27.17752f, textBoxInfo.Top));
            Assert.IsTrue(SlideUtil.IsRoughlySame(760.945068f, textBoxInfo.Width));
        }
Ejemplo n.º 29
0
        private PowerPoint.Shape ApplyCircleBannerEffect(string overlayColor, int transparency,
                                                         bool isOutline = false, int margin = 0)
        {
            TextBoxInfo tbInfo =
                new TextBoxes(Shapes.Range(), SlideWidth, SlideHeight)
                .GetTextBoxesInfo();

            if (tbInfo == null)
            {
                return(null);
            }

            TextBoxes.AddMargin(tbInfo, margin);

            PowerPoint.Shape overlayShape = ApplyCircleOverlayEffect(overlayColor, transparency, tbInfo.Left, tbInfo.Top, tbInfo.Width,
                                                                     tbInfo.Height, isOutline);
            ChangeName(overlayShape, EffectName.Banner);
            return(overlayShape);
        }
Ejemplo n.º 30
0
        public void TestGetTextBoxInfo()
        {
            PpOperations.SelectSlide(2);
            var shapes    = PpOperations.SelectShapesByPrefix("TextBox");
            var textBoxes = new TextBoxes(shapes,
                                          Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight);
            var textBoxInfo = textBoxes.GetTextBoxesInfo();

            Assert.IsTrue(SlideUtil.IsRoughlySame(348.4239f, textBoxInfo.Height));
            Assert.IsTrue(SlideUtil.IsRoughlySame(68.2f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(52.17752f, textBoxInfo.Top));
            Assert.IsTrue(SlideUtil.IsRoughlySame(741.0565f, textBoxInfo.Width));

            TextBoxes.AddMargin(textBoxInfo, 25);
            Assert.IsTrue(SlideUtil.IsRoughlySame(398.4239f, textBoxInfo.Height));
            Assert.IsTrue(SlideUtil.IsRoughlySame(43.1999969f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(27.17752f, textBoxInfo.Top));
            Assert.IsTrue(SlideUtil.IsRoughlySame(791.0565f, textBoxInfo.Width));
        }