Exemplo n.º 1
0
        private void menuItem_Click(object sender, EventArgs e)
        {
            this.panelBar.BeginUpdate();
            this.panelBar.SuspendLayout();
            RadAssociatedMenuItem item = sender as RadAssociatedMenuItem;

            if (item.IsChecked)
            {
                BoxLayout layout = new BoxLayout();

                this.panelBar.Items.Insert(0, item.group);
                this.panelBar.Items.Owner = layout;

                this.panelBar.hiddenGroupsList.Remove(item.group);

                if (item.group.Visibility == ElementVisibility.Collapsed)
                {
                    InsertToggleButton(item.group);
                }
            }
            else
            {
                this.panelBar.Items.Remove(item.group);
                item.group.Items.Owner = item.group.verticalLayout;
                this.panelBar.hiddenGroupsList.Add(item.group);
                RemoveToggleButton(item.group);
            }

            this.panelBar.SetStyle();
            this.panelBar.EndUpdate();
            this.panelBar.ResumeLayout(true);
        }
Exemplo n.º 2
0
        protected override byte[] GetFinalData()
        {
            BoxLayout.SaveBattleTeams();
            SetChecksums();
            var result = MemeCrypto.Resign7(Data);

            Debug.Assert(result != Data);
            return(result);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Sets a BoxComponent to the BubbleContainer header
 /// </summary>
 /// <param name="boxLayout">
 /// The placement style of components in this box. Specify one of the following values
 /// </param>
 /// <param name="self">BubbleContainer</param>
 /// <param name="flex">
 /// The ratio of the width or height of this box within the parent box.
 /// The default value for the horizontal parent box is 1, and the default value for the vertical parent box is 0.
 /// </param>
 /// <param name="spacing">
 /// Minimum space between components in this box.
 /// You can specify one of the following values: none, xs, sm, md, lg, xl, or xxl.
 /// none does not set a space while the other values set a space whose size increases in the order of listing. <para>
 /// The default value is none.
 /// To override this setting for a specific component, set the margin property of that component.</para>
 /// </param>
 /// <param name="margin">
 /// Minimum space between this box and the previous component in the parent box.
 /// You can specify one of the following values: none, xs, sm, md, lg, xl, or xxl.
 /// none does not set a space while the other values set a space whose size increases in the order of listing. <para>
 /// The default value is the value of the spacing property of the parent box.
 /// If this box is the first component in the parent box, the margin property will be ignored.</para>
 /// </param>
 /// <returns>BoxContainer</returns>
 public static BubbleContainer SetHeader(this BubbleContainer self, BoxLayout boxLayout,
                                         int?flex = null, string?spacing = null, string?margin = null)
 {
     self.Header = new BoxComponent(boxLayout)
     {
         Flex    = flex,
         Spacing = spacing,
         Margin  = margin
     };
     return(self);
 }
Exemplo n.º 4
0
 protected Workflow(SerializationInfo info, StreamingContext context)
 {
     m_Name               = info.GetString("m_Name");
     m_Id                 = info.GetString("m_Id");
     m_Description        = info.GetString("m_Description");
     m_HardwareSetup      = (HardwareSetup)info.GetValue("m_HardwareSetup", typeof(HardwareSetup));
     m_WorkingsSteps      = (AsyncObservableCollection <WorkingStep>)info.GetValue("m_WorkingsSteps", typeof(AsyncObservableCollection <WorkingStep>));
     m_BoxLayout          = (BoxLayout)info.GetValue("m_BoxLayout", typeof(BoxLayout));
     m_ObjectZoneLayout   = (ObjectDetectionZonesLayout)info.GetValue("m_ObjectZoneLayout", typeof(ObjectDetectionZonesLayout));
     m_AssemblyZoneLayout = (AssemblyZoneLayout)info.GetValue("m_AssemblyZoneLayout", typeof(AssemblyZoneLayout));
 }
Exemplo n.º 5
0
        protected void ReloadBattleTeams()
        {
            var demo = this is SAV7SM && new ReadOnlySpan <byte>(Data, BoxLayout.Offset, 0x4C4).IsRangeEmpty(); // up to Battle Box values

            if (demo || !State.Exportable)
            {
                BoxLayout.ClearBattleTeams();
            }
            else // Valid slot locking info present
            {
                BoxLayout.LoadBattleTeams();
            }
        }
Exemplo n.º 6
0
        private void ReloadBattleTeams()
        {
            var demo = this is SAV7SM && Data.Skip(PCLayout).Take(0x4C4).All(z => z == 0); // up to Battle Box values

            if (demo || !Exportable)
            {
                BoxLayout.ClearBattleTeams();
            }
            else // Valid slot locking info present
            {
                BoxLayout.LoadBattleTeams();
            }
        }
Exemplo n.º 7
0
        protected void ReloadBattleTeams()
        {
            var demo = this is SAV7SM && Data.IsRangeAll((byte)0, BoxLayout.Offset, 0x4C4); // up to Battle Box values

            if (demo || !Exportable)
            {
                BoxLayout.ClearBattleTeams();
            }
            else // Valid slot locking info present
            {
                BoxLayout.LoadBattleTeams();
            }
        }
Exemplo n.º 8
0
        public void BoxLayout_Test_single_node_padding()
        {
            var layout = new BoxLayout();

            layout.Root = new Container(Direction.BottomToTop);
            var root = layout.Root;
            var n1   = root.AddBox(10, 5);

            root.PaddingBottom = 1.0;
            root.PaddingLeft   = 1.0;
            root.PaddingRight  = 1.0;
            root.PaddingTop    = 1.0;

            layout.PerformLayout();
            double delta = 0.00000001;

            AssertUtil.AreEqual((1.0, 1.0, 11, 6), n1.Rectangle, delta);
        }
Exemplo n.º 9
0
        static Actor CreateMenuActor(Actor scroll)
        {
            var menu          = new Actor();
            var layoutManager = new BoxLayout();

            layoutManager.Orientation = Orientation.Vertical;
            layoutManager.Spacing     = 12;

            menu.LayoutManager   = layoutManager;
            menu.BackgroundColor = Clutter.Color.New(0, 0, 0, 255);

            foreach (var s in menuItemsName)
            {
                menu.AddChild(CreateMenuItem(s));
            }

            return(menu);
        }
Exemplo n.º 10
0
        public static void Render(BoxLayout layout, Microsoft.Office.Interop.Visio.Document doc)
        {
            layout.PerformLayout();
            var page1 = doc.Pages.Add();
            // and tinker with it
            // render
            var nodes = layout.Nodes.ToList();

            foreach (var node in nodes)
            {
                var shape = page1.DrawRectangle(node.Rectangle);
                node.Data = shape;
            }

            var root_shape = (Microsoft.Office.Interop.Visio.Shape)layout.Root.Data;

            root_shape.CellsU["FillForegnd"].FormulaForceU = "rgb(240,240,240)";
            var margin = new VisioAutomation.Drawing.Size(0.5, 0.5);

            page1.ResizeToFitContents(margin);
        }
Exemplo n.º 11
0
 protected override void CreateChildElements()
 {
     base.CreateChildElements();
     this.layout             = new BoxLayout();
     this.layout.Orientation = Orientation.Vertical;
     this.Children.Add((RadElement)this.layout);
     this.arrowButtonUp = new RadRepeatArrowElement();
     this.arrowButtonUp.StretchVertically = false;
     this.arrowButtonUp.Direction         = Telerik.WinControls.ArrowDirection.Up;
     this.arrowButtonUp.Border.Visibility = ElementVisibility.Hidden;
     this.arrowButtonUp.Size = new Size(10, 6);
     this.layout.Children.Add((RadElement)this.arrowButtonUp);
     this.arrowButtonUp.BorderThickness = new Padding(0);
     this.arrowButtonDown = new RadRepeatArrowElement();
     this.arrowButtonDown.StretchVertically = false;
     this.arrowButtonDown.Direction         = Telerik.WinControls.ArrowDirection.Down;
     this.arrowButtonDown.Border.Visibility = ElementVisibility.Hidden;
     this.arrowButtonDown.Size = new Size(10, 6);
     this.layout.Children.Add((RadElement)this.arrowButtonDown);
     this.arrowButtonDown.BorderThickness = new Padding(0);
 }
Exemplo n.º 12
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();

            BoxLayout boxLayout = new BoxLayout();

            StackLayoutPanel stack = new StackLayoutPanel();

            stack.Orientation         = Orientation.Horizontal;
            stack.Margin              = new System.Windows.Forms.Padding(0, 0, 2, 0);
            stack.StretchHorizontally = false;
            stack.SetValue(BoxLayout.StripPositionProperty, BoxLayout.StripPosition.Last);

            for (int i = 0; i < 8; i++)
            {
                LightVisualElement element = new LightVisualElement();
                stack.Children.Add(element);

                element.MinSize           = new Size(13, 0);
                element.DrawFill          = true;
                element.GradientStyle     = GradientStyles.Solid;
                element.Margin            = new System.Windows.Forms.Padding(0, 2, 0, 2);
                element.DrawBorder        = true;
                element.BorderBoxStyle    = Telerik.WinControls.BorderBoxStyle.FourBorders;
                element.BorderLeftWidth   = 0;
                element.BorderLeftColor   = Color.White;
                element.BorderRightColor  = Color.White;
                element.BorderTopColor    = Color.White;
                element.BorderBottomColor = Color.White;
                if (i == 0)
                {
                    element.BorderLeftWidth = 1;
                    element.MinSize         = new Size(14, 10);
                }
                boxes[i] = element;
            }

            boxLayout.Children.Add(stack);
            this.Children.Add(boxLayout);
        }
Exemplo n.º 13
0
        protected override void CreateChildElements()
        {
            DockLayoutPanel parentStripLayout = new DockLayoutPanel();

            this.stripLayout = new BoxLayout();
            this.stripLayout.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren;
            this.stripLayout.Orientation  = System.Windows.Forms.Orientation.Horizontal;
            this.stripLayout.Class        = "overFlowLayout";

            this.overFlowBorder = new BorderPrimitive();
            this.overFlowBorder.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.overFlowBorder.Class        = "overFlowBorder";

            this.overFlowFill = new FillPrimitive();
            this.overFlowFill.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;
            this.overFlowFill.Class        = "overFlowFill";
            this.overFlowFill.MinSize      = new System.Drawing.Size(20, 20);

            this.dropDownButton = new RadDropDownButtonElement();

            this.Children.Add(this.overFlowFill);
            this.Children.Add(this.overFlowBorder);
            this.Children.Add(parentStripLayout);

            this.dropDownButton.ArrowButton.Arrow.AutoSize = true;
            this.stripLayout.RightToLeft            = true;
            this.dropDownButton.StretchHorizontally = false;
            this.dropDownButton.StretchVertically   = false;
            this.dropDownButton.Alignment           = ContentAlignment.MiddleRight;
            this.dropDownButton.Margin              = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.dropDownButton.MinSize             = new Size(16, 16);
            this.dropDownButton.ArrowButton.MinSize = new Size(16, 16);
            this.dropDownButton.SetValue(DockLayoutPanel.DockProperty, Dock.Right);
            parentStripLayout.Children.Add(this.dropDownButton);
            parentStripLayout.Children.Add(this.stripLayout);

            this.items.Owner = this.stripLayout;
        }
Exemplo n.º 14
0
        public void BoxLayout_Test_empty()
        {
            var layout = new BoxLayout();

            layout.Root = new Container(Direction.BottomToTop);
            Assert.IsNotNull(layout.Root);

            bool thrown = false;

            try
            {
                layout.PerformLayout();
            }
            catch (System.ArgumentException)
            {
                thrown = true;
            }

            if (!thrown)
            {
                Assert.Fail();
            }
        }
Exemplo n.º 15
0
        /// <summary>
        /// create child elements
        /// </summary>
        protected override void CreateChildElements()
        {
            this.textItem = new RadTextBoxItem();
            this.SetSpinValue(this.value, true);

            this.textItem.TextChanging             += new TextChangingEventHandler(textItem_TextChanging);
            this.textItem.TextChanged              += new EventHandler(textItem_TextChanged);
            this.textItem.LostFocus                += new EventHandler(textItem_LostFocus);
            this.textItem.KeyPress                 += new KeyPressEventHandler(textItem_KeyPress);
            this.textItem.KeyDown                  += new KeyEventHandler(textItem_KeyDown);
            this.textItem.KeyUp                    += new KeyEventHandler(textItem_KeyUp);
            this.textItem.HostedControl.MouseWheel += new MouseEventHandler(textItem_MouseWheel);
            this.textItem.HostedControl.MouseUp    += new MouseEventHandler(HostedControl_MouseUp);
            this.textItem.Alignment                 = ContentAlignment.MiddleLeft;
            this.textItem.StretchHorizontally       = true;
            this.textItem.StretchVertically         = false;

            this.buttonUp           = new RadRepeatArrowElement();
            this.buttonUp.ThemeRole = "UpButton";
            this.buttonUp.Class     = "UpButton";
            //hack!!!!!!!!!!!!
            this.buttonUp.Padding = new Padding(1, 0, 3, 2);
            //this.buttonUp.Margin = new Padding(0, 1, 1, 0);
            //this.buttonUp.Border.Visibility = ElementVisibility.Collapsed;
            this.buttonUp.Click         += new EventHandler(ButtonUp_Click);
            this.buttonUp.DoubleClick   += new EventHandler(ButtonUp_Click);
            this.buttonUp.Direction      = ArrowDirection.Up;
            this.buttonUp.Arrow.AutoSize = true;

            this.buttonDown           = new RadRepeatArrowElement();
            this.buttonDown.ThemeRole = "DownButton";
            this.buttonDown.Class     = "DownButton";
            //hack!!!!!!!!!!!!
            this.buttonDown.Padding = new Padding(1, 1, 3, 1);
            //this.buttonDown.Margin = new Padding(0, 0, 1, 1);
            //this.buttonDown.Border.Visibility = ElementVisibility.Collapsed;
            this.buttonDown.Click         += new EventHandler(ButtonDown_Click);
            this.buttonDown.DoubleClick   += new EventHandler(ButtonDown_Click);
            this.buttonDown.Arrow.AutoSize = true;
            this.buttonDown.Direction      = ArrowDirection.Down;
            this.stackLayout             = new BoxLayout();
            this.stackLayout.Orientation = Orientation.Vertical;
            BoxLayout.SetProportion(this.buttonUp, 1);
            BoxLayout.SetProportion(this.buttonDown, 1);
            this.stackLayout.Children.Add(this.buttonUp);
            this.stackLayout.Children.Add(this.buttonDown);

            this.textBoxFillPrimitive                = new FillPrimitive();
            this.textBoxFillPrimitive.Class          = "SpinElementFill";
            this.textBoxFillPrimitive.NumberOfColors = 1;
            this.textBoxFillPrimitive.MouseDown     += delegate { this.textItem.Focus(); };
            this.Children.Add(this.textBoxFillPrimitive);
            //this.textBoxFillPrimitive.BackColor = this.textItem.BackColor;

            this.dockLayout = new DockLayoutPanel();
            this.dockLayout.LastChildFill = true;

            if (!this.RightToLeft)
            {
                DockLayoutPanel.SetDock(stackLayout, Dock.Right);
            }
            else
            {
                DockLayoutPanel.SetDock(stackLayout, Dock.Left);
            }

            DockLayoutPanel.SetDock(this.textBoxFillPrimitive, Dock.Bottom);
            DockLayoutPanel.SetDock(this.textItem, Dock.Top);

            dockLayout.Children.Add(stackLayout);
            dockLayout.Children.Add(this.textItem);

            this.border       = new BorderPrimitive();
            this.border.Class = "SpinElementBorder";
            this.Children.Add(border);
            this.Children.Add(dockLayout);

            this.textItem.BindProperty(TextPrimitive.TextProperty, this, TextProperty, PropertyBindingOptions.TwoWay);

            this.textItem.Multiline     = false;
            this.textItem.RouteMessages = false;
            this.StretchVertically      = false;
        }
Exemplo n.º 16
0
        private static BoxLayout CreateTwoLevelLayout(List <string[]> data)
        {
            double itemsep = 0.0;
            var    major_group_direction = Direction.LeftToRight;
            var    minor_group_direction = Direction.TopToBottom;

            var name_to_major_group = new Dictionary <string, Container>();
            var name_to_minor_group = new Dictionary <string, Container>();

            var layout1 = new BoxLayout();

            layout1.Root = new Container(major_group_direction);

            var major_cells = new ShapeCells();

            major_cells.FillForeground         = "rgb(245,245,245)";
            major_cells.CharFont               = 0;
            major_cells.CharSize               = "12pt";
            major_cells.ParaHorizontalAlign    = "0";
            major_cells.TextBlockVerticalAlign = "0";
            major_cells.LineWeight             = "0";
            major_cells.LinePattern            = "0";

            var minor_cells = new ShapeCells();

            minor_cells.FillForeground         = "rgb(230,230,230)";
            minor_cells.CharFont               = 0;
            minor_cells.CharSize               = "10pt";
            minor_cells.ParaHorizontalAlign    = "0";
            minor_cells.TextBlockVerticalAlign = "0";
            minor_cells.LineWeight             = "0";
            minor_cells.LinePattern            = "0";

            var item_cells = new ShapeCells();

            item_cells.CharFont               = 0;
            item_cells.FillPattern            = "0";
            item_cells.CharSize               = "8pt";
            item_cells.ParaHorizontalAlign    = "0";
            item_cells.TextBlockVerticalAlign = "0";
            item_cells.LineWeight             = "0";
            item_cells.LinePattern            = "0";


            foreach (var row in data)
            {
                var majorname = row[0];
                var minorname = row[1];
                var itemname  = row[2];

                Container majorcnt;
                if (name_to_major_group.ContainsKey(majorname))
                {
                    majorcnt = name_to_major_group[majorname];
                }
                else
                {
                    majorcnt = layout1.Root.AddContainer(minor_group_direction, 1, 1);

                    var major_info = new TwoLevelInfo();
                    major_info.Text       = majorname;
                    major_info.Render     = true;
                    major_info.ShapeCells = major_cells;
                    majorcnt.Data         = major_info;


                    name_to_major_group[majorname] = majorcnt;

                    Box headerbox = majorcnt.AddBox(2, 0.25);
                }

                Container minorcnt;
                var       minorkey = majorname + "___" + minorname;
                if (name_to_minor_group.ContainsKey(minorkey))
                {
                    minorcnt = name_to_minor_group[minorkey];
                }
                else
                {
                    minorcnt = majorcnt.AddContainer(minor_group_direction);
                    minorcnt.ChildSpacing = itemsep;
                    var minor_info = new TwoLevelInfo();
                    minor_info.Text               = minorname;
                    minor_info.Render             = true;
                    minor_info.ShapeCells         = minor_cells;
                    minorcnt.Data                 = minor_info;
                    name_to_minor_group[minorkey] = minorcnt;

                    Box headerbox = minorcnt.AddBox(2, 0.25);
                }

                Box itembox = minorcnt.AddBox(2, 0.25);

                var item_info = new TwoLevelInfo();
                item_info.Text   = itemname;
                item_info.Render = true;


                item_info.ShapeCells = item_cells;

                itembox.Data = item_info;
            }
            return(layout1);
        }
Exemplo n.º 17
0
        public static void BoxLayout_SimpleCases()
        {
            // Create a blank canvas in Visio
            var app       = SampleEnvironment.Application;
            var documents = app.Documents;
            var doc       = documents.Add(string.Empty);

            // Create a simple Column
            var layout1 = new BoxLayout();

            layout1.Root = new Container(Direction.BottomToTop);
            layout1.Root.AddBox(1, 2);
            layout1.Root.AddBox(1, 1);
            layout1.Root.AddBox(0.5, 0.5);

            // You can set the min height and width of a container
            var layout2 = new BoxLayout();

            layout2.Root = new Container(Direction.BottomToTop, 3, 5);
            layout2.Root.AddBox(1, 2);
            layout2.Root.AddBox(1, 1);
            layout2.Root.AddBox(0.5, 0.5);

            // For vertical containers, you can layout shapes bottom-to-top or top-to-bottom
            var layout3 = new BoxLayout();

            layout3.Root = new Container(Direction.TopToBottom, 3, 5);
            layout3.Root.AddBox(1, 2);
            layout3.Root.AddBox(1, 1);
            layout3.Root.AddBox(0.5, 0.5);

            // Now switch to horizontal containers
            var layout4 = new BoxLayout();

            layout4.Root = new Container(Direction.RightToLeft, 3, 5);
            layout4.Root.AddBox(1, 2);
            layout4.Root.AddBox(1, 1);
            layout4.Root.AddBox(0.5, 0.5);


            // For Columns, you can tell the children how to horizontally align
            var layout5 = new BoxLayout();

            layout5.Root = new Container(Direction.BottomToTop, 3, 0);
            var b51 = layout5.Root.AddBox(1, 2);
            var b52 = layout5.Root.AddBox(1, 1);
            var b53 = layout5.Root.AddBox(0.5, 0.5);

            b51.HAlignToParent = AlignmentHorizontal.Left;
            b52.HAlignToParent = AlignmentHorizontal.Center;
            b53.HAlignToParent = AlignmentHorizontal.Right;

            // For Rows , you can tell the children how to vertially align
            var layout6 = new BoxLayout();

            layout6.Root = new Container(Direction.LeftToRight, 0, 5);
            var b61 = layout6.Root.AddBox(1, 2);
            var b62 = layout6.Root.AddBox(1, 1);
            var b63 = layout6.Root.AddBox(0.5, 0.5);

            b61.VAlignToParent = AlignmentVertical.Bottom;
            b62.VAlignToParent = AlignmentVertical.Center;
            b63.VAlignToParent = AlignmentVertical.Top;

            Util.Render(layout1, doc);
            Util.Render(layout2, doc);
            Util.Render(layout3, doc);
            Util.Render(layout4, doc);
            Util.Render(layout5, doc);
            Util.Render(layout6, doc);
        }
Exemplo n.º 18
0
 private void CreateButtonsForLayout(BoxLayout layout)
 {
     for (int x = 0; x < 5; x++)
     {
         var btn = CreateButton();
         btn.Text = "Button # " + x;
         btn.ResizeAroundText(5, 5);
         layout.AddItem(btn);
     }
 }
Exemplo n.º 19
0
 protected override void SetChecksums()
 {
     BoxLayout.SaveBattleTeams();
     AllBlocks.SetChecksums(Data);
 }
Exemplo n.º 20
0
 public BoxComponent(BoxLayout layout)
 {
     Layout = layout;
 }
Exemplo n.º 21
0
 public override void init()
 {
   this.layout = new BoxLayout((Container) this, 1);
   ((Container) this).setLayout((LayoutManager) this.layout);
   this.setObstruction(true);
   ((JComponent) this).setOpaque(true);
   ((JComponent) this).setVisible(true);
   ((JComponent) this).setBorder((Border) BorderFactory.createTitledBorder(this.getFieldName()));
   this.mouse = new LWSubsystem.Mouse(this, this);
   ((Component) this).addMouseListener((MouseListener) this.mouse);
   ((Component) this).addMouseMotionListener((MouseMotionListener) this.mouse);
 }
Exemplo n.º 22
0
        private void CustomInitialize()
        {
            _layout = UiControlManager.Instance.CreateControl<BoxLayout>();
            _layout.CurrentDirection = BoxLayout.Direction.Down;
            _layout.Spacing = 20;
            _layout.Margin = 20;
            _layout.BackgroundAnimationChains = GlobalContent.MenuBackground;
            _layout.CurrentBackgroundAnimationChainName = "Idle";
            _layout.AttachTo(this, false);

            // Add the text and the loading image
            _text = UiControlManager.Instance.CreateControl<LayoutableText>();
            _text.DisplayText = "Loading Level";
            _layout.AddItem(_text, BoxLayout.Alignment.Centered);

            var img = UiControlManager.Instance.CreateControl<LayoutableSprite>();
            img.AnimationChains = GlobalContent.LoadingAnimation;
            img.CurrentAnimationChainName = "Loading";
            _layout.AddItem(img, BoxLayout.Alignment.Centered);
        }
Exemplo n.º 23
0
 private void initGUI()
 {
     try
     {
         setPreferredSize(new Dimension(400, 300));
         {
             generalPanel = new JPanel();
             FlowLayout generalPanelLayout = new FlowLayout();
             generalPanelLayout.setAlignment(FlowLayout.LEFT);
             generalPanel.setLayout(generalPanelLayout);
             this.addTab("General", null, generalPanel, null);
             {
                 resolutionPanel = new JPanel();
                 generalPanel.add(resolutionPanel);
                 FlowLayout resolutionPanelLayout = new FlowLayout();
                 resolutionPanel.setLayout(resolutionPanelLayout);
                 resolutionPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED), "Resolution", TitledBorder.LEADING, TitledBorder.TOP));
                 {
                     resolutionCheckBox = new JCheckBox();
                     resolutionPanel.add(resolutionCheckBox);
                     resolutionCheckBox.setText("Override");
                 }
                 {
                     jLabel1 = new JLabel();
                     resolutionPanel.add(jLabel1);
                     jLabel1.setText("Image Width:");
                 }
                 {
                     resolutionXTextField = new JTextField();
                     resolutionPanel.add(resolutionXTextField);
                     resolutionXTextField.setText("640");
                     resolutionXTextField.setPreferredSize(new java.awt.Dimension(50, 20));
                 }
                 {
                     jLabel2 = new JLabel();
                     resolutionPanel.add(jLabel2);
                     jLabel2.setText("Image Height:");
                 }
                 {
                     resolutionYTextField = new JTextField();
                     resolutionPanel.add(resolutionYTextField);
                     resolutionYTextField.setText("480");
                     resolutionYTextField.setPreferredSize(new java.awt.Dimension(50, 20));
                 }
             }
             {
                 threadsPanel = new JPanel();
                 generalPanel.add(threadsPanel);
                 threadsPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED), "Threads", TitledBorder.LEADING, TitledBorder.TOP));
                 {
                     threadCheckBox = new JCheckBox();
                     threadsPanel.add(threadCheckBox);
                     threadCheckBox.setText("Use All Processors");
                 }
                 {
                     jLabel3 = new JLabel();
                     threadsPanel.add(jLabel3);
                     jLabel3.setText("Threads:");
                 }
                 {
                     threadTextField = new JTextField();
                     threadsPanel.add(threadTextField);
                     threadTextField.setText("1");
                     threadTextField.setPreferredSize(new java.awt.Dimension(50, 20));
                 }
             }
         }
         {
             rendererPanel = new JPanel();
             FlowLayout rendererPanelLayout = new FlowLayout();
             rendererPanelLayout.setAlignment(FlowLayout.LEFT);
             rendererPanel.setLayout(rendererPanelLayout);
             this.addTab("Renderer", null, rendererPanel, null);
             {
                 defaultRendererRadioButton = new JRadioButton();
                 rendererPanel.add(defaultRendererRadioButton);
                 defaultRendererRadioButton.setText("Default Renderer");
             }
             {
                 bucketRendererPanel = new JPanel();
                 BoxLayout bucketRendererPanelLayout = new BoxLayout(bucketRendererPanel, javax.swing.BoxLayout.Y_AXIS);
                 bucketRendererPanel.setLayout(bucketRendererPanelLayout);
                 rendererPanel.add(bucketRendererPanel);
                 bucketRendererPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED), "Bucket Renderer", TitledBorder.LEADING, TitledBorder.TOP));
                 {
                     bucketRendererRadioButton = new JRadioButton();
                     bucketRendererPanel.add(bucketRendererRadioButton);
                     bucketRendererRadioButton.setText("Enable");
                 }
                 {
                     samplingPanel = new JPanel();
                     GridLayout samplingPanelLayout = new GridLayout(2, 2);
                     samplingPanelLayout.setColumns(2);
                     samplingPanelLayout.setHgap(5);
                     samplingPanelLayout.setVgap(5);
                     samplingPanelLayout.setRows(2);
                     samplingPanel.setLayout(samplingPanelLayout);
                     bucketRendererPanel.add(samplingPanel);
                     {
                         jLabel5 = new JLabel();
                         samplingPanel.add(jLabel5);
                         jLabel5.setText("Min:");
                     }
                     {
                         ComboBoxModel minSamplingComboBoxModel = new DefaultComboBoxModel(new string[] {
                             "Item One", "Item Two" });
                         minSamplingComboBox = new JComboBox();
                         samplingPanel.add(minSamplingComboBox);
                         minSamplingComboBox.setModel(minSamplingComboBoxModel);
                     }
                     {
                         jLabel6 = new JLabel();
                         samplingPanel.add(jLabel6);
                         jLabel6.setText("Max:");
                     }
                     {
                         ComboBoxModel maxSamplingComboxBoxModel = new DefaultComboBoxModel(new string[] {
                             "Item One", "Item Two" });
                         maxSamplingComboxBox = new JComboBox();
                         samplingPanel.add(maxSamplingComboxBox);
                         maxSamplingComboxBox.setModel(maxSamplingComboxBoxModel);
                     }
                 }
             }
         }
     }
     catch (Exception e)
     {
         e.printStackTrace();
     }
 }
Exemplo n.º 24
0
 protected override void CreateChildElements()
 {
     this.verticalLayout             = new BoxLayout();
     this.verticalLayout.Orientation = System.Windows.Forms.Orientation.Vertical;
     this.Children.Add(this.verticalLayout);
 }
Exemplo n.º 25
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();

            this.boxLayout                     = new BoxLayout();
            this.boxLayout.Orientation         = System.Windows.Forms.Orientation.Horizontal;
            this.boxLayout.StretchHorizontally = true;
            this.boxLayout.StretchVertically   = false;
            this.boxLayout.RightToLeft         = false;

            this.fastForwardButton = new RadButtonElement();
            this.fastForwardButton.DisplayStyle        = DisplayStyle.Image;
            this.fastForwardButton.ThemeRole           = "FastNavigateForwardButton";
            this.fastForwardButton.StretchHorizontally = false;
            this.fastForwardButton.StretchVertically   = false;
            this.fastForwardButton.SetValue(BoxLayout.StripPositionProperty, BoxLayout.StripPosition.Last);
            this.fastForwardButton.MouseDown += new MouseEventHandler(fastForwardButton_MouseDown);
            this.fastForwardButton.Class      = "fastForwardButton";
            this.fastForwardButton.Children[1].Children[0].Class = "fastForwardButton";
            this.fastForwardButton.MinSize                = new Size(16, 16);
            this.fastForwardButton.ShowBorder             = false;
            this.fastForwardButton.Children[1].Alignment  = ContentAlignment.MiddleCenter;
            this.fastForwardButton.Children[0].Visibility = ElementVisibility.Hidden;
            this.boxLayout.Children.Add(this.fastForwardButton);

            this.nextButton = new RadRepeatButtonElement();
            this.nextButton.DisplayStyle        = DisplayStyle.Image;
            this.nextButton.ThemeRole           = "NavigateForwardButton";
            this.nextButton.StretchHorizontally = false;
            this.nextButton.StretchVertically   = false;
            this.nextButton.SetValue(BoxLayout.StripPositionProperty, BoxLayout.StripPosition.Last);
            this.nextButton.Click += new EventHandler(nextButton_Click);
            this.nextButton.Class  = "nextButton";
            this.nextButton.Children[1].Children[0].Class = "nextButton";
            this.nextButton.MinSize = new Size(16, 16);
            this.nextButton.Children[1].Alignment  = ContentAlignment.MiddleCenter;
            this.nextButton.ShowBorder             = false;
            this.nextButton.Children[0].Visibility = ElementVisibility.Hidden;
            this.boxLayout.Children.Add(this.nextButton);

            this.fastBackwardButton = new RadButtonElement();
            this.fastBackwardButton.DisplayStyle        = DisplayStyle.Image;
            this.fastBackwardButton.ThemeRole           = "FastNavigateBackwardButton";
            this.fastBackwardButton.StretchHorizontally = false;
            this.fastBackwardButton.StretchVertically   = false;
            this.fastBackwardButton.MouseDown          += new MouseEventHandler(fastBackwardButton_MouseDown);
            this.fastBackwardButton.SetValue(BoxLayout.StripPositionProperty, BoxLayout.StripPosition.First);
            this.fastBackwardButton.Class = "fastBackwardButton";
            this.fastBackwardButton.Children[1].Children[0].Class = "fastBackwardButton";
            this.fastBackwardButton.MinSize                = new Size(16, 16);
            this.fastBackwardButton.ShowBorder             = false;
            this.fastBackwardButton.Children[0].Visibility = ElementVisibility.Hidden;
            this.fastBackwardButton.Children[1].Alignment  = ContentAlignment.MiddleCenter;
            this.boxLayout.Children.Add(this.fastBackwardButton);

            this.prevButton = new RadRepeatButtonElement();
            this.prevButton.DisplayStyle        = DisplayStyle.Image;
            this.prevButton.ThemeRole           = "NavigateBackwardButton";
            this.prevButton.StretchHorizontally = false;
            this.prevButton.StretchVertically   = false;
            this.prevButton.Click += new EventHandler(prevButton_Click);
            this.prevButton.Class  = "prevButton";
            this.prevButton.Children[1].Children[0].Class = "prevButton";
            this.prevButton.SetValue(BoxLayout.StripPositionProperty, BoxLayout.StripPosition.First);
            this.prevButton.MinSize = new Size(16, 16);
            this.prevButton.Children[1].Alignment  = ContentAlignment.MiddleCenter;
            this.prevButton.ShowBorder             = false;
            this.prevButton.Children[0].Visibility = ElementVisibility.Hidden;
            this.boxLayout.Children.Add(this.prevButton);

            this.Children.Add(this.boxLayout);
        }
Exemplo n.º 26
0
 private void initGUI()
 {
     try
     {
         setPreferredSize(new Dimension(400, 300));
         {
             generalPanel = new JPanel();
             FlowLayout generalPanelLayout = new FlowLayout();
             generalPanelLayout.setAlignment(FlowLayout.LEFT);
             generalPanel.setLayout(generalPanelLayout);
             this.addTab("General", null, generalPanel, null);
             {
                 resolutionPanel = new JPanel();
                 generalPanel.add(resolutionPanel);
                 FlowLayout resolutionPanelLayout = new FlowLayout();
                 resolutionPanel.setLayout(resolutionPanelLayout);
                 resolutionPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED), "Resolution", TitledBorder.LEADING, TitledBorder.TOP));
                 {
                     resolutionCheckBox = new JCheckBox();
                     resolutionPanel.add(resolutionCheckBox);
                     resolutionCheckBox.setText("Override");
                 }
                 {
                     jLabel1 = new JLabel();
                     resolutionPanel.add(jLabel1);
                     jLabel1.setText("Image Width:");
                 }
                 {
                     resolutionXTextField = new JTextField();
                     resolutionPanel.add(resolutionXTextField);
                     resolutionXTextField.setText("640");
                     resolutionXTextField.setPreferredSize(new java.awt.Dimension(50, 20));
                 }
                 {
                     jLabel2 = new JLabel();
                     resolutionPanel.add(jLabel2);
                     jLabel2.setText("Image Height:");
                 }
                 {
                     resolutionYTextField = new JTextField();
                     resolutionPanel.add(resolutionYTextField);
                     resolutionYTextField.setText("480");
                     resolutionYTextField.setPreferredSize(new java.awt.Dimension(50, 20));
                 }
             }
             {
                 threadsPanel = new JPanel();
                 generalPanel.add(threadsPanel);
                 threadsPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED), "Threads", TitledBorder.LEADING, TitledBorder.TOP));
                 {
                     threadCheckBox = new JCheckBox();
                     threadsPanel.add(threadCheckBox);
                     threadCheckBox.setText("Use All Processors");
                 }
                 {
                     jLabel3 = new JLabel();
                     threadsPanel.add(jLabel3);
                     jLabel3.setText("Threads:");
                 }
                 {
                     threadTextField = new JTextField();
                     threadsPanel.add(threadTextField);
                     threadTextField.setText("1");
                     threadTextField.setPreferredSize(new java.awt.Dimension(50, 20));
                 }
             }
         }
         {
             rendererPanel = new JPanel();
             FlowLayout rendererPanelLayout = new FlowLayout();
             rendererPanelLayout.setAlignment(FlowLayout.LEFT);
             rendererPanel.setLayout(rendererPanelLayout);
             this.addTab("Renderer", null, rendererPanel, null);
             {
                 defaultRendererRadioButton = new JRadioButton();
                 rendererPanel.add(defaultRendererRadioButton);
                 defaultRendererRadioButton.setText("Default Renderer");
             }
             {
                 bucketRendererPanel = new JPanel();
                 BoxLayout bucketRendererPanelLayout = new BoxLayout(bucketRendererPanel, javax.swing.BoxLayout.Y_AXIS);
                 bucketRendererPanel.setLayout(bucketRendererPanelLayout);
                 rendererPanel.add(bucketRendererPanel);
                 bucketRendererPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED), "Bucket Renderer", TitledBorder.LEADING, TitledBorder.TOP));
                 {
                     bucketRendererRadioButton = new JRadioButton();
                     bucketRendererPanel.add(bucketRendererRadioButton);
                     bucketRendererRadioButton.setText("Enable");
                 }
                 {
                     samplingPanel = new JPanel();
                     GridLayout samplingPanelLayout = new GridLayout(2, 2);
                     samplingPanelLayout.setColumns(2);
                     samplingPanelLayout.setHgap(5);
                     samplingPanelLayout.setVgap(5);
                     samplingPanelLayout.setRows(2);
                     samplingPanel.setLayout(samplingPanelLayout);
                     bucketRendererPanel.add(samplingPanel);
                     {
                         jLabel5 = new JLabel();
                         samplingPanel.add(jLabel5);
                         jLabel5.setText("Min:");
                     }
                     {
                         ComboBoxModel minSamplingComboBoxModel = new DefaultComboBoxModel(new string[] {
                             "Item One", "Item Two"
                         });
                         minSamplingComboBox = new JComboBox();
                         samplingPanel.add(minSamplingComboBox);
                         minSamplingComboBox.setModel(minSamplingComboBoxModel);
                     }
                     {
                         jLabel6 = new JLabel();
                         samplingPanel.add(jLabel6);
                         jLabel6.setText("Max:");
                     }
                     {
                         ComboBoxModel maxSamplingComboxBoxModel = new DefaultComboBoxModel(new string[] {
                             "Item One", "Item Two"
                         });
                         maxSamplingComboxBox = new JComboBox();
                         samplingPanel.add(maxSamplingComboxBox);
                         maxSamplingComboxBox.setModel(maxSamplingComboxBoxModel);
                     }
                 }
             }
         }
     }
     catch (Exception e)
     {
         e.printStackTrace();
     }
 }
Exemplo n.º 27
0
        public static void FontGlyphComparision(IVisio.Document doc, string[] fontnames, List <string> samplechars)
        {
            var layout = new BoxLayout();

            var root = new Container(Direction.TopToBottom);

            layout.Root       = root;
            root.ChildSpacing = 0.5;

            var nodedata = new NodeData();

            nodedata.Render = false;
            root.Data       = nodedata;

            var fontname_cells = new ShapeCells();

            fontname_cells.FillPattern         = 0;
            fontname_cells.LinePattern         = 0;
            fontname_cells.LineWeight          = 0.0;
            fontname_cells.ParaHorizontalAlign = 0;
            fontname_cells.CharSize            = "36pt";

            var charbox_cells = new ShapeCells();

            charbox_cells.FillPattern         = 0;
            charbox_cells.LinePattern         = 1;
            charbox_cells.LineWeight          = 0.0;
            charbox_cells.LineColor           = "rgb(150,150,150)";
            charbox_cells.ParaHorizontalAlign = 1;
            charbox_cells.CharSize            = "24pt";

            foreach (string fontname in fontnames)
            {
                var fontname_box      = root.AddNodeEx(5, 0.5, fontname);
                var fontname_box_data = (NodeData)fontname_box.Data;
                fontname_box_data.Cells = fontname_cells;

                var font_box = root.AddContainer(Direction.TopToBottom);
                font_box.ChildSpacing = 0.25;
                var font_vox_data = (NodeData)font_box.Data;
                if (font_vox_data != null)
                {
                    font_vox_data.Render = false;
                }

                int numcols  = 17;
                int numrows  = 5;
                int numcells = numcols * numrows;


                foreach (int row in Enumerable.Range(0, numrows))
                {
                    var row_box = font_box.AddContainer(Direction.LeftToRight);
                    row_box.ChildSpacing = 0.25;
                    var row_box_data = new NodeData();
                    row_box_data.Render = false;

                    row_box.Data = row_box_data;

                    foreach (int col in Enumerable.Range(0, numcols))
                    {
                        int    charindex     = (col + (numcols * row)) % numcells;
                        string curchar       = samplechars[charindex];
                        var    cell_box      = row_box.AddNodeEx(0.50, 0.50, curchar);
                        var    cell_box_data = (NodeData)cell_box.Data;
                        cell_box_data.Font  = fontname;
                        cell_box_data.Cells = charbox_cells;
                    }
                }
            }

            layout.PerformLayout();

            var page = doc.Pages.Add();

            var domshapescol = new ShapeList();

            foreach (var node in layout.Nodes)
            {
                if (node.Data == null)
                {
                    continue;
                }
                var node_data = (NodeData)node.Data;

                if (node_data.Render == false)
                {
                    continue;
                }

                var shape_node = domshapescol.Drop("Rectangle", "basic_u.vss", node.Rectangle);

                var cells = node_data.Cells;
                if (cells == null)
                {
                    cells = new ShapeCells();
                }
                else
                {
                    cells = node_data.Cells.ShallowCopy();
                }

                if (node_data.Font != null)
                {
                    shape_node.CharFontName = node_data.Font;
                }

                shape_node.Cells = cells;
                shape_node.Text  = new VisioAutomation.Models.Text.TextElement(node_data.Text);
            }

            domshapescol.Render(page);

            var bordersize = new VA.Drawing.Size(0.5, 0.5);

            page.ResizeToFitContents(bordersize);
        }
Exemplo n.º 28
0
        private void CustomInitialize()
        {
            _mainGroup = UiControlManager.Instance.CreateSelectableControlGroup<SequentialSelectableGroup>();

            // Create the main layout
            _layout = UiControlManager.Instance.CreateControl<BoxLayout>();
            _layout.CurrentDirection = BoxLayout.Direction.Down;
            _layout.Spacing = 40;
            _layout.Margin = 50;
            _layout.BackgroundAnimationChains = GlobalContent.MenuBackground;
            _layout.CurrentBackgroundAnimationChainName = "Idle";
            _layout.BackgroundAlpha = 1;

            // Attach the layout to this entity so if we move the entity it moves the layout as well
            _layout.AttachTo(this, false);

            SpriteManager.AddToLayer(ArrowSprite, UiControlManager.Instance.Layer);

            InitButtons();
        }
Exemplo n.º 29
0
        /// <summary>
        /// Creates dateTimePicker's children
        /// </summary>
        public override void CreateChildren()
        {
            this.textBoxElement           = new RadMaskedEditBoxElement();
            this.textBoxElement.KeyDown  += new KeyEventHandler(textBoxElement_KeyDown);
            this.textBoxElement.KeyPress += new KeyPressEventHandler(textBoxElement_KeyPress);
            this.textBoxElement.KeyUp    += new KeyEventHandler(textBoxElement_KeyUp);

            this.textBoxElement.Mask                     = "";
            this.textBoxElement.MaskType                 = MaskType.DateTime;
            this.textBoxElement.ValueChanged            += new EventHandler(maskBox_ValueChanged);
            this.textBoxElement.TextBoxItem.LostFocus   += new EventHandler(maskBox_LostFocus);
            this.textBoxElement.TextBoxItem.TextChanged += new EventHandler(maskBox_TextChanged);
            this.textBoxElement.MouseDown               += new MouseEventHandler(maskBox_MouseDown);
            this.textBoxElement.ShowBorder               = false;
            this.textBoxElement.Class                    = "textbox";
            this.textBoxElement.ThemeRole                = "DateTimePickerMaskTextBoxElement";

            this.dockLayout               = new DockLayoutPanel();
            this.border                   = new BorderPrimitive();
            this.backGround               = new FillPrimitive();
            this.checkBox                 = new RadCheckBoxElement();
            this.border.Class             = "DateTimePickerBorder";
            this.backGround.Class         = "DateTimePickerBackGround";
            this.backGround.GradientStyle = GradientStyles.Solid;

            this.checkBox.SetValue(DockLayoutPanel.DockProperty, Dock.Left);
            this.checkBox.Children[1].Alignment = ContentAlignment.MiddleLeft;

            this.checkBox.StretchHorizontally = false;
            this.textBoxElement.Alignment     = ContentAlignment.MiddleLeft;

            this.upButton                   = new RadRepeatArrowElement();
            this.upButton.ThemeRole         = "UpButton";
            this.upButton.Padding           = new Padding(3, 1, 3, 1);
            this.upButton.Border.Visibility = ElementVisibility.Visible;
            this.upButton.Click            += new EventHandler(upButton_Click);
            this.upButton.Direction         = ArrowDirection.Up;
            this.upButton.Arrow.AutoSize    = true;
            this.upButton.CanFocus          = false;

            this.downButton                   = new RadRepeatArrowElement();
            this.downButton.ThemeRole         = "DownButton";
            this.downButton.Padding           = new Padding(3, 1, 3, 0);
            this.downButton.Border.Visibility = ElementVisibility.Visible;
            this.downButton.Click            += new EventHandler(downButton_Click);
            this.downButton.Arrow.AutoSize    = true;
            this.downButton.Direction         = ArrowDirection.Down;
            this.downButton.CanFocus          = false;

            BoxLayout stackLayout = new BoxLayout();

            stackLayout.Orientation = Orientation.Vertical;
            BoxLayout.SetProportion(this.upButton, 1);
            BoxLayout.SetProportion(this.downButton, 1);
            stackLayout.Children.Add(this.upButton);
            stackLayout.Children.Add(this.downButton);

            if (this.dateTimePickerElement.RightToLeft)
            {
                this.checkBox.SetValue(DockLayoutPanel.DockProperty, Dock.Right);
                this.checkBox.Children[1].Alignment = ContentAlignment.MiddleLeft;
                stackLayout.SetValue(DockLayoutPanel.DockProperty, Dock.Left);
                stackLayout.RightToLeft = false;
                this.textBoxElement.TextBoxItem.HostedControl.RightToLeft = RightToLeft.Yes;
            }
            else
            {
                this.checkBox.SetValue(DockLayoutPanel.DockProperty, Dock.Left);
                this.checkBox.Children[1].Alignment = ContentAlignment.MiddleLeft;
                stackLayout.SetValue(DockLayoutPanel.DockProperty, Dock.Right);
                this.textBoxElement.TextBoxItem.HostedControl.RightToLeft = RightToLeft.No;
            }

            this.dockLayout.Children.Add(this.checkBox);
            this.dockLayout.Children.Add(stackLayout);
            this.dockLayout.Children.Add(this.textBoxElement);

            this.dateTimePickerElement.Children.Add(this.backGround);
            this.dateTimePickerElement.Children.Add(this.dockLayout);
            this.dateTimePickerElement.Children.Add(this.border);

            this.dateTimePickerElement.checkBox = this.checkBox;

            if (!this.dateTimePickerElement.ShowCheckBox)
            {
                this.checkBox.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
            }

            this.SetDateByValue(this.dateTimePickerElement.Value, this.dateTimePickerElement.Format);

            // The BorderPrimitive of the RadTextBoxElement should be collapsed. This makes the size of the editors equal
            this.textBoxElement.Children[this.textBoxElement.Children.Count - 1].Visibility = ElementVisibility.Collapsed;
            this.border.Visibility = ElementVisibility.Visible;

            this.SetDateByValue(this.dateTimePickerElement.Value, this.dateTimePickerElement.Format);
        }