コード例 #1
0
        protected override void Assign(BaseControlViewInfo info)
        {
            base.Assign(info);
            CustomIconTextEditViewInfo be = info as CustomIconTextEditViewInfo;

            if (be == null)
            {
                return;
            }
            this.fIconRect = be.fIconRect;
        }
コード例 #2
0
        protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
        {
            CustomIconTextEditViewInfo vi = ViewInfo as CustomIconTextEditViewInfo;

            if (vi.IsIconClick(e.Location))
            {
                int            newX = e.X - vi.IconRect.Left;
                int            newY = e.Y - vi.IconRect.Top;
                MouseEventArgs ee   = new MouseEventArgs(e.Button, e.Clicks, newX, newY, e.Delta);
                Properties.RaiseIconClick(ee);
            }
            base.OnMouseDown(e);
        }
コード例 #3
0
        protected virtual void DrawIcon(ControlGraphicsInfoArgs info)
        {
            CustomIconTextEditViewInfo vi = info.ViewInfo as CustomIconTextEditViewInfo;
            OnIconSelectionEventArgs   e  = new OnIconSelectionEventArgs(vi.ImageList, vi.ImageIndex);

            vi.Item.RaiseOnIconSelection(e);
            if (e.ImageList != null && e.ImageIndex != -1)
            {
                info.Cache.Paint.DrawImage(info.Cache, e.ImageList, e.ImageIndex, vi.IconRect, true);
            }
            else
            {
                info.Graphics.FillRectangle(info.Cache.GetSolidBrush(Color.White), vi.IconRect);
            }
        }