示例#1
0
 private void personnaliserToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Parametres pr = new Parametres(this, false);
     pr.Show();
 }
示例#2
0
 private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Parametres pr = new Parametres(this.option, false);
     pr.Show();
 }
示例#3
0
 private void DessinObjets_MouseDown(object sender, MouseEventArgs e)
 {
     #region Mode sélection multiple activé
     if (sélection != Rectangle.Empty)
     {
         if (sélection.Contains(e.Location))
         {
             DéplacementMultipleEncours = true;
             StartBlockMovement = e.Location;
             origineDéplacement = e.Location;
             return;
         }
         else
         {
             sélection = Rectangle.Empty;
             DéplacementMultipleEncours = false;
         }
     }
     #endregion
     #region Recherche éléments courant
     Point pointInModel = ScreenToModel(e.Location);
     // Vérifier que le point convient
     if (!Screen.PrimaryScreen.Bounds.Contains(e.Location))
         return;
     noeudCourant = TrouveNoeudCourant(pointInModel);
     traitCourant = TrouveTraitCourant(e.Location);
     #endregion
     if (e.Button == MouseButtons.Right)
     {
         #region Bouton droit
         if (noeudCourant != null)
         {
             List<string> libellés = new List<string>() { "Supprimer", "_", "Modifier" };
             switch (noeudCourant.GetType().Name)
             {
                 case "Noeud":
                     break;
                 case "Relation":
                     libellés.Add("Editer la relation");
                     break;
                 case "Entité":
                     libellés.Add("Editer l'entité");
                     break;
                 case "Association":
                     libellés.Add("Editer l'association");
                     break;
             }
             ContextMenuStrip cm = new ContextMenuStrip();
             foreach (string t in libellés)
             {
                 if (t == "_")
                     cm.Items.Add(new ToolStripSeparator());
                 else
                 {
                     ToolStripMenuItem suppr = new ToolStripMenuItem(t);
                     suppr.Click += new EventHandler(traitementMenu_Click);
                     cm.Items.Add(suppr);
                 }
             }
             System.Diagnostics.Trace.WriteLine(noeudCourant);
             cm.Show(this, e.Location);
         }
         else if (traitCourant != null)
         {
             switch (traitCourant.GetType().Name)
             {
                 case "Contrainte":
                     EditionContrainte co = new EditionContrainte((Contrainte)traitCourant, (Relation)traitCourant.Source, (Relation)traitCourant.Destination);
                     co.ShowDialog();
                     break;
                 case "Lien":
                     EditionLien eL = new EditionLien((Lien)traitCourant);
                     eL.ShowDialog();
                     break;
                 default:
                     Parametres pa = new Parametres(traitCourant, false);
                     pa.ShowDialog();
                     break;
             }
             Refresh();
         }
         else
         {
             Parametres pa = new Parametres(this.option, useCustomDialog);
             pa.ShowDialog();
             Refresh();
         }
         #endregion
     }
     else if (e.Button == MouseButtons.Left)
     {
         #region Bouton gauche
         if (déplacement.Checked)
         {
             if (noeudCourant != null)
             {
                 #region Déplacement Simple
                 Déplacement_Simple = true;
                 origineDéplacement = pointInModel;
                 StartBlockMovement = e.Location;
                 #endregion
             }
             else
             {
                 #region Déplacement multiple
                 if (sélection != Rectangle.Empty)
                 {
                     if (sélection.Contains(e.Location))
                     {
                         selectedNodes = new List<Noeud>();
                     }
                 }
                 else
                 {
                     sélection = new Rectangle(e.Location, new Size(0, 0));
                     selectedNodes = new List<Noeud>();
                 }
                 #endregion
             }
         }
         else
         {
             #region mode dessin
             if (noeudCourant == null)
             {
                 Noeud nouv = null;
                 nouv = NoeudParDéfaut(pointInModel, Option.Type_schéma);
                 if (nouv != null)
                 {
                     PushUndo(new Action(Type_Action.Créer, new List<object>() { nouv }));
                 }
             }
             else
             { dessinTrait = true; }
             #endregion
         }
         Refresh();
         #endregion
     }
 }
示例#4
0
 private void traitementMenu_Click(object sender, EventArgs e)
 {
     if (noeudCourant != null)
     {
         ToolStripMenuItem tm = (ToolStripMenuItem)sender;
         switch (tm.Text)
         {
             case "Modifier":
                 #region Edition des propriétés
                 Noeud noeudAvant = noeudCourant.Clone();
                 Parametres pa = new Parametres(noeudCourant, false);
                 pa.ShowDialog();
                 if (noeudAvant != null)
                 {
                     Action act = new Action(Type_Action.Paramètres, new List<object>() { noeudCourant, noeudAvant, noeudCourant.Clone() });
                     PushUndo(act);
                 }
                 Refresh();
                 break;
                 #endregion
             case "Supprimer":
                 #region Suppression
                 Supprime(noeudCourant);
                 Refresh();
                 break;
                 #endregion
             case "Editer la relation":
                 #region Edition de la relation
                 AttributRelation dial = new AttributRelation((Relation)noeudCourant);
                 dial.ShowDialog();
                 Refresh();
                 break;
                 #endregion
             case "Editer l'entité":
                 #region Edition de l'entité
                 EditionEntité eE = new EditionEntité((Entité)noeudCourant);
                 eE.ShowDialog();
                 Refresh();
                 break;
                 #endregion
             case "Editer l'association":
                 #region Edition de l'association
                 EditionAssociation eA = new EditionAssociation((Association)noeudCourant);
                 eA.ShowDialog();
                 Refresh();
                 break;
                 #endregion
         }
     }
 }
示例#5
0
 private void personnaliserToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Parametres pa = new Parametres(options, false);
     pa.Show();
     ListeBases(options.Chaine_Base_de_données);
 }