/// <summary> /// Select TextDir.UpsideDown if this Control is clicked. /// If it is clicked with the Left MouseButton also close it. /// </summary> /// <param name="sender">Standard sender object.</param> /// <param name="e">Standard MouseEventArgs object.</param> private void mwlblTDU_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) { this.TextDir = TextDir.UpsideDown; this.Refresh(); if(e.Button == MouseButtons.Left) { this.IWFES.CloseDropDown(); } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.mwlblTDN = new MWLabel(); this.mwlblTDL = new MWLabel(); this.mwlblTDR = new MWLabel(); this.mwlblTDU = new MWLabel(); this.lblDescription = new System.Windows.Forms.Label(); this.SuspendLayout(); // // mwlblTDN // this.mwlblTDN.BackColor = System.Drawing.SystemColors.ActiveBorder; this.mwlblTDN.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.mwlblTDN.ForeColor = System.Drawing.SystemColors.HotTrack; this.mwlblTDN.Location = new System.Drawing.Point(24, 0); this.mwlblTDN.Name = "mwlblTDN"; this.mwlblTDN.Size = new System.Drawing.Size(80, 24); this.mwlblTDN.TabIndex = 0; this.mwlblTDN.Text = "Text"; this.mwlblTDN.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.mwlblTDN.MouseUp += new System.Windows.Forms.MouseEventHandler(this.mwlblTDN_MouseUp); // // mwlblTDL // this.mwlblTDL.BackColor = System.Drawing.SystemColors.ActiveBorder; this.mwlblTDL.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.mwlblTDL.ForeColor = System.Drawing.SystemColors.ControlText; this.mwlblTDL.Location = new System.Drawing.Point(0, 24); this.mwlblTDL.Name = "mwlblTDL"; this.mwlblTDL.Size = new System.Drawing.Size(24, 80); this.mwlblTDL.TabIndex = 1; this.mwlblTDL.Text = "Text"; this.mwlblTDL.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.mwlblTDL.TextDir = TextDir.Left; this.mwlblTDL.MouseUp += new System.Windows.Forms.MouseEventHandler(this.mwlblTDL_MouseUp); // // mwlblTDR // this.mwlblTDR.BackColor = System.Drawing.SystemColors.ActiveBorder; this.mwlblTDR.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.mwlblTDR.ForeColor = System.Drawing.SystemColors.ControlText; this.mwlblTDR.Location = new System.Drawing.Point(104, 24); this.mwlblTDR.Name = "mwlblTDR"; this.mwlblTDR.Size = new System.Drawing.Size(24, 80); this.mwlblTDR.TabIndex = 2; this.mwlblTDR.Text = "Text"; this.mwlblTDR.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.mwlblTDR.TextDir = TextDir.Right; this.mwlblTDR.MouseUp += new System.Windows.Forms.MouseEventHandler(this.mwlblTDR_MouseUp); // // mwlblTDU // this.mwlblTDU.BackColor = System.Drawing.SystemColors.ActiveBorder; this.mwlblTDU.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.mwlblTDU.ForeColor = System.Drawing.SystemColors.ControlText; this.mwlblTDU.Location = new System.Drawing.Point(24, 104); this.mwlblTDU.Name = "mwlblTDU"; this.mwlblTDU.Size = new System.Drawing.Size(80, 24); this.mwlblTDU.TabIndex = 3; this.mwlblTDU.Text = "Text"; this.mwlblTDU.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.mwlblTDU.TextDir = TextDir.UpsideDown; this.mwlblTDU.MouseUp += new System.Windows.Forms.MouseEventHandler(this.mwlblTDU_MouseUp); // // lblDescription // this.lblDescription.Location = new System.Drawing.Point(24, 24); this.lblDescription.Name = "lblDescription"; this.lblDescription.Size = new System.Drawing.Size(80, 80); this.lblDescription.TabIndex = 4; this.lblDescription.Text = "Text\nDirection:"; this.lblDescription.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblDescription.MouseUp += new System.Windows.Forms.MouseEventHandler(this.lblDescription_MouseUp); // // EditorTextDirUI // this.BackColor = System.Drawing.SystemColors.ActiveBorder; this.Controls.AddRange(new System.Windows.Forms.Control[] { this.lblDescription, this.mwlblTDN, this.mwlblTDU, this.mwlblTDR, this.mwlblTDL}); this.Name = "EditorTextDirUI"; this.Size = new System.Drawing.Size(128, 128); this.Resize += new System.EventHandler(this.EditorTextDirUI_Resize); this.ResumeLayout(false); }
/// <summary> /// Standard Constructor. /// </summary> /// <param name="tdOld">The old TextDir before the property was changed.</param> /// <param name="tdNew">The new TextDir after the property was changed.</param> public TextDirEventArgs(TextDir tdOld, TextDir tdNew) { tdOldTextDir = tdOld; tdNewTextDir = tdNew; }
/// <summary> /// Gets a Rectangle that is sized for being used to paint the value properly in Visual Studio's /// (or wherever it is used) Property Window. /// </summary> /// <param name="td">TextDir to base the Rectangle size and position on.</param> /// <param name="rct">Starting Rectangle.</param> /// <returns></returns> private Rectangle GetModifiedClientRectangle(TextDir td, Rectangle rct) { switch(td) { case TextDir.Normal: return new Rectangle(rct.X + 1, rct.Y, rct.Width, rct.Height); break; case TextDir.UpsideDown: return new Rectangle(rct.X - 2, rct.Y - 1, rct.Width, rct.Height); break; case TextDir.Left: return new Rectangle(rct.X - 5, rct.Y + 4, rct.Width, rct.Height); break; case TextDir.Right: return new Rectangle(rct.X - 2, rct.Y + 1, rct.Width, rct.Height); break; default: return rct; break; } }