Example #1
0
 // Token: 0x06000004 RID: 4 RVA: 0x000020A8 File Offset: 0x000002A8
 private void this_DrawItem(object sender, DrawItemEventArgs e)
 {
     if (e.Index != -1)
     {
         e.DrawBackground();
         if ((e.State & DrawItemState.Selected) != DrawItemState.None)
         {
             e.Graphics.FillRectangle(this._highlightbrush, e.Bounds);
         }
         EXComboBox.EXItem item   = (EXComboBox.EXItem)base.Items[e.Index];
         Rectangle         bounds = e.Bounds;
         int x = bounds.X + 2;
         if (item.GetType() == typeof(EXComboBox.EXImageItem))
         {
             EXComboBox.EXImageItem imgitem = (EXComboBox.EXImageItem)item;
             if (imgitem.MyImage != null)
             {
                 Image img = imgitem.MyImage;
                 int   y   = bounds.Y + bounds.Height / 2 - img.Height / 2 + 1;
                 e.Graphics.DrawImage(img, x, y, img.Width, img.Height);
                 x += img.Width + 2;
             }
         }
         else if (item.GetType() == typeof(EXComboBox.EXMultipleImagesItem))
         {
             EXComboBox.EXMultipleImagesItem imgitem2 = (EXComboBox.EXMultipleImagesItem)item;
             if (imgitem2.MyImages != null)
             {
                 for (int i = 0; i < imgitem2.MyImages.Count; i++)
                 {
                     Image img = (Image)imgitem2.MyImages[i];
                     int   y   = bounds.Y + bounds.Height / 2 - img.Height / 2 + 1;
                     e.Graphics.DrawImage(img, x, y, img.Width, img.Height);
                     x += img.Width + 2;
                 }
             }
         }
         int fonty = bounds.Y + bounds.Height / 2 - e.Font.Height / 2;
         e.Graphics.DrawString(item.Text, e.Font, new SolidBrush(e.ForeColor), (float)x, (float)fonty);
         e.DrawFocusRectangle();
     }
 }
Example #2
0
        private void cmbx_SelectedValueChanged(object sender, EventArgs e)
        {
            if (((Control)sender).Visible == false || _clickedsubitem == null)
            {
                return;
            }
            if (sender.GetType() == typeof(EXComboBox))
            {
                EXComboBox excmbx = (EXComboBox)sender;
                object     item   = excmbx.SelectedItem;
                //Is this an combobox item with one image?
                if (item.GetType() == typeof(EXComboBox.EXImageItem))
                {
                    EXComboBox.EXImageItem imgitem = (EXComboBox.EXImageItem)item;
                    //Is the first column clicked -- in that case it's a ListViewItem
                    if (_col == 0)
                    {
                        if (_clickeditem.GetType() == typeof(EXImageListViewItem))
                        {
                            ((EXImageListViewItem)_clickeditem).MyImage = imgitem.MyImage;
                        }
                        else if (_clickeditem.GetType() == typeof(EXMultipleImagesListViewItem))
                        {
                            EXMultipleImagesListViewItem imglstvitem = (EXMultipleImagesListViewItem)_clickeditem;
                            imglstvitem.MyImages.Clear();
                            imglstvitem.MyImages.AddRange(new object[] { imgitem.MyImage });
                        }
                        //another column than the first one is clicked, so we have a ListViewSubItem
                    }
                    else
                    {
                        if (_clickedsubitem.GetType() == typeof(EXImageListViewSubItem))
                        {
                            EXImageListViewSubItem imgsub = (EXImageListViewSubItem)_clickedsubitem;
                            imgsub.MyImage = imgitem.MyImage;
                        }
                        else if (_clickedsubitem.GetType() == typeof(EXMultipleImagesListViewSubItem))
                        {
                            EXMultipleImagesListViewSubItem imgsub = (EXMultipleImagesListViewSubItem)_clickedsubitem;
                            imgsub.MyImages.Clear();
                            imgsub.MyImages.Add(imgitem.MyImage);
                            imgsub.MyValue = imgitem.MyValue;
                        }
                    }
                    //or is this a combobox item with multiple images?
                }
                else if (item.GetType() == typeof(EXComboBox.EXMultipleImagesItem))
                {
                    EXComboBox.EXMultipleImagesItem imgitem = (EXComboBox.EXMultipleImagesItem)item;
                    if (_col == 0)
                    {
                        if (_clickeditem.GetType() == typeof(EXImageListViewItem))
                        {
                            ((EXImageListViewItem)_clickeditem).MyImage = (Image)imgitem.MyImages[0];
                        }
                        else if (_clickeditem.GetType() == typeof(EXMultipleImagesListViewItem))
                        {
                            EXMultipleImagesListViewItem imglstvitem = (EXMultipleImagesListViewItem)_clickeditem;
                            imglstvitem.MyImages.Clear();
                            imglstvitem.MyImages.AddRange(imgitem.MyImages);
                        }
                    }
                    else
                    {
                        if (_clickedsubitem.GetType() == typeof(EXImageListViewSubItem))
                        {
                            EXImageListViewSubItem imgsub = (EXImageListViewSubItem)_clickedsubitem;
                            if (imgitem.MyImages != null)
                            {
                                imgsub.MyImage = (Image)imgitem.MyImages[0];
                            }
                        }
                        else if (_clickedsubitem.GetType() == typeof(EXMultipleImagesListViewSubItem))
                        {
                            EXMultipleImagesListViewSubItem imgsub = (EXMultipleImagesListViewSubItem)_clickedsubitem;
                            imgsub.MyImages.Clear();
                            imgsub.MyImages.AddRange(imgitem.MyImages);
                            imgsub.MyValue = imgitem.MyValue;
                        }
                    }
                }
            }
            ComboBox c = (ComboBox)sender;

            _clickedsubitem.Text = c.Text;
            c.Visible            = false;
            _clickeditem.Tag     = null;
        }
Example #3
0
 // Token: 0x0600002C RID: 44 RVA: 0x00002D0C File Offset: 0x00000F0C
 private void cmbx_SelectedValueChanged(object sender, EventArgs e)
 {
     if (((Control)sender).Visible && this._clickedsubitem != null)
     {
         if (sender.GetType() == typeof(EXComboBox))
         {
             EXComboBox excmbx = (EXComboBox)sender;
             object     item   = excmbx.SelectedItem;
             if (item.GetType() == typeof(EXComboBox.EXImageItem))
             {
                 EXComboBox.EXImageItem imgitem = (EXComboBox.EXImageItem)item;
                 if (this._col == 0)
                 {
                     if (this._clickeditem.GetType() == typeof(EXImageListViewItem))
                     {
                         ((EXImageListViewItem)this._clickeditem).MyImage = imgitem.MyImage;
                     }
                     else if (this._clickeditem.GetType() == typeof(EXMultipleImagesListViewItem))
                     {
                         EXMultipleImagesListViewItem imglstvitem = (EXMultipleImagesListViewItem)this._clickeditem;
                         imglstvitem.MyImages.Clear();
                         imglstvitem.MyImages.AddRange(new object[]
                         {
                             imgitem.MyImage
                         });
                     }
                 }
                 else if (this._clickedsubitem.GetType() == typeof(EXImageListViewSubItem))
                 {
                     EXImageListViewSubItem imgsub = (EXImageListViewSubItem)this._clickedsubitem;
                     imgsub.MyImage = imgitem.MyImage;
                 }
                 else if (this._clickedsubitem.GetType() == typeof(EXMultipleImagesListViewSubItem))
                 {
                     EXMultipleImagesListViewSubItem imgsub2 = (EXMultipleImagesListViewSubItem)this._clickedsubitem;
                     imgsub2.MyImages.Clear();
                     imgsub2.MyImages.Add(imgitem.MyImage);
                     imgsub2.MyValue = imgitem.MyValue;
                 }
             }
             else if (item.GetType() == typeof(EXComboBox.EXMultipleImagesItem))
             {
                 EXComboBox.EXMultipleImagesItem imgitem2 = (EXComboBox.EXMultipleImagesItem)item;
                 if (this._col == 0)
                 {
                     if (this._clickeditem.GetType() == typeof(EXImageListViewItem))
                     {
                         ((EXImageListViewItem)this._clickeditem).MyImage = (Image)imgitem2.MyImages[0];
                     }
                     else if (this._clickeditem.GetType() == typeof(EXMultipleImagesListViewItem))
                     {
                         EXMultipleImagesListViewItem imglstvitem = (EXMultipleImagesListViewItem)this._clickeditem;
                         imglstvitem.MyImages.Clear();
                         imglstvitem.MyImages.AddRange(imgitem2.MyImages);
                     }
                 }
                 else if (this._clickedsubitem.GetType() == typeof(EXImageListViewSubItem))
                 {
                     EXImageListViewSubItem imgsub = (EXImageListViewSubItem)this._clickedsubitem;
                     if (imgitem2.MyImages != null)
                     {
                         imgsub.MyImage = (Image)imgitem2.MyImages[0];
                     }
                 }
                 else if (this._clickedsubitem.GetType() == typeof(EXMultipleImagesListViewSubItem))
                 {
                     EXMultipleImagesListViewSubItem imgsub2 = (EXMultipleImagesListViewSubItem)this._clickedsubitem;
                     imgsub2.MyImages.Clear();
                     imgsub2.MyImages.AddRange(imgitem2.MyImages);
                     imgsub2.MyValue = imgitem2.MyValue;
                 }
             }
         }
         ComboBox c = (ComboBox)sender;
         this._clickedsubitem.Text = c.Text;
         c.Visible             = false;
         this._clickeditem.Tag = null;
     }
 }