예제 #1
0
        public HCViewTool() : base()
        {
            FToolOffset   = -4;
            FActiveItem   = null;
            FHotToolBar   = null;
            FUseTableTool = true;
            FUseImageTool = true;

            FTableToolMenu = new ContextMenuStrip();
            ToolStripMenuItem vMenuItem = new ToolStripMenuItem("重设行列");

            FTableToolMenu.Items.Add(vMenuItem);
            vMenuItem.DropDownItems.Add("2 x 2").Click += delegate(object sender, EventArgs e)
            {
                this.ActiveTableResetRowCol(2, 2);
            };


            vMenuItem        = new ToolStripMenuItem("表格属性");
            vMenuItem.Click += DoTableToolPropertyClick;
            FTableToolMenu.Items.Add(vMenuItem);

            FTableToolBar = new HCTableToolBar();
            FTableToolBar.OnUpdateView   = DoTableToolBarUpdateView;
            FTableToolBar.OnControlPaint = DoTableToolBarControlPaint;

            FImageToolBar = new HCImageToolBar();
            FImageToolBar.OnUpdateView   = DoImageToolBarUpdateView;
            FImageToolBar.OnControlPaint = DoImageToolBarControlPaint;
        }
예제 #2
0
        private bool TableMouseMove(MouseEventArgs e)
        {
            if (PtInTableToolBar(e.X, e.Y))
            {
                if (FHotToolBar != FTableToolBar)
                {
                    if (FHotToolBar != null)
                    {
                        FHotToolBar.MouseLeave();
                    }

                    FHotToolBar = FTableToolBar;
                    FHotToolBar.MouseEnter();
                    this.Cursor = Cursors.Default;
                }
            }
            else
            if (FHotToolBar == FTableToolBar)
            {
                FTableToolBar.MouseLeave();
                FHotToolBar = null;
            }

            return(false);
        }
예제 #3
0
        private bool TableMouseMove(MouseEventArgs e)
        {
            if (PtInTableToolBar(e.X, e.Y))
            {
                if (FHotToolBar != FTableToolBar)
                {
                    if (FHotToolBar != null)
                    {
                        FHotToolBar.MouseLeave();
                    }

                    FHotToolBar = FTableToolBar;
                    FHotToolBar.MouseEnter();
                }
            }
            else
            if (FHotToolBar == FTableToolBar)
            {
                FTableToolBar.MouseLeave();
                FHotToolBar = null;
            }
            else
            //if FTableToolBar.ActiveIndex > 0 then  // 第一个是指针
            {
                HCTableItem vTableItem = FActiveItem as HCTableItem;
                if (HC.PtInRect(HC.Bounds(FActiveItemRect.Left, FActiveItemRect.Top, vTableItem.Width, vTableItem.Height),
                                new POINT(FMouseViewPt.X, FMouseViewPt.Y)))
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #4
0
        public HCViewTool() : base()
        {
            FToolOffset = -4;
            FActiveItem = null;
            FHotToolBar = null;

            FTableToolBar = new HCTableToolBar();
            FTableToolBar.OnUpdateView = DoTableToolBarUpdateView;

            FImageToolBar = new HCImageToolBar();
            FImageToolBar.OnUpdateView   = DoImageToolBarUpdateView;
            FImageToolBar.OnControlPaint = DoImageToolBarControlPaint;
        }
예제 #5
0
        private bool ImageMouseMove(MouseEventArgs e)
        {
            if (PtInImageToolBar(e.X, e.Y))
            {
                if (FHotToolBar != FImageToolBar)
                {
                    if (FHotToolBar != null)
                    {
                        FHotToolBar.MouseLeave();
                    }

                    FHotToolBar = FImageToolBar;
                    FHotToolBar.MouseEnter();
                    this.Cursor = Cursors.Default;
                }
            }
            else
            if (FHotToolBar == FImageToolBar)
            {
                FImageToolBar.MouseLeave();
                FHotToolBar = null;
            }
            else
            //if FImageToolBar.ActiveIndex > 0 then  // 有效的样式、第一个是指针
            {
                HCImageItem vImageItem = FActiveItem as HCImageItem;
                if (HC.PtInRect(HC.Bounds(FActiveItemRect.Left, FActiveItemRect.Top, vImageItem.Width, vImageItem.Height),
                                new POINT(FMouseViewPt.X, FMouseViewPt.Y)))
                {
                    MouseEventArgs vEvent = new MouseEventArgs(e.Button, e.Clicks, FMouseViewPt.X - FActiveItemRect.Left, FMouseViewPt.Y - FActiveItemRect.Top, e.Delta);
                    if (vImageItem.ShapeManager.MouseMove(vEvent))
                    {
                        this.UpdateView(new RECT(FActiveItemRect.Left, FActiveItemRect.Top - FImageToolBar.Height, FActiveItemRect.Right, FActiveItemRect.Bottom));

                        if (vImageItem.ShapeManager.HotIndex >= 0)
                        {
                            Cursor = vImageItem.ShapeManager[vImageItem.ShapeManager.HotIndex].Cursor;
                        }

                        return(true);
                    }
                }
            }

            return(false);
        }