Пример #1
0
 protected void DrawRoundedRectangle(Graphics gr, Brush brush, int x, int y, int width, int height, RoundedCornerStyles corners)
 {
     if (corners == RoundedCornerStyles.None)
     {
         gr.FillRectangle(brush, x, y, width, height);
     }
     else
     {
         int num = ItemRoundedCornerSize * 2;
         Rectangle rect = new Rectangle(x, y, width, ItemRoundedCornerSize);
         if ((corners & RoundedCornerStyles.TopLeft) == RoundedCornerStyles.TopLeft)
         {
             Rectangle rectangle2 = new Rectangle(x, y, num - 1, num - 1);
             gr.FillEllipse(brush, rectangle2);
             rect.X += ItemRoundedCornerSize;
             rect.Width -= ItemRoundedCornerSize;
         }
         if ((corners & RoundedCornerStyles.TopRight) == RoundedCornerStyles.TopRight)
         {
             Rectangle rectangle3 = new Rectangle((x + width) - num, y, num - 1, num - 1);
             gr.FillEllipse(brush, rectangle3);
             rect.Width -= ItemRoundedCornerSize;
         }
         gr.FillRectangle(brush, rect);
         gr.FillRectangle(brush, x, y + ItemRoundedCornerSize, width, height - num);
         rect = new Rectangle(x, (y + height) - ItemRoundedCornerSize, width, ItemRoundedCornerSize);
         if ((corners & RoundedCornerStyles.BottomLeft) == RoundedCornerStyles.BottomLeft)
         {
             Rectangle rectangle4 = new Rectangle(x, (y + height) - num, num - 1, num - 1);
             gr.FillEllipse(brush, rectangle4);
             rect.X += ItemRoundedCornerSize;
             rect.Width -= ItemRoundedCornerSize;
         }
         if ((corners & RoundedCornerStyles.BottomRight) == RoundedCornerStyles.BottomRight)
         {
             Rectangle rectangle5 = new Rectangle((x + width) - num, (y + height) - num, num - 1, num - 1);
             gr.FillEllipse(brush, rectangle5);
             rect.Width -= ItemRoundedCornerSize;
         }
         gr.FillRectangle(brush, rect);
     }
 }
Пример #2
0
 public Item()
 {
     this.m_border = Resco.Controls.DetailView.ItemBorder.Underline;
     this.m_dataMember = "";
     this.m_bVisible = true;
     this.m_LabelWidth = -1;
     this.m_Name = "";
     this.m_Parent = null;
     this.Changed = null;
     this.DisableEvents = false;
     this.DisableRefresh = false;
     this.Tag = null;
     this.m_Style = RescoItemStyle.LabelLeft;
     this.m_lineAlign = VerticalAlignment.Top;
     this.m_roundedCorner = RoundedCornerStyles.None;
     this.Label = "";
     this.LabelToolTip = false;
     this.m_LabelTooLong = false;
     this.Enabled = true;
     this.EditValue = null;
     this.m_Size = new Size(-1, 0x10);
     this.m_NewLine = true;
     this.m_LabelHeight = 0x10;
     this.m_LabelAutoHeight = false;
     this.ErrorMessage = null;
     this.m_LabelAlignment = HorizontalAlignment.Right;
     this.m_LabelFont = DefaultFont;
     this.m_TextFont = DefaultFont;
     this.m_LabelBackColor = Color.Transparent;
     this.m_LabelForeColor = Color.Black;
     this.m_TextBackColor = Color.Transparent;
     this.m_PreviousColor = Color.Transparent;
     this.m_TextForeColor = Color.Black;
     this.m_TextAlign = HorizontalAlignment.Left;
     this.m_LabelBackBrush = new SolidBrush(Color.Transparent);
     this.m_LabelForeBrush = new SolidBrush(Color.Black);
     this.m_TextBackBrush = new SolidBrush(Color.Transparent);
     this.m_TextForeBrush = new SolidBrush(Color.Black);
     this.m_Pen = new Pen(Color.Gray);
     this.m_RedColor = Color.Red;
     this.m_RedBrush = new SolidBrush(this.m_RedColor);
     this.m_ErrorBackground = Resco.Controls.DetailView.ErrorBackground.Background;
     this.m_Text = "";
 }
Пример #3
0
 public Item(Item toCopy)
 {
     this.m_border = Resco.Controls.DetailView.ItemBorder.Underline;
     this.m_dataMember = "";
     this.m_bVisible = true;
     this.m_LabelWidth = -1;
     this.m_Name = "";
     this.m_Parent = null;
     this.Changed = null;
     this.DisableEvents = false;
     this.DisableRefresh = false;
     this.Tag = null;
     this.Style = toCopy.Style;
     this.m_lineAlign = toCopy.LineAlign;
     this.m_roundedCorner = toCopy.RoundedCorner;
     this.Label = toCopy.Label;
     this.Enabled = toCopy.Enabled;
     this.m_Size = toCopy.m_Size;
     this.m_NewLine = toCopy.m_NewLine;
     this.m_AutoHeight = toCopy.AutoHeight;
     this.m_LabelHeight = toCopy.LabelHeight;
     this.m_LabelWidth = toCopy.m_LabelWidth;
     this.m_LabelAutoHeight = toCopy.m_LabelAutoHeight;
     this.ErrorMessage = null;
     this.m_LabelAlignment = toCopy.LabelAlignment;
     this.m_LabelFont = toCopy.LabelFont;
     this.m_TextFont = toCopy.TextFont;
     this.m_LabelBackColor = toCopy.LabelBackColor;
     this.m_LabelForeColor = toCopy.LabelForeColor;
     this.m_TextBackColor = toCopy.TextBackColor;
     this.m_PreviousColor = this.m_TextBackColor;
     this.m_TextForeColor = toCopy.TextForeColor;
     this.m_TextAlign = toCopy.TextAlign;
     this.m_RedColor = toCopy.m_RedColor;
     this.m_ErrorBackground = toCopy.ErrorBackground;
     this.m_LabelBackBrush = new SolidBrush(this.m_LabelBackColor);
     this.m_LabelForeBrush = new SolidBrush(this.m_LabelForeColor);
     this.m_TextBackBrush = new SolidBrush(this.m_TextBackColor);
     this.m_TextForeBrush = new SolidBrush(this.m_TextForeColor);
     this.m_Pen = new Pen(Color.Gray);
     this.m_RedBrush = new SolidBrush(this.m_RedColor);
     this.m_dataMember = toCopy.DataMember;
     this.m_Name = toCopy.Name;
     this.m_border = toCopy.m_border;
 }