Example #1
0
        private void UpdateSplitters(ABMCommonRoutines.enModes mode)
        {
            bool updateVerticalSplitter   = false;
            bool updateHorizontalSplitter = false;

            switch (mode)
            {
            case ABMCommonRoutines.enModes.Normal:
                updateHorizontalSplitter = !HorizontalSplitter.ControlToHide.Visible;
                updateVerticalSplitter   = !VerticalSplitter.ControlToHide.Visible;
                break;

            case ABMCommonRoutines.enModes.New:
            case ABMCommonRoutines.enModes.Edition:
                updateHorizontalSplitter = HorizontalSplitter.ControlToHide.Visible;
                break;

            case ABMCommonRoutines.enModes.Query:
            case ABMCommonRoutines.enModes.Search:
                updateVerticalSplitter   = VerticalSplitter.ControlToHide.Visible;
                updateHorizontalSplitter = HorizontalSplitter.ControlToHide.Visible;
                break;
            }

            if (updateVerticalSplitter)
            {
                VerticalSplitter.ToggleState();
            }

            if (updateHorizontalSplitter)
            {
                HorizontalSplitter.ToggleState();
            }
        }
Example #2
0
 private void TViewCategorias_NodeMouseDoubleClick(object sender, System.Windows.Forms.TreeNodeMouseClickEventArgs e)
 {
     if (e.Node.Nodes.Count == 0)
     {
         HorizontalSplitter.ToggleState();
     }
 }
        public ComplexSplitContainer(string name, Docking dock, IWidgetStyle style)
            : base(name, dock, style)
        {
            /***
             * PanelLeft = new ScrollableContainer ("panelleft", Docking.Fill, new SplitContainerPanelStyle ());
             * PanelCenter = new ScrollableContainer ("panelcenter", Docking.Fill, new SplitContainerPanelStyle ());
             * PanelBottom = new ScrollableContainer ("panelbottom", Docking.Fill, new SplitContainerPanelStyle ());
             * PanelRight = new ScrollableContainer ("panelright", Docking.Fill, new SplitContainerPanelStyle ());
             ***/

            PanelLeft   = new ScrollableContainer("panelleft", Docking.Fill, new SplitContainerPanelStyle());
            PanelCenter = new ScrollableContainer("panelcenter", Docking.Fill, new EmptyWidgetStyle());
            PanelBottom = new ScrollableContainer("panelbottom", Docking.Fill, new EmptyWidgetStyle());
            PanelRight  = new ScrollableContainer("panelright", Docking.Fill, new EmptyWidgetStyle());

            SplitterLeft   = new VerticalSplitter("leftsplitter", new SplitContainerTransparentSplitterStyle());
            SplitterBottom = new HorizontalSplitter("bottomsplitter", new SplitContainerTransparentSplitterStyle());
            SplitterRight  = new VerticalSplitter("rightsplitter", new SplitContainerTransparentSplitterStyle());

            PanelCenter.Dock = Docking.Fill;

            Children.Add(SplitterLeft);
            Children.Add(SplitterBottom);
            Children.Add(SplitterRight);

            Children.Add(PanelLeft);
            Children.Add(PanelCenter);
            Children.Add(PanelBottom);
            Children.Add(PanelRight);

            SplitterLeft.Distance   = 0.25f;
            SplitterBottom.Distance = -0.25f;
            SplitterRight.Distance  = -0.25f;
        }
Example #4
0
        private static async Task RenderUiAndHandleInputAsync(ITcpPeerMessenger messenger, MessageLog messageLog, bool isChatbotMode)
        {
            IMessengerCommandHandler commandHandler = new MessengerCommandHandler(messenger, messageLog);
            IMessengerCommandParser  commandParser  = new MessengerCommandParser();

            int headerHeight   = 2;
            int splitterHeight = 1;
            int inputHeight    = 5;

            Header header = new Header(isChatbotMode);

            int            logViewHeight  = Console.WindowHeight - headerHeight - splitterHeight - inputHeight;
            int            logViewTop     = headerHeight;
            MessageLogView messageLogView = new MessageLogView(logViewTop, logViewHeight, messageLog, messenger.EndPoint);

            int splitterTop             = headerHeight + logViewHeight;
            HorizontalSplitter splitter = new HorizontalSplitter(splitterTop);

            int inputTop = headerHeight + splitterHeight + logViewHeight;
            MessageTextInput messageTextInput = new MessageTextInput(inputTop);

            messageTextInput.MessageEntered += async(s, input) =>
            {
                if (input != "")
                {
                    try
                    {
                        MessengerCommand command = commandParser.Parse(input);
                        await command.AcceptHandlerAsync(commandHandler);
                    }
                    catch (MessengerCommandParserException ex)
                    {
                        messageLog.Add(new SystemMessage(ex.Message));
                    }
                    catch (Exception e)
                    {
                        messenger.Stop();
                        throw e;
                    }
                }
            };

            var components = new List <ConsoleUiComponent>
            {
                header, messageLogView, splitter, messageTextInput
            };

            Console.Clear();
            while (messenger.IsStarted)
            {
                foreach (var c in components)
                {
                    c.Render();
                }
                await Task.Delay(500);
            }
        }
Example #5
0
        static RectRegion BuildUI()
        {
            var root = new HorizontalSplitter
            {
                Left  = new ListRegion <FileSystemInfo>(new DirSource()),
                Right = new RectRegion(),
            };

            return(root);
        }
        public QuatSplitter(string name, Docking dock, IWidgetStyle style)
            : base(name, dock, style)
        {
            Panel1 = new ScrollableContainer("panel1", Docking.Fill, new SplitContainerPanelStyle());
            Panel2 = new ScrollableContainer("panel2", Docking.Fill, new SplitContainerPanelStyle());
            Panel3 = new ScrollableContainer("panel3", Docking.Fill, new SplitContainerPanelStyle());
            Panel4 = new ScrollableContainer("panel4", Docking.Fill, new SplitContainerPanelStyle());

            Splitter1 = new HorizontalSplitter();
            Splitter2 = new VerticalSplitter();

            Children.Add(Splitter1);
            Children.Add(Splitter2);
            Children.Add(Panel1);
            Children.Add(Panel2);
            Children.Add(Panel3);
            Children.Add(Panel4);
        }
Example #7
0
        public TripleSplitContainer(string name, SplitOrientation orientation, Docking dock, IWidgetStyle style)
            : base(name, dock, style)
        {
            Orientation = orientation;

            /***
             * Panel1 = new ScrollableContainer ("panel1", Docking.Fill, new SplitContainerPanelStyle ());
             * Panel2 = new ScrollableContainer ("panel2", Docking.Fill, new SplitContainerPanelStyle ());
             * Panel3 = new ScrollableContainer ("panel3", Docking.Fill, new SplitContainerPanelStyle ());
             ***/

            Panel1 = new ScrollableContainer("panel1", Docking.Fill, new EmptyWidgetStyle());
            Panel2 = new ScrollableContainer("panel2", Docking.Fill, new EmptyWidgetStyle());
            Panel3 = new ScrollableContainer("panel3", Docking.Fill, new EmptyWidgetStyle());


            if (orientation == SplitOrientation.Horizontal)
            {
                Splitter1 = new HorizontalSplitter("splitter1", new SplitContainerTransparentSplitterStyle());
                Splitter2 = new HorizontalSplitter("splitter2", new SplitContainerTransparentSplitterStyle());
            }
            else
            {
                Splitter1 = new VerticalSplitter("splitter1", new SplitContainerTransparentSplitterStyle());
                Splitter2 = new VerticalSplitter("splitter2", new SplitContainerTransparentSplitterStyle());
            }

            Children.Add(Panel1);
            Children.Add(Splitter1);
            Children.Add(Panel2);
            Children.Add(Splitter2);
            Children.Add(Panel3);

            //if (distance != 0)
            Splitter1.Distance = 0.334f;
            Splitter2.Distance = 0.334f;
        }
        protected override ShaderGUITreeElement OnBuildRoot()
        {
            var root = new ShaderGUITreeElement();


            // Lit Area
            var lit = new HorizontalSplitter {
                labelContent = new GUIContent("Lit")
            };

            root.AddChild(lit);
            {
                // Rendering Mode
                lit.AddChild(new ShaderProperty {
                    property = "_Mode"
                });
                lit.AddChild(new SpaceLayout());

                // Base Map Label
                lit.AddChild(new Label {
                    labelContent = new GUIContent("Main Maps"), style = EditorStyles.boldLabel
                });

                // Albedo
                lit.AddChild(new TextureSingleLine
                {
                    labelContent    = new GUIContent("Albedo"),
                    textureProperty = "_MainTex",
                    extraProperty1  = "_Color"
                });

                // Metallic & Smoothness
                lit.AddChild(new TextureTwoLines
                {
                    labelContent    = new GUIContent("Metallic"),
                    textureProperty = "_GlossMap",
                    extraProperty1  = "_Metallic",
                    labelContant2   = new GUIContent("Smoothness"),
                    extraProperty2  = "_Glossiness"
                });

                // Occlusion
                lit.AddChild(new TextureSingleLine
                {
                    labelContent    = new GUIContent("Occlusion"),
                    textureProperty = "_OcclusionMap",
                    extraProperty1  = "_OcclusionStrength"
                });


                // Emission
                var emissionArea = new EmissionEnabledProperty();
                lit.AddChild(emissionArea);
                {
                    emissionArea.AddChild(new TextureWithHDRColor
                    {
                        labelContent    = new GUIContent("Color"),
                        colorProperty   = "_EmissionColor",
                        textureProperty = "_EmissionMap"
                    });

                    emissionArea.AddChild(new LightmapEmissionFlagsProperty
                    {
                        labelIndent = MaterialEditor.kMiniTextureFieldLabelIndentLevel
                    });
                }

                // Misc
                lit.AddChild(new TextureScaleOffset {
                    textureProperty = "_MainTex"
                });
                lit.AddChild(new SpaceLayout());

                // Forward Rendering options
            }


            // Displacement Area
            var displacement = new HorizontalSplitter {
                labelContent = new GUIContent("Displacement")
            };

            root.AddChild(displacement);
            {
                displacement.AddChild(new ShaderProperty {
                    property = "_DisplacementMode"
                });
                displacement.AddChild(new SpaceLayout());

                // Basis
                displacement.AddChild(new Label {
                    labelContent = new GUIContent("Basis"), style = EditorStyles.boldLabel
                });
                displacement.AddChild(new TextureSingleLine
                {
                    labelContent    = new GUIContent("Normal Map"),
                    textureProperty = "_BumpMap",
                    extraProperty1  = "_BumpScale"
                });
                displacement.AddChild(new TextureSingleLine
                {
                    labelContent    = new GUIContent("Height Map"),
                    textureProperty = "_ParallaxMap",
                    extraProperty1  = "_Parallax"
                });
                displacement.AddChild(new SpaceLayout());

                // Tessellation
                displacement.AddChild(new Label
                {
                    labelContent = new GUIContent("Tessellation"),
                    style        = EditorStyles.boldLabel
                });
                displacement.AddChild(new ShaderProperty {
                    property = "_Tessellation"
                });
                displacement.AddChild(new ShaderProperty {
                    property = "_TessellationEdge"
                });
                displacement.AddChild(new ShaderProperty {
                    property = "_TessellationPhong"
                });

                displacement.AddChild(new SpaceLayout());
            }


            root.AddChild(new DefaultOtherPropertyTab());
            root.AddChild(new DefaultShaderOptions());
            root.AddChild(new TreeDebugTab());

            return(root);
        }
Example #9
0
        public CrossSplitter(ControlBase parent)
            : base(parent)
        {
            m_CurZoom = 0;

            m_Splitter      = new Control.CrossSplitter(this);
            m_Splitter.Dock = Dock.Fill;

            {
                VerticalSplitter splitter = new VerticalSplitter(m_Splitter);
                Control.Button   button1  = new Control.Button(splitter);
                button1.Text = "Vertical left";
                Control.Button button2 = new Control.Button(splitter);
                button2.Text = "Vertical right";
                splitter.SetPanel(0, button1);
                splitter.SetPanel(1, button2);
                m_Splitter.SetPanel(0, splitter);
            }

            {
                HorizontalSplitter splitter = new HorizontalSplitter(m_Splitter);
                Control.Button     button1  = new Control.Button(splitter);
                button1.Text = "Horizontal up";
                Control.Button button2 = new Control.Button(splitter);
                button2.Text = "Horizontal down";
                splitter.SetPanel(0, button1);
                splitter.SetPanel(1, button2);
                m_Splitter.SetPanel(1, splitter);
            }

            {
                HorizontalSplitter splitter = new HorizontalSplitter(m_Splitter);
                Control.Button     button1  = new Control.Button(splitter);
                button1.Text = "Horizontal up";
                Control.Button button2 = new Control.Button(splitter);
                button2.Text = "Horizontal down";
                splitter.SetPanel(0, button1);
                splitter.SetPanel(1, button2);
                m_Splitter.SetPanel(2, splitter);
            }

            {
                VerticalSplitter splitter = new VerticalSplitter(m_Splitter);
                Control.Button   button1  = new Control.Button(splitter);
                button1.Text = "Vertical left";
                Control.Button button2 = new Control.Button(splitter);
                button2.Text = "Vertical right";
                splitter.SetPanel(0, button1);
                splitter.SetPanel(1, button2);
                m_Splitter.SetPanel(3, splitter);
            }

            //Status bar to hold unit testing buttons
            Control.StatusBar pStatus = new Control.StatusBar(this);
            pStatus.Dock = Dock.Bottom;

            {
                Control.Button pButton = new Control.Button(pStatus);
                pButton.Text     = "Zoom";
                pButton.Clicked += ZoomTest;
                pStatus.AddControl(pButton, false);
            }

            {
                Control.Button pButton = new Control.Button(pStatus);
                pButton.Text     = "UnZoom";
                pButton.Clicked += UnZoomTest;
                pStatus.AddControl(pButton, false);
            }

            {
                Control.Button pButton = new Control.Button(pStatus);
                pButton.Text     = "CenterPanels";
                pButton.Clicked += CenterPanels;
                pStatus.AddControl(pButton, true);
            }

            {
                Control.Button pButton = new Control.Button(pStatus);
                pButton.Text     = "Splitters";
                pButton.Clicked += ToggleSplitters;
                pStatus.AddControl(pButton, true);
            }
        }
Example #10
0
 protected void Splitter1_Toggle_Status()
 {
     HorizontalSplitter.ToggleState();
 }
Example #11
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //
            HorizontalSplitter splitter = new HorizontalSplitter(this);

            splitter.Dock = Pos.Fill;

            Base topContainer = new Base(splitter);

            topContainer.Dock = Pos.Fill;

            Base bottomContainer = new Base(splitter);

            bottomContainer.Dock = Pos.Fill;

            splitter.SetPanel(0, topContainer);
            splitter.SetPanel(1, bottomContainer);
            splitter.SetVValue(0.35f);
            splitter.Margin = new Margin(5);


            //  Top
            Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(topContainer);
            label.Text               = "HtmlLabel:";
            label.Dock               = Pos.Top;
            label.Alignment          = Pos.Center;
            label.AutoSizeToContents = true;
            label.TextColor          = Color.Green;
            label.Margin             = new Margin(2, 2, 2, 5);

            _htmlLabelHostingPanel        = new DoubleBufferedControl(topContainer);
            _htmlLabelHostingPanel.Dock   = Pos.Fill;
            _htmlLabelHostingPanel.Paint += new GUI.PaintEventHandler(OnHtmlLabelHostingPanelPaint);

            _htmlLabel                    = new Alt.GUI.HtmlRenderer.Temporary.Gwen.HtmlLabel(_htmlLabelHostingPanel);
            _htmlLabel.Dock               = Pos.Fill;
            _htmlLabel.AutoSize           = false;
            _htmlLabel.AutoSizeHeightOnly = true;
            _htmlLabel.BackColor          = Color.Empty;// Transparent;
            _htmlLabel.BaseStylesheet     = null;
            _htmlLabel.Text               = "This is an <b>HtmlLabel</b> on transparent background with <span style=\"color: re" +
                                            "d\">colors</span> and links: <a href=\"http://htmlrenderer.codeplex.com/\">HTML Renderer</a>";


            //  Bottom
            label                    = new Alt.GUI.Temporary.Gwen.Control.Label(bottomContainer);
            label.Text               = "HtmlPanel:";
            label.Dock               = Pos.Top;
            label.Alignment          = Pos.Center;
            label.AutoSizeToContents = true;
            label.TextColor          = Color.Green;
            label.Margin             = new Margin(2, 2, 2, 5);

            _changeTooltipButton        = new Alt.GUI.Temporary.Gwen.Control.Button(bottomContainer);
            _changeTooltipButton.Dock   = Pos.Bottom;
            _changeTooltipButton.Text   = "Click me to change tooltip";
            _changeTooltipButton.Click += new System.EventHandler(OnButtonClick);

            _htmlToolTip = new Alt.GUI.HtmlRenderer.Temporary.Gwen.HtmlToolTip(_changeTooltipButton);
            _htmlToolTip.SetToolTip(_changeTooltipButton, "When you click this button, this tooltip will be replaced for the text of the <b>HtmlLabel</b>");

            _htmlPanel                = new Alt.GUI.HtmlRenderer.Temporary.Gwen.HtmlPanel(bottomContainer);
            _htmlPanel.Dock           = Pos.Fill;
            _htmlPanel.AutoScroll     = true;
            _htmlPanel.BackColor      = Color.White;
            _htmlPanel.BaseStylesheet = null;
            _htmlPanel.Text           = HtmlRenderer.Resources.SampleForm_HtmlPanel;


            //
            Center();


            //
            Bitmap bmp = new Bitmap(10, 10);

            using (Graphics g = Graphics.FromImage(bmp))
            {
                g.Clear(Color.White);
                g.FillRectangle(Brushes.LightGray, new RectI(0, 0, 5, 5));
                g.FillRectangle(Brushes.LightGray, new RectI(5, 5, 5, 5));
            }

            m_TransparentBGBrush = new TextureBrush(bmp, WrapMode.Tile);
        }