示例#1
0
 public ReminderListBox(ReminderControl owner)
     : base()
 {
     DoubleBuffered = true;
     _Owner         = owner;
     _ItemIndent    = 15;
     _NotePainter   = CreatePainter();
     _ButtonsInfo   = new List <ButtonViewInfo>();
 }
示例#2
0
        protected virtual void DrawNoteButton(DrawItemEventArgs e, ReminderControl reminderControl)
        {
            Button          noteButton = reminderControl.NoteButton;
            ReminderListBox listBox    = reminderControl.ReminderListBox;

            if (e.Index < listBox.ButtonsInfo.Count)
            {
                ButtonViewInfo buttonViewInfo = listBox.ButtonsInfo[e.Index];
                Rectangle      buttonRect     = buttonViewInfo.Bounds;
                Rectangle      textRect       = buttonViewInfo.TextBounds;

                buttonViewInfo.OffsetBounds(e.Bounds.Location, buttonViewInfo, buttonRect, textRect);

                noteButton.ButtonPainter.Draw(e.Graphics, buttonViewInfo);

                buttonViewInfo.RestoreBounds(e.Bounds.Location, buttonViewInfo, buttonRect, textRect);
            }
        }
示例#3
0
        public virtual void DrawItem(DrawItemEventArgs e, ReminderControl reminderControl)
        {
            ReminderListBox listBox = reminderControl.ReminderListBox;
            Note            note    = listBox.Items[e.Index] as Note;

            e.Graphics.FillRectangle(Brushes.CornflowerBlue, e.Bounds);
            e.Graphics.DrawRectangle(Pens.Indigo, e.Bounds);
            Rectangle noteRect = GetNoteTextRect(e, note, listBox.Font);

            e.Graphics.DrawString(note.Text, listBox.Font, Brushes.White, noteRect);
            string    description     = listBox.GetDescription(note);
            Rectangle descriptionRect = GetDescriptionRect(e, noteRect, description, listBox.DescriptionFont);

            e.Graphics.DrawString(description, listBox.DescriptionFont, Brushes.DarkOrange, descriptionRect);

            DrawNoteButton(e, reminderControl);
            if ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
            {
                e.Graphics.DrawRectangle(Pens.White, e.Bounds);
            }
        }
示例#4
0
 public EditPanel(ReminderControl reminderControl) : base()
 {
     _Owner       = reminderControl;
     _TextBox     = CreateTextBox();
     _DateControl = CreateDateControl();
 }
 public ReminderViewInfo(ReminderControl owner)
 {
     _Owner = owner;
 }