Exemplo n.º 1
0
        //-----------------------------------------------------------------
        public override void OnMouseMoveNonStandard(object sender, MouseEventArgs e)
        {
            if (ModeSourisCustom == EModeSourisCustom.Join && m_colStartJoin != null && e.Button == MouseButtons.Left)
            {
                Graphics g = CreateGraphics();

                Point ptCentre = new Point(m_rectColStartJoin.Left + m_rectColStartJoin.Width / 2,
                                           m_rectColStartJoin.Top + m_rectColStartJoin.Height / 2);
                Rectangle rct = m_rectJoin;

                Point ptLogique            = GetLogicalPointFromDisplay(new Point(e.X, e.Y));
                IColumnDeEasyQuery colDest = null;
                CODEQBase          dest    = ObjetEdite.SelectionnerElementDuDessus(ptLogique) as CODEQBase;
                if (dest == m_table1Join)
                {
                    dest = null;
                }
                colDest = dest != null?dest.GetColonneAt(ptLogique) : null;

                Rectangle rctDest = new Rectangle(e.X, e.Y, 1, 1);
                if (colDest != null)
                {
                    rctDest = dest.GetRectAbsoluColonne(colDest);
                    rctDest = new Rectangle(GetDisplayPointFromLogical(rctDest.Location),
                                            GetDisplaySizeFromLogical(rctDest.Size));
                }

                rct.Inflate(2, 2);
                using (Bitmap bmp = DernierApercuToDispose)
                    g.DrawImage(bmp, rct, rct, GraphicsUnit.Pixel);
                Pen pen = new Pen(Color.Blue);
                pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
                Brush br = new SolidBrush(Color.FromArgb(128, 0, 0, 255));
                g.FillRectangle(br, m_rectColStartJoin);
                if (colDest != null)
                {
                    g.FillRectangle(br, rctDest);
                }
                br.Dispose();
                g.DrawLine(pen, ptCentre, new Point(e.X, e.Y));
                pen.Dispose();
                g.Dispose();
                m_rectJoin = Rectangle.Union(m_rectColStartJoin, rctDest);
            }
        }
Exemplo n.º 2
0
 public override void OnMouseDownNonStandard(object sender, MouseEventArgs e)
 {
     m_colStartJoin = null;
     if (ModeSourisCustom == EModeSourisCustom.Join && e.Button == MouseButtons.Left)
     {
         Point ptLogique = GetLogicalPointFromDisplay(new Point(e.X, e.Y));
         m_table1Join = ObjetEdite.SelectionnerElementDuDessus(ptLogique) as CODEQBase;
         if (m_table1Join != null)
         {
             m_colStartJoin = m_table1Join.GetColonneAt(ptLogique);
             if (m_colStartJoin != null)
             {
                 Rectangle rctCol = m_table1Join.GetRectAbsoluColonne(m_colStartJoin);
                 rctCol = new Rectangle(GetDisplayPointFromLogical(rctCol.Location),
                                        GetDisplaySizeFromLogical(rctCol.Size));
                 m_rectColStartJoin = rctCol;
                 m_rectJoin         = m_rectColStartJoin;
             }
         }
     }
 }