public override void PaintSlideBar(SlideBar component) { Position origin = UI.Instance.GetOrigin(); if (component.Type == ETypeOrientation.Horizontal) { origin = UI.Instance.GetOrigin(); float x1 = origin.X + component.Position.X; float x2 = origin.X + component.Position.X + 4; float x3 = origin.X + component.Position.X + component.Size.width - 4; float x4 = origin.X + component.Position.X + component.Size.width; float y1 = origin.Y + component.Position.Y; float y2 = origin.Y + component.Position.Y + component.Size.height; GL.Enable(EnableCap.Texture2D); GL.Color3(1f, 1f, 1f); progressBarLeft.Paint(x1, y1, x2, y2); progressBarRight.Paint(x3, y1, x4, y2); GL.Disable(EnableCap.Texture2D); GL.Color3((byte)79, (byte)91, (byte)84); GL.Begin(BeginMode.Quads); GL.Vertex2(x2, y1); GL.Vertex2(x3, y1); GL.Vertex2(x3, y2); GL.Vertex2(x2, y2); GL.End(); } else { GL.Enable(EnableCap.Texture2D); GL.Color3(1f, 1f, 1f); float x1 = origin.X + component.Position.X; float x2 = origin.X + component.Position.X + component.Size.width; float y1 = origin.Y + component.Position.Y; float y2 = origin.Y + component.Position.Y + 4; float y3 = origin.Y + component.Position.Y + component.Size.height - 4; float y4 = origin.Y + component.Position.Y + component.Size.height; progressBarTop.Paint(x1, y1, x2, y2); progressBarBottom.Paint(x1, y3, x2, y4); GL.Disable(EnableCap.Texture2D); GL.Color3((byte)79, (byte)91, (byte)84); GL.Begin(BeginMode.Quads); GL.Vertex2(x1, y2); GL.Vertex2(x2, y2); GL.Vertex2(x2, y3); GL.Vertex2(x1, y3); GL.End(); } }
public abstract void PaintSlideBar(SlideBar component);
public void SetSlideBar(SlideBar parent) { this.parent = parent; }
public ProgressNSliderTestDialog() : base("Progress and Slider Test", 150, 150, 320, 200) { /* borderLayout=new BorderLayout(16,16,16,16,8); borderLayout.SouthHAlignment = EHorizontalAlignment.HRight; closeButton=new Button("Close"); closeButton.LayoutProperty = EArea.South; valueLabel=new Label("Value:0%"); valueLabel.LayoutProperty = EArea.North; centerPanel=new Panel(); centerGirdLayout=new GirdLayout(2,1); centerPanel.Layout = centerGirdLayout; horizontalPBar=new ProgressBar(0.0f,100.0f,0.0f); horizontalSBar=new SlideBar(0.0f,100.0f,0.0f); centerPanel.Add(horizontalPBar); centerPanel.Add(horizontalSBar); centerPanel.LayoutProperty = EArea.Center; centerPanel.Pack(); verticalPBar=new ProgressBar(0.0f,100.0f,0.0f, ETypeOrientation.Vertical); verticalSBar=new SlideBar(0.0f,100.0f,0.0f, ETypeOrientation.Vertical); verticalPBar.LayoutProperty = EArea.East; verticalSBar.LayoutProperty = EArea.East; Add(closeButton); Add(valueLabel); Add(centerPanel); Add(verticalPBar); Add(verticalSBar); Layout = borderLayout; Pack(); */ girdLayout = new GirdLayout(4, 1); girdLayout.SetHorizontalAlignment(0, 0, EHAlignment.HLeft); girdLayout.SetHorizontalAlignment(1, 0, EHAlignment.HCenter); girdLayout.SetHorizontalAlignment(2, 0, EHAlignment.HCenter); girdLayout.SetHorizontalAlignment(3, 0, EHAlignment.HRight); girdLayout.Right = 16; girdLayout.Left = 16; girdLayout.Top = 8; girdLayout.Bottom = 8; girdLayout.Spacer = 4; closeButton = new Button("Close"); closeButton.LayoutProperty = EArea.South; valueLabel = new Label("Value: 0%"); valueLabel.LayoutProperty = EArea.North; horizontalPBar = new ProgressBar(0.0f, 100.0f, ETypeOrientation.Horizontal); horizontalSBar = new SlideBar(0.0f, 100.0f, ETypeOrientation.Horizontal); Button button1 = new Button("button1"); Button button2 = new Button("button2"); Add(valueLabel); Add(horizontalPBar); Add(horizontalSBar); //Add(button1); //Add(button2); Add(closeButton); Layout = girdLayout; Pack(); horizontalSBar.Slider.DragMovedEvent += new DragMovedHandler(Slider_DragMovedEvent); closeButton.MouseReleasedEvent += new MouseReleasedHandler(closeButton_MouseReleasedEvent); }