//private ContextMenu prContextMenu; public VPianoRollControl() { _zoomy = 1.0f; // valeur de zoom resolution = 4; // 4 incréments par noire channel = 0; pnlCanvas = new MyPanel(); pnlCanvas.Location = new Point(0, 0); pnlCanvas.Size = new Size(40, 40); pnlCanvas.BackColor = Color.White; pnlCanvas.Dock = DockStyle.Fill; pnlCanvas.Paint += new PaintEventHandler(pnlCanvas_Paint); pnlCanvas.MouseLeave += new EventHandler(pnlCanvas_MouseLeave); pnlCanvas.MouseDown += new MouseEventHandler(pnlCanvas_MouseDown); pnlCanvas.MouseMove += new MouseEventHandler(pnlCanvas_MouseMove); pnlCanvas.MouseUp += new MouseEventHandler(pnlCanvas_MouseUp); this.Controls.Add(pnlCanvas); // Graphic optimization this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.ResizeRedraw, true); keysNumber = 1 + highNoteID - lowNoteID; // 128 or less }
public void GraphicGrid(MyPanel panel, Graphics graphic) { Panel = panel; Pen pen = new Pen(Color.FromArgb(89, 10, 148), 2); Pen pen1 = new Pen(Color.FromArgb(89, 10, 148), 1); for (int i = 0; i <= Col; i++) { if (i == 0) { graphic.DrawLine(pen1, 0, 0, 0, panel.Height); } else { graphic.DrawLine(pen, i * 27 - 1, 0, i * 27 - 1, panel.Height); } } for (int i = 0; i <= Row; i++) { if (i == 0) { graphic.DrawLine(pen1, 0, 0, panel.Width, 0); } else { graphic.DrawLine(pen, 0, i * 27 - 1, panel.Width, i * 27 - 1); } } }
public MyInputField(string name, Sprite sprite, Rect rect) : base(name) { Element = new MyPanel(sprite, rect).Element; var inputScript = Element.AddComponent<InputField>(); var text = new MyText(""); var placeholder = new MyText("Enter Text..."); text.SetAnchor(0, 0, 1, 1); placeholder.SetAnchor(0, 0, 1, 1); text.Element.GetComponent<Text>().alignment = TextAnchor.MiddleLeft; placeholder.Element.GetComponent<Text>().alignment = TextAnchor.MiddleLeft; placeholder.Element.GetComponent<Text>().fontStyle = FontStyle.Italic; placeholder.Element.GetComponent<Text>().color = Color.gray; var rectT = text.Element.GetComponent<RectTransform>(); rectT.offsetMin = new Vector2(10, 5); rectT.offsetMax = new Vector2(-10, -5); rectT = placeholder.Element.GetComponent<RectTransform>(); rectT.offsetMin = new Vector2(10, 5); rectT.offsetMax = new Vector2(-10, -5); AddElement(text); AddElement(placeholder); inputScript.placeholder = placeholder.Element.GetComponent<Text>(); inputScript.textComponent = text.Element.GetComponent<Text>(); }
private void GenerateButton_Click(object sender, EventArgs e) { //GenerateButton try { int ChildNumberOfColumns = int.Parse(ConfigurationManager.AppSettings["ChildNumberOfColumns"]); string ChildColumnNames = ConfigurationManager.AppSettings["ChildColumnNames"]; List <string> ColumnNamesList = new List <string>(ConfigurationManager.AppSettings["ChildColumnNames"].Split(',')); int pointX = 80; int pointY = 40; MyPanel.Controls.Clear(); for (int i = 0; i < ChildNumberOfColumns; i++) { TextBox a = new TextBox(); a.Width = 200; a.Name = ColumnNamesList[i].ToString(); a.Text = ColumnNamesList[i].ToString(); a.Location = new Point(pointX, pointY); MyPanel.Controls.Add(a); MyPanel.Show(); pointY += 45; } } catch (Exception) { MessageBox.Show(e.ToString()); } }
private void Form1_Load(object sender, EventArgs e) { Height = 500; Width = 500; MyPanel myPanel = new MyPanel(); myPanel.BackColor = Color.White; myPanel.BorderStyle = BorderStyle.FixedSingle; myPanel.Height = Height - 50; myPanel.Width = 200; myPanel.Top = 5; myPanel.Left = 5; Controls.Add(myPanel); var icon1 = Image.FromFile(@"path/to/file"); //Load the image FIRST MyPanel.Tile tile = new MyPanel.Tile(icon1); //Pass it into the constructor tile.BackColor = Color.PowderBlue; myPanel.AddTile(tile); var icon2 = Image.FromFile(@"path/to/file"); //Again, image first MyPanel.Tile tile2 = new MyPanel.Tile(icon2); //Then construct tile2.BackColor = Color.PeachPuff; myPanel.AddTile(tile2); }
public void DeletePanelAndDepth(MyPanel myPanel) { //lst_OpenedPanel.Remove(panel); current_panel_depth -= myPanel.plusDepth; Destroy(myPanel.gameObject); }
public void AddPanelObject(MyPanel panel) { if (!panel.gameObject) { return; } panel.gameObject.transform.SetParent(transform); }
public Form6() { InitializeComponent(); g = MyPanel.CreateGraphics(); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; pen = new Pen(Color.Black, 5); pen.StartCap = pen.EndCap = System.Drawing.Drawing2D.LineCap.Round; }
public override void Initialize(IComponent component) { base.Initialize(component); MyPanel myPanel = component as MyPanel; this.EnableDesignMode(myPanel.InnerPanel, "InnerPanel"); this.EnableDesignMode(myPanel.InnerTableLayout, "InnerTableLayout"); }
void deleteButton_Click(object sender, EventArgs e) { //throw new NotImplementedException(); if (MyPanel.FindControl("newButton") != null) { MyPanel.Controls.Remove(MyPanel.FindControl("newButton")); } }
// Start is called before the first frame update void Start() { //tutorialPointer.SetBool("showPointer", true); triggerTarget = FindObjectOfType <TriggerTarget>(); //numberOfTargets = GameObject.FindGameObjectsWithTag("Target").Length; fakePanel = FindObjectOfType <MyPanel>(); fakePanel.PanelSwitch(false); }
private void button2_Click(object sender, EventArgs e) { using (var bmp = new Bitmap(MyPanel.Width, MyPanel.Height)) { MyPanel.DrawToBitmap(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height)); bmp.Save(@"images/" + txtImage.Text + ".bmp"); } }
private void InitializeComponent() { this.components = new Container(); ComponentResourceManager resources = new ComponentResourceManager(typeof(frmCompassView)); this.toolTipCompassView = new ToolTip(this.components); this.panel_Roll = new MyPanel(); this.panel_Pitch = new MyPanel(); this.panel_Compass = new MyPanel(); base.SuspendLayout(); this.panel_Roll.Anchor = AnchorStyles.Left | AnchorStyles.Bottom; this.panel_Roll.Location = new Point(270, 0x83); this.panel_Roll.Margin = new Padding(1); this.panel_Roll.Name = "panel_Roll"; this.panel_Roll.Size = new Size(0x87, 0x87); this.panel_Roll.TabIndex = 2; this.panel_Roll.DoubleClick += new EventHandler(this.panel_Roll_DoubleClick); this.panel_Roll.Paint += new PaintEventHandler(this.panel_Roll_Paint); this.panel_Roll.Resize += new EventHandler(this.panel_Roll_Resize); this.panel_Pitch.Location = new Point(270, 1); this.panel_Pitch.Margin = new Padding(1); this.panel_Pitch.Name = "panel_Pitch"; this.panel_Pitch.Size = new Size(0x87, 0x87); this.panel_Pitch.TabIndex = 1; this.panel_Pitch.DoubleClick += new EventHandler(this.panel_Pitch_DoubleClick); this.panel_Pitch.Paint += new PaintEventHandler(this.panel_Pitch_Paint); this.panel_Pitch.Resize += new EventHandler(this.panel_Pitch_Resize); this.panel_Compass.Location = new Point(1, 1); this.panel_Compass.Margin = new Padding(1); this.panel_Compass.Name = "panel_Compass"; this.panel_Compass.Size = new Size(270, 270); this.panel_Compass.TabIndex = 0; this.panel_Compass.DoubleClick += new EventHandler(this.panel_Compass_DoubleClick); this.panel_Compass.Paint += new PaintEventHandler(this.panel_Compass_Paint); this.panel_Compass.Resize += new EventHandler(this.panel_Compass_Resize); this.panel_Compass.MouseHover += new EventHandler(this.panel_Compass_MouseHover); base.AutoScaleDimensions = new SizeF(6f, 13f); base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; base.ClientSize = new Size(0x189, 0x10c); base.Controls.Add(this.panel_Roll); base.Controls.Add(this.panel_Pitch); base.Controls.Add(this.panel_Compass); base.Icon = (Icon)resources.GetObject("$this.Icon"); base.Location = new Point(50, 50); base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "frmCompassView"; base.ShowInTaskbar = false; base.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; base.StartPosition = FormStartPosition.Manual; this.Text = "MEMS Compass View"; base.Load += new EventHandler(this.frmCompassView_Load); base.LocationChanged += new EventHandler(this.frmCompassView_LocationChanged); base.ResizeEnd += new EventHandler(this.frmCompassView_ResizeEnd); base.ResumeLayout(false); }
private void InitializeComponent() { this.pnlPrice = new MyPanel(); this.lblPrice = new MyLabel(); this.pnlDishName = new MyPanel(); this.lblDishName = new MyLabel(); this.pnlPrice.SuspendLayout(); this.pnlDishName.SuspendLayout(); base.SuspendLayout(); this.pnlPrice.BackColor = Color.IndianRed; this.pnlPrice.BorderStyle = BorderStyle.FixedSingle; this.pnlPrice.Controls.Add(this.lblPrice); this.pnlPrice.Dock = DockStyle.Bottom; this.pnlPrice.Location = new Point(0, 0x178); this.pnlPrice.Name = "pnlPrice"; this.pnlPrice.Size = new Size(480, 0x10); this.pnlPrice.TabIndex = 0; this.pnlPrice.Tag = ""; this.lblPrice.Dock = DockStyle.Fill; this.lblPrice.Location = new Point(0, 0); this.lblPrice.Name = "lblPrice"; this.lblPrice.Size = new Size(0x1de, 14); this.lblPrice.TabIndex = 0; this.lblPrice.Tag = "-9999"; this.lblPrice.Text = "label1"; this.lblPrice.TextAlign = ContentAlignment.BottomCenter; this.pnlDishName.BackColor = Color.FloralWhite; this.pnlDishName.BorderStyle = BorderStyle.FixedSingle; this.pnlDishName.Controls.Add(this.lblDishName); this.pnlDishName.Location = new Point(0, 0); this.pnlDishName.Name = "pnlDishName"; this.pnlDishName.Size = new Size(0x1a0, 0x120); this.pnlDishName.TabIndex = 1; this.pnlDishName.Tag = ""; this.lblDishName.BackColor = Color.Transparent; this.lblDishName.Dock = DockStyle.Fill; this.lblDishName.Location = new Point(0, 0); this.lblDishName.Name = "lblDishName"; this.lblDishName.Size = new Size(0x19e, 0x11e); this.lblDishName.TabIndex = 0; this.lblDishName.Tag = "-9999"; this.lblDishName.Text = "dsfadsfasdfsa"; this.lblDishName.TextAlign = ContentAlignment.MiddleCenter; this.BackColor = SystemColors.Control; base.Controls.Add(this.pnlDishName); base.Controls.Add(this.pnlPrice); base.Name = "DishCard"; base.Size = new Size(480, 0x188); base.Resize += new EventHandler(this.DishCard_Resize); base.Load += new EventHandler(this.DishCard_Load); this.pnlPrice.ResumeLayout(false); this.pnlDishName.ResumeLayout(false); base.ResumeLayout(false); }
public void DisposeTest() { StatusBar sut = new StatusBar(); MyPanel panel = new MyPanel(); sut.Panels.Add(panel); sut.Dispose(); Assert.That(panel.IsDisposed, Is.True); }
public UC_Expression() { InitializeComponent(); SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true); this.panel1 = this.GetPanel(); this.panel1.Location = new Point(0, 0); this.panel1.AutoSize = true; this.panel1.ControlAdded += Panel1_ControlAdded; this.panel_Parent.Controls.Add(this.panel1); this.AddImageToPanel(); }
private void InitializeComponent() { this.components = new Container(); ComponentResourceManager resources = new ComponentResourceManager(typeof(frmCommSignalView)); this.toolTip1 = new ToolTip(this.components); this.toolStrip1 = new ToolStrip(); this.toolStripComboBox_Sattype = new ToolStripComboBox(); this.panel_signal = new MyPanel(); this.toolStrip1.SuspendLayout(); base.SuspendLayout(); this.toolStrip1.Items.AddRange(new ToolStripItem[] { this.toolStripComboBox_Sattype }); this.toolStrip1.Location = new Point(0, 0); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new Size(0x176, 0x19); this.toolStrip1.TabIndex = 1; this.toolStrip1.Text = "toolStrip2"; this.toolStripComboBox_Sattype.Items.AddRange(new object[] { "GPS", "GLONASS", "ALL" }); this.toolStripComboBox_Sattype.Name = "toolStripComboBox_Sattype"; this.toolStripComboBox_Sattype.Size = new Size(90, 0x19); this.toolStripComboBox_Sattype.SelectedIndexChanged += new EventHandler(this.toolStripComboBox_Sattype_SelectedIndexChanged); this.panel_signal.AutoScroll = true; this.panel_signal.AutoSize = true; this.panel_signal.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.panel_signal.Dock = DockStyle.Fill; this.panel_signal.Location = new Point(0, 0x19); this.panel_signal.Name = "panel_signal"; this.panel_signal.Size = new Size(0x176, 0xe4); this.panel_signal.TabIndex = 0; this.panel_signal.Paint += new PaintEventHandler(this.panel_Signal_Paint); this.panel_signal.Resize += new EventHandler(this.panel_signal_Resize); base.AutoScaleDimensions = new SizeF(6f, 13f); base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScroll = true; base.ClientSize = new Size(0x176, 0xfd); base.Controls.Add(this.panel_signal); base.Controls.Add(this.toolStrip1); base.Icon = (Icon)resources.GetObject("$this.Icon"); base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "frmCommSignalView"; base.ShowInTaskbar = false; base.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; base.StartPosition = FormStartPosition.Manual; this.Text = "Signal View"; base.Load += new EventHandler(this.frmCommSignalView_Load); base.LocationChanged += new EventHandler(this.frmCommSignalView_LocationChanged); base.ResizeEnd += new EventHandler(this.frmCommSignalView_ResizeEnd); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); base.ResumeLayout(false); base.PerformLayout(); }
/// <summary> /// 生成控件面板 /// </summary> /// <returns></returns> private MyPanel GetPanel() { MyPanel panel = new MyPanel { BackColor = System.Drawing.Color.White, BorderStyle = System.Windows.Forms.BorderStyle.None, Location = new System.Drawing.Point(100, 55), Size = this.panel_Parent.Size, Padding = new Padding(0, 0, 0, 10) }; return(panel); }
/// <summary> /// 生成面板 /// </summary> /// <returns></returns> private MyPanel GetPanel() { Size size = new Size(550, 360); Point p = new Point(35, 70); MyPanel panel = new MyPanel { BackColor = Color.FromArgb(22, 24, 28), Location = p, Size = size, Padding = new Padding(0, 0, 0, 10) }; return(panel); }
private void BtnUserManage_Click(object sender, EventArgs e) { try { MyPanel.Controls.Clear(); MyPanel.Controls.Add(userInfoContrl); MyPanel.Focus(); } catch (Exception ex) { Log.Error("[" + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "][" + System.Reflection.MethodBase.GetCurrentMethod().Name + "] err" + ex); MessageBox.Show(ex.Message); } }
public void When_Measure_Empty() { var SUT = new MyPanel() { Name = "test" }; SUT.Measure(default(Windows.Foundation.Size)); var size = SUT.DesiredSize; SUT.Arrange(default(Windows.Foundation.Rect)); Assert.AreEqual(default(Windows.Foundation.Size), size); Assert.IsTrue(SUT.GetChildren().None()); }
public ChooseHeadImage() { InitializeComponent(); Method.FormShadow(this); SelectImage = HeadImages.im1; SelectImageName = "im1"; Thread.CurrentThread.IsBackground = true; SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true); this.panel1 = this.GetPanel(); this.panel1.Location = new Point(0, 0); this.panel1.AutoSize = true; this.panel1.ControlAdded += Panel1_ControlAdded; this.panel_Panent.Controls.Add(this.panel1); this.bt_Confirm.Image = HeadImages.im1; this.Refresh(); }
public MyList(Sprite sprite, Rect rect) : base("List") { Element = new MyPanel(sprite, rect).Element; Element.AddComponent<Mask>(); var scrollRect = Element.AddComponent<ScrollRect>(); var panelIn = new MyPanel(sprite, new Rect(0, 0, 0, 200)); var panelInRect = panelIn.Element.GetComponent<RectTransform>(); panelInRect.pivot = new Vector2(0.5f, 1); panelIn.SetAnchor(new Vector2(0, 0), new Vector2(1, 1)); panelIn.Element.AddComponent<VerticalLayoutGroup>(); AddElement(panelIn); MainElement = panelIn; scrollRect.content = MainElement.Element.GetComponent<RectTransform>(); }
private void from_Load(object sender, EventArgs e) { tasks = new List <TaskWork>(); LabelClick = label_click; tasks = TaskController.GetListTask(); this.Size = new Size(1300, 800); myPanel = new MyPanel(tasks, label_click, button1.Size.Width); splitContainer2.Panel2.Controls.Add(myPanel); myPanel.Dock = DockStyle.Fill; myPanel.BackColor = Color.White; UpdateCBBView(); cbbView.SelectedItem = "ALL"; }
public Grid(MyPanel panel, int col, int row) { Panel = panel; Col = col; Row = row; Width = col * 27 - 1; Height = row * 27 - 1; Points = new Point[Row, Col]; for (int i = 0; i < Row; i++) { for (int j = 0; j < Col; j++) { Points[i, j].X = 27 * j - 1; Points[i, j].Y = 27 * i - 1; } } }
private void ListControlsInPanel() { var theInfo = ""; theInfo = $"<b>Does the panel have controls? {MyPanel.HasControls()} </b><br/>"; //Get all the controls in the panel foreach (Control control in MyPanel.Controls) { if (!object.ReferenceEquals(control.GetType(), typeof(System.Web.UI.LiteralControl))) { theInfo += "**************<br>"; theInfo += $"Control Name: {control}<br>"; theInfo += $"ID? {control.ID} <br>"; theInfo += $"Control Visable? {control.Visible}<br>"; theInfo += $"ViewState? {control.ViewStateMode}<br>"; } } lblControlInfo.Text = theInfo; }
public Window CreateWindow() { // Create a window object and set its size to the // size of the display. mainWindow = new Window(); _panel = new MyPanel(); mainWindow.Height = SystemMetrics.ScreenHeight; mainWindow.Width = SystemMetrics.ScreenWidth; Text t = new Text(Resources.GetFont(Resources.FontResources.small), "Shape Tests !"); t.VerticalAlignment = VerticalAlignment.Center; t.HorizontalAlignment = HorizontalAlignment.Center; _panel.Children.Add(t); mainWindow.Child = _panel; // Set the window visibility to visible. mainWindow.Visibility = Visibility.Visible; return mainWindow; }
public Window CreateWindow() { // Create a window object and set its size to the // size of the display. mainWindow = new Window(); _panel = new MyPanel(); mainWindow.Height = SystemMetrics.ScreenHeight; mainWindow.Width = SystemMetrics.ScreenWidth; Text t = new Text(Resources.GetFont(Resources.FontResources.NinaB), "Media Tests !"); t.VerticalAlignment = VerticalAlignment.Center; t.HorizontalAlignment = HorizontalAlignment.Center; _panel.Children.Add(t); mainWindow.Child = _panel; // Set the window visibility to visible. mainWindow.Visibility = Visibility.Visible; return(mainWindow); }
public void When_Measure_OneItem() { var SUT = new MyPanel() { Name = "test" }; var item1 = new Border() { Width = 10, Height = 10 }; SUT.Children.Add(item1); SUT.Measure(new Size(20, 20)); var size = SUT.DesiredSize; SUT.Arrange(new Rect(0, 0, 10, 10)); Assert.AreEqual(new Size(10, 10), size); Assert.AreEqual(new Rect(0, 0, 10, 10), item1.Arranged); Assert.AreEqual(1, SUT.GetChildren().Count()); }
public ScreenShots(Bitmap bmp) { InitializeComponent(); this.OverSave = false; this.TopMost = true; this.WindowState = FormWindowState.Maximized; this.BackgroundImage = bmp; SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true); MyPanel panel = new MyPanel(); panel.Name = "panel_Select"; panel.Size = new Size(1, 1); panel.Visible = false; panel.BackColor = Color.Transparent; panel.Parent = this; panel.BorderStyle = BorderStyle.FixedSingle; panel.BackgroundImageLayout = ImageLayout.Stretch; MyPanel m = new MyPanel(); m.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); m.Dock = System.Windows.Forms.DockStyle.Fill; m.Location = new System.Drawing.Point(0, 0); m.Name = "panel1"; m.Size = new System.Drawing.Size(1007, 574); m.TabIndex = 0; m.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown); m.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseMove); m.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseUp); m.Cursor = Cursors.Cross; this.Controls.Add(panel); this.Controls.Add(m); panel.BringToFront(); this.panel_Select = panel; this.panel_Meng = m; }
private void InitializeComponent() { this.components = new Container(); ComponentResourceManager manager = new ComponentResourceManager(typeof(frmCommRadarMap)); this.toolTip1 = new ToolTip(this.components); this.panel_SVs = new MyPanel(); base.SuspendLayout(); this.panel_SVs.AutoSize = true; this.panel_SVs.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.panel_SVs.Dock = DockStyle.Fill; this.panel_SVs.Location = new Point(0, 0); this.panel_SVs.Name = "panel_SVs"; this.panel_SVs.Size = new Size(0x117, 0x11b); this.panel_SVs.TabIndex = 0; this.panel_SVs.Paint += new PaintEventHandler(this.panel_SVs_Paint); this.panel_SVs.Resize += new EventHandler(this.panel_SVs_Resize); this.panel_SVs.MouseEnter += new EventHandler(this.panel_SVs_MouseEnter); base.AutoScaleDimensions = new SizeF(6f, 13f); base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; base.ClientSize = new Size(0x117, 0x11b); base.Controls.Add(this.panel_SVs); base.Icon = (Icon)manager.GetObject("$this.Icon"); base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "frmCommRadarMap"; base.ShowInTaskbar = false; base.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; base.StartPosition = FormStartPosition.Manual; this.Text = "Radar View"; base.Load += new EventHandler(this.frmCommRadarMap_Load); base.Resize += new EventHandler(this.frmCommRadarMap_Resize); base.LocationChanged += new EventHandler(this.frmCommRadarMap_LocationChanged); base.ResumeLayout(false); base.PerformLayout(); }
public MyWindow(Sprite sprite, string title, Rect rect) : base() { isOpen = true; Head = new MyPanel(sprite, rect); Head.Element.name = "Window" + title; var trans = Head.Element.GetComponent<RectTransform>(); Head.SetAnchor(new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f)); trans.anchoredPosition3D = new Vector3(0, 0, 0); trans.anchoredPosition = new Vector2(0, 0); trans.localPosition = new Vector3(0, 0, 0); trans.localScale = new Vector3(1, 1, 1); SetSize(trans, rect.size); var header = new MyPanel(sprite, rect); trans = header.Element.GetComponent<RectTransform>(); header.Element.GetComponent<Image>().color = new Color32(230, 230, 230, 200); header.SetAnchor(new Vector2(0, 1), new Vector2(1, 1)); trans.anchoredPosition3D = new Vector3(0, 0, 0); trans.anchoredPosition = new Vector2(0, 0); trans.offsetMin = new Vector2(0, 0); trans.offsetMax = new Vector2(0, 0); trans.localPosition = new Vector3(0, -10, 0); trans.sizeDelta = new Vector2(0, 20); trans.localScale = new Vector3(1, 1, 1); var titleWindow = new MyText(title); header.AddElement(titleWindow); var buttonClosed = new MyButton(() => SetActive(false), sprite, new Rect(0, 0, 64, 48), "X"); var rectButton = buttonClosed.Element.GetComponent<RectTransform>(); buttonClosed.SetAnchor(new Vector2(1, 1), new Vector2(1, 1)); rectButton.sizeDelta = new Vector2(50, 20); rectButton.localPosition = new Vector3(-25, -10, 0); //rectButton.pivot = new Vector2(1, 1); var buttonScript = buttonClosed.Element.GetComponent<Button>(); buttonScript.transition = Selectable.Transition.ColorTint; var selColor = new ColorBlock(); selColor.normalColor = buttonClosed.Element.GetComponent<Button>().colors.normalColor; selColor.pressedColor = new Color32(255, 80, 80, 255); selColor.highlightedColor = new Color32(255, 0, 0, 255); selColor.colorMultiplier = 1; selColor.fadeDuration = 0.2f; buttonClosed.Element.GetComponent<Button>().colors = selColor; Element = new MyPanel(sprite, rect).Element; var transM = Element.GetComponent<RectTransform>(); SetAnchor(new Vector2(0, 0), new Vector2(1, 1)); transM.anchoredPosition3D = new Vector3(0, 0, 0); transM.anchoredPosition = new Vector2(0, 0); transM.sizeDelta = new Vector2(0, 0); transM.localPosition = new Vector3(0, -20, 0); transM.offsetMin = new Vector2(transM.offsetMin.x, 0); transM.localScale = new Vector3(1, 1, 1); header.AddElement(buttonClosed); Head.AddElement(header); Head.AddElement(this); }
public static MyPanel TestButton(object test, Sprite sprite, LoadingData data, Sprite backgroundTest) { var headPanel = new MyPanel(sprite, new Rect(0, 0, 0, 0)); Destroy(headPanel.Element.GetComponent<Image>()); headPanel.SetAnchor(new Vector2(0, 0), new Vector2(1, 1)); headPanel.Element.AddComponent<VerticalLayoutGroup>(); var headPanelContentSizeFilter = headPanel.Element.AddComponent<ContentSizeFitter>(); headPanelContentSizeFilter.verticalFit = ContentSizeFitter.FitMode.PreferredSize; if ((test as Folder) != null) { var mainPanel = new MyPanel(sprite, new Rect(0, 0, 0, 0)); Destroy(mainPanel.Element.GetComponent<Image>()); mainPanel.Element.SetActive(((Folder)test).IsOpen); mainPanel.SetAnchor(new Vector2(0, 0), new Vector2(1, 1)); mainPanel.Element.AddComponent<LayoutElement>(); mainPanel.Element.AddComponent<VerticalLayoutGroup>().padding.left = 20; var buttonArea = new MyPanel(sprite, new Rect(0, 0, 0, 0)); UIElement.SetSize(buttonArea.Element.GetComponent<RectTransform>(), new Vector2(60, 32)); buttonArea.SetAnchor(new Vector2(0, 0), new Vector2(1, 1)); buttonArea.Element.AddComponent<HorizontalLayoutGroup>(); var button = new MyButton( () => { mainPanel.Element.SetActive(!mainPanel.Element.activeSelf); ((Folder)test).IsOpen = !((Folder)test).IsOpen; Debug.Log(((Folder)test).Name + " : " + mainPanel.Element.activeSelf); } , sprite, new Rect(0, 0, 0, 0), " <color=#00000060>►</color> " + ((Folder)test).Name); button.Element.AddComponent<LayoutElement>(); var buttonRunTestIn = new MyButton( () => { TestDispatcher.RunAnyTests(((Folder)test).GetChildrenTests().Select(e => e.NameTest), data); foreach(var e in ((Folder)test).GetChildrenTests().Select(e => e.NameTest)) ((Test) test).State = TestDispatcher.LastTestExecution[e] ? 1 : -1; } , sprite, new Rect(0, 0, 0, 0), " <color=#00ff0060>►</color> "); buttonRunTestIn.Element.AddComponent<LayoutElement>(); buttonArea.AddElement(button); buttonArea.AddElement(buttonRunTestIn); button.Element.GetComponentInChildren<Text>().alignment = TextAnchor.MiddleLeft; UIElement.SetSize(button.Element.GetComponent<RectTransform>(), new Vector2(60, 32)); button.SetAnchor(new Vector2(0, 0), new Vector2(1, 1)); var layoutElement = button.Element.AddComponent<LayoutElement>(); layoutElement.minHeight = 30; headPanel.AddElement(buttonArea); foreach (var e in ((Folder)test).GetChildren()) mainPanel.AddElement(TestButton(e, sprite, data, backgroundTest)); headPanel.AddElement(mainPanel); } else { var testName = ((Test)test).NameTest; var button = new MyButton( () => { TestDispatcher.RunOneTest(data, testName); if (TestDispatcher.LastTestExecution.ContainsKey(testName)) if (TestDispatcher.LastTestExecution[testName]) ((Test)test).State = 1; else ((Test)test).State = -1; else ((Test)test).State = 0; ((Test)test).State = TestDispatcher.LastTestExecution[testName] ? 1 : -1; }, sprite, new Rect(0, 0, 0, 0), testName.Split('_').Last()); button.SetAnchor(new Vector2(0, 0), new Vector2(1, 1)); button.Element.AddComponent<LayoutElement>(); var testStateImage = new MyPanel(backgroundTest, new Rect(0, 0, 0, 0)); testStateImage.SetAnchor(new Vector2(0, 0), new Vector2(1, 1)); button.AddElement(testStateImage); testStateImage.Element.transform.SetAsFirstSibling(); //testStateImage.Element.GetComponent<Image>().color = new Color32(0, 0, 0, 100); testStateImage.Element.GetComponent<Image>().color = GetTestColor(testName); button.Element.GetComponent<Button>().onClick.AddListener(() => testStateImage.Element.GetComponent<Image>().color = GetTestColor(testName)); headPanel.AddElement(button); UIElement.SetSize(button.Element.GetComponent<RectTransform>(), new Vector2(60, 32)); button.SetAnchor(new Vector2(0, 0), new Vector2(1, 1)); var layoutElement = button.Element.AddComponent<LayoutElement>(); layoutElement.minHeight = 30; } return headPanel; }
override protected void CreateChildren() { base.CreateChildren(); #region Title Label label = new TitleLabel {HorizontalCenter = 0, Top = 20, StyleName = "title", Text = "Panel demo"}; AddChild(label); #endregion #region Scroller Scroller scroller = new Scroller { SkinClass = typeof (ScrollerSkin2), Left = 0, Right = 0, Top = 0, Bottom = 0, }; //scroller.SetStyle("horizontalScrollPolicy", ScrollPolicy.On); //scroller.SetStyle("verticalScrollPolicy", ScrollPolicy.On); AddChild(scroller); Group viewport = new Group(); scroller.Viewport = viewport; #endregion #region HGroup HGroup hGroup = new HGroup {Gap = 10, HorizontalCenter = 0, VerticalCenter = 0}; viewport.AddChild(hGroup); #endregion #region Panel 1 Panel panel = new MyPanel { Width = 360, Height = 600, Icon = ImageLoader.Instance.Load("Icons/shape_square_add"), Title = "First panel", StyleName = "default" }; hGroup.AddChild(panel); #endregion #region Panel 2 panel = new MyPanel { //Width = 360, Height = 600, SkinClass = typeof(PanelSkin2), Icon = ImageLoader.Instance.Load("Icons/page_white_text"), Title = "Second panel" }; hGroup.AddChild(panel); //// NOTE: propagation of styles to skin still not implemented //// So, this won't work: panel.SetStyle("headerLabelColor", 0xffff00); //// This is a temporary solution: //panel.CreationCompleteHandler += delegate //{ //Debug.Log("panel.Skin: " + panel.Skin); //panel.Skin.SetStyle("headerLabelColor", Color.yellow); //}; #endregion #region Panel 2 skin switch VGroup vGroup = new VGroup(); vGroup.Plugins.Add(new TabManager { ArrowsEnabled = true, UpDownArrowsEnabled = true }); hGroup.AddChild(vGroup); Button button = new Button { Text = "Skin 1", Icon = Resources.Load<Texture>("Icons/skin"), SkinClass = typeof(ImageButtonSkin), PercentWidth = 100 }; button.Press += delegate { panel.SkinClass = typeof (PanelSkin); //((MyPanel)panel).CreateButtons(); }; vGroup.AddChild(button); button = new Button { Text = "Skin 2", Icon = Resources.Load<Texture>("Icons/skin"), SkinClass = typeof(ImageButtonSkin), PercentWidth = 100 }; button.Press += delegate { panel.SkinClass = typeof (PanelSkin2); }; vGroup.AddChild(button); button = new Button { Text = "Skin 3", Icon = Resources.Load<Texture>("Icons/skin"), SkinClass = typeof(ImageButtonSkin), PercentWidth = 100 }; button.Press += delegate { panel.SkinClass = typeof (PanelSkin3); }; vGroup.AddChild(button); button = new Button { Text = "Skin 4", Icon = Resources.Load<Texture>("Icons/skin"), SkinClass = typeof(ImageButtonSkin), PercentWidth = 100 }; button.Press += delegate { panel.SkinClass = typeof (PanelSkin4); }; vGroup.AddChild(button); button = new Button { Text = "Add button", AutoRepeat = true, Icon = Resources.Load<Texture>("Icons/add"), SkinClass = typeof(ImageButtonSkin), PercentWidth = 100 }; /*button.Press += delegate { ((MyPanel)panel).AddButton("Button"); };*/ button.ButtonDown += delegate { ((MyPanel)panel).AddButton("Button"); }; vGroup.AddChild(button); #endregion }
private void InitializeComponent() { ComponentResourceManager manager = new ComponentResourceManager(typeof(frmCommDRStatus)); this.fileSystemWatcher1 = new FileSystemWatcher(); this.myPanel1 = new MyPanel(); this.groupBox7 = new GroupBox(); this.textBox_DRNavStatus = new TextBox(); this.groupBox2 = new GroupBox(); this.textBox_DRNavSubSysData = new TextBox(); this.groupBox1 = new GroupBox(); this.textBox_DRNavState = new TextBox(); this.fileSystemWatcher1.BeginInit(); this.myPanel1.SuspendLayout(); this.groupBox7.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox1.SuspendLayout(); base.SuspendLayout(); this.fileSystemWatcher1.EnableRaisingEvents = true; this.fileSystemWatcher1.SynchronizingObject = this; this.myPanel1.Controls.Add(this.groupBox7); this.myPanel1.Controls.Add(this.groupBox2); this.myPanel1.Controls.Add(this.groupBox1); this.myPanel1.Dock = DockStyle.Fill; this.myPanel1.Location = new Point(0, 0); this.myPanel1.Name = "myPanel1"; this.myPanel1.Size = new Size(0x2ef, 0x28c); this.myPanel1.TabIndex = 3; this.myPanel1.Paint += new PaintEventHandler(this.myPanel1_Paint); this.groupBox7.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.groupBox7.BackColor = SystemColors.ControlLight; this.groupBox7.Controls.Add(this.textBox_DRNavStatus); this.groupBox7.Location = new Point(7, 9); this.groupBox7.Name = "groupBox7"; this.groupBox7.Size = new Size(0x183, 640); this.groupBox7.TabIndex = 1; this.groupBox7.TabStop = false; this.groupBox7.Text = "DR NAV Status"; this.groupBox7.Enter += new EventHandler(this.groupBox7_Enter); this.textBox_DRNavStatus.BackColor = SystemColors.ControlLight; this.textBox_DRNavStatus.BorderStyle = BorderStyle.None; this.textBox_DRNavStatus.Dock = DockStyle.Fill; this.textBox_DRNavStatus.Location = new Point(3, 0x10); this.textBox_DRNavStatus.Multiline = true; this.textBox_DRNavStatus.Name = "textBox_DRNavStatus"; this.textBox_DRNavStatus.Size = new Size(0x17d, 0x26d); this.textBox_DRNavStatus.TabIndex = 9; this.textBox_DRNavStatus.Text = "status"; this.groupBox2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.groupBox2.BackColor = SystemColors.ControlLight; this.groupBox2.Controls.Add(this.textBox_DRNavSubSysData); this.groupBox2.Location = new Point(400, 0x1cd); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new Size(0x159, 0xbd); this.groupBox2.TabIndex = 2; this.groupBox2.TabStop = false; this.groupBox2.Text = "NAV Subsystem Data"; this.groupBox2.Enter += new EventHandler(this.groupBox2_Enter); this.textBox_DRNavSubSysData.BackColor = SystemColors.ControlLight; this.textBox_DRNavSubSysData.BorderStyle = BorderStyle.None; this.textBox_DRNavSubSysData.Dock = DockStyle.Fill; this.textBox_DRNavSubSysData.Location = new Point(3, 0x10); this.textBox_DRNavSubSysData.Multiline = true; this.textBox_DRNavSubSysData.Name = "textBox_DRNavSubSysData"; this.textBox_DRNavSubSysData.Size = new Size(0x153, 170); this.textBox_DRNavSubSysData.TabIndex = 9; this.textBox_DRNavSubSysData.Text = "Subsys data"; this.groupBox1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.groupBox1.BackColor = SystemColors.ControlLight; this.groupBox1.Controls.Add(this.textBox_DRNavState); this.groupBox1.Location = new Point(400, 9); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new Size(0x159, 0x1bd); this.groupBox1.TabIndex = 2; this.groupBox1.TabStop = false; this.groupBox1.Text = "DR NAV State"; this.groupBox1.Enter += new EventHandler(this.groupBox1_Enter); this.textBox_DRNavState.BackColor = SystemColors.ControlLight; this.textBox_DRNavState.BorderStyle = BorderStyle.None; this.textBox_DRNavState.Dock = DockStyle.Fill; this.textBox_DRNavState.Location = new Point(3, 0x10); this.textBox_DRNavState.Multiline = true; this.textBox_DRNavState.Name = "textBox_DRNavState"; this.textBox_DRNavState.Size = new Size(0x153, 0x1aa); this.textBox_DRNavState.TabIndex = 8; this.textBox_DRNavState.Text = "state"; base.AutoScaleDimensions = new SizeF(6f, 13f); base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; base.ClientSize = new Size(0x2ef, 0x28c); base.Controls.Add(this.myPanel1); base.Icon = (Icon)manager.GetObject("$this.Icon"); base.Name = "frmCommDRStatus"; base.ShowInTaskbar = false; base.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.Text = "SiRFDRive Status View"; base.Load += new EventHandler(this.frmCommDRStatus_Load); base.Resize += new EventHandler(this.frmCommDRStatus_Resize); base.LocationChanged += new EventHandler(this.frmCommDRStatus_LocationChanged); base.ResizeEnd += new EventHandler(this.frmCommDRStatus_ResizeEnd); this.fileSystemWatcher1.EndInit(); this.myPanel1.ResumeLayout(false); this.groupBox7.ResumeLayout(false); this.groupBox7.PerformLayout(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); base.ResumeLayout(false); }
override protected void CreateChildren() { base.CreateChildren(); #region Controls Toolbar toolbar = new Toolbar(); AddChild(toolbar); #region Alert Button btnAlert = new Button { Text = "Alert", FocusEnabled = false, SkinClass = typeof(ImageButtonSkin), Icon = ImageLoader.Instance.Load("Icons/comment") }; btnAlert.Click += delegate { Alert.Show("Info", "This is the example alert.", AlertButtonFlag.Ok, new AlertOption(AlertOptionType.HeaderIcon, Resources.Load<Texture>("Icons/information")), new AlertOption(AlertOptionType.Icon, Resources.Load<Texture>("Icons/star_big"))); }; toolbar.AddContentChild(btnAlert); #endregion #region Window Button btnWindow = new Button { Text = "New window", FocusEnabled = false, SkinClass = typeof(ImageButtonSkin), Icon = ImageLoader.Instance.Load("Icons/comment") }; btnWindow.Click += delegate { _count++; var window = new MyWindow { Title = "The Window " + _count, Id = "window_" + _count, SkinClass = typeof(WindowSkin2), Icon = ImageLoader.Instance.Load("Icons/balloon_32"), Width = 400, Height = 600 }; window.SetStyle("addedEffect", _windowShow); window.Plugins.Add(new Resizable { ShowOverlay = false }); window.AddEventListener(CloseEvent.CLOSE, delegate { PopupManager.Instance.RemovePopup(window); }); PopupManager.Instance.AddPopup(window, false); PopupManager.Instance.CenterPopUp(window); }; toolbar.AddContentChild(btnWindow); #endregion #endregion #region Scroller Scroller scroller = new Scroller { SkinClass = typeof (ScrollerSkin2), PercentWidth = 100, PercentHeight = 100 }; //scroller.SetStyle("horizontalScrollPolicy", ScrollPolicy.On); //scroller.SetStyle("verticalScrollPolicy", ScrollPolicy.On); AddChild(scroller); Group viewport = new Group { Layout = new VerticalLayout { HorizontalAlign = HorizontalAlign.Left, PaddingLeft = 10, PaddingRight = 10, PaddingTop = 10, PaddingBottom = 10, Gap = 10 } }; scroller.Viewport = viewport; #endregion #region Horizontal Scrollbars viewport.AddChild(new HScrollBar { SkinClass = typeof(HScrollBarSkin3), PercentWidth = 100, MinWidth = 300, Maximum = 300, PageSize = 100 }); viewport.AddChild(new HScrollBar { SkinClass = typeof(HScrollBarSkin3), PercentWidth = 50, Maximum = 500, Value = 200, PageSize = 100 }); viewport.AddChild(new HScrollBar { SkinClass = typeof(HScrollBarSkin2), MinWidth = 600, Maximum = 1000, PageSize = 100 }); viewport.AddChild(new HScrollBar { SkinClass = typeof(HScrollBarSkin3), MinWidth = 700, Maximum = 300, PageSize = 100 }); viewport.AddChild(new HScrollBar { PercentWidth = 100, MinWidth = 600, SkinClass = typeof(HScrollBarSkin3), Maximum = 1000, PageSize = 100 }); #endregion #region HGroup HGroup hGroup = new HGroup { /*PercentWidth = 100, */Gap = 10 }; viewport.AddChild(hGroup); #endregion #region Vertical scrollbars VScrollBar vScrollBar = new VScrollBar { PercentHeight = 100, Maximum = 300 }; vScrollBar.Change += delegate(Event e) { Debug.Log("Change: " + e); }; hGroup.AddChild(vScrollBar); hGroup.AddChild(new VScrollBar { PercentHeight = 100, Maximum = 400, PageSize = 100 }); hGroup.AddChild(new VScrollBar { SkinClass = typeof(VScrollBarSkin2), PercentHeight = 100, Maximum = 1000, PageSize = 100 }); hGroup.AddChild(new VScrollBar { SkinClass = typeof(VScrollBarSkin2), Height = 400, Maximum = 400, PageSize = 100 }); hGroup.AddChild(new VScrollBar { SkinClass = typeof(VScrollBarSkin3), PercentHeight = 100, Maximum = 200, PageSize = 100 }); hGroup.AddChild(new VScrollBar { SkinClass = typeof(VScrollBarSkin3), Height = 400, Maximum = 300, PageSize = 100 }); #endregion #region Panels //hGroup.AddChild(new Spacer { PercentWidth = 50 }); Panel panel = new MyPanel { Width = 360, Height = 600, Icon = ImageLoader.Instance.Load("Icons/shape_square_add"), Title = "First panel", StyleName = "default" }; hGroup.AddChild(panel); panel = new MyPanel2 { MaxWidth = 500, Height = 600, SkinClass = typeof (PanelSkin2), Icon = ImageLoader.Instance.Load("Icons/page_white_text"), Title = "Second panel" }; panel.SetStyle("titleColor", 0xffff00); hGroup.AddChild(panel); //hGroup.AddChild(new Spacer { PercentWidth = 50 }); #endregion #region Vertical sliders hGroup.AddChild(new VSlider { PercentHeight = 100 }); hGroup.AddChild(new VSlider { Width = 30, Height = 400, SkinClass = typeof(VSliderSkin2) }); hGroup.AddChild(new VSlider { Width = 30, Height = 400, SkinClass = typeof(VSliderSkin2), Enabled = false }); hGroup.AddChild(new VSlider { Width = 50, Height = 400, SkinClass = typeof(VSliderSkin2) }); hGroup.AddChild(new VSlider { Width = 80, Height = 400, SkinClass = typeof(VSliderSkin3) }); hGroup.AddChild(new VSlider { Width = 80, PercentHeight = 100, Maximum = 1000, SkinClass = typeof(VSliderSkin3) }); #endregion #region Horizontal sliders viewport.AddChild(new HSlider { Maximum = 400, PercentWidth = 100 }); viewport.AddChild(new HSlider { Width = 400, Maximum = 400, Height = 30, SkinClass = typeof(HSliderSkin2) }); viewport.AddChild(new HSlider { Width = 400, Maximum = 400, Height = 50, SkinClass = typeof(HSliderSkin2) }); viewport.AddChild(new HSlider { PercentWidth = 50, Height = 80, SkinClass = typeof(HSliderSkin3) }); viewport.AddChild(new HSlider { PercentWidth = 100, Maximum = 1000, Height = 80, SkinClass = typeof(HSliderSkin3) }); #endregion }