public void AddToolPanel(Panel p) { p.SetParent(this.contextPanel); p.ShouldPassInput = true; p.SetWidth(contextPanel.Width); if (this.contextPanel.Children.Count > 1) { p.Below(this.contextPanel.Children[this.contextPanel.Children.Count - 2], ElementSpacing );//Align ourselves below the last panel over } }
public override void Init() { this.Material = Resource.GetMaterial("engine/depth"); this.drawMode = OpenTK.Graphics.OpenGL.BeginMode.Triangles; this.Model = Resource.GetMesh("engine/quad.obj"); DepthScreen = GUIManager.Create<Panel>(); DepthScreen.SetMaterial(Resource.GetMaterial("engine/depth")); DepthScreen.SetWidth(Utilities.engine.Width / Size); DepthScreen.SetHeight(Utilities.engine.Height / Size); DepthScreen.SetPos(new Vector2(0, Utilities.engine.Height - DepthScreen.Height)); DepthScreen.AlphaBlendmode = false; Utilities.engine.Keyboard.KeyDown += new EventHandler<OpenTK.Input.KeyboardKeyEventArgs>(Keyboard_KeyDown); }
public void AddPanel(Panel p) { p.SetParent(this.ScrollPanel); if (this.Panels.Count > 0 && this.Panels[this.Panels.Count - 1]) { p.Below(this.Panels[this.Panels.Count - 1], 3); } Panels.Add(p); p.SetWidth(this.ScrollPanel.Width); p.SetAnchorStyle(Anchors.Left | Anchors.Top | Anchors.Right); this.ScrollPanel.SetHeight(p.Position.Y + p.Height); }
public override void Init() { base.Init(); ScrollPanel = GUIManager.Create<Panel>(this); ScrollPanel.SetMaterial(Utilities.White); ScrollPanel.SetWidth(this.Width); ScrollPanel.SetHeight(this.Height); ScrollPanel.SetAnchorStyle(Anchors.Left | Anchors.Right); Grip = GUIManager.Create<Panel>(this); Grip.SetColor(200, 201, 200); Grip.SetWidth(20); Grip.Dock(DockStyle.RIGHT); Grip.IsVisible = false; //We'll be drawing it manually Grip.OnMouseDown += new Action<Panel,OpenTK.Input.MouseButtonEventArgs>(Grip_OnMouseDown); this.OnMouseMove += new Action<Panel,OpenTK.Input.MouseMoveEventArgs>(ScrollBar_OnMouseMove); Utilities.engine.Mouse.ButtonUp += new EventHandler<OpenTK.Input.MouseButtonEventArgs>(Mouse_ButtonUp); }
public override void Init() { base.Init(); contextPanel = GUIManager.Create<Panel>(); contextPanel.ShouldPassInput = true; contextPanel.SetWidth(150); contextPanel.SetPos(this.Position.X, this.Position.Y + this.Height); //Create our text label TextLabel = GUIManager.Create<Label>(); TextLabel.SetParent(this); TextLabel.Autosize = false; TextLabel.Dock(DockStyle.FILL); TextLabel.SetAlignment(Label.TextAlign.MiddleCenter); this.SetButtonState(State.Idle); Utilities.engine.Mouse.ButtonDown += new EventHandler<MouseButtonEventArgs>(Mouse_ButtonDown); }