Beispiel #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();
     }
 }
Beispiel #2
0
        //-----------------------------------------------------------------
        void menuAddSousElement_Click(object sender, EventArgs e)
        {
            CMenuAddSousElement menu = sender as CMenuAddSousElement;

            if (menu != null)
            {
                CODEQFromObjetsSource    objet      = menu.SousElement;
                List <IObjetDeEasyQuery> lstSources = new List <IObjetDeEasyQuery>();
                foreach (I2iObjetGraphique obj in Selection)
                {
                    if (obj is IObjetDeEasyQuery)
                    {
                        lstSources.Add(obj as IObjetDeEasyQuery);
                    }
                }
                if (lstSources.Count == Selection.Count)
                {
                    Point pt = lstSources[0].Position;
                    pt.Offset(new Point(lstSources[0].Size.Width * 2, lstSources[0].Size.Height / 3));
                    objet.Position       = pt;
                    objet.Parent         = ObjetEdite;
                    objet.ElementsSource = lstSources.ToArray();
                    if (EditeProprietes(objet))
                    {
                        ObjetEdite.AddChild(objet);
                        Refresh();
                    }
                }
            }
        }