FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC

Développement d'applications avec le langage Panoramic
 
AccueilAccueil  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  MembresMembres  Connexion  
Derniers sujets
» demande explication KGF pour imprimer en mm
Un essai de construction d'organigramme par Panoramic Emptypar lepetitmarocain Aujourd'hui à 12:55

» Petit passage furtif
Un essai de construction d'organigramme par Panoramic Emptypar Froggy One Hier à 14:26

» SPIN et aide langage (résolu)
Un essai de construction d'organigramme par Panoramic Emptypar leclode Sam 23 Mar 2024 - 15:20

» Aide-mémoire des mots-clés Panoramic
Un essai de construction d'organigramme par Panoramic Emptypar papydall Mer 20 Mar 2024 - 21:23

» Je ne comprend pas pourquoi la largeur de la scene 3d change
Un essai de construction d'organigramme par Panoramic Emptypar Marc Mar 12 Mar 2024 - 20:06

» Comment télécharger panoramic?
Un essai de construction d'organigramme par Panoramic Emptypar lepetitmarocain Sam 9 Mar 2024 - 13:31

» @lepetitmarocain <==> KGFGrid
Un essai de construction d'organigramme par Panoramic Emptypar Klaus Dim 3 Mar 2024 - 9:59

» Tangram-Toukaré
Un essai de construction d'organigramme par Panoramic Emptypar jjn4 Mer 28 Fév 2024 - 18:12

» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
Un essai de construction d'organigramme par Panoramic Emptypar jjn4 Mer 28 Fév 2024 - 18:09

» KGF_dll - nouvelles versions
Un essai de construction d'organigramme par Panoramic Emptypar Klaus Mer 28 Fév 2024 - 17:01

» Mes souhaits d'amélioration de Panoramic.
Un essai de construction d'organigramme par Panoramic Emptypar Pedro Lun 26 Fév 2024 - 18:12

» Testez-votre-QI
Un essai de construction d'organigramme par Panoramic Emptypar jjn4 Dim 25 Fév 2024 - 17:12

» Utilisation d'Élip
Un essai de construction d'organigramme par Panoramic Emptypar jjn4 Sam 24 Fév 2024 - 18:33

» Récapitulatif ludothèque panoramic jjn4
Un essai de construction d'organigramme par Panoramic Emptypar jjn4 Sam 24 Fév 2024 - 18:11

» Générateur de mots de passe
Un essai de construction d'organigramme par Panoramic Emptypar mindstorm Mar 20 Fév 2024 - 20:09

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Mars 2024
LunMarMerJeuVenSamDim
    123
45678910
11121314151617
18192021222324
25262728293031
CalendrierCalendrier
-20%
Le deal à ne pas rater :
-20% sur le Lot de 2 écrans PC GIGABYTE 27″ LED M27Q
429 € 539 €
Voir le deal

 

 Un essai de construction d'organigramme par Panoramic

Aller en bas 
+2
Minibug
Klaus
6 participants
Aller à la page : 1, 2, 3, 4, 5, 6, 7  Suivant
AuteurMessage
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptySam 10 Mar 2018 - 12:59

J'ai déposé dans mon WebDav, dossier DLLs, une version de KGF.dll qui contient de nouvelles fonctions permettant de tracer des orgarnigrammes. C'est un essai, mais j'ai l'impression que quelque chose d'intérressant peut sortir de là.

L'ogranigramme est une représentation graphique de flux logiques. Il est composé d'éléments graphiques représentant chacun une unité logique, et de liens entre les éléments.

J'ai pour le moment créé les éléments suivants:
0 = Connector (point de rencontre de plusieurs liens, pour les différencier des croisements entre liens)
1 = Action (une unité de traitement)
2 = Condition (comme IF...)
3 = Selector (comme SELECT...CASE...)
4 = Start (début de l'action/programme)
5 = End (fin de l'action/programme)

Chacun de ces éléments (sauf Start) a automatiquement un et un seul connecteur d'entrée.

Chacun de ces éléments (sauf End) a au moins un connecteur de sortie.

On peut placer autant d'éléments que nécessaire, choisir l'emplacement, les dimensions et couleurs de ces éléments. On peut choisir les textes qui s'y affichent.

On peut lier n'importe quel connecteur de sortie à n'importe quel connecteur d'entrée ou un élément Connecteur autonome. Les liens sont représentés par des segments droits éventuellement multiples allant d'une sortie vers une entrée.

Voici une première démo pour montrer graphiquement ce que cela peut donner, mais l'organigramme montré n'a pas de véritable sens. Il montre juste les éléments, ainsi qu'un lien entre deux éléments:
Code:
' test_FlowChart.bas
'
' types d'éléments:
'   0 = Connector
'   1 = Action
'   2 = Condition
'   3 = Selection
'   4 = Start
'   5 = End

label creer, supprimer

dim no%, res%, i%, titre$, no_memo%, xx%, yy%

dim FC%
dim FCE1%, FCE2%, FCE3%, FCE4%, FCE5%, FCE6%, FCE7%
dim FCL1%

dim xArray%(20), yArray%(20)


no% = no% + 1 : button no% : caption no%,"Créer" : on_click no%,creer
no% = no% + 1 : button no% : left no%,width(no%-1) : caption no%,"Supprimer" : on_click no%,supprimer

no% = no% + 1 : memo no% : no_memo% = no% : hide  no% : bar_both no%

dll_on "KGF.dll"

end

creer:
  FC% = dll_call1("CreateFlowChart",handle(0))
  res% = dll_call5("LocateFlowChart",FC%,10,50,500,350)
  
  titre$ = "Initialisations"
  FCE1% = dll_call4("AddElementToFlowChart",FC%,1,hex("FFFF00"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE1%,50,50,300,200)
  clear no_memo%
  item_add no%,"Définition des variables"
  item_add no%,"Préparer les constantes"
  item_add no%,"Ouvrir KGF.dll"
  res% = dll_call3("TextForElementOfFlowChart",FC%,FCE1%,handle(no_memo%))
  
  titre$ = "Chargement des fichiers"
  FCE2% = dll_call4("AddElementToFlowChart",FC%,1,hex("00FFFF"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE2%,400,300,200,150)
  clear no_memo%
  item_add no%,"Fichier des paramètres"
  item_add no%,"Fichier Client"
  res% = dll_call3("TextForElementOfFlowChart",FC%,FCE2%,handle(no_memo%))
  
  titre$ = "Est-ce que la sauvegarde est faite ?"
  FCE3% = dll_call4("AddElementToFlowChart",FC%,2,hex("0000FF"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE3%,20,300,300,100)
  clear no_memo%
  item_add no%,"."
  item_add no%,"Oui"
  item_add no%,"Non"
  res% = dll_call3("TextForElementOfFlowChart",FC%,FCE3%,handle(no_memo%))

  titre$ = "Type de client"
  FCE4% = dll_call4("AddElementToFlowChart",FC%,3,hex("0000FF"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE4%,20,500,300,100)
  clear no_memo%
  item_add no%,"1"
  item_add no%,"2"
  item_add no%,"3"
  res% = dll_call3("TextForElementOfFlowChart",FC%,FCE4%,handle(no_memo%))
  
  titre$ = "Début"
  FCE5% = dll_call4("AddElementToFlowChart",FC%,4,hex("F0F0F0"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE5%,20,700,100,100)
  
  titre$ = "Arrêt"
  FCE6% = dll_call4("AddElementToFlowChart",FC%,5,hex("F0F0F0"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE6%,150,700,100,100)
  
  FCE7% = dll_call4("AddElementToFlowChart",FC%,0,0,0)
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE7%,300,700,20,20)
  
  xArray%(0) = 3
  
  res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCE3%,3,adr(xx%),adr(yy%))
  xArray%(1) = 380
  yArray%(1) = yy%
  
  xArray%(2) = 380
  yArray%(2) = 250
  
  res% = dll_call3("GetInputConnectorOfFlowChartElement",FCE2%,adr(xx%),adr(yy%))
  xArray%(3) = xx%
  yArray%(3) = 250
  
  FCL1% = dll_call6("ConnectElementsOfFlowChart",FC%,FCE3%,3,FCE2%,adr(xArray%),adr(yArray%))
  
  res% = dll_call1("DrawFlowChart",FC%)

  return
        
supprimer:
  FC% = dll_call1("DeleteFlowChart",FC%)
  return

Comme on peut voir, l'organigramme est contenu dans un ScrollImage implicite, avec toutes les fonctionnalités que cela implique.

Voici une vue partielle du résultat:
Un essai de construction d'organigramme par Panoramic Aa146

Projets d'évolution:
- sauvegarde/rechargement d'un organigramme
- d'autres éléments suivant les besoins qui se feront sentir

Question restant ouverte à ce jour (et peut-être un défi pour les "matheux" parmi les Panoramiciens):
comment établir par programme le tracé d'un lien entre une sortie (donnée par la fonction GetOutputConnectorOfFlowChartElement) et une entrée (donnée par la fonction GetInputConnectorOfFlowChartElement), sans traverser un élément déjà placé dans l'organigramme, en gardant une distance minimale imposée, sachant que les positions et dimensions de chaque élément sont connues ?
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Minibug

Minibug


Nombre de messages : 4566
Age : 57
Localisation : Vienne (86)
Date d'inscription : 09/02/2012

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptySam 10 Mar 2018 - 19:40

Bonsoir Klaus !

Je viens de tester ta dernière trouvaille. Il y a sûrement un intérêt à cet outil...

Pour ma part, je n'ai pas vraiment de position pour l'instant.
Tu as sûrement une idée derrière la tête pour la suite, donc j'attends pour voir... Wink

Concernant les liens entre eux, peut être faudrait il connaître les positions des objet et calculer par une forme d"IA comment les éviter.
Ou bien faire en sorte que le tracé reste sur le fond (couleur spéciale du fond calculé par retour du pixel...)

Bon courage pour la suite... drunken
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptySam 10 Mar 2018 - 19:57

Merci, Minibug.

Pour le tracé, je ne cherche pas un code, mais plutôt un algorithme - à moi de le coder ensuite pour qu'il s'intègre dans les fonctions de la DLL.

Pour ceux qui s'intéressent à ce problème, voici les données initiales:
1. je dispose d'une liste des objets présents, tous occupant un espace rectangulaire dont une table contient les positions et dimensions, en pixels.
2. je connais exactement le point de départ et d'arrivée, en pixels.
3. Je veux pouvoir déterminer un chemin sous forme de segments successifs de droites, se joignant à angle droit (ou pas, d'ailleurs), et gardant une distance minimale de tout objet (ce qui revient à augmenter virtruellement les dimensions de chaque rectangle-objet d'une valeur fixe dans tous les sens). Et bien sûr, deux chemins successifs ne doivent pas se recouvrir, bien qu'ils puissent s'entre-couper.
Voilà le problème.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
silverman

silverman


Nombre de messages : 968
Age : 51
Localisation : Picardie
Date d'inscription : 18/03/2015

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptySam 10 Mar 2018 - 21:01

Ce que tu cherches à faire s'appelle "PATHFINDING".
Il existe des algorithmes de recherche de chemin en 2D, le plus connu est A* (Astar), mais il y en d'autres. Je n'ai jamais pratiqué le pathfinding, mais il me semble que ces algorithmes trouvent des chemins pas forcément angulaires.
A la limite, si tu parvient à établir quelques points de liaisons, tu pourras appliquer l'agorithme de "bézier" ou celui du "catmull rom" pour obtenir un tracé arrondi.
Ce ne sont que des pistes de recherches, je ne sais pas ce que ça vaut.
Revenir en haut Aller en bas
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptySam 10 Mar 2018 - 21:22

Merci, Siverman. Je vais suivre ces pistes.
Actuellement, je suis tombé sur un article décrivant une méthode de "front d'onde" (wave front) mais qui, techniquement, semble très gourmand en mémoire puisqu'il faut remplir un tableau représentant le monde à parcourir, avec des valeurs marquant les cellules. Et dans mon cas, les cellules sont des pixels... autant dire que ça va être très lourd.
Je vais suivre toutes les pistes...
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptySam 10 Mar 2018 - 21:52

Je vais tenter A*. Ca a l'air intéressant.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyDim 11 Mar 2018 - 9:49

Je n'ai pas pu mettre en oeuvre A* facilement. La description verbale de l'algorithme est limpide,, mais la traduction en Delphi est plus complexe...

En attendant,, j'ai ajouté un mode de traçage assisté par la souris. J'ai ajouté 3 boutons:
"Préparer lien" - le programme se place en mode traçage et demande de cliquer sur un connecteur de sortie (départ du lien). Lorsque le départ est identifié, le programme demande de cliquer sur un élément de destination. Ensuite, le programme demande de cliquer successivement sur les endroits où doit passer le lien, qu'on peut ainsi constituer, étape par étape.
"Tracer lien" - effectue le traçage du lien selon les points intermédiaires, entre la sortie choisie et l'entrée de l'élément de destiination. Si aucun point intermédiaire a été cliqué, le lien est tracé directement de la sortie choisie vers l'entrée de l'élément choisi.
"Annuler lien" - annuler la préparation du lien, y compris les points déjà cliqués. Ceci peut être utilisé à tout moment.

Autre  nouveauté:
Le programme a maintenant un bouton "Enregistrer" qui permet de créer un fichier image BMP, JPG, GIF ou PNG de la FlowChart.

Le programme"rectiifie" le tracé de façon à obtenir toujours des segments horizontaux et verticaux.

Il faut bien sûr recharger KGF.dll à partir de mon WebDav, dossier DLLs.

Code:
' test_FlowChart.bas
'
' types d'éléments:
'  0 = Connector
'  1 = Action
'  2 = Condition
'  3 = Selection
'  4 = Start
'  5 = End

label UserEvent, creer, supprimer, preparer, tracer, annuler, enregistrer

dim no%, no_memo%, xx%, yy%, pos%, DoPoints%, DeltaRectangle% , no_save%
dim res%, i%, titre$, xxp%, yyp%, do1%, f$

dim FC%
dim FCE1%, FCE2%, FCE3%, FCE4%, FCE5%, FCE6%, FCE7%, FCEstart%, output%, FCEdest%
dim FCL1%, FCLX%(30), nFCLX%

dim xArray%(20), yArray%(20), npt%


no% = no% + 1 : button no% : caption no%,"Créer" : on_click no%,creer
no% = no% + 1 : button no% : left no%,width(no%-1) : caption no%,"Supprimer" : on_click no%,supprimer
no% = no% + 1 : button no% : left no%,left(no%-1)+width(no%-1)+20 : caption no%,"Préparer lien" : on_click no%,preparer
no% = no% + 1 : button no% : left no%,left(no%-1)+width(no%-1) : caption no%,"Tracer lien" : on_click no%,tracer
no% = no% + 1 : button no% : left no%,left(no%-1)+width(no%-1) : caption no%,"Annuler lien" : on_click no%,annuler
no% = no% + 1 : button no% : left no%,left(no%-1)+width(no%-1)+20 : caption no%,"Enregistrer" : on_click no%,enregistrer

no% = no% + 1 : memo no% : no_memo% = no% : hide  no% : bar_both no%
no% = no% + 1 : save_dialog no% : no_save% = no% : filter no%,"Images|*.bmp;*.jpg;*.gif;*.png"

dll_on "KGF.dll"

on_user_event UserEvent

DoPoints% = 0
nFCLX% = 0
DeltaRectangle% = 10

end

UserEvent:
  if bin_and(user_event_wparam,hex("FF000000"))=hex("0B000000") : ' ScrollImage
    if DoPoints%>0
      pos% =  user_event_lparam              : ' positon: yyyyxxxx
      xxp% = bin_and(pos%,hex("0000FFFF"))
      yyp% = pos%/65536
' message hex$(pos%)+"  "+hex$(xx%)+"  "+hex$(yy%)
      if DoPoints%=1
        res% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%))
        if res%<0
          message "Ce n'est pas une sortie valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..."
          return
        end_if
        DoPoints% = 2
        message "Cliquez maintenant l'élémént de destination"+chr$(13)+chr$(10)+"ou Annulez..."
        return
      end_if
      if DoPoints%=2
        res% = dll_call4("IdentifyFlowChartElement",FC%,xxp%,yyp%,adr(FCEdest%))
        if res%<0
          message "Ce n'est pas un élément valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..."
          return
        end_if
        DoPoints% = 3
        message "Cliquez maintenant les points d'étape"+chr$(13)+chr$(10)+"puis Tracez ou Annulez..."
        return
      end_if
      ' ici, rectangulariser le tracé
      if npt%=0
        res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xx%),adr(yy%))   
      else
        xx% = xarray%(npt%)
        yy% = yarray%(npt%)
      end_if
      if abs(xxp%-xx%)<=DeltaRectangle%
        xxp% = xx%
      else
        if abs(yyp%-yy%)<=DeltaRectangle%
          yyp% = yy%
        else
          npt% =  npt% + 1
          xarray%(0) = npt%
          xarray%(npt%) = xxp%
          yarray%(npt%) = yy%
        end_if
      end_if
      ' mémoriser le point
      npt% = npt% + 1
      xarray%(0) = npt%
      xarray%(npt%) = xxp%
      yarray%(npt%) = yyp%
'      message "Point "+str$(npt%)+": "+str$(xx%)+","+str$(yy%)
    end_if
  end_if

  return

creer:
  FC% = dll_call1("CreateFlowChart",handle(0))
  res% = dll_call5("LocateFlowChart",FC%,10,50,500,350)
 
  titre$ = "Initialisations"
  FCE1% = dll_call4("AddElementToFlowChart",FC%,1,hex("FFFF00"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE1%,50,50,300,200)
  clear no_memo%
  item_add no_memo%,"Définition des variables"
  item_add no_memo%,"Préparer les constantes"
  item_add no_memo%,"Ouvrir KGF.dll"
  res% = dll_call3("TextForElementOfFlowChart",FC%,FCE1%,handle(no_memo%))
 
  titre$ = "Chargement des fichiers"
  FCE2% = dll_call4("AddElementToFlowChart",FC%,1,hex("00FFFF"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE2%,400,300,200,150)
  clear no_memo%
  item_add no_memo%,"Fichier des paramètres"
  item_add no_memo%,"Fichier Client"
  res% = dll_call3("TextForElementOfFlowChart",FC%,FCE2%,handle(no_memo%))
 
  titre$ = "Est-ce que la sauvegarde est faite ?"
  FCE3% = dll_call4("AddElementToFlowChart",FC%,2,hex("0000FF"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE3%,20,300,300,100)
  clear no_memo%
  item_add no_memo%,"."
  item_add no_memo%,"Oui"
  item_add no_memo%,"Non"
  res% = dll_call3("TextForElementOfFlowChart",FC%,FCE3%,handle(no_memo%))

  titre$ = "Type de client"
  FCE4% = dll_call4("AddElementToFlowChart",FC%,3,hex("0000FF"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE4%,20,500,300,100)
  clear no_memo%
  item_add no_memo%,"1"
  item_add no_memo%,"2"
  item_add no_memo%,"3"
  res% = dll_call3("TextForElementOfFlowChart",FC%,FCE4%,handle(no_memo%))
 
  titre$ = "Début"
  FCE5% = dll_call4("AddElementToFlowChart",FC%,4,hex("F0F0F0"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE5%,20,700,100,100)
 
  titre$ = "Arrêt"
  FCE6% = dll_call4("AddElementToFlowChart",FC%,5,hex("F0F0F0"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE6%,150,700,100,100)
 
  FCE7% = dll_call4("AddElementToFlowChart",FC%,0,0,0)
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE7%,300,700,20,20)
 
  xArray%(0) = 3
 
  res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCE3%,3,adr(xx%),adr(yy%))
  xArray%(1) = 380
  yArray%(1) = yy%
 
  xArray%(2) = 380
  yArray%(2) = 250
 
  res% = dll_call3("GetInputConnectorOfFlowChartElement",FCE2%,adr(xx%),adr(yy%))
  xArray%(3) = xx%
  yArray%(3) = 250
 
  FCL1% = dll_call6("ConnectElementsOfFlowChart",FC%,FCE3%,3,FCE2%,adr(xArray%),adr(yArray%))
 
  res% = dll_call1("DrawFlowChart",FC%)

  return
       
supprimer:
  FC% = dll_call1("DeleteFlowChart",FC%)
  return
       
preparer:
  DoPoints% = 1
  npt% = 0
  Message "Cliquer sur une sortie..."
  return
 
tracer:
  ' rectangulariser le dernier segment
  res% = dll_call3("GetInputConnectorOfFlowChartElement",FCEdest%,adr(xx%),adr(yy%))   
  if npt%=0
    res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xxp%),adr(yyp%))   
  else
    xxp% = xArray%(npt%)
    yyp% = yArray%(npt%)
  end_if
 
  do1% = 0
  if abs(xxp%-xx%)<=DeltaRectangle%
    xxp% = xx%
    do1% = 1
  else
    if abs(yyp%-yy%)<=DeltaRectangle%
      yyp% = yy%
      do1% = 1
    end_if
  end_if
  if do1%=1
    npt% =  npt% + 1
    xarray%(0) = npt%
    xarray%(npt%) = xxp%
    yarray%(npt%) = yyp%
  end_if
  if yyp%>(yy%-DeltaRectangle%)
    yyp% = yy% - DeltaRectangle%
    npt% =  npt% + 1
    xarray%(0) = npt%
    xarray%(npt%) = xxp%
    yarray%(npt%) = yyp%
  end_if
  if xxp%<>xx%
    xxp% = xx%
    npt% =  npt% + 1
    xarray%(0) = npt%
    xarray%(npt%) = xxp%
    yarray%(npt%) = yyp%
  end_if

  res% = dll_call6("ConnectElementsOfFlowChart",FC%,FCEstart%,output%,FCEdest%,adr(xArray%),adr(yArray%))
  if res%=0
    message "Erreur en créant la connexion"
  else
    nFCLX% = nFCLX% + 1
    FCLX%(nFCLX%) = res%
  end_if
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  return
 
annuler:
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  return 

enregistrer:
  f$ = file_name$(no_save%)
  if f$="_" then return
  if instr(".bmp.jpg.gif.png",lower$(file_extract_extension$(f$)))=0
    message "Il faut un fichier de type bmp, jpg, gif ou png"
    return
  end_if
  if file_exists(f$)=1
    if message_confirmation_yes_no("Ce fichier existe déjà. Remplacer ?")<>1 then return
  end_if
  res% = dll_call2("SaveFlowChartToImage",FC%,adr(f$))
  message "L'image a été créée."
  return


Dernière édition par Klaus le Dim 11 Mar 2018 - 10:57, édité 1 fois
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Marc

Marc


Nombre de messages : 2372
Age : 63
Localisation : TOURS (37)
Date d'inscription : 17/03/2014

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyDim 11 Mar 2018 - 10:30

Bonjour Klaus !

Bonjour à tous !

@Klaus
Je viens de regarder tout ce que tu as fait depuis 15 jours.
Chapeau bas !  cheers
C'est vraiment très très fort !
Tu programmes plus vite que ton ombre !
Merci beaucoup !
Revenir en haut Aller en bas
papydall

papydall


Nombre de messages : 6985
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyDim 11 Mar 2018 - 11:45

Bonjour Klaus.
J’ai modifié un peu les dimensions du FORM 0 ainsi que celles du FlowChart pour avoir le tout sous l’œil.
1er constat : Annuler lien ne fonctionne pas.
2ème constat :
J’ai voulu relier 2 rouge en bas à 1 jaune, voici ce que j’obtiens et impossible d’annuler le lien


Voici ce que j'obtiens:


EDIT : Peut-être fallait-il créer une autre fonction DeConnectElementsOfFlowChart

Si j'ai écris une bêtise, fais en sorte comme si je n'ai rien dit ! Wink
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyDim 11 Mar 2018 - 12:19

Merci d'avir essayé, Papydall.

Code:
1er constat : Annuler lien ne fonctionne pas.
Si, si... mais l'effet n'est pas visible. Si par exemple, tu as commencé à définir un lien, et finalement tu veux laisser tomber, ou recommencer avec un autre lien, un clic sur ce bouton fait simplement "oublier" le lien en cours, et tu peux recommencer à créer un nouveau lien.  Cela n'efface PAS un lien déjà établi !

Code:
J’ai voulu relier 2 rouge en bas à 1 jaune, voici ce que j’obtiens
Ce n'est pas possible. Le 1 jaune est une sortie, et tu ne peux pas relier deux sorties. Tu peux seulement relier une sortie à un élément dont l'unique entrée (contact 0) sera automatiquement utilisé.

Citation :
voici ce que j’obtiens
L'explication ci-dessus explque pourquoi le lien va jusqu'au 0 au lieu de s'arrêter au 1...

Citation :
impossible d’annuler le lien
Comme expliqué ci-dessus, on ne peut pas effacer un lien déjà établi. On ne peut qu'annuler la pahse de création en cours d'un nouveau lien, avant que celui-ci ne soit tracé. La suppression d'un lien déjà tracé est en cours de codage.

Pour établir un lien, il faut indiquer au programme le tracé approximatif du lien, afin d'éviter le passage du tracé à travers des éléments ce qui n'est pas joli, et afin d'éviter que deux liens se superposent. Pour cela, il faut cliquer sur des "points d'itinéraire", bien sûr situés dans l'espace non occupé du plan, et ce dans l'ordre successif afin de semer les petites pières blanches permettant au "traceur" de trouver sin chemin. Inutile de cliquer, ni sur la sortie de départ (déjà sélectionnée) ni sur l'entrée d'arrivée (sélectionnée automatiquement en choisissant l'élément d'rarrivée). D'ailleurs, il faut bien lire les messages: on choisit l'élémént d'arrivé, pas le connecteur !

Et pur finir, une petite remarque:
Citation :
J’ai modifié un peu les dimensions du FORM 0 ainsi que celles du FlowChart pour avoir le tout sous l’œil.
Bien sûr, c'est plus comfortable. J'ai choisi des dimensions réduites exprès, pour montrer que le diagramme se constitue dans un objet ScrollImage, quelque soit sa taille. On peut déplacer la fenêtre de visualisation avec les ascenseurs, mais on peut aussi "tirer" l'image avec la souris par 'bouton gauche enfoncé"-"tirer"-"bouton gauche relâché".

Et voici un lien tracé correctement:
sortie 3 du sélecteur "Type de client" vers l'entrée de la condition "Est-ce que la sauvegarde est faite ?":
Un essai de construction d'organigramme par Panoramic Aa147
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
papydall

papydall


Nombre de messages : 6985
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyDim 11 Mar 2018 - 12:39

Tout est OK Klaus, merci.

"Je comprends vite mais il faut m'expliquer longtemps"  tongue
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyDim 11 Mar 2018 - 12:46

Lorsque la suppression d'un lien existant sera opérationnelle, je publierai une sorte d'IDE permettant deconstituer interactivement son diagramme.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyMar 13 Mar 2018 - 3:48

J'ai mis une nouvelle version de KGF.dll dans mon WebDav, dossier DLLs. Elle complète sérieusement les fonctions autour de l'objet FlowChart. Outre certaines nouvelles fonctions de gestion, il y a maintenant des fonctions permettant de sauvegarder un organigramme dans un fichier (considéré comme un "projet") et de recharger un tel projet dans l'objet FlowChart.

Avec cela, j'ai fait une première version d'un IDE permettant de créer interactivement des organigrammes? On  place des objets sur le terrain de jeu, et comme en Panoramic, ils apparaissent en (0,0). Puis, on peut modifier les propriétés, position et dimensions, bien sûr, mais également couleur, textes etc. Ainsi, on peut visuellement constituer la structure de l'organigramme. Si un objet est placé en-dehors de la zone de visualisation, des ascenseurs apparaissent automatiquement et permettent de déplacer la fenêtre de visualisation. L'image peut également être tirée par la souris - c'est un ScrollImage !

Ensuite, on peut dessiner des liens entre un contact de sortie et un contact d'entrée d'un autre élément (ou du même, si cela présente un intérêt...). Pour éviter que les liens passent à travers les objets, on sème de petits "cailloux" en cliquant au fur et ) mesure sur les endroits où doit passer le lien. Le programme tentera de normaliser le trajet en produisant des angles droits.

A tout moment, la situation actuelle peut être sauvegardée dans un fichier, pour être rechargée plus tard.

Voici le code:
Code:
' FlowChartDesigner.bas

labels()
constantes()
variables()
menu()
cadres()
Objets()

on_user_event UserEvent

end

UserEvent:
  if bin_and(user_event_wparam,hex("FF000000"))=hex("0B000000") : ' ScrollImage
    if DoPoints%>0
      pos% =  user_event_lparam              : ' positon: yyyyxxxx
      xxp% = bin_and(pos%,hex("0000FFFF"))
      yyp% = pos%/65536
      if DoPoints%=1
        res% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%))
        if res%<0
          message "Ce n'est pas une sortie valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..."
          return
        end_if
        DoPoints% = 2
        message "Cliquez maintenant l'élémént de destination"+chr$(13)+chr$(10)+"ou Annulez..."
        return
      end_if
      if DoPoints%=2
        res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEdest%))
        if res%<0
          message "Ce n'est pas un élément valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..."
          return
        end_if
        DoPoints% = 3
        message "Cliquez maintenant les points d'étape"+chr$(13)+chr$(10)+"puis Tracez ou Annulez..."
        return
      end_if
      if DoPoints%=3
        ' ici, rectangulariser le tracé
        if npt%=0
          res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xx%),adr(yy%))    
        else
          xx% = xarray%(npt%)
          yy% = yarray%(npt%)
        end_if
        if abs(xxp%-xx%)<=DeltaRectangle%
          xxp% = xx%
        else
          if abs(yyp%-yy%)<=DeltaRectangle%
            yyp% = yy%
          else
            npt% =  npt% + 1
            xarray%(0) = npt%
            xarray%(npt%) = xxp%
            yarray%(npt%) = yy%
          end_if
        end_if
        ' mémoriser le point
        npt% = npt% + 1
        xarray%(0) = npt%
        xarray%(npt%) = xxp%
        yarray%(npt%) = yyp%
'        message "Point "+str$(npt%)+": "+str$(xx%)+","+str$(yy%
      end_if
      if DoPoints%=4
        res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%))
        if res%<0
          message "Ce n'est pas un élément valide."
          return
        end_if
        message "Elément "+nature$(res%)+" identifié"
        select res%
          case 0
            show no_AttributsConnector%
            position no_Connector_X%,xxp%
            position no_Connector_Y%,yyp%
          case 1
            res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%))
            show no_AttributsAction%
            position no_Action_X%,xxp%
            position no_Action_Y%,yyp%
            position no_Action_Largeur%,wwp%
            position no_Action_Hauteur%,hhp%
            text no_action_Couleur%,right$(hex$(ccc%),6)
            text no_Action_Titre%,item_read$(no_memo%,1)
            item_delete no_memo%,1
            clear no_Action_Contenu%
            if count(no_memo%)>0
              for i%=1 to count(no_memo%)
                item_add no_Action_Contenu%,item_read$(no_memo%,i%)
              next i%
            end_if
          case 2
            res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%))
            show no_AttributsCondition%
            position no_Condition_X%,xxp%
            position no_Condition_Y%,yyp%
            position no_Condition_Largeur%,wwp%
            position no_Condition_Hauteur%,hhp%
            text no_Condition_Couleur%,right$(hex$(ccc%),6)
            text no_Condition_Titre%,item_read$(no_memo%,1)
            item_delete no_memo%,1
            clear no_Condition_Contenu%
            if count(no_memo%)>0
              for i%=1 to count(no_memo%)
                item_add no_Condition_Contenu%,item_read$(no_memo%,i%)
              next i%
            end_if
          case 3
            res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%))
            show no_AttributsSelection%
            position no_Selection_X%,xxp%
            position no_Selection_Y%,yyp%
            position no_Selection_Largeur%,wwp%
            position no_Selection_Hauteur%,hhp%
            text no_Selection_Couleur%,right$(hex$(ccc%),6)
            text no_Selection_Titre%,item_read$(no_memo%,1)
            item_delete no_memo%,1
            clear no_Selection_Contenu%
            if count(no_memo%)>0
              for i%=1 to count(no_memo%)
                item_add no_Selection_Contenu%,item_read$(no_memo%,i%)
              next i%
            end_if
          case 4
            res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%))
            show no_AttributsStart%
            position no_Start_X%,xxp%
            position no_Start_Y%,yyp%
            position no_Start_Largeur%,wwp%
            position no_Start_Hauteur%,hhp%
            text no_Start_Couleur%,right$(hex$(ccc%),6)
          case 5
            res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%))
            show no_AttributsEnd%
            position no_End_X%,xxp%
            position no_End_Y%,yyp%
            position no_End_Largeur%,wwp%
            position no_End_Hauteur%,hhp%
            text no_End_Couleur%,right$(hex$(ccc%),6)
        end_select
      end_if
    end_if
  end_if

  return


sortir:
  terminate

AddConnector:
  AddConnector()
  return

AddAction:
  AddAction()
  return

AddCondition:
  AddCondition()
  return

AddSelector:
  AddSelector()
  return

AddStart:
  AddStart()
  return

AddEnd:
  AddEnd()
  return

selectionner:
  selectionner()
  return
  
valider_connector:
  valider_connector()
  return
  
valider_action:
  valider_action()
  return
  
valider_Condition:
  valider_Condition()
  return
  
annulerselection:
  annulerselection()
  return
  
valider_Selection:
  valider_Selection()
  return

valider_start:
  valider_start()
  return
  
valider_end:
  valider_end()
  return
  
nouveauprojet:
  nouveauprojet()
  return

ouvrirprojet:
  ouvrirprojet()
  return
  
enregistrerprojet:
  enregistrerprojet()
  return
  
enregistrersousprojet:
  enregistrersousprojet()
  return
  
lier:
  lier()
  return
  
annulerlier:
  annulerlier()
  return
  
tracer:
  tracer()
  return

sub labels()
  label AddConnector, AddAction, AddCondition, AddSelector, AddStart, AddEnd
  label valider_connector, valider_action, valider_Condition, valider_Selection
  label valider_Start, valider_End
  label selectionner, annulerselection, UserEvent, sortir
  label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet
  label lier, annulerlier, tracer
end_sub

sub constantes()
  dim KGF$ : KGF$ = "KGF.dll"
  dim M1% : M1% = 0-1
  dim DeltaRectangle% : DeltaRectangle% = 10
  dim nature$(6)
    nature$(0) = "Connector"
    nature$(1) = "Action"
    nature$(2) = "Condition"
    nature$(3) = "Selector"
    nature$(4) = "Start"
    nature$(5) = "End"
end_sub

sub variables()
  dim res%, DoPoints%, pos%, xxp%, yyp%, titre$, wwp%, hhp%, i%, ccc%, output%, xx%, yy%
  dim npt%, xarray%(100),yarray%(100)
  dim no%, no1%, no2%, no_cElements%, no_AnnSel%, no_memo%, no_open%, no_save%
  dim no_AttributsConnector%, no_AttributsAction%, no_AttributsCondition%
  dim no_AttributsSelection%, no_AttributsStart%, no_AttributsEnd%
  dim no_Connector_X%, no_Connector_Y%, no_AnnLink%, no_Tracer%
  dim no_Action_X%, no_Action_Y%, no_Action_Titre%, no_action_Couleur%
  dim no_Action_Largeur%, no_Action_Hauteur%, no_Action_Contenu%
  dim no_Condition_X%, no_Condition_Y%, no_Condition_Titre%, no_condition_Couleur%
  dim no_Condition_Largeur%, no_Condition_Hauteur%, no_Condition_Contenu%
  dim no_Selection_X%, no_Selection_Y%, no_Selection_Titre%, no_selection_Couleur%
  dim no_Selection_Largeur%, no_Selection_Hauteur%, no_Selection_Contenu%
  dim no_Start_X%, no_Start_Y%, no_Start_Largeur%, no_Start_Hauteur%, no_start_Couleur%
  dim no_End_X%, no_End_Y%, no_End_Largeur%, no_End_Hauteur%, no_end_Couleur%
  dim FC%, FCE%, FCEstart%, FCEdest%
  dim projet$
end_sub

sub menu()
  no% = no% + 1 : main_menu no% : no1% = no%
    no% = no% + 1 : sub_menu no% : parent no%,no1% : no2% = no% : caption no%,"Fichier"
      no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Nouveau" : on_click no%,nouveauprojet
      no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Ouvrir..." : on_click no%,ouvrirprojet
      no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer" : on_click no%,enregistrerprojet
      no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer sous..." : on_click no%,enregistrersousprojet
      no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"-"
      no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Sortir" : on_click no%,sortir
end_sub

sub cadres()
  dll_on KGF$
  no% = no% + 1 : container no% : no_cElements% = no% : width no%,200 : caption no%,"Eléments"
  FC% = dll_call1("CreateFlowChart",handle(0))
  full_space 0
  res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0))
  height no_cElements%,300
  
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Connecteur"
    top no%,15 : left no%,10 : on_click no%,AddConnector
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Action"
    top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddAction
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Condition"
    top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddCondition
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Selecteur"
    top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddSelector
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Début"
    top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddStart
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Fin"
    top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddEnd

  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sélectionner"
    top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionner
  no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSel% = no% : caption no%,"Annuler" : inactive no%
    top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerselection

  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Lier"
    top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,lier
  no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnLink% = no% : caption no%,"Annuler" : inactive no%
    top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerlier
  no% = no% + 1 : button no% : parent no%,no_cElements% : no_Tracer% = no% : caption no%,"Tracer" : inactive no%
    top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,tracer

    ' attributs Connector
  no% = no% + 1 : container no% : no_AttributsConnector% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Connector" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,20 : left no%,10
    caption no%,"Position X:"
  no% = no% + 1 : spin no% : no_Connector_X% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Position Y:"
  no% = no% + 1 : spin no% : no_Connector_Y% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : button no% : parent no%,no_AttributsConnector% : top no%,height(no_AttributsConnector%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_connector

  ' attributs Action
  no% = no% + 1 : container no% : no_AttributsAction% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Action" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,20 : left no%,10
    caption no%,"Position X:"
  no% = no% + 1 : spin no% : no_Action_X% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Position Y:"
  no% = no% + 1 : spin no% : no_Action_Y% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Largeur:"
  no% = no% + 1 : spin no% : no_Action_Largeur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Hauteur:"
  no% = no% + 1 : spin no% : no_Action_Hauteur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_Action_Couleur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Titre:"
  no% = no% + 1 : edit no% : no_Action_Titre% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80
    width no%,150
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Contenu:"
  no% = no% + 1 : memo no% : no_Action_Contenu% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+15 : left no%,10
    width no%,150 : bar_both no%
  no% = no% + 1 : button no% : parent no%,no_AttributsAction% : top no%,height(no_AttributsAction%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_action

  ' attributs Condition
  no% = no% + 1 : container no% : no_AttributsCondition% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Condition" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,20 : left no%,10
    caption no%,"Position X:"
  no% = no% + 1 : spin no% : no_Condition_X% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Position Y:"
  no% = no% + 1 : spin no% : no_Condition_Y% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Largeur:"
  no% = no% + 1 : spin no% : no_Condition_Largeur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Hauteur:"
  no% = no% + 1 : spin no% : no_Condition_Hauteur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_Condition_Couleur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Titre:"
  no% = no% + 1 : edit no% : no_Condition_Titre% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80
    width no%,150
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Contenu:"
  no% = no% + 1 : memo no% : no_Condition_Contenu% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+15 : left no%,10
    width no%,150 : bar_both no%
  no% = no% + 1 : button no% : parent no%,no_AttributsCondition% : top no%,height(no_AttributsCondition%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_Condition

  ' attributs Selection
  no% = no% + 1 : container no% : no_AttributsSelection% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Selection" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,20 : left no%,10
    caption no%,"Position X:"
  no% = no% + 1 : spin no% : no_Selection_X% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Position Y:"
  no% = no% + 1 : spin no% : no_Selection_Y% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Largeur:"
  no% = no% + 1 : spin no% : no_Selection_Largeur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Hauteur:"
  no% = no% + 1 : spin no% : no_Selection_Hauteur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_Selection_Couleur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Titre:"
  no% = no% + 1 : edit no% : no_Selection_Titre% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80
    width no%,150
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Contenu:"
  no% = no% + 1 : memo no% : no_Selection_Contenu% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+15 : left no%,10
    width no%,150 : bar_both no%
  no% = no% + 1 : button no% : parent no%,no_AttributsSelection% : top no%,height(no_AttributsSelection%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_Selection


  ' attributs Start
  no% = no% + 1 : container no% : no_AttributsStart% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Start" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,20 : left no%,10
    caption no%,"Position X:"
  no% = no% + 1 : spin no% : no_Start_X% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Position Y:"
  no% = no% + 1 : spin no% : no_Start_Y% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Largeur:"
  no% = no% + 1 : spin no% : no_Start_Largeur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Hauteur:"
  no% = no% + 1 : spin no% : no_Start_Hauteur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_Start_Couleur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : button no% : parent no%,no_AttributsStart% : top no%,height(no_AttributsStart%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_Start

  ' attributs End
  no% = no% + 1 : container no% : no_AttributsEnd% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs End" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,20 : left no%,10
    caption no%,"Position X:"
  no% = no% + 1 : spin no% : no_End_X% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Position Y:"
  no% = no% + 1 : spin no% : no_End_Y% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Largeur:"
  no% = no% + 1 : spin no% : no_End_Largeur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Hauteur:"
  no% = no% + 1 : spin no% : no_End_Hauteur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_End_Couleur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : button no% : parent no%,no_AttributsEnd% : top no%,height(no_AttributsEnd%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_End

end_sub

sub Objets()
  no% = no% + 1 : memo no% : no_memo% = no% : hide no% : bar_both no%
  no% = no% + 1 : open_dialog no% : no_open% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj"
  no% = no% + 1 : save_dialog no% : no_save% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj"
end_sub

sub AddConnector()
  FCE% = dll_call4("AddElementToFlowChart",FC%,0,0,0)
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,20,20)
  res% = dll_call1("DrawFlowChart",FC%)
  position no_Connector_X%,0
  position no_Connector_Y%,0
  show no_AttributsConnector%
end_sub

sub AddAction()
  dim_local titre$
  titre$ = "Action"
  FCE% = dll_call4("AddElementToFlowChart",FC%,1,hex("FFFF00"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,200)
  res% = dll_call1("DrawFlowChart",FC%)
  position no_Action_X%,0
  position no_Action_Y%,0
  position no_Action_Largeur%,300
  position no_Action_Hauteur%,200
  text no_action_Couleur%,"FFFF00"
  text no_Action_Titre%,titre$
  clear no_Action_Contenu%  
  show no_AttributsAction%
end_sub

sub AddCondition()
  dim_local titre$
  titre$ = "Condition ?"
  FCE% = dll_call4("AddElementToFlowChart",FC%,2,hex("0000FF"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100)
  clear no_memo%
  item_add no_memo%,"."
  item_add no_memo%,"Oui"
  item_add no_memo%,"Non"
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%))
  res% = dll_call1("DrawFlowChart",FC%)
  position no_Condition_X%,0
  position no_Condition_Y%,0
  position no_Condition_Largeur%,300
  position no_Condition_Hauteur%,100
  text no_Condition_Couleur%,"0000FF"
  text no_Condition_Titre%,titre$
  clear no_Condition_Contenu%  
  item_add no_Condition_Contenu%,"."
  item_add no_Condition_Contenu%,"Oui"
  item_add no_Condition_Contenu%,"Non"
  show no_AttributsCondition%
end_sub

sub AddSelector()
  dim_local titre$
  titre$ = "Sélection"
  FCE% = dll_call4("AddElementToFlowChart",FC%,3,hex("0000FF"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100)
  clear no_memo%
  item_add no_memo%,"1"
  item_add no_memo%,"2"
  item_add no_memo%,"3"
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%))
  res% = dll_call1("DrawFlowChart",FC%)
  position no_Selection_X%,0
  position no_Selection_Y%,0
  position no_Selection_Largeur%,300
  position no_Selection_Hauteur%,100
  text no_Selection_Couleur%,"0000FF"
  text no_Selection_Titre%,titre$
  clear no_Selection_Contenu%  
  item_add no_Selection_Contenu%,"1"
  item_add no_Selection_Contenu%,"2"
  item_add no_Selection_Contenu%,"3"
  show no_AttributsSelection%
end_sub

sub AddStart()
  dim_local titre$
  titre$ = "Début"
  FCE% = dll_call4("AddElementToFlowChart",FC%,4,hex("F0F0F0"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100)
  res% = dll_call1("DrawFlowChart",FC%)
  position no_Start_X%,0
  position no_Start_Y%,0
  position no_Start_Largeur%,100
  position no_Start_Hauteur%,100
  text no_Start_Couleur%,"F0F0F0"
  show no_AttributsStart%
end_sub

sub AddEnd()
  dim_local titre$
  titre$ = "Arrêt"
  FCE% = dll_call4("AddElementToFlowChart",FC%,5,hex("F0F0F0"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100)
  res% = dll_call1("DrawFlowChart",FC%)
  position no_End_X%,0
  position no_End_Y%,0
  position no_End_Largeur%,100
  position no_End_Hauteur%,100
  text no_End_Couleur%,"F0F0F0"
  show no_AttributsEnd%
end_sub

sub selectionner()
  message "Sélectionner un élément en cliquant dessus..."
  DoPoints% = 4
  active no_AnnSel%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
end_sub

sub annulerselection()
  DoPoints% = 0
  inactive no_AnnSel%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
end_sub

sub valider_connector()
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Connector_X%),position(no_Connector_Y%),M1%,M1%)
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsConnector%
end_sub

sub valider_action()
  dim_local titre$
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Action_X%),position(no_Action_Y%),position(no_Action_Largeur%),position(no_Action_Hauteur%))
  titre$ = trim$(text$(no_Action_Titre%))
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Action_Contenu%))
  res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Action_couleur%)))
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsAction%
end_sub

sub valider_Condition()
  dim_local titre$
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Condition_X%),position(no_Condition_Y%),position(no_Condition_Largeur%),position(no_Condition_Hauteur%))
  titre$ = trim$(text$(no_Condition_Titre%))
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Condition_Contenu%))
  res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Condition_couleur%)))
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsCondition%
end_sub

sub valider_Selection()
  dim_local titre$
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Selection_X%),position(no_Selection_Y%),position(no_Selection_Largeur%),position(no_Selection_Hauteur%))
  titre$ = trim$(text$(no_Selection_Titre%))
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Selection_Contenu%))
  res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Selection_couleur%)))
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsSelection%
end_sub

sub valider_Start()
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Start_X%),position(no_Start_Y%),position(no_Start_Largeur%),position(no_Start_Hauteur%))
  res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Start_couleur%)))
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsStart%
end_sub

sub valider_End()
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_End_X%),position(no_End_Y%),position(no_End_Largeur%),position(no_End_Hauteur%))
  res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_End_couleur%)))
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsEnd%
end_sub

sub nouveauprojet()
  FC% = dll_call1("DeleteFlowChart",FC%)
  FC% = dll_call1("CreateFlowChart",handle(0))
  full_space 0
  res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0))
  height no_cElements%,300
  projet$ = ""
end_sub

sub ouvrirprojet()
  dim_local prj$
  prj$ = file_name$(no_save%)
  if prj$="_" then exit_sub
  if lower$(file_extract_extension$(prj$))<>".fcproj"
    message "Extension erronnée (*.FCproj)"
    exit_sub
  end_if
  if file_exists(prj$)=0
    message("Ce fichier n'existe pas."
    exit_sub
  end_if
  
  nouveauprojet()
  res% = dll_call2("LoadFlowChartProject",FC%,adr(prj$))
  if res%<0
    message "Erreur en chargement"
  else
    message "Le projet a été chargé:"+chr$(13)+chr$(10)+prj$
    projet$ = prj$
  end_if  
end_sub

sub enregistrerprojet()
  dim_local prj$
  if projet$=""
    enregistrersousprojet()
    exit_sub
  end_if
  prj$ = projet$
  if file_exists(prj$)=1 then file_delete prj$
  res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$))
  if res%<0
    message "Erreur en sauvegarde"
  else
    message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$
    projet$ = prj$
  end_if
end_sub

sub enregistrersousprojet()
  dim_local prj$
  prj$ = file_name$(no_save%)
  if prj$="_" then exit_sub
  if lower$(file_extract_extension$(prj$))<>".fcproj"
    message "Extension erronnée (*.FCproj)"
    exit_sub
  end_if
  if file_exists(prj$)=1
    if message_confirmation_yes_no("Ce fichier existe déjà. Remplacer ?")<>1 then exit_sub
    file_delete prj$
  end_if
  res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$))
  if res%<0
    message "Erreur en sauvegarde"
  else
    message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$
    projet$ = prj$
  end_if
end_sub

sub lier()
  DoPoints% = 1
  npt% = 0
  Message "Cliquer sur une sortie..."
  active no_AnnLink%
  active no_Tracer%
end_sub

sub annulerlier()
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  inactive no_AnnLink%
  inactive no_Tracer%
end_sub

sub tracer()
  dim_local do1%
  ' rectangulariser le dernier segment
  res% = dll_call3("GetInputConnectorOfFlowChartElement",FCEdest%,adr(xx%),adr(yy%))    
  if npt%=0
    res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xxp%),adr(yyp%))    
  else
    xxp% = xArray%(npt%)
    yyp% = yArray%(npt%)
  end_if

  do1% = 0
  if abs(xxp%-xx%)<=DeltaRectangle%
    xxp% = xx%
    do1% = 1
  else
    if abs(yyp%-yy%)<=DeltaRectangle%
      yyp% = yy%
      do1% = 1
    end_if
  end_if
  if do1%=1
    npt% =  npt% + 1
    xarray%(0) = npt%
    xarray%(npt%) = xxp%
    yarray%(npt%) = yyp%
  end_if
  if yyp%>(yy%-DeltaRectangle%)
    yyp% = yy% - DeltaRectangle%
    npt% =  npt% + 1
    xarray%(0) = npt%
    xarray%(npt%) = xxp%
    yarray%(npt%) = yyp%
  end_if
  if xxp%<>xx%
    xxp% = xx%
    npt% =  npt% + 1
    xarray%(0) = npt%
    xarray%(npt%) = xxp%
    yarray%(npt%) = yyp%
  end_if

  res% = dll_call6("ConnectElementsOfFlowChart",FC%,FCEstart%,output%,FCEdest%,adr(xArray%),adr(yArray%))
  if res%=0 then message "Erreur en créant la connexion"
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  inactive no_AnnLink%
  inactive no_Tracer%
end_sub

Et voici un fichier "test_6_elements_5_liens.FCproj" contenant un projet complet pouvant être chargé par le menu Fichiers/Ouvrir:
Spoiler:
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyMar 13 Mar 2018 - 18:34

Nouvelle version de KGF.dll dans le WebDav, dossier DLLs. Avec ça, j'ai ajouté des règles de visée rouges au FlowChartDesigner, permettant de mieux viser lors de la création de liens. De petits cercles rouges apparaissent à ces points de passage imposés par un clic, et on peut ainsi les viser facilement avec les règles de visée, pour obtenir un vrai tracé réctangulaire. En plus, les coordonnées s'affichent dans la barre de titre, et on peut utiliser cette information pour placer des objets à des endroits précis.

Les petits cercles de guidage disparaissent lors du traçage du lien, ou lorsqu'un annule le traçage du lien.

Voici le programme Panoramic (voux pouvez charger un projet complet avec 6 objets et 5 liens dans le spoiler du message précédent...):
Code:
' FlowChartDesigner.bas

labels()
constantes()
variables()
menu()
cadres()
Objets()

on_user_event UserEvent

end

UserEvent:
  if bin_and(user_event_wparam,hex("FF000000"))=hex("0B000000") : ' ScrollImage
    if DoPoints%>0
      pos% =  user_event_lparam              : ' positon: yyyyxxxx
      xxp% = bin_and(pos%,hex("0000FFFF"))
      yyp% = pos%/65536
      if DoPoints%=1
        res% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%))
        if res%<0
          message "Ce n'est pas une sortie valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..."
          return
        end_if
        DoPoints% = 2
        message "Cliquez maintenant l'élémént de destination"+chr$(13)+chr$(10)+"ou Annulez..."
        return
      end_if
      if DoPoints%=2
        res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEdest%))
        if res%<0
          message "Ce n'est pas un élément valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..."
          return
        end_if
        DoPoints% = 3
        message "Cliquez maintenant les points d'étape"+chr$(13)+chr$(10)+"puis Tracez ou Annulez..."
        res% = dll_call2("ShowRulersInFlowChart",FC%,1)
        return
      end_if
      if DoPoints%=3
        ' ici, rectangulariser le tracé
        if npt%=0
          res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xx%),adr(yy%))   
        else
          xx% = xarray%(npt%)
          yy% = yarray%(npt%)
        end_if
        if abs(xxp%-xx%)<=DeltaRectangle%
          xxp% = xx%
        else
          if abs(yyp%-yy%)<=DeltaRectangle%
            yyp% = yy%
          else
            npt% =  npt% + 1
            xarray%(0) = npt%
            xarray%(npt%) = xxp%
            yarray%(npt%) = yy%
          end_if
        end_if
        ' mémoriser le point
        npt% = npt% + 1
        xarray%(0) = npt%
        xarray%(npt%) = xxp%
        yarray%(npt%) = yyp%
        res% = dll_call3("DrawTemporaryMarkIntoFolwChart",FC%,xxp%,yyp%)
'        message "Point "+str$(npt%)+": "+str$(xx%)+","+str$(yy%
      end_if
      if DoPoints%=4
        res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%))
        if res%<0
          message "Ce n'est pas un élément valide."
          return
        end_if
        message "Elément "+nature$(res%)+" identifié"
        select res%
          case 0
            show no_AttributsConnector%
            position no_Connector_X%,xxp%
            position no_Connector_Y%,yyp%
          case 1
            res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%))
            show no_AttributsAction%
            position no_Action_X%,xxp%
            position no_Action_Y%,yyp%
            position no_Action_Largeur%,wwp%
            position no_Action_Hauteur%,hhp%
            text no_action_Couleur%,right$(hex$(ccc%),6)
            text no_Action_Titre%,item_read$(no_memo%,1)
            item_delete no_memo%,1
            clear no_Action_Contenu%
            if count(no_memo%)>0
              for i%=1 to count(no_memo%)
                item_add no_Action_Contenu%,item_read$(no_memo%,i%)
              next i%
            end_if
          case 2
            res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%))
            show no_AttributsCondition%
            position no_Condition_X%,xxp%
            position no_Condition_Y%,yyp%
            position no_Condition_Largeur%,wwp%
            position no_Condition_Hauteur%,hhp%
            text no_Condition_Couleur%,right$(hex$(ccc%),6)
            text no_Condition_Titre%,item_read$(no_memo%,1)
            item_delete no_memo%,1
            clear no_Condition_Contenu%
            if count(no_memo%)>0
              for i%=1 to count(no_memo%)
                item_add no_Condition_Contenu%,item_read$(no_memo%,i%)
              next i%
            end_if
          case 3
            res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%))
            show no_AttributsSelection%
            position no_Selection_X%,xxp%
            position no_Selection_Y%,yyp%
            position no_Selection_Largeur%,wwp%
            position no_Selection_Hauteur%,hhp%
            text no_Selection_Couleur%,right$(hex$(ccc%),6)
            text no_Selection_Titre%,item_read$(no_memo%,1)
            item_delete no_memo%,1
            clear no_Selection_Contenu%
            if count(no_memo%)>0
              for i%=1 to count(no_memo%)
                item_add no_Selection_Contenu%,item_read$(no_memo%,i%)
              next i%
            end_if
          case 4
            res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%))
            show no_AttributsStart%
            position no_Start_X%,xxp%
            position no_Start_Y%,yyp%
            position no_Start_Largeur%,wwp%
            position no_Start_Hauteur%,hhp%
            text no_Start_Couleur%,right$(hex$(ccc%),6)
          case 5
            res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%))
            show no_AttributsEnd%
            position no_End_X%,xxp%
            position no_End_Y%,yyp%
            position no_End_Largeur%,wwp%
            position no_End_Hauteur%,hhp%
            text no_End_Couleur%,right$(hex$(ccc%),6)
        end_select
      end_if
    end_if
  end_if

  return


sortir:
  terminate

AddConnector:
  AddConnector()
  return

AddAction:
  AddAction()
  return

AddCondition:
  AddCondition()
  return

AddSelector:
  AddSelector()
  return

AddStart:
  AddStart()
  return

AddEnd:
  AddEnd()
  return

selectionner:
  selectionner()
  return
 
valider_connector:
  valider_connector()
  return
 
valider_action:
  valider_action()
  return
 
valider_Condition:
  valider_Condition()
  return
 
annulerselection:
  annulerselection()
  return
 
valider_Selection:
  valider_Selection()
  return

valider_start:
  valider_start()
  return
 
valider_end:
  valider_end()
  return
 
nouveauprojet:
  nouveauprojet()
  return

ouvrirprojet:
  ouvrirprojet()
  return
 
enregistrerprojet:
  enregistrerprojet()
  return
 
enregistrersousprojet:
  enregistrersousprojet()
  return
 
lier:
  lier()
  return
 
annulerlier:
  annulerlier()
  return
 
tracer:
  tracer()
  return

sub labels()
  label AddConnector, AddAction, AddCondition, AddSelector, AddStart, AddEnd
  label valider_connector, valider_action, valider_Condition, valider_Selection
  label valider_Start, valider_End
  label selectionner, annulerselection, UserEvent, sortir
  label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet
  label lier, annulerlier, tracer
end_sub

sub constantes()
  dim KGF$ : KGF$ = "KGF.dll"
  dim M1% : M1% = 0-1
  dim DeltaRectangle% : DeltaRectangle% = 10
  dim nature$(6)
    nature$(0) = "Connector"
    nature$(1) = "Action"
    nature$(2) = "Condition"
    nature$(3) = "Selector"
    nature$(4) = "Start"
    nature$(5) = "End"
end_sub

sub variables()
  dim res%, DoPoints%, pos%, xxp%, yyp%, titre$, wwp%, hhp%, i%, ccc%, output%, xx%, yy%
  dim npt%, xarray%(100),yarray%(100)
  dim no%, no1%, no2%, no_cElements%, no_AnnSel%, no_memo%, no_open%, no_save%
  dim no_AttributsConnector%, no_AttributsAction%, no_AttributsCondition%
  dim no_AttributsSelection%, no_AttributsStart%, no_AttributsEnd%
  dim no_Connector_X%, no_Connector_Y%, no_AnnLink%, no_Tracer%
  dim no_Action_X%, no_Action_Y%, no_Action_Titre%, no_action_Couleur%
  dim no_Action_Largeur%, no_Action_Hauteur%, no_Action_Contenu%
  dim no_Condition_X%, no_Condition_Y%, no_Condition_Titre%, no_condition_Couleur%
  dim no_Condition_Largeur%, no_Condition_Hauteur%, no_Condition_Contenu%
  dim no_Selection_X%, no_Selection_Y%, no_Selection_Titre%, no_selection_Couleur%
  dim no_Selection_Largeur%, no_Selection_Hauteur%, no_Selection_Contenu%
  dim no_Start_X%, no_Start_Y%, no_Start_Largeur%, no_Start_Hauteur%, no_start_Couleur%
  dim no_End_X%, no_End_Y%, no_End_Largeur%, no_End_Hauteur%, no_end_Couleur%
  dim FC%, FCE%, FCEstart%, FCEdest%
  dim projet$
end_sub

sub menu()
  no% = no% + 1 : main_menu no% : no1% = no%
    no% = no% + 1 : sub_menu no% : parent no%,no1% : no2% = no% : caption no%,"Fichier"
      no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Nouveau" : on_click no%,nouveauprojet
      no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Ouvrir..." : on_click no%,ouvrirprojet
      no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer" : on_click no%,enregistrerprojet
      no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer sous..." : on_click no%,enregistrersousprojet
      no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"-"
      no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Sortir" : on_click no%,sortir
end_sub

sub cadres()
  dll_on KGF$
  no% = no% + 1 : container no% : no_cElements% = no% : width no%,200 : caption no%,"Eléments"
  FC% = dll_call1("CreateFlowChart",handle(0))
  full_space 0
  res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0))
  height no_cElements%,300
 
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Connecteur"
    top no%,15 : left no%,10 : on_click no%,AddConnector
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Action"
    top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddAction
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Condition"
    top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddCondition
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Selecteur"
    top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddSelector
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Début"
    top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddStart
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Fin"
    top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddEnd

  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sélectionner"
    top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionner
  no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSel% = no% : caption no%,"Annuler" : inactive no%
    top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerselection

  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Lier"
    top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,lier
  no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnLink% = no% : caption no%,"Annuler" : inactive no%
    top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerlier
  no% = no% + 1 : button no% : parent no%,no_cElements% : no_Tracer% = no% : caption no%,"Tracer" : inactive no%
    top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,tracer

    ' attributs Connector
  no% = no% + 1 : container no% : no_AttributsConnector% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Connector" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,20 : left no%,10
    caption no%,"Position X:"
  no% = no% + 1 : spin no% : no_Connector_X% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Position Y:"
  no% = no% + 1 : spin no% : no_Connector_Y% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : button no% : parent no%,no_AttributsConnector% : top no%,height(no_AttributsConnector%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_connector

  ' attributs Action
  no% = no% + 1 : container no% : no_AttributsAction% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Action" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,20 : left no%,10
    caption no%,"Position X:"
  no% = no% + 1 : spin no% : no_Action_X% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Position Y:"
  no% = no% + 1 : spin no% : no_Action_Y% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Largeur:"
  no% = no% + 1 : spin no% : no_Action_Largeur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Hauteur:"
  no% = no% + 1 : spin no% : no_Action_Hauteur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_Action_Couleur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Titre:"
  no% = no% + 1 : edit no% : no_Action_Titre% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80
    width no%,150
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Contenu:"
  no% = no% + 1 : memo no% : no_Action_Contenu% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+15 : left no%,10
    width no%,150 : bar_both no%
  no% = no% + 1 : button no% : parent no%,no_AttributsAction% : top no%,height(no_AttributsAction%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_action

  ' attributs Condition
  no% = no% + 1 : container no% : no_AttributsCondition% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Condition" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,20 : left no%,10
    caption no%,"Position X:"
  no% = no% + 1 : spin no% : no_Condition_X% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Position Y:"
  no% = no% + 1 : spin no% : no_Condition_Y% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Largeur:"
  no% = no% + 1 : spin no% : no_Condition_Largeur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Hauteur:"
  no% = no% + 1 : spin no% : no_Condition_Hauteur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_Condition_Couleur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Titre:"
  no% = no% + 1 : edit no% : no_Condition_Titre% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80
    width no%,150
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Contenu:"
  no% = no% + 1 : memo no% : no_Condition_Contenu% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+15 : left no%,10
    width no%,150 : bar_both no%
  no% = no% + 1 : button no% : parent no%,no_AttributsCondition% : top no%,height(no_AttributsCondition%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_Condition

  ' attributs Selection
  no% = no% + 1 : container no% : no_AttributsSelection% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Selection" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,20 : left no%,10
    caption no%,"Position X:"
  no% = no% + 1 : spin no% : no_Selection_X% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Position Y:"
  no% = no% + 1 : spin no% : no_Selection_Y% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Largeur:"
  no% = no% + 1 : spin no% : no_Selection_Largeur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Hauteur:"
  no% = no% + 1 : spin no% : no_Selection_Hauteur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_Selection_Couleur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Titre:"
  no% = no% + 1 : edit no% : no_Selection_Titre% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80
    width no%,150
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Contenu:"
  no% = no% + 1 : memo no% : no_Selection_Contenu% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+15 : left no%,10
    width no%,150 : bar_both no%
  no% = no% + 1 : button no% : parent no%,no_AttributsSelection% : top no%,height(no_AttributsSelection%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_Selection


  ' attributs Start
  no% = no% + 1 : container no% : no_AttributsStart% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Start" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,20 : left no%,10
    caption no%,"Position X:"
  no% = no% + 1 : spin no% : no_Start_X% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Position Y:"
  no% = no% + 1 : spin no% : no_Start_Y% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Largeur:"
  no% = no% + 1 : spin no% : no_Start_Largeur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Hauteur:"
  no% = no% + 1 : spin no% : no_Start_Hauteur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_Start_Couleur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : button no% : parent no%,no_AttributsStart% : top no%,height(no_AttributsStart%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_Start

  ' attributs End
  no% = no% + 1 : container no% : no_AttributsEnd% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs End" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,20 : left no%,10
    caption no%,"Position X:"
  no% = no% + 1 : spin no% : no_End_X% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Position Y:"
  no% = no% + 1 : spin no% : no_End_Y% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Largeur:"
  no% = no% + 1 : spin no% : no_End_Largeur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Hauteur:"
  no% = no% + 1 : spin no% : no_End_Hauteur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_End_Couleur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : button no% : parent no%,no_AttributsEnd% : top no%,height(no_AttributsEnd%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_End

end_sub

sub Objets()
  no% = no% + 1 : memo no% : no_memo% = no% : hide no% : bar_both no%
  no% = no% + 1 : open_dialog no% : no_open% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj"
  no% = no% + 1 : save_dialog no% : no_save% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj"
end_sub

sub AddConnector()
  FCE% = dll_call4("AddElementToFlowChart",FC%,0,0,0)
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,20,20)
  res% = dll_call1("DrawFlowChart",FC%)
  position no_Connector_X%,0
  position no_Connector_Y%,0
  show no_AttributsConnector%
end_sub

sub AddAction()
  dim_local titre$
  titre$ = "Action"
  FCE% = dll_call4("AddElementToFlowChart",FC%,1,hex("FFFF00"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,200)
  res% = dll_call1("DrawFlowChart",FC%)
  position no_Action_X%,0
  position no_Action_Y%,0
  position no_Action_Largeur%,300
  position no_Action_Hauteur%,200
  text no_action_Couleur%,"FFFF00"
  text no_Action_Titre%,titre$
  clear no_Action_Contenu% 
  show no_AttributsAction%
end_sub

sub AddCondition()
  dim_local titre$
  titre$ = "Condition ?"
  FCE% = dll_call4("AddElementToFlowChart",FC%,2,hex("0000FF"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100)
  clear no_memo%
  item_add no_memo%,"."
  item_add no_memo%,"Oui"
  item_add no_memo%,"Non"
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%))
  res% = dll_call1("DrawFlowChart",FC%)
  position no_Condition_X%,0
  position no_Condition_Y%,0
  position no_Condition_Largeur%,300
  position no_Condition_Hauteur%,100
  text no_Condition_Couleur%,"0000FF"
  text no_Condition_Titre%,titre$
  clear no_Condition_Contenu% 
  item_add no_Condition_Contenu%,"."
  item_add no_Condition_Contenu%,"Oui"
  item_add no_Condition_Contenu%,"Non"
  show no_AttributsCondition%
end_sub

sub AddSelector()
  dim_local titre$
  titre$ = "Sélection"
  FCE% = dll_call4("AddElementToFlowChart",FC%,3,hex("0000FF"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100)
  clear no_memo%
  item_add no_memo%,"1"
  item_add no_memo%,"2"
  item_add no_memo%,"3"
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%))
  res% = dll_call1("DrawFlowChart",FC%)
  position no_Selection_X%,0
  position no_Selection_Y%,0
  position no_Selection_Largeur%,300
  position no_Selection_Hauteur%,100
  text no_Selection_Couleur%,"0000FF"
  text no_Selection_Titre%,titre$
  clear no_Selection_Contenu% 
  item_add no_Selection_Contenu%,"1"
  item_add no_Selection_Contenu%,"2"
  item_add no_Selection_Contenu%,"3"
  show no_AttributsSelection%
end_sub

sub AddStart()
  dim_local titre$
  titre$ = "Début"
  FCE% = dll_call4("AddElementToFlowChart",FC%,4,hex("F0F0F0"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100)
  res% = dll_call1("DrawFlowChart",FC%)
  position no_Start_X%,0
  position no_Start_Y%,0
  position no_Start_Largeur%,100
  position no_Start_Hauteur%,100
  text no_Start_Couleur%,"F0F0F0"
  show no_AttributsStart%
end_sub

sub AddEnd()
  dim_local titre$
  titre$ = "Arrêt"
  FCE% = dll_call4("AddElementToFlowChart",FC%,5,hex("F0F0F0"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100)
  res% = dll_call1("DrawFlowChart",FC%)
  position no_End_X%,0
  position no_End_Y%,0
  position no_End_Largeur%,100
  position no_End_Hauteur%,100
  text no_End_Couleur%,"F0F0F0"
  show no_AttributsEnd%
end_sub

sub selectionner()
  message "Sélectionner un élément en cliquant dessus..."
  DoPoints% = 4
  active no_AnnSel%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
end_sub

sub annulerselection()
  DoPoints% = 0
  inactive no_AnnSel%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
end_sub

sub valider_connector()
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Connector_X%),position(no_Connector_Y%),M1%,M1%)
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsConnector%
end_sub

sub valider_action()
  dim_local titre$
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Action_X%),position(no_Action_Y%),position(no_Action_Largeur%),position(no_Action_Hauteur%))
  titre$ = trim$(text$(no_Action_Titre%))
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Action_Contenu%))
  res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Action_couleur%)))
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsAction%
end_sub

sub valider_Condition()
  dim_local titre$
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Condition_X%),position(no_Condition_Y%),position(no_Condition_Largeur%),position(no_Condition_Hauteur%))
  titre$ = trim$(text$(no_Condition_Titre%))
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Condition_Contenu%))
  res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Condition_couleur%)))
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsCondition%
end_sub

sub valider_Selection()
  dim_local titre$
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Selection_X%),position(no_Selection_Y%),position(no_Selection_Largeur%),position(no_Selection_Hauteur%))
  titre$ = trim$(text$(no_Selection_Titre%))
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Selection_Contenu%))
  res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Selection_couleur%)))
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsSelection%
end_sub

sub valider_Start()
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Start_X%),position(no_Start_Y%),position(no_Start_Largeur%),position(no_Start_Hauteur%))
  res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Start_couleur%)))
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsStart%
end_sub

sub valider_End()
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_End_X%),position(no_End_Y%),position(no_End_Largeur%),position(no_End_Hauteur%))
  res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_End_couleur%)))
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsEnd%
end_sub

sub nouveauprojet()
  FC% = dll_call1("DeleteFlowChart",FC%)
  FC% = dll_call1("CreateFlowChart",handle(0))
  full_space 0
  res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0))
  height no_cElements%,300
  projet$ = ""
end_sub

sub ouvrirprojet()
  dim_local prj$
  prj$ = file_name$(no_save%)
  if prj$="_" then exit_sub
  if lower$(file_extract_extension$(prj$))<>".fcproj"
    message "Extension erronnée (*.FCproj)"
    exit_sub
  end_if
  if file_exists(prj$)=0
    message("Ce fichier n'existe pas."
    exit_sub
  end_if
 
  nouveauprojet()
  res% = dll_call2("LoadFlowChartProject",FC%,adr(prj$))
  if res%<0
    message "Erreur en chargement"
  else
    message "Le projet a été chargé:"+chr$(13)+chr$(10)+prj$
    projet$ = prj$
  end_if 
end_sub

sub enregistrerprojet()
  dim_local prj$
  if projet$=""
    enregistrersousprojet()
    exit_sub
  end_if
  prj$ = projet$
  if file_exists(prj$)=1 then file_delete prj$
  res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$))
  if res%<0
    message "Erreur en sauvegarde"
  else
    message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$
    projet$ = prj$
  end_if
end_sub

sub enregistrersousprojet()
  dim_local prj$
  prj$ = file_name$(no_save%)
  if prj$="_" then exit_sub
  if lower$(file_extract_extension$(prj$))<>".fcproj"
    message "Extension erronnée (*.FCproj)"
    exit_sub
  end_if
  if file_exists(prj$)=1
    if message_confirmation_yes_no("Ce fichier existe déjà. Remplacer ?")<>1 then exit_sub
    file_delete prj$
  end_if
  res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$))
  if res%<0
    message "Erreur en sauvegarde"
  else
    message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$
    projet$ = prj$
  end_if
end_sub

sub lier()
  DoPoints% = 1
  npt% = 0
  Message "Cliquer sur une sortie..."
  active no_AnnLink%
  active no_Tracer%
end_sub

sub annulerlier()
'  res% = dll_call2("ShowRulersInFlowChart",FC%,0)
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  res% = dll_call1("DrawFlowChart",FC%)
  inactive no_AnnLink%
  inactive no_Tracer%
end_sub

sub tracer()
  dim_local do1%
  ' rectangulariser le dernier segment
  res% = dll_call3("GetInputConnectorOfFlowChartElement",FCEdest%,adr(xx%),adr(yy%))   
  if npt%=0
    res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xxp%),adr(yyp%))   
  else
    xxp% = xArray%(npt%)
    yyp% = yArray%(npt%)
  end_if

  do1% = 0
  if abs(xxp%-xx%)<=DeltaRectangle%
    xxp% = xx%
    do1% = 1
  else
    if abs(yyp%-yy%)<=DeltaRectangle%
      yyp% = yy%
      do1% = 1
    end_if
  end_if
  if do1%=1
    npt% =  npt% + 1
    xarray%(0) = npt%
    xarray%(npt%) = xxp%
    yarray%(npt%) = yyp%
  end_if
  if yyp%>(yy%-DeltaRectangle%)
    yyp% = yy% - DeltaRectangle%
    npt% =  npt% + 1
    xarray%(0) = npt%
    xarray%(npt%) = xxp%
    yarray%(npt%) = yyp%
  end_if
  if xxp%<>xx%
    xxp% = xx%
    npt% =  npt% + 1
    xarray%(0) = npt%
    xarray%(npt%) = xxp%
    yarray%(npt%) = yyp%
  end_if

  res% = dll_call6("ConnectElementsOfFlowChart",FC%,FCEstart%,output%,FCEdest%,adr(xArray%),adr(yArray%))
  if res%=0 then message "Erreur en créant la connexion"
'  res% = dll_call2("ShowRulersInFlowChart",FC%,0)
  res% = dll_call1("DrawFlowChart",FC%)
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  inactive no_AnnLink%
  inactive no_Tracer%
end_sub
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Minibug

Minibug


Nombre de messages : 4566
Age : 57
Localisation : Vienne (86)
Date d'inscription : 09/02/2012

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyMar 13 Mar 2018 - 19:17

Bonsoir Klaus !

Je viens de tester la dernière version. C'est de plus en plus intéressant...
J'imagine que tu as derrière la tête la possibilité de transformer l'algo réalisé en code Panoramic n'est ce pas ?

Par contre le déplacement des objets n'est pas top.
Tu ne pourrais pas intégré le principe du déplacement des objets Windows que tu as réalisé il y a peu ?
Ça serai beaucoup plus simple et pratique. Enfin je dis çà... Laughing

Ça me fait penser à la programmation scratch avec des principes graphiques en déplacement et copier-coller...
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyMar 13 Mar 2018 - 19:34

Citation :
J'imagine que tu as derrière la tête la possibilité de transformer l'algo réalisé en code Panoramic n'est ce pas ?
De façon lointaine, peut-être... L'idée principale est plutôt de réaliser des documentations, des présentations, ... c'est plutôt une démonstration des capacités de ScrollImage et des graphismes en général avec KGF.dll.

Citation :
Par contre le déplacement des objets n'est pas top.
Tu ne pourrais pas intégré le principe du déplacement des objets Windows que tu as réalisé il y a peu ?
Je suis d'accord avec toi, sur ce sujet. C'est une prémière étape, techniquement opérationnelle. Je ne peux malheureusement pas appliquer les objets Designer ou ObjectMover à ces éléments, car ces graphismes sont simplement des morceaux de bitmaps iintégrés dans le Canvas d'une grande bitmap représentant l'organigramme, et je n'ai donc pas de handle pour ces graphismes. Mais je prépare un mécanisme similaire, dédié à ces graphismes, avec l'idée de l'appliquer à des Sprites, également...

Qu'est-ce que tu penses des règles de visée et des petits ronds rouges semés pour marquer le chemin choisi pour un lien ?
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Minibug

Minibug


Nombre de messages : 4566
Age : 57
Localisation : Vienne (86)
Date d'inscription : 09/02/2012

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyMar 13 Mar 2018 - 19:44

Citation :
Qu'est-ce que tu penses des règles de visée et des petits ronds rouges semés pour marquer le chemin choisi pour un lien ?

Ben j'ai pas vu de petits points rouges ! Suspect king
Désolé Klaus mais là, je ne te suis plus... drunken
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyMar 13 Mar 2018 - 20:01

Ben, pour tracer un lien entre une sortie d'un objet et l'entrée d'un autre, tu fais, dans l'ordre:
- cliquer sur "Lien"
- cliquer sur une sortie d'objet
- cliquer dans l'objet ciblé
- puis déposer, à partir d'un endroit proche de la sortie choisie, des points par clic gauche, jusqu'à s'approcher de l'entrée ciblée (à l'aplomp de préférence)
- cliquer sur "Tracer"

Lors de la phase des clics,, chaque point est marqué par un cercle rouge, ce qui permet de le viser par des règles de visée, pour choisir l'emplacement suivant en respectant des angles droits...
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Minibug

Minibug


Nombre de messages : 4566
Age : 57
Localisation : Vienne (86)
Date d'inscription : 09/02/2012

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyMar 13 Mar 2018 - 20:31

Oui j'ai bien fais tout cela mais j'ai pas vu les points ! Wink

Pour le tracer j'aurai plutôt pensé à un premier clic sur le sélecteur de sortie ( comme tu as choisi)
Et ensuite un trait ce dégage et pointe vers la souris en suivant le déplacement de celle-ci
Puis dès que l'on clic le trait se fixe et un nouveau démarre du point cliqué sur le point de la souris
et ainsi de suite jusqu"au prochain clic et jusqu’à cliquer sur le sélecteur d'entrée.

Avec éventuellement une possibilité de sortie en cours de tracé par la touche ECHAP.

Qu'en pense tu ?
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyMar 13 Mar 2018 - 20:41

Si tu ne vois pas les petits cercles, c'est que tu as chargée la DLL et le code Panoramic juste avant ma dernière mise à jour. Vérifie si la ligne 66 di programme est bien:
Code:
        res% = dll_call3("DrawTemporaryMarkIntoFolwChart",FC%,xxp%,yyp%)
Si non, reprends le code du post ci-dessus, et recharge la DLL.

Citation :
Avec éventuellement une possibilité de sortie en cours de tracé par la touche ECHAP.
C'est fait avec le bouton "Annuler" à droite du bouton "Lier".
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Marc

Marc


Nombre de messages : 2372
Age : 63
Localisation : TOURS (37)
Date d'inscription : 17/03/2014

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyMar 13 Mar 2018 - 21:02

Bonsoir Klaus,
Bonsoir à tous,

@Klaus:
Je suis en train de tester l'évolution de ton projet et je constate que les règles de visée rouges restent visibles sur les autres écrans de Windows : Voici un exemple plus parlant avec ton programme en arrière plan et Google Chrome en avant plan :

Spoiler:

Merci pour tout et bonne continuation.
Revenir en haut Aller en bas
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyMar 13 Mar 2018 - 21:14

Citation :
les règles de visée rouges restent visibles sur les autres écrans de Windows
Oui... ces règles de visée sont des fenêtres "topmost" pour Windows, sans bord et d'une largeur ou hauteur de 1 pixel. Je vais les rendre visibles uniquement lors de la création de liens, comme ceci:
Code:
' FlowChartDesigner.bas

labels()
constantes()
variables()
menu()
cadres()
Objets()

on_user_event UserEvent

end

UserEvent:
  if bin_and(user_event_wparam,hex("FF000000"))=hex("0B000000") : ' ScrollImage
    if DoPoints%>0
      pos% =  user_event_lparam              : ' positon: yyyyxxxx
      xxp% = bin_and(pos%,hex("0000FFFF"))
      yyp% = pos%/65536
      if DoPoints%=1
        res% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%))
        if res%<0
          message "Ce n'est pas une sortie valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..."
          return
        end_if
        DoPoints% = 2
        message "Cliquez maintenant l'élémént de destination"+chr$(13)+chr$(10)+"ou Annulez..."
        return
      end_if
      if DoPoints%=2
        res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEdest%))
        if res%<0
          message "Ce n'est pas un élément valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..."
          return
        end_if
        DoPoints% = 3
        message "Cliquez maintenant les points d'étape"+chr$(13)+chr$(10)+"puis Tracez ou Annulez..."
        res% = dll_call2("ShowRulersInFlowChart",FC%,1)
        return
      end_if
      if DoPoints%=3
        ' ici, rectangulariser le tracé
        if npt%=0
          res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xx%),adr(yy%))   
        else
          xx% = xarray%(npt%)
          yy% = yarray%(npt%)
        end_if
        if abs(xxp%-xx%)<=DeltaRectangle%
          xxp% = xx%
        else
          if abs(yyp%-yy%)<=DeltaRectangle%
            yyp% = yy%
          else
            npt% =  npt% + 1
            xarray%(0) = npt%
            xarray%(npt%) = xxp%
            yarray%(npt%) = yy%
          end_if
        end_if
        ' mémoriser le point
        npt% = npt% + 1
        xarray%(0) = npt%
        xarray%(npt%) = xxp%
        yarray%(npt%) = yyp%
        res% = dll_call3("DrawTemporaryMarkIntoFolwChart",FC%,xxp%,yyp%)
'        message "Point "+str$(npt%)+": "+str$(xx%)+","+str$(yy%
      end_if
      if DoPoints%=4
        res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%))
        if res%<0
          message "Ce n'est pas un élément valide."
          return
        end_if
        message "Elément "+nature$(res%)+" identifié"
        select res%
          case 0
            show no_AttributsConnector%
            position no_Connector_X%,xxp%
            position no_Connector_Y%,yyp%
          case 1
            res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%))
            show no_AttributsAction%
            position no_Action_X%,xxp%
            position no_Action_Y%,yyp%
            position no_Action_Largeur%,wwp%
            position no_Action_Hauteur%,hhp%
            text no_action_Couleur%,right$(hex$(ccc%),6)
            text no_Action_Titre%,item_read$(no_memo%,1)
            item_delete no_memo%,1
            clear no_Action_Contenu%
            if count(no_memo%)>0
              for i%=1 to count(no_memo%)
                item_add no_Action_Contenu%,item_read$(no_memo%,i%)
              next i%
            end_if
          case 2
            res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%))
            show no_AttributsCondition%
            position no_Condition_X%,xxp%
            position no_Condition_Y%,yyp%
            position no_Condition_Largeur%,wwp%
            position no_Condition_Hauteur%,hhp%
            text no_Condition_Couleur%,right$(hex$(ccc%),6)
            text no_Condition_Titre%,item_read$(no_memo%,1)
            item_delete no_memo%,1
            clear no_Condition_Contenu%
            if count(no_memo%)>0
              for i%=1 to count(no_memo%)
                item_add no_Condition_Contenu%,item_read$(no_memo%,i%)
              next i%
            end_if
          case 3
            res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%))
            show no_AttributsSelection%
            position no_Selection_X%,xxp%
            position no_Selection_Y%,yyp%
            position no_Selection_Largeur%,wwp%
            position no_Selection_Hauteur%,hhp%
            text no_Selection_Couleur%,right$(hex$(ccc%),6)
            text no_Selection_Titre%,item_read$(no_memo%,1)
            item_delete no_memo%,1
            clear no_Selection_Contenu%
            if count(no_memo%)>0
              for i%=1 to count(no_memo%)
                item_add no_Selection_Contenu%,item_read$(no_memo%,i%)
              next i%
            end_if
          case 4
            res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%))
            show no_AttributsStart%
            position no_Start_X%,xxp%
            position no_Start_Y%,yyp%
            position no_Start_Largeur%,wwp%
            position no_Start_Hauteur%,hhp%
            text no_Start_Couleur%,right$(hex$(ccc%),6)
          case 5
            res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%))
            show no_AttributsEnd%
            position no_End_X%,xxp%
            position no_End_Y%,yyp%
            position no_End_Largeur%,wwp%
            position no_End_Hauteur%,hhp%
            text no_End_Couleur%,right$(hex$(ccc%),6)
        end_select
      end_if
    end_if
  end_if

  return


sortir:
  terminate

AddConnector:
  AddConnector()
  return

AddAction:
  AddAction()
  return

AddCondition:
  AddCondition()
  return

AddSelector:
  AddSelector()
  return

AddStart:
  AddStart()
  return

AddEnd:
  AddEnd()
  return

selectionner:
  selectionner()
  return
 
valider_connector:
  valider_connector()
  return
 
valider_action:
  valider_action()
  return
 
valider_Condition:
  valider_Condition()
  return
 
annulerselection:
  annulerselection()
  return
 
valider_Selection:
  valider_Selection()
  return

valider_start:
  valider_start()
  return
 
valider_end:
  valider_end()
  return
 
nouveauprojet:
  nouveauprojet()
  return

ouvrirprojet:
  ouvrirprojet()
  return
 
enregistrerprojet:
  enregistrerprojet()
  return
 
enregistrersousprojet:
  enregistrersousprojet()
  return
 
lier:
  lier()
  return
 
annulerlier:
  annulerlier()
  return
 
tracer:
  tracer()
  return

sub labels()
  label AddConnector, AddAction, AddCondition, AddSelector, AddStart, AddEnd
  label valider_connector, valider_action, valider_Condition, valider_Selection
  label valider_Start, valider_End
  label selectionner, annulerselection, UserEvent, sortir
  label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet
  label lier, annulerlier, tracer
end_sub

sub constantes()
  dim KGF$ : KGF$ = "KGF.dll"
  dim M1% : M1% = 0-1
  dim DeltaRectangle% : DeltaRectangle% = 10
  dim nature$(6)
    nature$(0) = "Connector"
    nature$(1) = "Action"
    nature$(2) = "Condition"
    nature$(3) = "Selector"
    nature$(4) = "Start"
    nature$(5) = "End"
end_sub

sub variables()
  dim res%, DoPoints%, pos%, xxp%, yyp%, titre$, wwp%, hhp%, i%, ccc%, output%, xx%, yy%
  dim npt%, xarray%(100),yarray%(100)
  dim no%, no1%, no2%, no_cElements%, no_AnnSel%, no_memo%, no_open%, no_save%
  dim no_AttributsConnector%, no_AttributsAction%, no_AttributsCondition%
  dim no_AttributsSelection%, no_AttributsStart%, no_AttributsEnd%
  dim no_Connector_X%, no_Connector_Y%, no_AnnLink%, no_Tracer%
  dim no_Action_X%, no_Action_Y%, no_Action_Titre%, no_action_Couleur%
  dim no_Action_Largeur%, no_Action_Hauteur%, no_Action_Contenu%
  dim no_Condition_X%, no_Condition_Y%, no_Condition_Titre%, no_condition_Couleur%
  dim no_Condition_Largeur%, no_Condition_Hauteur%, no_Condition_Contenu%
  dim no_Selection_X%, no_Selection_Y%, no_Selection_Titre%, no_selection_Couleur%
  dim no_Selection_Largeur%, no_Selection_Hauteur%, no_Selection_Contenu%
  dim no_Start_X%, no_Start_Y%, no_Start_Largeur%, no_Start_Hauteur%, no_start_Couleur%
  dim no_End_X%, no_End_Y%, no_End_Largeur%, no_End_Hauteur%, no_end_Couleur%
  dim FC%, FCE%, FCEstart%, FCEdest%
  dim projet$
end_sub

sub menu()
  no% = no% + 1 : main_menu no% : no1% = no%
    no% = no% + 1 : sub_menu no% : parent no%,no1% : no2% = no% : caption no%,"Fichier"
      no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Nouveau" : on_click no%,nouveauprojet
      no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Ouvrir..." : on_click no%,ouvrirprojet
      no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer" : on_click no%,enregistrerprojet
      no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer sous..." : on_click no%,enregistrersousprojet
      no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"-"
      no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Sortir" : on_click no%,sortir
end_sub

sub cadres()
  dll_on KGF$
  no% = no% + 1 : container no% : no_cElements% = no% : width no%,200 : caption no%,"Eléments"
  FC% = dll_call1("CreateFlowChart",handle(0))
  full_space 0
  res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0))
  height no_cElements%,300
  res% = dll_call2("ShowRulersInFlowChart",FC%,0)
 
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Connecteur"
    top no%,15 : left no%,10 : on_click no%,AddConnector
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Action"
    top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddAction
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Condition"
    top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddCondition
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Selecteur"
    top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddSelector
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Début"
    top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddStart
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Fin"
    top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddEnd

  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sélectionner"
    top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionner
  no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSel% = no% : caption no%,"Annuler" : inactive no%
    top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerselection

  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Lier"
    top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,lier
  no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnLink% = no% : caption no%,"Annuler" : inactive no%
    top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerlier
  no% = no% + 1 : button no% : parent no%,no_cElements% : no_Tracer% = no% : caption no%,"Tracer" : inactive no%
    top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,tracer

    ' attributs Connector
  no% = no% + 1 : container no% : no_AttributsConnector% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Connector" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,20 : left no%,10
    caption no%,"Position X:"
  no% = no% + 1 : spin no% : no_Connector_X% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Position Y:"
  no% = no% + 1 : spin no% : no_Connector_Y% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : button no% : parent no%,no_AttributsConnector% : top no%,height(no_AttributsConnector%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_connector

  ' attributs Action
  no% = no% + 1 : container no% : no_AttributsAction% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Action" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,20 : left no%,10
    caption no%,"Position X:"
  no% = no% + 1 : spin no% : no_Action_X% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Position Y:"
  no% = no% + 1 : spin no% : no_Action_Y% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Largeur:"
  no% = no% + 1 : spin no% : no_Action_Largeur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Hauteur:"
  no% = no% + 1 : spin no% : no_Action_Hauteur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_Action_Couleur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Titre:"
  no% = no% + 1 : edit no% : no_Action_Titre% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80
    width no%,150
  no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Contenu:"
  no% = no% + 1 : memo no% : no_Action_Contenu% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+15 : left no%,10
    width no%,150 : bar_both no%
  no% = no% + 1 : button no% : parent no%,no_AttributsAction% : top no%,height(no_AttributsAction%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_action

  ' attributs Condition
  no% = no% + 1 : container no% : no_AttributsCondition% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Condition" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,20 : left no%,10
    caption no%,"Position X:"
  no% = no% + 1 : spin no% : no_Condition_X% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Position Y:"
  no% = no% + 1 : spin no% : no_Condition_Y% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Largeur:"
  no% = no% + 1 : spin no% : no_Condition_Largeur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Hauteur:"
  no% = no% + 1 : spin no% : no_Condition_Hauteur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_Condition_Couleur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Titre:"
  no% = no% + 1 : edit no% : no_Condition_Titre% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80
    width no%,150
  no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Contenu:"
  no% = no% + 1 : memo no% : no_Condition_Contenu% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+15 : left no%,10
    width no%,150 : bar_both no%
  no% = no% + 1 : button no% : parent no%,no_AttributsCondition% : top no%,height(no_AttributsCondition%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_Condition

  ' attributs Selection
  no% = no% + 1 : container no% : no_AttributsSelection% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Selection" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,20 : left no%,10
    caption no%,"Position X:"
  no% = no% + 1 : spin no% : no_Selection_X% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Position Y:"
  no% = no% + 1 : spin no% : no_Selection_Y% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Largeur:"
  no% = no% + 1 : spin no% : no_Selection_Largeur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Hauteur:"
  no% = no% + 1 : spin no% : no_Selection_Hauteur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_Selection_Couleur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Titre:"
  no% = no% + 1 : edit no% : no_Selection_Titre% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80
    width no%,150
  no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Contenu:"
  no% = no% + 1 : memo no% : no_Selection_Contenu% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+15 : left no%,10
    width no%,150 : bar_both no%
  no% = no% + 1 : button no% : parent no%,no_AttributsSelection% : top no%,height(no_AttributsSelection%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_Selection


  ' attributs Start
  no% = no% + 1 : container no% : no_AttributsStart% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Start" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,20 : left no%,10
    caption no%,"Position X:"
  no% = no% + 1 : spin no% : no_Start_X% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Position Y:"
  no% = no% + 1 : spin no% : no_Start_Y% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Largeur:"
  no% = no% + 1 : spin no% : no_Start_Largeur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Hauteur:"
  no% = no% + 1 : spin no% : no_Start_Hauteur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_Start_Couleur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : button no% : parent no%,no_AttributsStart% : top no%,height(no_AttributsStart%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_Start

  ' attributs End
  no% = no% + 1 : container no% : no_AttributsEnd% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs End" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,20 : left no%,10
    caption no%,"Position X:"
  no% = no% + 1 : spin no% : no_End_X% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Position Y:"
  no% = no% + 1 : spin no% : no_End_Y% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,4000 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Largeur:"
  no% = no% + 1 : spin no% : no_End_Largeur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Hauteur:"
  no% = no% + 1 : spin no% : no_End_Hauteur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80
    min no%,0 : max no%,500 : position no%,0 : width no%,50
  no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_End_Couleur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : button no% : parent no%,no_AttributsEnd% : top no%,height(no_AttributsEnd%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_End

end_sub

sub Objets()
  no% = no% + 1 : memo no% : no_memo% = no% : hide no% : bar_both no%
  no% = no% + 1 : open_dialog no% : no_open% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj"
  no% = no% + 1 : save_dialog no% : no_save% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj"
end_sub

sub AddConnector()
  FCE% = dll_call4("AddElementToFlowChart",FC%,0,0,0)
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,20,20)
  res% = dll_call1("DrawFlowChart",FC%)
  position no_Connector_X%,0
  position no_Connector_Y%,0
  show no_AttributsConnector%
end_sub

sub AddAction()
  dim_local titre$
  titre$ = "Action"
  FCE% = dll_call4("AddElementToFlowChart",FC%,1,hex("FFFF00"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,200)
  res% = dll_call1("DrawFlowChart",FC%)
  position no_Action_X%,0
  position no_Action_Y%,0
  position no_Action_Largeur%,300
  position no_Action_Hauteur%,200
  text no_action_Couleur%,"FFFF00"
  text no_Action_Titre%,titre$
  clear no_Action_Contenu% 
  show no_AttributsAction%
end_sub

sub AddCondition()
  dim_local titre$
  titre$ = "Condition ?"
  FCE% = dll_call4("AddElementToFlowChart",FC%,2,hex("0000FF"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100)
  clear no_memo%
  item_add no_memo%,"."
  item_add no_memo%,"Oui"
  item_add no_memo%,"Non"
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%))
  res% = dll_call1("DrawFlowChart",FC%)
  position no_Condition_X%,0
  position no_Condition_Y%,0
  position no_Condition_Largeur%,300
  position no_Condition_Hauteur%,100
  text no_Condition_Couleur%,"0000FF"
  text no_Condition_Titre%,titre$
  clear no_Condition_Contenu% 
  item_add no_Condition_Contenu%,"."
  item_add no_Condition_Contenu%,"Oui"
  item_add no_Condition_Contenu%,"Non"
  show no_AttributsCondition%
end_sub

sub AddSelector()
  dim_local titre$
  titre$ = "Sélection"
  FCE% = dll_call4("AddElementToFlowChart",FC%,3,hex("0000FF"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100)
  clear no_memo%
  item_add no_memo%,"1"
  item_add no_memo%,"2"
  item_add no_memo%,"3"
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%))
  res% = dll_call1("DrawFlowChart",FC%)
  position no_Selection_X%,0
  position no_Selection_Y%,0
  position no_Selection_Largeur%,300
  position no_Selection_Hauteur%,100
  text no_Selection_Couleur%,"0000FF"
  text no_Selection_Titre%,titre$
  clear no_Selection_Contenu% 
  item_add no_Selection_Contenu%,"1"
  item_add no_Selection_Contenu%,"2"
  item_add no_Selection_Contenu%,"3"
  show no_AttributsSelection%
end_sub

sub AddStart()
  dim_local titre$
  titre$ = "Début"
  FCE% = dll_call4("AddElementToFlowChart",FC%,4,hex("F0F0F0"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100)
  res% = dll_call1("DrawFlowChart",FC%)
  position no_Start_X%,0
  position no_Start_Y%,0
  position no_Start_Largeur%,100
  position no_Start_Hauteur%,100
  text no_Start_Couleur%,"F0F0F0"
  show no_AttributsStart%
end_sub

sub AddEnd()
  dim_local titre$
  titre$ = "Arrêt"
  FCE% = dll_call4("AddElementToFlowChart",FC%,5,hex("F0F0F0"),adr(titre$))
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100)
  res% = dll_call1("DrawFlowChart",FC%)
  position no_End_X%,0
  position no_End_Y%,0
  position no_End_Largeur%,100
  position no_End_Hauteur%,100
  text no_End_Couleur%,"F0F0F0"
  show no_AttributsEnd%
end_sub

sub selectionner()
  message "Sélectionner un élément en cliquant dessus..."
  DoPoints% = 4
  active no_AnnSel%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
end_sub

sub annulerselection()
  DoPoints% = 0
  inactive no_AnnSel%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
end_sub

sub valider_connector()
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Connector_X%),position(no_Connector_Y%),M1%,M1%)
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsConnector%
end_sub

sub valider_action()
  dim_local titre$
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Action_X%),position(no_Action_Y%),position(no_Action_Largeur%),position(no_Action_Hauteur%))
  titre$ = trim$(text$(no_Action_Titre%))
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Action_Contenu%))
  res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Action_couleur%)))
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsAction%
end_sub

sub valider_Condition()
  dim_local titre$
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Condition_X%),position(no_Condition_Y%),position(no_Condition_Largeur%),position(no_Condition_Hauteur%))
  titre$ = trim$(text$(no_Condition_Titre%))
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Condition_Contenu%))
  res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Condition_couleur%)))
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsCondition%
end_sub

sub valider_Selection()
  dim_local titre$
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Selection_X%),position(no_Selection_Y%),position(no_Selection_Largeur%),position(no_Selection_Hauteur%))
  titre$ = trim$(text$(no_Selection_Titre%))
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Selection_Contenu%))
  res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Selection_couleur%)))
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsSelection%
end_sub

sub valider_Start()
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Start_X%),position(no_Start_Y%),position(no_Start_Largeur%),position(no_Start_Hauteur%))
  res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Start_couleur%)))
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsStart%
end_sub

sub valider_End()
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_End_X%),position(no_End_Y%),position(no_End_Largeur%),position(no_End_Hauteur%))
  res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_End_couleur%)))
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsEnd%
end_sub

sub nouveauprojet()
  FC% = dll_call1("DeleteFlowChart",FC%)
  FC% = dll_call1("CreateFlowChart",handle(0))
  full_space 0
  res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0))
  height no_cElements%,300
  projet$ = ""
end_sub

sub ouvrirprojet()
  dim_local prj$
  prj$ = file_name$(no_save%)
  if prj$="_" then exit_sub
  if lower$(file_extract_extension$(prj$))<>".fcproj"
    message "Extension erronnée (*.FCproj)"
    exit_sub
  end_if
  if file_exists(prj$)=0
    message("Ce fichier n'existe pas."
    exit_sub
  end_if
 
  nouveauprojet()
  res% = dll_call2("LoadFlowChartProject",FC%,adr(prj$))
  if res%<0
    message "Erreur en chargement"
  else
    message "Le projet a été chargé:"+chr$(13)+chr$(10)+prj$
    projet$ = prj$
  end_if 
end_sub

sub enregistrerprojet()
  dim_local prj$
  if projet$=""
    enregistrersousprojet()
    exit_sub
  end_if
  prj$ = projet$
  if file_exists(prj$)=1 then file_delete prj$
  res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$))
  if res%<0
    message "Erreur en sauvegarde"
  else
    message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$
    projet$ = prj$
  end_if
end_sub

sub enregistrersousprojet()
  dim_local prj$
  prj$ = file_name$(no_save%)
  if prj$="_" then exit_sub
  if lower$(file_extract_extension$(prj$))<>".fcproj"
    message "Extension erronnée (*.FCproj)"
    exit_sub
  end_if
  if file_exists(prj$)=1
    if message_confirmation_yes_no("Ce fichier existe déjà. Remplacer ?")<>1 then exit_sub
    file_delete prj$
  end_if
  res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$))
  if res%<0
    message "Erreur en sauvegarde"
  else
    message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$
    projet$ = prj$
  end_if
end_sub

sub lier()
  DoPoints% = 1
  npt% = 0
  Message "Cliquer sur une sortie..."
  active no_AnnLink%
  active no_Tracer%
end_sub

sub annulerlier()
  res% = dll_call2("ShowRulersInFlowChart",FC%,0)
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  res% = dll_call1("DrawFlowChart",FC%)
  inactive no_AnnLink%
  inactive no_Tracer%
end_sub

sub tracer()
  dim_local do1%
  ' rectangulariser le dernier segment
  res% = dll_call3("GetInputConnectorOfFlowChartElement",FCEdest%,adr(xx%),adr(yy%))   
  if npt%=0
    res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xxp%),adr(yyp%))   
  else
    xxp% = xArray%(npt%)
    yyp% = yArray%(npt%)
  end_if

  do1% = 0
  if abs(xxp%-xx%)<=DeltaRectangle%
    xxp% = xx%
    do1% = 1
  else
    if abs(yyp%-yy%)<=DeltaRectangle%
      yyp% = yy%
      do1% = 1
    end_if
  end_if
  if do1%=1
    npt% =  npt% + 1
    xarray%(0) = npt%
    xarray%(npt%) = xxp%
    yarray%(npt%) = yyp%
  end_if
  if yyp%>(yy%-DeltaRectangle%)
    yyp% = yy% - DeltaRectangle%
    npt% =  npt% + 1
    xarray%(0) = npt%
    xarray%(npt%) = xxp%
    yarray%(npt%) = yyp%
  end_if
  if xxp%<>xx%
    xxp% = xx%
    npt% =  npt% + 1
    xarray%(0) = npt%
    xarray%(npt%) = xxp%
    yarray%(npt%) = yyp%
  end_if

  res% = dll_call6("ConnectElementsOfFlowChart",FC%,FCEstart%,output%,FCEdest%,adr(xArray%),adr(yArray%))
  if res%=0 then message "Erreur en créant la connexion"
  res% = dll_call2("ShowRulersInFlowChart",FC%,0)
  res% = dll_call1("DrawFlowChart",FC%)
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  inactive no_AnnLink%
  inactive no_Tracer%
end_sub
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Marc

Marc


Nombre de messages : 2372
Age : 63
Localisation : TOURS (37)
Date d'inscription : 17/03/2014

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyMar 13 Mar 2018 - 21:27

Ok Klaus pour la fonction "topmost" !

J'ai voulu enregistrer un projet en employant "Enregister sous" et j'ai obtenu un message d'erreur :

Un essai de construction d'organigramme par Panoramic 164

Autre petite remarque avant d'entrer et de tester le "vif du sujet" : quand je veux ouvrir un projet existant, j'ai une fenêtre
"Enregistrer sous" qui s'ouvre :

Un essai de construction d'organigramme par Panoramic 165
Revenir en haut Aller en bas
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyMar 13 Mar 2018 - 21:48

Ben oui - l'extension doit impérativement être *.FCproj signifiant FlowChart project.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Marc

Marc


Nombre de messages : 2372
Age : 63
Localisation : TOURS (37)
Date d'inscription : 17/03/2014

Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic EmptyMar 13 Mar 2018 - 22:15

Désolé Klaus, j'ai cru que l'extension se mettait toute seule par défaut... Embarassed

Je n'ai pas pu sélectionner le point de connexion qui s'affiche dès que l'on clique sur l'élément "Début"
J'ai un message "Ce n'est pas un élément valide". Par contre, la sélection des autres points de connexion semble fonctionner.

Spoiler:

Autrement j'ai fait un tracé entre deux éléments : les petits ronds rouges sont bien pratiques pour indiquer et forcer
le cheminement du tracé. Very Happy  

Autre remarque : les couleurs R et B sont inversées. Ainsi la couleur FF0000 donne du bleu et 0000FF donne du rouge.

En tout cas c'est un super projet que tu as entamé.

Bravo et bonne continuation !
Revenir en haut Aller en bas
Contenu sponsorisé





Un essai de construction d'organigramme par Panoramic Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic Empty

Revenir en haut Aller en bas
 
Un essai de construction d'organigramme par Panoramic
Revenir en haut 
Page 1 sur 7Aller à la page : 1, 2, 3, 4, 5, 6, 7  Suivant
 Sujets similaires
-
» Un essai d'éditeur 100% Panoramic
» Compilateur FBPano
» WebBrowser sur une form Panoramic !
» Éditeur de texte : Mini Word
» Petit essai autour de la 3D

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: PANORAMIC :: Vos sources, vos utilitaires à partager-
Sauter vers: