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
» SineCube
Un essai de construction d'organigramme par Panoramic - Page 3 Emptypar Marc Hier à 12:38

» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
Un essai de construction d'organigramme par Panoramic - Page 3 Emptypar Marc Hier à 12:22

» Philharmusique
Un essai de construction d'organigramme par Panoramic - Page 3 Emptypar jjn4 Ven 10 Mai 2024 - 13:58

» PANORAMIC V 1
Un essai de construction d'organigramme par Panoramic - Page 3 Emptypar papydall Jeu 9 Mai 2024 - 3:22

» select intégrés [résolu]
Un essai de construction d'organigramme par Panoramic - Page 3 Emptypar jjn4 Mer 8 Mai 2024 - 17:00

» number_mouse_up
Un essai de construction d'organigramme par Panoramic - Page 3 Emptypar jjn4 Mer 8 Mai 2024 - 11:59

» Aide de PANORAMIC
Un essai de construction d'organigramme par Panoramic - Page 3 Emptypar jjn4 Mer 8 Mai 2024 - 11:16

» trop de fichiers en cours
Un essai de construction d'organigramme par Panoramic - Page 3 Emptypar lepetitmarocain Mer 8 Mai 2024 - 10:43

» Je teste PANORAMIC V 1 beta 1
Un essai de construction d'organigramme par Panoramic - Page 3 Emptypar papydall Mer 8 Mai 2024 - 4:17

» bouton dans autre form que 0
Un essai de construction d'organigramme par Panoramic - Page 3 Emptypar leclode Lun 6 Mai 2024 - 13:59

» KGF_dll - nouvelles versions
Un essai de construction d'organigramme par Panoramic - Page 3 Emptypar Klaus Lun 6 Mai 2024 - 11:41

» Gestion d'un système client-serveur.
Un essai de construction d'organigramme par Panoramic - Page 3 Emptypar Klaus Lun 6 Mai 2024 - 10:23

» @Jack
Un essai de construction d'organigramme par Panoramic - Page 3 Emptypar Jack Mar 30 Avr 2024 - 20:40

» Une calculatrice en une ligne de programme
Un essai de construction d'organigramme par Panoramic - Page 3 Emptypar jean_debord Dim 28 Avr 2024 - 8:47

» Form(résolu)
Un essai de construction d'organigramme par Panoramic - Page 3 Emptypar leclode Sam 27 Avr 2024 - 17:59

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Mai 2024
LunMarMerJeuVenSamDim
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendrierCalendrier
Le Deal du moment :
Funko POP! Jumbo One Piece Kaido Dragon Form : ...
Voir le deal

 

 Un essai de construction d'organigramme par Panoramic

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

Marc


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptyVen 16 Mar 2018 - 21:00

Bonsoir Klaus !

A chaque fois que je rentre du travail, je m’aperçois que tu as avancé à pas de géant !

Citation :
L'affichage de l'objet Selecteur est corrigé
Il subsiste un petit défaut des sorties qui ne suivent pas le Selecteur.
Voici une petite vidéo démonstrative du dysfonctionnement :


Je continue mes tests...

Bonne continuation !


Dernière édition par Marc le Ven 16 Mar 2018 - 21:37, édité 1 fois
Revenir en haut Aller en bas
Marc

Marc


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptyVen 16 Mar 2018 - 21:20

A Klaus :

Petite constatation :

Lorsque l'on a fini de modifier un élément (qui était donc en jaune), on valide avec le bouton VALIDER.
L'objet reprend sa couleur originale. J'ai remarqué que cet objet gardait le "focus" et la souris peut toujours le déplacer bien qu'il ne soit plus en jaune.


Dernière édition par Marc le Ven 16 Mar 2018 - 21:36, édité 1 fois
Revenir en haut Aller en bas
Marc

Marc


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptyVen 16 Mar 2018 - 21:32

@ Klaus:

Mini bug ? (au passage, bonsoir Minibug !)
Cas de figure :
Mise en place d'un élément Début et d'un élément Action.
Je ne peux pas relier la sortie Début à l'entrée Action. J'ai un message : Ce n'est pas un élément valide. Recommencez ou annulez.

Si tu penses qu'une petite vidéo serait plus parlante, pas de problème, ce sera avec plaisir.


EDIT : Pas de bug : C'est de ma faute ! Au lieu de cliquer l'élément de destination, je cliquais le point de connexion de destination !
Revenir en haut Aller en bas
Marc

Marc


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptyVen 16 Mar 2018 - 22:10

@ klaus

Erreur ligne 856 :

Citation :
856    if instr(".bmp,jpg.gif.png",lower$(file_extract_extension$(f$)))=0

Il devrait y avoir un point au lieu d'une virgule entre bmp et jpg.

Conséquence : on ne peut pas enregistrer sous le format jpg.


Je ne sais pas quelle procédure adopter :
- écrire un nouveau post au fur et à mesure de mes tests au risque que tu ne vois pas qu'il y avait un autre post avant,
ou
- éditer mon post tant qu'il n'a pas eu de réponse, au risque que tu ne vois pas qu'il a été édité... ?
Revenir en haut Aller en bas
Marc

Marc


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptyVen 16 Mar 2018 - 22:40

@ Klaus:

Perte de couleur :

Cas de figure :
Je choisis l'élément Début.
Je le sélectionne, je le place, lui donne la taille souhaitée et la couleur verte (00FF00)
Je valide, l'élément Début qui était jaune lors de sa sélection passe bien au vert.
Puis, je sélectionne l'élément Action et là, l'élément Début perd sa belle couleur verte...

Idem pour les autres éléments.
Revenir en haut Aller en bas
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptyVen 16 Mar 2018 - 23:17

J'ai lu l'ensemble de vos posts depuis ma dernière publication, et je vais tout explorer, point par point. Un grand MERCI pour vos essais !
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptyVen 16 Mar 2018 - 23:59

Premier problème réglé: la perte de couleurs lors du passage d'un élément à un autre.
Deuxième problème (mineur) réglé: le filtre sur l'enregistrement du fichier.
Troisième problème réglé: un élément sélectionné puis libéré par le bouton Valider n'est plus déplaçable, conforme à son nouvel état d'élément "non sélectionné'.

La DLL est dans le WeDav, et voici le programme Pano:
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("DrawTemporaryMarkIntoFlowChart",FC%,xxp%,yyp%)
        res% = dll_call5("DrawTemporaryLineIntoFlowChart",FC%,xx%,yy%,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é"
        DoPoints% = 5
        select res%
          case 0
            show no_AttributsConnector%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Connector_X%),handle(no_Connector_Y%),0,0)
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Action_X%),handle(no_Action_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Condition_X%),handle(no_Condition_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Selection_X%),handle(no_Selection_Y%),handle(no_Selection_Largeur%),handle(no_Selection_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Start_X%),handle(no_Start_Y%),handle(no_Start_Largeur%),handle(no_Start_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_End_X%),handle(no_End_Y%),handle(no_End_Largeur%),handle(no_End_Hauteur%))
            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
        res% = dll_call2("SelectElementInFlowChart",FC%,FCE%)
      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
 
supprimerliens:
  supprimerliens()
  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
 
exporter:
  exporter()
  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, supprimerliens, UserEvent, sortir
  label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet
  label lier, annulerlier, tracer, exporter
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_SuppLiens%, 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%, no_export%
  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%, FCD%
  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%,"Exporter..." : on_click no%,exporter
      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_call5("CreateFlowChart",handle(0),0,0,0,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% : no_SuppLiens% = no% : caption no%,"Supprimer lien" : inactive no%
    top no%,top(no%-1)+height(no%-1) : left no%,left(no%-1) : on_click no%,supprimerliens

  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%,110
  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%,180 : 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%,110
  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%,180 : 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%,110
  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%,180 : 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"
  no% = no% + 1 : save_dialog no% : no_export% = no% : filter no%,"Images (BMP,JPG,GIF,PNG)|*.BMP;*.JPG;*.GIF;*.PNG"
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
  annulerselection()
'  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% 
  annulerselection()
'  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"
  annulerselection()
'  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"
  annulerselection()
'  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"
  annulerselection()
'  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"
  annulerselection()
'  show no_AttributsEnd%
end_sub

sub selectionner()
  message "Sélectionner un élément en cliquant dessus..."
  DoPoints% = 4
  active no_AnnSel%
  active no_SuppLiens%
  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%
  inactive no_SuppLiens%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
end_sub

sub supprimerliens()
  res% = dll_call2("RemoveAllLinksFromFlowChartElement",FC%,FCE%)
end_sub

sub valider_connector()
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Connector_X%),position(no_Connector_Y%),M1%,M1%)
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsEnd%
end_sub

sub nouveauprojet()
  FC% = dll_call1("DeleteFlowChart",FC%)
  FC% = dll_call5("CreateFlowChart",handle(0),0,0,0,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

sub exporter()
  dim_local f$
  f$ = file_name$(no_export%)
  if f$="_" then exit_sub
  if instr(".bmp.jpg.gif.png",lower$(file_extract_extension$(f$)))=0
    message "Erreur d'extension"
    exit_sub
  end_if
  if file_exists(f$)=1
    if message_confirmation_yes_no("Cette image existe déjà? Remplacer ?")<>1 then exit_sub
  end_if
  res% = dll_call1("CopyFlowChartToClipboard",FC%)
  res% = dll_call1("SaveAnyImageFile",adr(f$))
  message "L'image est enregistrée dans:"+chr$(13)+chr$(10)+f$
end_sub
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Marc

Marc


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptySam 17 Mar 2018 - 0:13

La nouvelle fonction de redimensionnement avec Shift + click droit fonctionne à merveille.
C'est très pratique et convivial ! cheers

Les règles rouges : génial aussi !
Il y a juste un très petit écart (constant) entre l'intersection des lignes rouges et la pointe de la flèche de la souris, ce qui donne une légère imprécision de quelques pixels.

En tout cas, chapeau !
Bravo et bonne continuation !
Revenir en haut Aller en bas
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptySam 17 Mar 2018 - 0:28

Citation :
Il y a juste un très petit écart (constant) entre l'intersection des lignes rouges et la pointe de la flèche de la souris
C'est vrai, et je n'ai pas trouvé de moyen sûr de l'éviter. Il s'agit de 2 pixels horizontalement et verticalement que j'introduis à dessein, car sinon, le clic tombe sur une des règles (qui sont chacune une fenêtre, en réalité) et ne tombe pas sur le vréi point à cliquer en-dessous.

Je me demande si je ne vais pas transformer ces règles en 2 barres parammèles, avec la pointe de la souris pile entre les deux... je vais faire des essais.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Marc

Marc


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptySam 17 Mar 2018 - 0:50

@ Klaus :

As-tu vu le problème sur ma petite vidéo : celle du post de 21h00 ?
Les connexions qui ne suivent pas le Selecteur.
Revenir en haut Aller en bas
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptySam 17 Mar 2018 - 1:06

Oui, et je suis en train de travailler dessus...

D'ailleurs, si après un tel déplacement "rate", tu sélectionnes cet élément à nouveau et tu le déplaces par le bouton droit de la souris, tout redevient normal...
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptySam 17 Mar 2018 - 2:05

Et voilà - dernier problème réglé: la désolidarisation des connecteurs de sortie de leur parent Selecteur en cas de déplacement par les propriétés de l'objet. Nouvelle version de KGF.dll dans le WebDav, dossier DLLs.

Et voici le code du programme:
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("DrawTemporaryMarkIntoFlowChart",FC%,xxp%,yyp%)
        res% = dll_call5("DrawTemporaryLineIntoFlowChart",FC%,xx%,yy%,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é"
        DoPoints% = 5
        select res%
          case 0
            show no_AttributsConnector%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Connector_X%),handle(no_Connector_Y%),0,0)
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Action_X%),handle(no_Action_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Condition_X%),handle(no_Condition_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Selection_X%),handle(no_Selection_Y%),handle(no_Selection_Largeur%),handle(no_Selection_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Start_X%),handle(no_Start_Y%),handle(no_Start_Largeur%),handle(no_Start_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_End_X%),handle(no_End_Y%),handle(no_End_Largeur%),handle(no_End_Hauteur%))
            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
        res% = dll_call2("SelectElementInFlowChart",FC%,FCE%)
      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
 
supprimerliens:
  supprimerliens()
  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
 
exporter:
  exporter()
  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, supprimerliens, UserEvent, sortir
  label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet
  label lier, annulerlier, tracer, exporter
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_SuppLiens%, 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%, no_export%
  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%, FCD%
  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%,"Exporter..." : on_click no%,exporter
      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_call5("CreateFlowChart",handle(0),0,0,0,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% : no_SuppLiens% = no% : caption no%,"Supprimer lien" : inactive no%
    top no%,top(no%-1)+height(no%-1) : left no%,left(no%-1) : on_click no%,supprimerliens

  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%,110
  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%,180 : 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%,110
  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%,180 : 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%,110
  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%,180 : 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"
  no% = no% + 1 : save_dialog no% : no_export% = no% : filter no%,"Images (BMP,JPG,GIF,PNG)|*.BMP;*.JPG;*.GIF;*.PNG"
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
  annulerselection()
'  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% 
  annulerselection()
'  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%,"Oui"
  item_add no_Condition_Contenu%,"."
  item_add no_Condition_Contenu%,"Non"
  annulerselection()
'  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"
  annulerselection()
'  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"
  annulerselection()
'  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"
  annulerselection()
'  show no_AttributsEnd%
end_sub

sub selectionner()
  message "Sélectionner un élément en cliquant dessus..."
  DoPoints% = 4
  active no_AnnSel%
  active no_SuppLiens%
  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%
  inactive no_SuppLiens%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
end_sub

sub supprimerliens()
  res% = dll_call2("RemoveAllLinksFromFlowChartElement",FC%,FCE%)
end_sub

sub valider_connector()
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Connector_X%),position(no_Connector_Y%),M1%,M1%)
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsEnd%
end_sub

sub nouveauprojet()
  FC% = dll_call1("DeleteFlowChart",FC%)
  FC% = dll_call5("CreateFlowChart",handle(0),0,0,0,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

sub exporter()
  dim_local f$
  f$ = file_name$(no_export%)
  if f$="_" then exit_sub
  if instr(".bmp.jpg.gif.png",lower$(file_extract_extension$(f$)))=0
    message "Erreur d'extension"
    exit_sub
  end_if
  if file_exists(f$)=1
    if message_confirmation_yes_no("Cette image existe déjà? Remplacer ?")<>1 then exit_sub
  end_if
  res% = dll_call1("CopyFlowChartToClipboard",FC%)
  res% = dll_call1("SaveAnyImageFile",adr(f$))
  message "L'image est enregistrée dans:"+chr$(13)+chr$(10)+f$
end_sub
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptySam 17 Mar 2018 - 3:00

J'ai changé la présentation des règles de visée. Maintenant, elles se présentent chacune sous forme de deux traits rouges parallèles, avec le curseur visant entre les deux, en fait dans le carré de croisement des deux paires de lignes de visée. Le petit cercle laissé par un clic est inchangé, et il est maintenant facile de viser ce petit cercle en l'encadrant par les deux traits d'une paire de lignes.

Je vais avoir le choix entre les deux systèmes de visée: deux lignes simples décalées de 2 pixels à droite et vers le bas, ou deux paires de lignes parallèles encadrant le point de visée. Je trouve un intérêt aux deux systèmes. Dites-moi ce que vous en pensez. Est-ce qu'il faut supprimer un système ou l'autre, ou est-ce qu'il faut garder les deux et permettre le choix via une fonction ?

La nouvelle DLL est dans le WebDav, dossier DLL. Le programme Panoramic est inchangé par rapport à mon post précédent. Voici ce à quoi ça ressemble:
Un essai de construction d'organigramme par Panoramic - Page 3 Aa149
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptySam 17 Mar 2018 - 10:09

J'ai rendu la présence et le format des lignes de visée paramétrables, par un noveau paramètre pour CreateFlowChart et CreateScrollImage. Mon WebDav est malheureusement inaccessible pour le moment (je n'en connais pas la cause). J'ai donc déposé le fichier KGF_FlowChart.zip sur un de mes sites Web, et ce fichier est téléchargeable sur le lien suivant:
https://klauspanoramic.000webhostapp.com/KGF_FlowChart.zip

Et voici le programme qui va avec. Dans la SUB Constantes(), il y a une ouvelle variable LignesDeVisee% qui peut prendre les valeurs 0, 1 ou 2 suivant le nombre de lignes de visée souhaitées.
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("DrawTemporaryMarkIntoFlowChart",FC%,xxp%,yyp%)
        res% = dll_call5("DrawTemporaryLineIntoFlowChart",FC%,xx%,yy%,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é"
        DoPoints% = 5
        select res%
          case 0
            show no_AttributsConnector%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Connector_X%),handle(no_Connector_Y%),0,0)
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Action_X%),handle(no_Action_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Condition_X%),handle(no_Condition_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Selection_X%),handle(no_Selection_Y%),handle(no_Selection_Largeur%),handle(no_Selection_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Start_X%),handle(no_Start_Y%),handle(no_Start_Largeur%),handle(no_Start_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_End_X%),handle(no_End_Y%),handle(no_End_Largeur%),handle(no_End_Hauteur%))
            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
        res% = dll_call2("SelectElementInFlowChart",FC%,FCE%)
      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
 
supprimerliens:
  supprimerliens()
  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
 
exporter:
  exporter()
  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, supprimerliens, UserEvent, sortir
  label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet
  label lier, annulerlier, tracer, exporter
end_sub

sub constantes()
  dim KGF$ : KGF$ = "KGF.dll"
  dim M1% : M1% = 0-1
  dim DeltaRectangle% : DeltaRectangle% = 10
  dim LignesDeVisee% : ' nombre de lignes de visée (0, 1 ou 2)
    LignesDeVisee% = 2
  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_SuppLiens%, 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%, no_export%
  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%, FCD%
  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%,"Exporter..." : on_click no%,exporter
      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_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%)
  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% : no_SuppLiens% = no% : caption no%,"Supprimer lien" : inactive no%
    top no%,top(no%-1)+height(no%-1) : left no%,left(no%-1) : on_click no%,supprimerliens

  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%,110
  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%,180 : 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%,110
  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%,180 : 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%,110
  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%,180 : 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"
  no% = no% + 1 : save_dialog no% : no_export% = no% : filter no%,"Images (BMP,JPG,GIF,PNG)|*.BMP;*.JPG;*.GIF;*.PNG"
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
  annulerselection()
'  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% 
  annulerselection()
'  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%,"Oui"
  item_add no_Condition_Contenu%,"."
  item_add no_Condition_Contenu%,"Non"
  annulerselection()
'  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"
  annulerselection()
'  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"
  annulerselection()
'  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"
  annulerselection()
'  show no_AttributsEnd%
end_sub

sub selectionner()
  message "Sélectionner un élément en cliquant dessus..."
  DoPoints% = 4
  active no_AnnSel%
  active no_SuppLiens%
  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%
  inactive no_SuppLiens%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
end_sub

sub supprimerliens()
  res% = dll_call2("RemoveAllLinksFromFlowChartElement",FC%,FCE%)
end_sub

sub valider_connector()
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Connector_X%),position(no_Connector_Y%),M1%,M1%)
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsEnd%
end_sub

sub nouveauprojet()
  FC% = dll_call1("DeleteFlowChart",FC%)
  FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%)
  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

sub exporter()
  dim_local f$
  f$ = file_name$(no_export%)
  if f$="_" then exit_sub
  if instr(".bmp.jpg.gif.png",lower$(file_extract_extension$(f$)))=0
    message "Erreur d'extension"
    exit_sub
  end_if
  if file_exists(f$)=1
    if message_confirmation_yes_no("Cette image existe déjà? Remplacer ?")<>1 then exit_sub
  end_if
  res% = dll_call1("CopyFlowChartToClipboard",FC%)
  res% = dll_call1("SaveAnyImageFile",adr(f$))
  message "L'image est enregistrée dans:"+chr$(13)+chr$(10)+f$
end_sub
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptySam 17 Mar 2018 - 17:50

Nouvelle version: gestion correcte de l'élément "Connector". C'est juste un connecteur libre, non associé à un élément. Il permet de connecter des liens, par opposition au croisement des tracés des liens mais qui ne représentent pas une connexion.

Mon WebDav est malheureusement inaccessible pour le moment (je n'en connais pas la cause). J'ai donc déposé le fichier KGF_FlowChart.zip sur un de mes sites Web, et ce fichier est téléchargeable sur le lien suivant:
https://klauspanoramic.000webhostapp.com/KGF_FlowChart.zip

Voici le programme qui va avec:
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
        NatureOutput% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%))
        if NatureOutput%<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 (npt%=0) and (NatureOutput%<>0)
          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
        end_if
       
        ' mémoriser le point
        npt% = npt% + 1
        xarray%(0) = npt%
        xarray%(npt%) = xxp%
        yarray%(npt%) = yyp%
        res% = dll_call3("DrawTemporaryMarkIntoFlowChart",FC%,xxp%,yyp%)
        res% = dll_call5("DrawTemporaryLineIntoFlowChart",FC%,xx%,yy%,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é"
        DoPoints% = 5
        select res%
          case 0
            show no_AttributsConnector%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Connector_X%),handle(no_Connector_Y%),0,0)
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Action_X%),handle(no_Action_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Condition_X%),handle(no_Condition_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Selection_X%),handle(no_Selection_Y%),handle(no_Selection_Largeur%),handle(no_Selection_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Start_X%),handle(no_Start_Y%),handle(no_Start_Largeur%),handle(no_Start_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_End_X%),handle(no_End_Y%),handle(no_End_Largeur%),handle(no_End_Hauteur%))
            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
        res% = dll_call2("SelectElementInFlowChart",FC%,FCE%)
      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
 
supprimerliens:
  supprimerliens()
  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
 
exporter:
  exporter()
  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, supprimerliens, UserEvent, sortir
  label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet
  label lier, annulerlier, tracer, exporter
end_sub

sub constantes()
  dim KGF$ : KGF$ = "KGF.dll"
  dim M1% : M1% = 0-1
  dim DeltaRectangle% : DeltaRectangle% = 10
  dim LignesDeVisee% : ' nombre de lignes de visée (0, 1 ou 2)
    LignesDeVisee% = 2
  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%
  dim xx%, yy%, NatureOutput%, NatureInput%
  dim npt%, xarray%(100),yarray%(100)
  dim no%, no1%, no2%, no_cElements%, no_AnnSel%, no_SuppLiens%, 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%, no_export%
  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%, FCD%
  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%,"Exporter..." : on_click no%,exporter
      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_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%)
  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% : no_SuppLiens% = no% : caption no%,"Supprimer lien" : inactive no%
    top no%,top(no%-1)+height(no%-1) : left no%,left(no%-1) : on_click no%,supprimerliens

  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%,110
  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%,180 : 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%,110
  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%,180 : 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%,110
  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%,180 : 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"
  no% = no% + 1 : save_dialog no% : no_export% = no% : filter no%,"Images (BMP,JPG,GIF,PNG)|*.BMP;*.JPG;*.GIF;*.PNG"
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
  annulerselection()
'  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% 
  annulerselection()
'  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%,"Oui"
  item_add no_Condition_Contenu%,"."
  item_add no_Condition_Contenu%,"Non"
  annulerselection()
'  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"
  annulerselection()
'  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"
  annulerselection()
'  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"
  annulerselection()
'  show no_AttributsEnd%
end_sub

sub selectionner()
  message "Sélectionner un élément en cliquant dessus..."
  DoPoints% = 4
  active no_AnnSel%
  active no_SuppLiens%
  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%
  inactive no_SuppLiens%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
end_sub

sub supprimerliens()
  res% = dll_call2("RemoveAllLinksFromFlowChartElement",FC%,FCE%)
end_sub

sub valider_connector()
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Connector_X%),position(no_Connector_Y%),M1%,M1%)
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call1("DrawFlowChart",FC%)
  hide no_AttributsEnd%
end_sub

sub nouveauprojet()
  FC% = dll_call1("DeleteFlowChart",FC%)
  FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%)
  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
  NatureInput% = dll_call3("GetInputConnectorOfFlowChartElement",FCEdest%,adr(xx%),adr(yy%))
  if NatureInput%<>0   
    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
  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

sub exporter()
  dim_local f$
  f$ = file_name$(no_export%)
  if f$="_" then exit_sub
  if instr(".bmp.jpg.gif.png",lower$(file_extract_extension$(f$)))=0
    message "Erreur d'extension"
    exit_sub
  end_if
  if file_exists(f$)=1
    if message_confirmation_yes_no("Cette image existe déjà? Remplacer ?")<>1 then exit_sub
  end_if
  res% = dll_call1("CopyFlowChartToClipboard",FC%)
  res% = dll_call1("SaveAnyImageFile",adr(f$))
  message "L'image est enregistrée dans:"+chr$(13)+chr$(10)+f$
end_sub

Et pour montrer le résultat, voici un projet créé et sauvegardé avec ce programme:
Spoiler:

et l'image, exportée également par le programme:
Un essai de construction d'organigramme par Panoramic - Page 3 Aa150
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptySam 17 Mar 2018 - 23:46

Nouvelle version:
Il y a maintenant une fonction permettant de supprimer un lien unique, ciblé par un point quelconque dans le lien !
La nouvelle version de KGF.dll est sur le WebDav, dossier DLLs. Le WebDav fonctionne à nouveau !

Dans l'IDE ci-dessous, il y a maintenant des boutons supplémentaires, dans le panneau de contrôle à gauche:
"Sel. lien" passe en mode "sélection d'un lien". Tous les liens sont redessinés avec une épaisseur de trait de 5 pixels, ce qui permet un pointage plus facile. On clique alors sur un lien quelconque, et le programme affiche le numéro du lien trouvé (0, 1, 2, ...).
On a alors le choix entre deux boutons:
"Annuler" juste à droite de "Sel lien" annule la sélection et redessine tous les liens en épaisseur de 1 pixel
"Supprimer" supprime le lien ciblé et redessine tous les liens restants en épaisseur de 1 pixel

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
        NatureOutput% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%))
        if NatureOutput%<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 (npt%=0) and (NatureOutput%<>0)
          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
        end_if
       
        ' mémoriser le point
        npt% = npt% + 1
        xarray%(0) = npt%
        xarray%(npt%) = xxp%
        yarray%(npt%) = yyp%
        res% = dll_call3("DrawTemporaryMarkIntoFlowChart",FC%,xxp%,yyp%)
        res% = dll_call5("DrawTemporaryLineIntoFlowChart",FC%,xx%,yy%,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é"
        DoPoints% = 5
        select res%
          case 0
            show no_AttributsConnector%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Connector_X%),handle(no_Connector_Y%),0,0)
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Action_X%),handle(no_Action_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Condition_X%),handle(no_Condition_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Selection_X%),handle(no_Selection_Y%),handle(no_Selection_Largeur%),handle(no_Selection_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Start_X%),handle(no_Start_Y%),handle(no_Start_Largeur%),handle(no_Start_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_End_X%),handle(no_End_Y%),handle(no_End_Largeur%),handle(no_End_Hauteur%))
            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
        res% = dll_call2("SelectElementInFlowChart",FC%,FCE%)
      end_if
      if DoPoints%=6
        res% = dll_call4("IdentifyFlowChartLink",FC%,xxp%,yyp%,adr(FCL%))
        if res%<0
          message "Ce n'est pas un lien valide."
          DoPoints% = 0
          res% = dll_call2("DrawFlowChart",FC%,1)
          return
        end_if
        message "Lien "+str$(res%)+" identifié"
       
        DoPoints% = 0
        res% = dll_call2("DrawFlowChart",FC%,1)
      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
 
supprimerliens:
  supprimerliens()
  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
 
exporter:
  exporter()
  return

selectionLien:
  selectionLien()
  return
 
annulerSelLien:
  annulerSelLien()
  return
 
supprimerLien:
  supprimerLien()
  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, supprimerliens, UserEvent, sortir
  label selectionLien, annulerSelLien, supprimerLien
  label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet
  label lier, annulerlier, tracer, exporter
end_sub

sub constantes()
  dim KGF$ : KGF$ = "KGF.dll"
  dim M1% : M1% = 0-1
  dim DeltaRectangle% : DeltaRectangle% = 10
  dim LignesDeVisee% : ' nombre de lignes de visée (0, 1 ou 2)
    LignesDeVisee% = 2
  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%
  dim xx%, yy%, NatureOutput%, NatureInput%
  dim npt%, xarray%(100),yarray%(100)
  dim no%, no1%, no2%, no_cElements%, no_AnnSel%, no_SuppLiens%, 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%, no_export%
  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 no_AnnSelLink%, no_DelLink%
  dim FC%, FCE%, FCEstart%, FCEdest%, FCL%
  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%,"Exporter..." : on_click no%,exporter
      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_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%)
  full_space 0
  res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0))
  height no_cElements%,350
  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% : no_SuppLiens% = no% : caption no%,"Supprimer lien" : inactive no%
    top no%,top(no%-1)+height(no%-1) : left no%,left(no%-1) : on_click no%,supprimerliens

  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
                                                                   
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sel. Lien"
    top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionLien
  no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSelLink% = no% : caption no%,"Annuler" : inactive no%
    top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerSelLien
  no% = no% + 1 : button no% : parent no%,no_cElements% : no_DelLink% = no% : caption no%,"Supprimer lien" : inactive no%
    top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,supprimerLien

    ' 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%,110
  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%,180 : 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%,110
  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%,180 : 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%,110
  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%,180 : 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"
  no% = no% + 1 : save_dialog no% : no_export% = no% : filter no%,"Images (BMP,JPG,GIF,PNG)|*.BMP;*.JPG;*.GIF;*.PNG"
end_sub

sub AddConnector()
  FCE% = dll_call4("AddElementToFlowChart",FC%,0,0,0)
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,20,20)
  res% = dll_call2("DrawFlowChart",FC%,1)
  position no_Connector_X%,0
  position no_Connector_Y%,0
  annulerselection()
'  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_call2("DrawFlowChart",FC%,1)
  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% 
  annulerselection()
'  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_call2("DrawFlowChart",FC%,1)
  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%,"Oui"
  item_add no_Condition_Contenu%,"."
  item_add no_Condition_Contenu%,"Non"
  annulerselection()
'  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_call2("DrawFlowChart",FC%,1)
  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"
  annulerselection()
'  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_call2("DrawFlowChart",FC%,1)
  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"
  annulerselection()
'  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_call2("DrawFlowChart",FC%,1)
  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"
  annulerselection()
'  show no_AttributsEnd%
end_sub

sub selectionner()
  message "Sélectionner un élément en cliquant dessus..."
  DoPoints% = 4
  active no_AnnSel%
  active no_SuppLiens%
  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%
  inactive no_SuppLiens%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
end_sub

sub supprimerliens()
  res% = dll_call2("RemoveAllLinksFromFlowChartElement",FC%,FCE%)
end_sub

sub valider_connector()
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Connector_X%),position(no_Connector_Y%),M1%,M1%)
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  hide no_AttributsEnd%
end_sub

sub nouveauprojet()
  FC% = dll_call1("DeleteFlowChart",FC%)
  FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%)
  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_call2("DrawFlowChart",FC%,1)
  inactive no_AnnLink%
  inactive no_Tracer%
end_sub

sub tracer()
  dim_local do1%
  ' rectangulariser le dernier segment
  NatureInput% = dll_call3("GetInputConnectorOfFlowChartElement",FCEdest%,adr(xx%),adr(yy%))
  if NatureInput%<>0   
    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
  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_call2("DrawFlowChart",FC%,1)
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  inactive no_AnnLink%
  inactive no_Tracer%
end_sub

sub exporter()
  dim_local f$
  f$ = file_name$(no_export%)
  if f$="_" then exit_sub
  if instr(".bmp.jpg.gif.png",lower$(file_extract_extension$(f$)))=0
    message "Erreur d'extension"
    exit_sub
  end_if
  if file_exists(f$)=1
    if message_confirmation_yes_no("Cette image existe déjà? Remplacer ?")<>1 then exit_sub
  end_if
  res% = dll_call1("CopyFlowChartToClipboard",FC%)
  res% = dll_call1("SaveAnyImageFile",adr(f$))
  message "L'image est enregistrée dans:"+chr$(13)+chr$(10)+f$
end_sub

sub selectionLien()
  DoPoints% = 6
  npt% = 0
  Message "Cliquer sur un lien..."
  res% = dll_call2("DrawFlowChart",FC%,5) 
  active no_AnnSelLink%
  active no_DelLink%
end_sub
 
sub annulerSelLien()
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  res% = dll_call2("DrawFlowChart",FC%,1)
  inactive no_AnnSelLink%
  inactive no_DelLink%
end_sub
 
sub supprimerLien()
  res% = dll_call1("DeleteLinkFromFlowChart",FCL%)
end_sub
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Marc

Marc


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptyDim 18 Mar 2018 - 1:24

Bonsoir à tous !

Bonsoir Klaus !

J'ai testé, c'est parfaitement fonctionnel cheers

J'ai pu sélectionner un lien quelconque de mon organigramme et le supprimer pour pouvoir le redessiner. Pas de problème ! cheers

Spoiler:

Pour moi, les doubles lignes de visée me conviennent tout à fait.

Je reste  (têtu ce Marc !) sur mon idée d'avoir une matrice de points. Je dirais même plus, une matrice de points "magnétiques" qui permettrait de se caler sur ces points pour avoir un tracé parfait et un positionnement parfait des éléments.
On ne pourrait donc pas tomber (tracer) entre deux points.
Cette matrice pourrait être invisible. Elle se réaliserait par voie logicielle : les coordonnées seraient "arrondies" au pas le plus proche.
Si le pas est de 20, les coordonnées ne pourront être que 0,20,40,60...280,300,320....
Idem pour les éléments : ils seront conçus au pas de la matrice et ils ne pourront être redimensionnés et repositionnés qu'au pas prédéfini.
Mais ce n'est qu'une idée ! (copiée sur les logiciels de dessins de circuits imprimés pour l'électronique)

Bonne continuation dans ce vaste projet.

EDIT :
J'oubliais de te dire :
- le connecteur fonctionne bien, aussi bien en entrée qu'en sortie.
- Quand on le sélectionne, il ne passe pas en jaune.


Dernière édition par Marc le Dim 18 Mar 2018 - 1:41, édité 2 fois
Revenir en haut Aller en bas
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptyDim 18 Mar 2018 - 1:32

Merci d'avoir testé,, Marc.

Citation :
Cette matrice pourrait être invisible. Elle se réaliserait par voie logicielle
C'est une très bonne idée. Je vais creuser cela, en rendant le pas paramétrable, bien sûr.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Marc

Marc


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptyDim 18 Mar 2018 - 1:37

Mince, on s'est croisé ! Je viens de mettre un EDIT à mon précédant message.
Revenir en haut Aller en bas
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptyDim 18 Mar 2018 - 10:16

Nouvelle version:
Un objet Connector devient jaune maintenant lorsqu'il est sélectionné.
Un lien sélectionné devient jaune également.

Le nouvelle version de KGF.dll est dans le WebDav, dossier DLLs.

Voici le code du programme qui va avec cette version:
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
        NatureOutput% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%))
        if NatureOutput%<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 (npt%=0) and (NatureOutput%<>0)
          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
        end_if
        
        ' mémoriser le point
        npt% = npt% + 1
        xarray%(0) = npt%
        xarray%(npt%) = xxp%
        yarray%(npt%) = yyp%
        res% = dll_call3("DrawTemporaryMarkIntoFlowChart",FC%,xxp%,yyp%)
        res% = dll_call5("DrawTemporaryLineIntoFlowChart",FC%,xx%,yy%,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é"
        DoPoints% = 5
        select res%
          case 0
            show no_AttributsConnector%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Connector_X%),handle(no_Connector_Y%),0,0)
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Action_X%),handle(no_Action_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Condition_X%),handle(no_Condition_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Selection_X%),handle(no_Selection_Y%),handle(no_Selection_Largeur%),handle(no_Selection_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Start_X%),handle(no_Start_Y%),handle(no_Start_Largeur%),handle(no_Start_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_End_X%),handle(no_End_Y%),handle(no_End_Largeur%),handle(no_End_Hauteur%))
            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
        res% = dll_call2("SelectElementInFlowChart",FC%,FCE%)
      end_if
      if DoPoints%=6
        res% = dll_call4("IdentifyFlowChartLink",FC%,xxp%,yyp%,adr(FCL%))
        if res%<0
          message "Ce n'est pas un lien valide."
          DoPoints% = 0
          res% = dll_call2("DrawFlowChart",FC%,1)
          return
        end_if
        message "Lien "+str$(res%)+" identifié"
        
        res% = dll_call2("SelectLinkInFlowChart",FC%,FCL%)
        DoPoints% = 0
        res% = dll_call2("DrawFlowChart",FC%,5)
      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
  
supprimerliens:
  supprimerliens()
  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
  
exporter:
  exporter()
  return

selectionLien:
  selectionLien()
  return
  
annulerSelLien:
  annulerSelLien()
  return
  
supprimerLien:
  supprimerLien()
  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, supprimerliens, UserEvent, sortir
  label selectionLien, annulerSelLien, supprimerLien
  label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet
  label lier, annulerlier, tracer, exporter
end_sub

sub constantes()
  dim KGF$ : KGF$ = "KGF.dll"
  dim M1% : M1% = 0-1
  dim DeltaRectangle% : DeltaRectangle% = 10
  dim LignesDeVisee% : ' nombre de lignes de visée (0, 1 ou 2)
    LignesDeVisee% = 2
  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%
  dim xx%, yy%, NatureOutput%, NatureInput%
  dim npt%, xarray%(100),yarray%(100)
  dim no%, no1%, no2%, no_cElements%, no_AnnSel%, no_SuppLiens%, 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%, no_export%
  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 no_AnnSelLink%, no_DelLink%
  dim FC%, FCE%, FCEstart%, FCEdest%, FCL%
  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%,"Exporter..." : on_click no%,exporter
      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_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%)
  full_space 0
  res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0))
  height no_cElements%,350
  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% : no_SuppLiens% = no% : caption no%,"Supprimer lien" : inactive no%
    top no%,top(no%-1)+height(no%-1) : left no%,left(no%-1) : on_click no%,supprimerliens

  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
                                                                    
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sel. Lien"
    top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionLien
  no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSelLink% = no% : caption no%,"Annuler" : inactive no%
    top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerSelLien
  no% = no% + 1 : button no% : parent no%,no_cElements% : no_DelLink% = no% : caption no%,"Supprimer lien" : inactive no%
    top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,supprimerLien

    ' 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%,110
  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%,180 : 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%,110
  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%,180 : 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%,110
  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%,180 : 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"
  no% = no% + 1 : save_dialog no% : no_export% = no% : filter no%,"Images (BMP,JPG,GIF,PNG)|*.BMP;*.JPG;*.GIF;*.PNG"
end_sub

sub AddConnector()
  FCE% = dll_call4("AddElementToFlowChart",FC%,0,0,0)
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,20,20)
  res% = dll_call2("DrawFlowChart",FC%,1)
  position no_Connector_X%,0
  position no_Connector_Y%,0
  annulerselection()
'  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_call2("DrawFlowChart",FC%,1)
  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%  
  annulerselection()
'  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_call2("DrawFlowChart",FC%,1)
  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%,"Oui"
  item_add no_Condition_Contenu%,"."
  item_add no_Condition_Contenu%,"Non"
  annulerselection()
'  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_call2("DrawFlowChart",FC%,1)
  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"
  annulerselection()
'  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_call2("DrawFlowChart",FC%,1)
  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"
  annulerselection()
'  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_call2("DrawFlowChart",FC%,1)
  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"
  annulerselection()
'  show no_AttributsEnd%
end_sub

sub selectionner()
  message "Sélectionner un élément en cliquant dessus..."
  DoPoints% = 4
  active no_AnnSel%
  active no_SuppLiens%
  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%
  inactive no_SuppLiens%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
end_sub

sub supprimerliens()
  res% = dll_call2("RemoveAllLinksFromFlowChartElement",FC%,FCE%)
end_sub

sub valider_connector()
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Connector_X%),position(no_Connector_Y%),M1%,M1%)
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  hide no_AttributsEnd%
end_sub

sub nouveauprojet()
  FC% = dll_call1("DeleteFlowChart",FC%)
  FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%)
  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_call2("DrawFlowChart",FC%,1)
  inactive no_AnnLink%
  inactive no_Tracer%
end_sub

sub tracer()
  dim_local do1%
  ' rectangulariser le dernier segment
  NatureInput% = dll_call3("GetInputConnectorOfFlowChartElement",FCEdest%,adr(xx%),adr(yy%))
  if NatureInput%<>0    
    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
  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_call2("DrawFlowChart",FC%,1)
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  inactive no_AnnLink%
  inactive no_Tracer%
end_sub

sub exporter()
  dim_local f$
  f$ = file_name$(no_export%)
  if f$="_" then exit_sub
  if instr(".bmp.jpg.gif.png",lower$(file_extract_extension$(f$)))=0
    message "Erreur d'extension"
    exit_sub
  end_if
  if file_exists(f$)=1
    if message_confirmation_yes_no("Cette image existe déjà? Remplacer ?")<>1 then exit_sub
  end_if
  res% = dll_call1("CopyFlowChartToClipboard",FC%)
  res% = dll_call1("SaveAnyImageFile",adr(f$))
  message "L'image est enregistrée dans:"+chr$(13)+chr$(10)+f$
end_sub

sub selectionLien()
  DoPoints% = 6
  npt% = 0
  Message "Cliquer sur un lien..."
  res% = dll_call2("DrawFlowChart",FC%,5)  
  active no_AnnSelLink%
  active no_DelLink%
end_sub
  
sub annulerSelLien()
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  res% = dll_call2("SelectLinkInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  inactive no_AnnSelLink%
  inactive no_DelLink%
end_sub
  
sub supprimerLien()
  res% = dll_call1("DeleteLinkFromFlowChart",FCL%)
end_sub
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Marc

Marc


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptyDim 18 Mar 2018 - 11:01

cheers No comment Smile

Spoiler:

Bon dimanche à tous !
Revenir en haut Aller en bas
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 - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptyDim 18 Mar 2018 - 11:07

Bonjour Klaus !

Je viens de tester ta dernière version.

J'ai quelques difficultés lors de la création d'un lien à sélectionné le connecteur de destination.
Quand je parle de connecteur, il s'agit bien du cercle avec le numéro à l'intérieur.
Chez moi le connecteur sélectionné ne change pas de couleur et ne passe pas en jaune. Est ce normal ?

Sinon j'ai créé un petit organigramme sans grosses difficulté.
Maintenant comme dit Marc avec une grille magnétique, tout n’alignerai et se serai top !

Continu comme çà Klaus, bravo ! cheers
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptyDim 18 Mar 2018 - 11:21

Citation :
J'ai quelques difficultés lors de la création d'un lien à sélectionné le connecteur de destination.
Lis bien le message qui introduit cette phase. On ne sélectionne pas le connecteur de destination, mais l'élément de destination ! Tu cliques simplement dans l'élément de destination et il trouvera le connecteur d'entrée tout seul, vu qu'il n'y a qu'un seul connecteur d'entrée.
Et oui, les éléments de début et fin du lien à tracer ne changent pas d'aspect.

Je suis en rain de réfléchir sur la grille magnétique. Mais ce n'est pas évident. S'il est facile de positionner les éléments selon une grille magnétique, ce l'est beaucoup moins pour le positionnement des connecteurs de ces éléments. Chaque position de connecteur est variable et dépend des dimensions de l'élément et, dans le cas du sélecteur, du nombre de sorties à créer. Essaie, avec une grille magnétique, de positionner 3 ou 5 sorties sur un sélecteur, tout en respectant l'alignement de chaque sélecteur sur la grille magnétique ! Et ceci est indispensable car les lignes des liens devraient également être alignées sur la grille magnétique. Pour le moment, je n'ai pas trouvé de solutiion géniale à ce problème.


Dernière édition par Klaus le Dim 18 Mar 2018 - 11:22, édité 1 fois
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 - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptyDim 18 Mar 2018 - 11:21

Klaus, Il y a un autre petit soucis.

Sur l'image ci-dessous, j'ai créé un lien avec 2 points. Normalement lors du déplacement il ne devrait pas y avoir de soucis.
Mais regarde comment le lien à réagit. Il y a un autre point qui fait tout 'dérailler' !

je te mets l'image en dessous pour mien comprendre.

Un essai de construction d'organigramme par Panoramic - Page 3 Sans_t35


EDIT : On s'est croisée Klaus ! Laughing

Ok pour l'explication. Je regarde cela.

Concernant la grille magnétique, du coup, il faut que chacun des connecteurs soient aussi alignés sur cette grille.
C'est vrai que là c'est chaud parce qu'il faut aussi que tout les éléments soient aussi d'alignés en tailles et positions...
En fait il faut que chaque élément, position, taille etc... soit calculés en multiple du pas de la grille.
Ça nécessite de créer une SUB qui te permettra de calculer chaque position avec exactitude.

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

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 3 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 3 EmptyDim 18 Mar 2018 - 11:41

Je n'ai pas réussi à reproduire la situation que tu indiques. Mais je constate que la "rectangilarisation" du tracé montre des défauts. J'ai identifié le problème qui vient du code Panoramic, pas de la DLL. Donc, voici le programme Panoramic avec les tracés améliorés:
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
        NatureOutput% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%))
        if NatureOutput%<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 (npt%=0) and (NatureOutput%<>0)
          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
        end_if
        if npt%>0
          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
        end_if
       
        ' mémoriser le point
        npt% = npt% + 1
        xarray%(0) = npt%
        xarray%(npt%) = xxp%
        yarray%(npt%) = yyp%
        res% = dll_call3("DrawTemporaryMarkIntoFlowChart",FC%,xxp%,yyp%)
        res% = dll_call5("DrawTemporaryLineIntoFlowChart",FC%,xx%,yy%,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é"
        DoPoints% = 5
        select res%
          case 0
            show no_AttributsConnector%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Connector_X%),handle(no_Connector_Y%),0,0)
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Action_X%),handle(no_Action_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Condition_X%),handle(no_Condition_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Selection_X%),handle(no_Selection_Y%),handle(no_Selection_Largeur%),handle(no_Selection_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Start_X%),handle(no_Start_Y%),handle(no_Start_Largeur%),handle(no_Start_Hauteur%))
            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%
            res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_End_X%),handle(no_End_Y%),handle(no_End_Largeur%),handle(no_End_Hauteur%))
            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
        res% = dll_call2("SelectElementInFlowChart",FC%,FCE%)
      end_if
      if DoPoints%=6
        res% = dll_call4("IdentifyFlowChartLink",FC%,xxp%,yyp%,adr(FCL%))
        if res%<0
          message "Ce n'est pas un lien valide."
          DoPoints% = 0
          res% = dll_call2("DrawFlowChart",FC%,1)
          return
        end_if
        message "Lien "+str$(res%)+" identifié"
       
        res% = dll_call2("SelectLinkInFlowChart",FC%,FCL%)
        DoPoints% = 0
        res% = dll_call2("DrawFlowChart",FC%,5)
      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
 
supprimerliens:
  supprimerliens()
  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
 
exporter:
  exporter()
  return

selectionLien:
  selectionLien()
  return
 
annulerSelLien:
  annulerSelLien()
  return
 
supprimerLien:
  supprimerLien()
  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, supprimerliens, UserEvent, sortir
  label selectionLien, annulerSelLien, supprimerLien
  label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet
  label lier, annulerlier, tracer, exporter
end_sub

sub constantes()
  dim KGF$ : KGF$ = "KGF.dll"
  dim M1% : M1% = 0-1
  dim DeltaRectangle% : DeltaRectangle% = 10
  dim LignesDeVisee% : ' nombre de lignes de visée (0, 1 ou 2)
    LignesDeVisee% = 2
  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%
  dim xx%, yy%, NatureOutput%, NatureInput%
  dim npt%, xarray%(100),yarray%(100)
  dim no%, no1%, no2%, no_cElements%, no_AnnSel%, no_SuppLiens%, 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%, no_export%
  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 no_AnnSelLink%, no_DelLink%
  dim FC%, FCE%, FCEstart%, FCEdest%, FCL%
  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%,"Exporter..." : on_click no%,exporter
      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_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%)
  full_space 0
  res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0))
  height no_cElements%,350
  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% : no_SuppLiens% = no% : caption no%,"Supprimer lien" : inactive no%
    top no%,top(no%-1)+height(no%-1) : left no%,left(no%-1) : on_click no%,supprimerliens

  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
                                                                   
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sel. Lien"
    top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionLien
  no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSelLink% = no% : caption no%,"Annuler" : inactive no%
    top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerSelLien
  no% = no% + 1 : button no% : parent no%,no_cElements% : no_DelLink% = no% : caption no%,"Supprimer lien" : inactive no%
    top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,supprimerLien

    ' 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%,110
  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%,180 : 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%,110
  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%,180 : 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%,110
  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%,180 : 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"
  no% = no% + 1 : save_dialog no% : no_export% = no% : filter no%,"Images (BMP,JPG,GIF,PNG)|*.BMP;*.JPG;*.GIF;*.PNG"
end_sub

sub AddConnector()
  FCE% = dll_call4("AddElementToFlowChart",FC%,0,0,0)
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,20,20)
  res% = dll_call2("DrawFlowChart",FC%,1)
  position no_Connector_X%,0
  position no_Connector_Y%,0
  annulerselection()
'  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_call2("DrawFlowChart",FC%,1)
  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% 
  annulerselection()
'  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_call2("DrawFlowChart",FC%,1)
  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%,"Oui"
  item_add no_Condition_Contenu%,"."
  item_add no_Condition_Contenu%,"Non"
  annulerselection()
'  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_call2("DrawFlowChart",FC%,1)
  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"
  annulerselection()
'  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_call2("DrawFlowChart",FC%,1)
  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"
  annulerselection()
'  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_call2("DrawFlowChart",FC%,1)
  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"
  annulerselection()
'  show no_AttributsEnd%
end_sub

sub selectionner()
  message "Sélectionner un élément en cliquant dessus..."
  DoPoints% = 4
  active no_AnnSel%
  active no_SuppLiens%
  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%
  inactive no_SuppLiens%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
end_sub

sub supprimerliens()
  res% = dll_call2("RemoveAllLinksFromFlowChartElement",FC%,FCE%)
end_sub

sub valider_connector()
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Connector_X%),position(no_Connector_Y%),M1%,M1%)
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  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_call2("SelectElementInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  hide no_AttributsEnd%
end_sub

sub nouveauprojet()
  FC% = dll_call1("DeleteFlowChart",FC%)
  FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%)
  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_call2("DrawFlowChart",FC%,1)
  inactive no_AnnLink%
  inactive no_Tracer%
end_sub

sub tracer()
  dim_local do1%
  ' rectangulariser le dernier segment
  NatureInput% = dll_call3("GetInputConnectorOfFlowChartElement",FCEdest%,adr(xx%),adr(yy%))
  if NatureInput%<>0   
    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
  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_call2("DrawFlowChart",FC%,1)
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  inactive no_AnnLink%
  inactive no_Tracer%
end_sub

sub exporter()
  dim_local f$
  f$ = file_name$(no_export%)
  if f$="_" then exit_sub
  if instr(".bmp.jpg.gif.png",lower$(file_extract_extension$(f$)))=0
    message "Erreur d'extension"
    exit_sub
  end_if
  if file_exists(f$)=1
    if message_confirmation_yes_no("Cette image existe déjà? Remplacer ?")<>1 then exit_sub
  end_if
  res% = dll_call1("CopyFlowChartToClipboard",FC%)
  res% = dll_call1("SaveAnyImageFile",adr(f$))
  message "L'image est enregistrée dans:"+chr$(13)+chr$(10)+f$
end_sub

sub selectionLien()
  DoPoints% = 6
  npt% = 0
  Message "Cliquer sur un lien..."
  res% = dll_call2("DrawFlowChart",FC%,5) 
  active no_AnnSelLink%
  active no_DelLink%
end_sub
 
sub annulerSelLien()
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  res% = dll_call2("SelectLinkInFlowChart",FC%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  inactive no_AnnSelLink%
  inactive no_DelLink%
end_sub
 
sub supprimerLien()
  res% = dll_call1("DeleteLinkFromFlowChart",FCL%)
end_sub

Maintenant, le tracé ne montrera plus l'effet "escalier" sur certaines lignes. Et si, après établissement d'un lien, tu sélectionnes l'objet de destination et tu le déplaces par la souris, seul le dernier segment du lien est redessiné - le reste du lien reste fixe.

Il est vrai que cela peut conduire à des tracés inutilement compliqué:
Un essai de construction d'organigramme par Panoramic - Page 3 Aa151
Seule solution: supprimer le lien en cause et le recréer. Heureusement, cela se fait maintenant sans difficultés.

Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Contenu sponsorisé





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

Revenir en haut Aller en bas
 
Un essai de construction d'organigramme par Panoramic
Revenir en haut 
Page 3 sur 7Aller à la page : Précédent  1, 2, 3, 4, 5, 6, 7  Suivant
 Sujets similaires
-
» Un essai d'éditeur 100% Panoramic
» Compilateur FBPano
» Essai d'envoi d'un fichier .rar
» Partage sur MyDrive
» 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: