Exemple #1
0
 //-----------------------------------------------------------------
 public override void OnMouseUpNonStandard(object sender, MouseEventArgs e)
 {
     if (ModeSourisCustom == EModeSourisCustom.Join && e.Button == MouseButtons.Left)
     {
         Point     ptLogique = GetLogicalPointFromDisplay(new Point(e.X, e.Y));
         CODEQBase table     = ObjetEdite.SelectionnerElementDuDessus(ptLogique) as CODEQBase;
         if (table != null && table != m_table1Join)
         {
             IColumnDeEasyQuery colEndJoin = table.GetColonneAt(ptLogique);
             if (colEndJoin != null)
             {
                 CODEQJointure jointure = new CODEQJointure();
                 jointure.Parent         = ObjetEdite;
                 jointure.ElementsSource = new IObjetDeEasyQuery[] { m_table1Join, table };
                 jointure.NomFinal       = m_table1Join.NomFinal + "-" + table.NomFinal;
                 if (jointure.AddParametre(m_colStartJoin, colEndJoin))
                 {
                     Rectangle rct = Rectangle.Union(m_table1Join.RectangleAbsolu, table.RectangleAbsolu);
                     rct.Offset(rct.Width / 2 - jointure.Size.Width / 2, rct.Height / 2 - jointure.Size.Height / 2);
                     jointure.Position = new Point(rct.Left, rct.Top);
                     ObjetEdite.AddChild(jointure);
                     ModeSouris = EModeSouris.Selection;
                 }
             }
         }
         m_colStartJoin = null;
         m_table1Join   = null;
         Refresh();
     }
 }
Exemple #2
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);
            }
        }
Exemple #3
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;
             }
         }
     }
 }