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 5 Emptypar Marc Aujourd'hui à 12:38

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

» Philharmusique
Un essai de construction d'organigramme par Panoramic - Page 5 Emptypar jjn4 Hier à 13:58

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

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

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

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

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

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

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

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

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

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

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

» Form(résolu)
Un essai de construction d'organigramme par Panoramic - Page 5 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
-40%
Le deal à ne pas rater :
-40% sur le Pack Gaming Mario PDP Manette filaire + Casque filaire ...
29.99 € 49.99 €
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
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyLun 19 Mar 2018 - 18:57

Nouvelle version:
Dans tous les panels de propriétés où l'on peut choisir la couleur (Start, Action, Condition, Selector, End, Link), il y a maintenant un bouton coloré juste à côté du champ qui montre le code hexa de la couleur. Ce bouton prend automatiquement la couleur de l'objet choise (celle indiquée dans le champ à côté, donc la couleur normale de l'objet, pas la couleur de sélection ! ).

Un clic sur de bouton coloré ouvre le sélecteur de couleurs Windows, avec toutes ses fonctionnalités. Ainsi, le choix des couleurs est nettement facilité.

La nouvelle DLL est dans le WebDav, dossier DLLs. Et voici le 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
    pos% =  user_event_lparam              : ' positon: yyyyxxxx
    xxp% = bin_and(pos%,hex("0000FFFF"))
    yyp% = pos%/65536
   
    if DoPoints%=5
      res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEnew%))
      if res%<0 then return
      if FCEnew%=FCE%
        annulerselection()
        return
      else
        DoPoints% = 0 
        annulerSelLien()
      end_if
    end_if
    if DoPoints%=0
      res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%))
      if res%<0 then return
      annulerSelLien()
      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_if
   
    if DoPoints%>0
      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
        res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,output%)
        DoPoints% = 2
        show no_info%
        clear no_infotext%
        text no_infotext%,"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
        res% = dll_call2("SelectElementInFlowChart",FC%,FCEdest%)
        show no_info%
        clear no_infotext%
        text no_infotext%,"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é"
        hide no_info%
        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%
            DecoderRGB(no_Action_Couleur%,no_ActionColor%,ccc%)
'            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%
            DecoderRGB(no_Condition_Couleur%,no_ConditionColor%,ccc%)
'            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)
            DecoderRGB(no_Selection_Couleur%,no_SelectionColor%,ccc%)
'            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%
            DecoderRGB(no_Start_Couleur%,no_StartColor%,ccc%)
'            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%
            DecoderRGB(no_End_Couleur%,no_EndColor%,ccc%)
'            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."
          res% = dll_call2("DrawFlowChart",FC%,1)
          return
        end_if
'        message "Lien "+str$(res%)+" identifié"
       
        res% = dll_call3("SelectLinkInFlowChart",FC%,FCL%,adr(ccc%))
        DecoderRGB(no_Link_Couleur%,no_LinkColor%,ccc%)
        res% = dll_call2("DrawFlowChart",FC%,5)
        show no_AttributsLink%
'        text no_Link_Couleur%,right$(hex$(ccc%),6)
      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
 
valider_Link:
  valider_Link()
  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
 
SelCouleurAction:
  SelCouleurAction()
  return
 
SelCouleurCondition:
  SelCouleurCondition()
  return
 
SelCouleurSelection:
  SelCouleurSelection()
  return
 
SelCouleurStart:
  SelCouleurStart()
  return
 
SelCouleurEnd:
  SelCouleurEnd()
  return
 
SelCouleurLink:
  SelCouleurLink()
  return 
 
sub labels()
  label AddConnector, AddAction, AddCondition, AddSelector, AddStart, AddEnd
  label valider_connector, valider_action, valider_Condition, valider_Selection
  label valider_Start, valider_End, valider_Link
  label selectionner, annulerselection, supprimerliens, UserEvent, sortir
  label selectionLien, annulerSelLien, supprimerLien
  label SelCouleurAction, SelCouleurCondition, SelCouleurSelection
  label SelCouleurStart, SelCouleurEnd, SelCouleurLink
  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%, no_AttributsLink%
  dim no_Connector_X%, no_Connector_Y%, no_AnnLink%, no_Tracer% , no_Info%, no_infotext%
  dim no_Action_X%, no_Action_Y%, no_Action_Titre%, no_action_Couleur%, no_ActionColor%
  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%, no_ConditionColor%
  dim no_Selection_X%, no_Selection_Y%, no_Selection_Titre%, no_selection_Couleur%, no_SelectionColor%
  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%, no_startcolor%
  dim no_End_X%, no_End_Y%, no_End_Largeur%, no_End_Hauteur%, no_end_Couleur%, no_EndColor%
  dim no_Link_Couleur%, no_LinkColor%
  dim no_AnnSelLink%, no_DelLink%
  dim FC%, FCE%, FCEstart%, FCEdest%, FCL%, FCEnew%
  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()
  dim_local hnd%
  dll_on KGF$
  no% = no% + 1 : form no% : hide no% : no_info% = no% : width no%,400 : height no%,200
  no% = no% + 1 : memo no% : no_infotext% = no% : parent no%,no_info% : full_space no% : bar_both no% : font_size no%,12
 
  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)
  top no_info%,0 : left no_info%,width_client(0)-width(no_info%)-width(no_cElements%)
 
  hnd% = dll_call1("GetHandleOfFlowChart",FC%)
  res% = dll_call3("SetFormParent",handle(no_info%),hnd%,0)
 
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Début"
    top no%,15 : left no%,10 : on_click no%,AddStart
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Connecteur"
    top no%,top(no%-1)+height(no%-1) : 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%,"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 : panel no%  : no_ActionColor% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurAction
  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 : panel no%  : no_ConditionColor% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurCondition
  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 : panel no%  : no_SelectionColor% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurSelection
  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 : panel no%  : no_StartColor% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurStart
  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 : panel no%  : no_EndColor% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurEnd
  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

' Attributs Link
  no% = no% + 1 : container no% : no_AttributsLink% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Lien" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsLink% : top no%,20 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_Link_Couleur% = no% : parent no%,no_AttributsLink% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : panel no%  : no_LinkColor% = no% : parent no%,no_AttributsLink% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurLink
  no% = no% + 1 : button no% : parent no%,no_AttributsLink% : top no%,height(no_AttributsLink%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_Link

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()
  show no_info%
  clear no_infotext%
  text no_infotext%,"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%
  hide no_AttributsLink%
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%
  hide no_AttributsLink%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
  hide no_info%
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 valider_Link()
  res% = dll_call3("ColorForLinkOfFlowChart",FC%,FCL%,hex(text$(no_Link_couleur%)))
  res% = dll_call3("SelectLinkInFlowChart",FC%,0,adr(ccc%))
  res% = dll_call2("DrawFlowChart",FC%,5)
  hide no_AttributsLink%
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()
  annulerSelLien()
  AnnulerSelection()
  DoPoints% = 1
  npt% = 0
  show no_info%
  clear no_infotext%
  text no_infotext%,"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("SelectElementInFlowChart",FC%,0)
  res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  inactive no_AnnLink%
  inactive no_Tracer%
  hide no_info%
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("SelectElementInFlowChart",FC%,0)
  res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0)
'  res% = dll_call2("DrawFlowChart",FC%,1)
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  inactive no_AnnLink%
  inactive no_Tracer%
  hide no_info%
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()
  AnnulerSelection()
  DoPoints% = 6
  npt% = 0
  show no_info%
  clear no_infotext%
  text no_infotext%,"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_call3("SelectLinkInFlowChart",FC%,0,adr(ccc%))
  res% = dll_call2("DrawFlowChart",FC%,1)
  inactive no_AnnSelLink%
  inactive no_DelLink%
  hide no_info%
  hide no_info%
end_sub
 
sub supprimerLien()
  res% = dll_call1("DeleteLinkFromFlowChart",FCL%)
  hide no_info%
end_sub

sub SelCouleurAction()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Action_Couleur%,no_ActionColor%,ccc%)
end_sub

sub SelCouleurCondition()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Condition_Couleur%,no_ConditionColor%,ccc%)
end_sub

sub SelCouleurSelection()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Selection_Couleur%,no_SelectionColor%,ccc%)
end_sub

sub SelCouleurStart()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Start_Couleur%,no_StartColor%,ccc%)
end_sub

sub SelCouleurEnd()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_End_Couleur%,no_EndColor%,ccc%)
end_sub

sub SelCouleurLink()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Link_Couleur%,no_LinkColor%,ccc%)
end_sub

sub DecoderRGB(no_Text%,no_Picture%,RGB%)
  dim_local R%, G%, B%, n%
  text no_text%,hex$(RGB%)
  R% = bin_and(RGB%,hex("FF"))
  G% = bin_and(RGB%/256,hex("FF"))
  B% = bin_and(RGB%,hex("FF0000"))/65536
  color no_Picture%,R%,G%,B%
end_sub
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Minibug

Minibug


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyLun 19 Mar 2018 - 19:58

Bonsoir Klaus !

Dis moi au lieu de rentrer les codes des couleurs, il me semble que tu avais créé l'interface couleur dans KGF
qui était l'interface de Windows. Est ce que tu vois de quoi je parle ? Est ce que çà serait pas mieux ?!
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyLun 19 Mar 2018 - 20:53

As-tu lu mon post juste au-dessus ?
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 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyLun 19 Mar 2018 - 21:06

Ben non pourquoi ?

lol! lol! lol! lol! lol!

Tu vois, on a les mêmes idées... Wink

Au fait je viens de tester, c'est vraiment plus simple et plus pro.
Par contre, je pense qu'il y a une amélioration a apporter. Je t'explique...

1/ tu sélectionnes un objet
2/ tu change sa couleur avec le selecteur
3/ tu désélectionnes l'objet
Et bien il reprends sa couleur de départ... C'est magique non ?! Suspect drunken geek
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyLun 19 Mar 2018 - 21:16

Normal - tu n'as pas validé les propriétés... et tu peux même modifier les couleurs des liens, avec ça !
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 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyLun 19 Mar 2018 - 21:29

Citation :
Normal - tu n'as pas validé les propriétés...
Ben oui je sais, mais j'ai trouvé ça bizarre... mais bon ton principe se défends.
Disons que j'ai rien dis alors... Laughing

Citation :
et tu peux même modifier les couleurs des liens, avec ça !
Oui j'ai vu.

Encore une bizarrerie,
Après avoir changer les couleurs d"un objet SELECTION j'ai eu les connecteurs qui sont apparus en jaunes.
Je sais que tu as parlé de quelque chose à ce sujet mais j'ai pas trop compris...
C'est quand même bizarre !
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyLun 19 Mar 2018 - 21:35

Citation :
Après avoir changer les couleurs d"un objet SELECTION j'ai eu les connecteurs qui sont apparus en jaunes
Oui, c'est une anomalie et il faut que je la corrige.
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 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyLun 19 Mar 2018 - 21:44

Citation :
Oui, c'est une anomalie et il faut que je la corrige.

Ok Klaus. Au fait as tu étudié le principe du plan avec les points magnétiques ?
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyLun 19 Mar 2018 - 21:48

Bon, c'est corrigé. Recharge la DLL du WebDav - le programme est inchangé.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyMar 20 Mar 2018 - 0:53

Et une nouvelle version:
Il y a maintenant un bouton "Supprimer tous les liens" (qui fait ce qu'il dit). La nouvelle version de la DLL est dans le WebDav, dossier DLLs. Et voici le 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
    pos% =  user_event_lparam              : ' positon: yyyyxxxx
    xxp% = bin_and(pos%,hex("0000FFFF"))
    yyp% = pos%/65536
   
    if DoPoints%=5
      res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEnew%))
      if res%<0 then return
      if FCEnew%=FCE%
        annulerselection()
        return
      else
        DoPoints% = 0 
        annulerSelLien()
      end_if
    end_if
    if DoPoints%=0
      res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%))
      if res%<0 then return
      annulerSelLien()
      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_if
   
    if DoPoints%>0
      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
        res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,output%)
        DoPoints% = 2
        show no_info%
        clear no_infotext%
        text no_infotext%,"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
        res% = dll_call2("SelectElementInFlowChart",FC%,FCEdest%)
        show no_info%
        clear no_infotext%
        text no_infotext%,"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é"
        hide no_info%
        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%
            DecoderRGB(no_Action_Couleur%,no_ActionColor%,ccc%)
'            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%
            DecoderRGB(no_Condition_Couleur%,no_ConditionColor%,ccc%)
'            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)
            DecoderRGB(no_Selection_Couleur%,no_SelectionColor%,ccc%)
'            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%
            DecoderRGB(no_Start_Couleur%,no_StartColor%,ccc%)
'            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%
            DecoderRGB(no_End_Couleur%,no_EndColor%,ccc%)
'            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."
          res% = dll_call2("DrawFlowChart",FC%,1)
          return
        end_if
'        message "Lien "+str$(res%)+" identifié"
       
        res% = dll_call3("SelectLinkInFlowChart",FC%,FCL%,adr(ccc%))
        DecoderRGB(no_Link_Couleur%,no_LinkColor%,ccc%)
        res% = dll_call2("DrawFlowChart",FC%,5)
        show no_AttributsLink%
'        text no_Link_Couleur%,right$(hex$(ccc%),6)
      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
 
supprimerTousLiens:
  supprimerTousLiens()
  return
 
valider_Selection:
  valider_Selection()
  return

valider_start:
  valider_start()
  return
 
valider_end:
  valider_end()
  return
 
valider_Link:
  valider_Link()
  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
 
SelCouleurAction:
  SelCouleurAction()
  return
 
SelCouleurCondition:
  SelCouleurCondition()
  return
 
SelCouleurSelection:
  SelCouleurSelection()
  return
 
SelCouleurStart:
  SelCouleurStart()
  return
 
SelCouleurEnd:
  SelCouleurEnd()
  return
 
SelCouleurLink:
  SelCouleurLink()
  return 
 
sub labels()
  label AddConnector, AddAction, AddCondition, AddSelector, AddStart, AddEnd
  label valider_connector, valider_action, valider_Condition, valider_Selection
  label valider_Start, valider_End, valider_Link
  label selectionner, annulerselection, supprimerliens
  label  UserEvent, sortir
  label selectionLien, annulerSelLien, supprimerLien, supprimerTousLiens
  label SelCouleurAction, SelCouleurCondition, SelCouleurSelection
  label SelCouleurStart, SelCouleurEnd, SelCouleurLink
  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%, no_AttributsLink%
  dim no_Connector_X%, no_Connector_Y%, no_AnnLink%, no_Tracer% , no_Info%, no_infotext%
  dim no_Action_X%, no_Action_Y%, no_Action_Titre%, no_action_Couleur%, no_ActionColor%
  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%, no_ConditionColor%
  dim no_Selection_X%, no_Selection_Y%, no_Selection_Titre%, no_selection_Couleur%, no_SelectionColor%
  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%, no_startcolor%
  dim no_End_X%, no_End_Y%, no_End_Largeur%, no_End_Hauteur%, no_end_Couleur%, no_EndColor%
  dim no_Link_Couleur%, no_LinkColor%
  dim no_AnnSelLink%, no_DelLink%, no_DelLinkAll%
  dim FC%, FCE%, FCEstart%, FCEdest%, FCL%, FCEnew%
  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()
  dim_local hnd%
  dll_on KGF$
  no% = no% + 1 : form no% : hide no% : no_info% = no% : width no%,400 : height no%,200
  no% = no% + 1 : memo no% : no_infotext% = no% : parent no%,no_info% : full_space no% : bar_both no% : font_size no%,12
 
  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%,380
  res% = dll_call2("ShowRulersInFlowChart",FC%,0)
  top no_info%,0 : left no_info%,width_client(0)-width(no_info%)-width(no_cElements%)
 
  hnd% = dll_call1("GetHandleOfFlowChart",FC%)
  res% = dll_call3("SetFormParent",handle(no_info%),hnd%,0)
 
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Début"
    top no%,15 : left no%,10 : on_click no%,AddStart
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Connecteur"
    top no%,top(no%-1)+height(no%-1) : 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%,"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
  no% = no% + 1 : button no% : parent no%,no_cElements% : no_DelLinkAll% = no% : caption no%,"Supprimer tous les liens" : inactive no%
    top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-1) : on_click no%,supprimerTousLiens

    ' 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 : panel no%  : no_ActionColor% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurAction
  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 : panel no%  : no_ConditionColor% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurCondition
  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 : panel no%  : no_SelectionColor% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurSelection
  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 : panel no%  : no_StartColor% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurStart
  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 : panel no%  : no_EndColor% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurEnd
  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

' Attributs Link
  no% = no% + 1 : container no% : no_AttributsLink% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Lien" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsLink% : top no%,20 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_Link_Couleur% = no% : parent no%,no_AttributsLink% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : panel no%  : no_LinkColor% = no% : parent no%,no_AttributsLink% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurLink
  no% = no% + 1 : button no% : parent no%,no_AttributsLink% : top no%,height(no_AttributsLink%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_Link

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()
  show no_info%
  clear no_infotext%
  text no_infotext%,"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%
  hide no_AttributsLink%
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%
  hide no_AttributsLink%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
  hide no_info%
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 valider_Link()
  res% = dll_call3("ColorForLinkOfFlowChart",FC%,FCL%,hex(text$(no_Link_couleur%)))
  res% = dll_call3("SelectLinkInFlowChart",FC%,0,adr(ccc%))
  res% = dll_call2("DrawFlowChart",FC%,5)
  hide no_AttributsLink%
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()
  annulerSelLien()
  AnnulerSelection()
  DoPoints% = 1
  npt% = 0
  show no_info%
  clear no_infotext%
  text no_infotext%,"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("SelectElementInFlowChart",FC%,0)
  res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  inactive no_AnnLink%
  inactive no_Tracer%
  hide no_info%
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("SelectElementInFlowChart",FC%,0)
  res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0)
'  res% = dll_call2("DrawFlowChart",FC%,1)
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  inactive no_AnnLink%
  inactive no_Tracer%
  hide no_info%
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()
  AnnulerSelection()
  DoPoints% = 6
  npt% = 0
  show no_info%
  clear no_infotext%
  text no_infotext%,"Cliquer sur un lien..."
  res% = dll_call2("DrawFlowChart",FC%,5) 
  active no_AnnSelLink%
  active no_DelLink%
  active no_DelLinkAll%
end_sub
 
sub annulerSelLien()
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  res% = dll_call3("SelectLinkInFlowChart",FC%,0,adr(ccc%))
  res% = dll_call2("DrawFlowChart",FC%,1)
  inactive no_AnnSelLink%
  inactive no_DelLink%
  inactive no_DelLinkAll%
  hide no_info%
  hide no_info%
end_sub
 
sub supprimerLien()
  res% = dll_call1("DeleteLinkFromFlowChart",FCL%)
  hide no_info%
end_sub

sub supprimerTousLiens()
  res% = dll_call1("DeleteAllLinksFromFlowChart",FC%)
  hide no_info%
end_sub

sub SelCouleurAction()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Action_Couleur%,no_ActionColor%,ccc%)
end_sub

sub SelCouleurCondition()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Condition_Couleur%,no_ConditionColor%,ccc%)
end_sub

sub SelCouleurSelection()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Selection_Couleur%,no_SelectionColor%,ccc%)
end_sub

sub SelCouleurStart()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Start_Couleur%,no_StartColor%,ccc%)
end_sub

sub SelCouleurEnd()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_End_Couleur%,no_EndColor%,ccc%)
end_sub

sub SelCouleurLink()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Link_Couleur%,no_LinkColor%,ccc%)
end_sub

sub DecoderRGB(no_Text%,no_Picture%,RGB%)
  dim_local R%, G%, B%, n%
  text no_text%,hex$(RGB%)
  R% = bin_and(RGB%,hex("FF"))
  G% = bin_and(RGB%/256,hex("FF"))
  B% = bin_and(RGB%,hex("FF0000"))/65536
  color no_Picture%,R%,G%,B%
end_sub

Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Minibug

Minibug


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyMar 20 Mar 2018 - 17:54

C'est bon Klaus. Testé et approuvé ! Wink
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyMar 20 Mar 2018 - 21:45

Nouvelle version:
- restructurationn interne du tracé des liens, avec élimination automatique de points colinéaires qui étaient générés en excès.
- possibilité de déplacer un angle d'un lien sélectionné en le tirant par la souris avec le bouton droit

La nouvelle version de la DLL est dans le WebDav, dossier DLLs.

Et 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
    pos% =  user_event_lparam              : ' positon: yyyyxxxx
    xxp% = bin_and(pos%,hex("0000FFFF"))
    yyp% = pos%/65536
    
    if DoPoints%=5
      res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEnew%))
      if res%<0 then return
      if FCEnew%=FCE%
        annulerselection()
        return
      else
        DoPoints% = 0  
        annulerSelLien()
      end_if
    end_if
    if DoPoints%=0
      res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%))
      if res%<0 then return
      annulerSelLien()
      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_if
    
    if DoPoints%>0
      if DoPoints%=1
        NatureOutput% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%))
        if NatureOutput%<0  : ' c'est la nature de l'élément
          message "Ce n'est pas une sortie valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..."
          return
        end_if
        res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,output%)
        DoPoints% = 2
        show no_info%
        clear no_infotext%
        text no_infotext%,"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
        res% = dll_call2("SelectElementInFlowChart",FC%,FCEdest%)
        res% = dll_call2("ShowRulersInFlowChart",FC%,1)
        show no_info%
        clear no_infotext%
        text no_infotext%,"Cliquez maintenant les points d'étape"+chr$(13)+chr$(10)+"puis Tracez ou Annulez..."
        return
      end_if
      if DoPoints%=3
        ' ici, rectangulariser le tracé
        if npt%=0
          res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xx%),adr(yy%))    
        else
          xx% = xarray%(npt%)
          yy% = yarray%(npt%)
        end_if
        if (npt%=0) and (NatureOutput%<>0)   : ' NatureOutput%=0 => Connector seul
          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
        
if 1=2        
s$ = "avant: npt%="+str$(npt%)
for i%=1 to npt%
  s$ = s$ + chr$(13)+chr$(10)+str$(xarray%(i%))+","+str$(yarray%(i%))
next i%
message s$
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%
if 1=2
s$ = "après: npt%="+str$(npt%)
for i%=1 to npt%
  s$ = s$ + chr$(13)+chr$(10)+str$(xarray%(i%))+","+str$(yarray%(i%))
next i%
message s$
end_if      

      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é"
        hide no_info%
        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%
            DecoderRGB(no_Action_Couleur%,no_ActionColor%,ccc%)
'            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%
            DecoderRGB(no_Condition_Couleur%,no_ConditionColor%,ccc%)
'            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)
            DecoderRGB(no_Selection_Couleur%,no_SelectionColor%,ccc%)
'            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%
            DecoderRGB(no_Start_Couleur%,no_StartColor%,ccc%)
'            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%
            DecoderRGB(no_End_Couleur%,no_EndColor%,ccc%)
'            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."
          res% = dll_call2("DrawFlowChart",FC%,1)
          return
        end_if
'        message "Lien "+str$(res%)+" identifié"
        
        res% = dll_call3("SelectLinkInFlowChart",FC%,FCL%,adr(ccc%))
        DecoderRGB(no_Link_Couleur%,no_LinkColor%,ccc%)
        res% = dll_call2("DrawFlowChart",FC%,5)
        show no_AttributsLink%
'        text no_Link_Couleur%,right$(hex$(ccc%),6)
      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
  
supprimerTousLiens:
  supprimerTousLiens()
  return
  
valider_Selection:
  valider_Selection()
  return

valider_start:
  valider_start()
  return
  
valider_end:
  valider_end()
  return
  
valider_Link:
  valider_Link()
  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
  
SelCouleurAction:
  SelCouleurAction()
  return
  
SelCouleurCondition:
  SelCouleurCondition()
  return
  
SelCouleurSelection:
  SelCouleurSelection()
  return
  
SelCouleurStart:
  SelCouleurStart()
  return
  
SelCouleurEnd:
  SelCouleurEnd()
  return
  
SelCouleurLink:
  SelCouleurLink()
  return  
  
sub labels()
  label AddConnector, AddAction, AddCondition, AddSelector, AddStart, AddEnd
  label valider_connector, valider_action, valider_Condition, valider_Selection
  label valider_Start, valider_End, valider_Link
  label selectionner, annulerselection, supprimerliens
  label  UserEvent, sortir
  label selectionLien, annulerSelLien, supprimerLien, supprimerTousLiens
  label SelCouleurAction, SelCouleurCondition, SelCouleurSelection
  label SelCouleurStart, SelCouleurEnd, SelCouleurLink
  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%, s$
  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%, no_AttributsLink%
  dim no_Connector_X%, no_Connector_Y%, no_AnnLink%, no_Tracer% , no_Info%, no_infotext%
  dim no_Action_X%, no_Action_Y%, no_Action_Titre%, no_action_Couleur%, no_ActionColor%
  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%, no_ConditionColor%
  dim no_Selection_X%, no_Selection_Y%, no_Selection_Titre%, no_selection_Couleur%, no_SelectionColor%
  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%, no_startcolor%
  dim no_End_X%, no_End_Y%, no_End_Largeur%, no_End_Hauteur%, no_end_Couleur%, no_EndColor%
  dim no_Link_Couleur%, no_LinkColor%
  dim no_AnnSelLink%, no_DelLink%, no_DelLinkAll%
  dim FC%, FCE%, FCEstart%, FCEdest%, FCL%, FCEnew%
  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()
  dim_local hnd%
  dll_on KGF$
  no% = no% + 1 : form no% : hide no% : no_info% = no% : width no%,400 : height no%,200
  no% = no% + 1 : memo no% : no_infotext% = no% : parent no%,no_info% : full_space no% : bar_both no% : font_size no%,12
  
  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%,380
  res% = dll_call2("ShowRulersInFlowChart",FC%,0)
  top no_info%,0 : left no_info%,width_client(0)-width(no_info%)-width(no_cElements%)
  
  hnd% = dll_call1("GetHandleOfFlowChart",FC%)
  res% = dll_call3("SetFormParent",handle(no_info%),hnd%,0)
  
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Début"
    top no%,15 : left no%,10 : on_click no%,AddStart
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Connecteur"
    top no%,top(no%-1)+height(no%-1) : 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%,"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
  no% = no% + 1 : button no% : parent no%,no_cElements% : no_DelLinkAll% = no% : caption no%,"Supprimer tous les liens" : inactive no%
    top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-1) : on_click no%,supprimerTousLiens

    ' 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 : panel no%  : no_ActionColor% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurAction
  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 : panel no%  : no_ConditionColor% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurCondition
  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 : panel no%  : no_SelectionColor% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurSelection
  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 : panel no%  : no_StartColor% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurStart
  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 : panel no%  : no_EndColor% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurEnd
  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

' Attributs Link
  no% = no% + 1 : container no% : no_AttributsLink% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Lien" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsLink% : top no%,20 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_Link_Couleur% = no% : parent no%,no_AttributsLink% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : panel no%  : no_LinkColor% = no% : parent no%,no_AttributsLink% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurLink
  no% = no% + 1 : button no% : parent no%,no_AttributsLink% : top no%,height(no_AttributsLink%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_Link

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()
  show no_info%
  clear no_infotext%
  text no_infotext%,"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%
  hide no_AttributsLink%
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%
  hide no_AttributsLink%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
  hide no_info%
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 valider_Link()
  res% = dll_call3("ColorForLinkOfFlowChart",FC%,FCL%,hex(text$(no_Link_couleur%)))
  res% = dll_call3("SelectLinkInFlowChart",FC%,0,adr(ccc%))
  res% = dll_call2("DrawFlowChart",FC%,5)
  hide no_AttributsLink%
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()
  annulerSelLien()
  AnnulerSelection()
  DoPoints% = 1
  npt% = 0
  show no_info%
  clear no_infotext%
  text no_infotext%,"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("SelectElementInFlowChart",FC%,0)
  res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  inactive no_AnnLink%
  inactive no_Tracer%
  hide no_info%
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
if 1=2
s$ = "final: npt%="+str$(npt%)
for i%=1 to npt%
  s$ = s$ + chr$(13)+chr$(10)+str$(xarray%(i%))+","+str$(yarray%(i%))
next i%
message s$
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("SelectElementInFlowChart",FC%,0)
  res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0)
'  res% = dll_call2("DrawFlowChart",FC%,1)
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  inactive no_AnnLink%
  inactive no_Tracer%
  hide no_info%
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()
  AnnulerSelection()
  DoPoints% = 6
  npt% = 0
  show no_info%
  clear no_infotext%
  text no_infotext%,"Cliquer sur un lien..."
  res% = dll_call2("DrawFlowChart",FC%,5)  
  active no_AnnSelLink%
  active no_DelLink%
  active no_DelLinkAll%
end_sub
  
sub annulerSelLien()
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  res% = dll_call3("SelectLinkInFlowChart",FC%,0,adr(ccc%))
  res% = dll_call2("DrawFlowChart",FC%,1)
  inactive no_AnnSelLink%
  inactive no_DelLink%
  inactive no_DelLinkAll%
  hide no_info%
  hide no_info%
end_sub
  
sub supprimerLien()
  res% = dll_call1("DeleteLinkFromFlowChart",FCL%)
  hide no_info%
end_sub

sub supprimerTousLiens()
  res% = dll_call1("DeleteAllLinksFromFlowChart",FC%)
  hide no_info%
end_sub

sub SelCouleurAction()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Action_Couleur%,no_ActionColor%,ccc%)
end_sub

sub SelCouleurCondition()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Condition_Couleur%,no_ConditionColor%,ccc%)
end_sub

sub SelCouleurSelection()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Selection_Couleur%,no_SelectionColor%,ccc%)
end_sub

sub SelCouleurStart()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Start_Couleur%,no_StartColor%,ccc%)
end_sub

sub SelCouleurEnd()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_End_Couleur%,no_EndColor%,ccc%)
end_sub

sub SelCouleurLink()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Link_Couleur%,no_LinkColor%,ccc%)
end_sub

sub DecoderRGB(no_Text%,no_Picture%,RGB%)
  dim_local R%, G%, B%, n%
  text no_text%,hex$(RGB%)
  R% = bin_and(RGB%,hex("FF"))
  G% = bin_and(RGB%/256,hex("FF"))
  B% = bin_and(RGB%,hex("FF0000"))/65536
  color no_Picture%,R%,G%,B%
end_sub

EDIT

testé et opérationnel avec la nouvelle version de Panoramic de ce jour !
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyMer 21 Mar 2018 - 1:47

Nouvelle version:
outre la possibilité de déplacer un point d'un lien sélectionné (voir ci-dessus), on peut maintenant afficher les liens sous forme de polygone (suite se segments orthogonaux) ou sous forme de courbes souples (Bézier). Pour cela, le cadre des propriétés d'un lien sélectionné contient une nouvelle propriété "Nature" avec une combo affichant par défaut "Polygon", mais on peut y choisir "Bézier". Et lors de la validation des propriétés, l'aspect du lien change.

Pour cela, il faut savoir un minimum sur les courbes Bézier. Dans cette implémentation, un lien en format Bézier est dessiné par une suite de segments de courbes Bézier, chacun déterminé par 4 points: le point de départ et le point d'arrivée sont forcément sur la courbe, ainsi que deux points intermédiaires servant d'"attracteurs" pour le segment de courbe concerné, sans toute fois être placés sur cette courbe. Pour le premier segment, le point de départ est forcément le connecteur de sortie de l'élément  de départ. A partir de là, on utilise les 3 points suivants comme deux points d'attracteurs puis un point d'arrivée. Si le lien a plus de points, on recommence en utilisant implicitement le point d'arrivée précédent comme nouveau point de départ, puis un utilise les 3 points suivants comme nouveau triplet Bézier. Si, après le dessin d'un segment Bézier, moins que 3 points (en comptant le connecteur d'entrée de l'élément de destination) restent disponible, le dessin du lien termine en polygone.

La nouvelle DLL est dans le WebDav, dossier DLLs. Et voici le programme adapté:
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
    pos% =  user_event_lparam              : ' positon: yyyyxxxx
    xxp% = bin_and(pos%,hex("0000FFFF"))
    yyp% = pos%/65536
    
    if DoPoints%=5
      res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEnew%))
      if res%<0 then return
      if FCEnew%=FCE%
        annulerselection()
        return
      else
        DoPoints% = 0  
        annulerSelLien()
      end_if
    end_if
    if DoPoints%=0
      res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%))
      if res%<0 then return
      annulerSelLien()
      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_if
    
    if DoPoints%>0
      if DoPoints%=1
        NatureOutput% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%))
        if NatureOutput%<0  : ' c'est la nature de l'élément
          message "Ce n'est pas une sortie valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..."
          return
        end_if
        res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,output%)
        DoPoints% = 2
        show no_info%
        clear no_infotext%
        text no_infotext%,"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
        res% = dll_call2("SelectElementInFlowChart",FC%,FCEdest%)
        res% = dll_call2("ShowRulersInFlowChart",FC%,1)
        show no_info%
        clear no_infotext%
        text no_infotext%,"Cliquez maintenant les points d'étape"+chr$(13)+chr$(10)+"puis Tracez ou Annulez..."
        return
      end_if
      if DoPoints%=3
        ' ici, rectangulariser le tracé
        if npt%=0
          res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xx%),adr(yy%))    
        else
          xx% = xarray%(npt%)
          yy% = yarray%(npt%)
        end_if
        if (npt%=0) and (NatureOutput%<>0)   : ' NatureOutput%=0 => Connector seul
          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
        
if 1=2        
s$ = "avant: npt%="+str$(npt%)
for i%=1 to npt%
  s$ = s$ + chr$(13)+chr$(10)+str$(xarray%(i%))+","+str$(yarray%(i%))
next i%
message s$
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%
if 1=2
s$ = "après: npt%="+str$(npt%)
for i%=1 to npt%
  s$ = s$ + chr$(13)+chr$(10)+str$(xarray%(i%))+","+str$(yarray%(i%))
next i%
message s$
end_if      

      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é"
        hide no_info%
        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%
            DecoderRGB(no_Action_Couleur%,no_ActionColor%,ccc%)
'            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%
            DecoderRGB(no_Condition_Couleur%,no_ConditionColor%,ccc%)
'            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)
            DecoderRGB(no_Selection_Couleur%,no_SelectionColor%,ccc%)
'            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%
            DecoderRGB(no_Start_Couleur%,no_StartColor%,ccc%)
'            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%
            DecoderRGB(no_End_Couleur%,no_EndColor%,ccc%)
'            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."
          res% = dll_call2("DrawFlowChart",FC%,1)
          return
        end_if
'        message "Lien "+str$(res%)+" identifié"
        
        res% = dll_call3("SelectLinkInFlowChart",FC%,FCL%,adr(ccc%))
        res% = dll_call2("SelectComboBoxItem",handle(no_NatureLink%),res%+1)
        DecoderRGB(no_Link_Couleur%,no_LinkColor%,ccc%)
        res% = dll_call2("DrawFlowChart",FC%,5)
        show no_AttributsLink%
'        text no_Link_Couleur%,right$(hex$(ccc%),6)
      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
  
supprimerTousLiens:
  supprimerTousLiens()
  return
  
valider_Selection:
  valider_Selection()
  return

valider_start:
  valider_start()
  return
  
valider_end:
  valider_end()
  return
  
valider_Link:
  valider_Link()
  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
  
SelCouleurAction:
  SelCouleurAction()
  return
  
SelCouleurCondition:
  SelCouleurCondition()
  return
  
SelCouleurSelection:
  SelCouleurSelection()
  return
  
SelCouleurStart:
  SelCouleurStart()
  return
  
SelCouleurEnd:
  SelCouleurEnd()
  return
  
SelCouleurLink:
  SelCouleurLink()
  return  
  
sub labels()
  label AddConnector, AddAction, AddCondition, AddSelector, AddStart, AddEnd
  label valider_connector, valider_action, valider_Condition, valider_Selection
  label valider_Start, valider_End, valider_Link
  label selectionner, annulerselection, supprimerliens
  label  UserEvent, sortir
  label selectionLien, annulerSelLien, supprimerLien, supprimerTousLiens
  label SelCouleurAction, SelCouleurCondition, SelCouleurSelection
  label SelCouleurStart, SelCouleurEnd, SelCouleurLink
  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%, s$
  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%, no_AttributsLink%
  dim no_Connector_X%, no_Connector_Y%, no_AnnLink%, no_Tracer% , no_Info%, no_infotext%
  dim no_Action_X%, no_Action_Y%, no_Action_Titre%, no_action_Couleur%, no_ActionColor%
  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%, no_ConditionColor%
  dim no_Selection_X%, no_Selection_Y%, no_Selection_Titre%, no_selection_Couleur%, no_SelectionColor%
  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%, no_startcolor%
  dim no_End_X%, no_End_Y%, no_End_Largeur%, no_End_Hauteur%, no_end_Couleur%, no_EndColor%
  dim no_Link_Couleur%, no_LinkColor%, no_cStatus%, no_StatusText%, no_NatureLink%
  dim no_AnnSelLink%, no_DelLink%, no_DelLinkAll%
  dim FC%, FCE%, FCEstart%, FCEdest%, FCL%, FCEnew%
  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()
  dim_local hnd%
  dll_on KGF$
  no% = no% + 1 : form no% : hide no% : no_info% = no% : width no%,400 : height no%,200
  no% = no% + 1 : memo no% : no_infotext% = no% : parent no%,no_info% : full_space no% : bar_both no% : font_size no%,12
  
  no% = no% + 1 : container no% : no_cElements% = no% : width no%,200 : caption no%,"Eléments"
'  no% = no% + 1 : container no% : no_cStatus% = no% : width no%,width_client(0)-width(no_cElements%) : height no%,40
'    top no%,height_client(0)-40 : left no_cStatus%,width(no_cElements%) : caption no%,"Status"
  FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%)
  full_space 0
'  top no_cStatus%,height_client(0)-40 : width no%,width_client(0)-width(no_cElements%) : caption no_cStatus%,"Status"
'  no% = no% + 1 : alpha no% : parent no%,no_cStatus% : no_StatusText% = no%
  res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0))
  height no_cElements%,380
  res% = dll_call2("ShowRulersInFlowChart",FC%,0)
  top no_info%,0 : left no_info%,width_client(0)-width(no_info%)-width(no_cElements%)
  
  hnd% = dll_call1("GetHandleOfFlowChart",FC%)
  res% = dll_call3("SetFormParent",handle(no_info%),hnd%,0)
  
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Début"
    top no%,15 : left no%,10 : on_click no%,AddStart
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Connecteur"
    top no%,top(no%-1)+height(no%-1) : 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%,"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
  no% = no% + 1 : button no% : parent no%,no_cElements% : no_DelLinkAll% = no% : caption no%,"Supprimer tous les liens" : inactive no%
    top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-1) : on_click no%,supprimerTousLiens

    ' 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 : panel no%  : no_ActionColor% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurAction
  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 : panel no%  : no_ConditionColor% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurCondition
  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 : panel no%  : no_SelectionColor% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurSelection
  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 : panel no%  : no_StartColor% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurStart
  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 : panel no%  : no_EndColor% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurEnd
  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

' Attributs Link
  no% = no% + 1 : container no% : no_AttributsLink% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Lien" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsLink% : top no%,20 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_Link_Couleur% = no% : parent no%,no_AttributsLink% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : panel no%  : no_LinkColor% = no% : parent no%,no_AttributsLink% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurLink
  no% = no% + 1 : alpha no% : parent no%,no_AttributsLink% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Nature:"
  no% = no% + 1 : combo no% : parent no%,no_AttributsLink% : no_NatureLink% = no% : top no%,top(no%-1) : left no%,80 : width no%,80
    item_add no%,"Polygon" : item_add no%,"Bézier"
  no% = no% + 1 : button no% : parent no%,no_AttributsLink% : top no%,height(no_AttributsLink%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_Link

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()
  show no_info%
  clear no_infotext%
  text no_infotext%,"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%
  hide no_AttributsLink%
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%
  hide no_AttributsLink%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
  hide no_info%
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 valider_Link()
  res% = dll_call3("ColorForLinkOfFlowChart",FC%,FCL%,hex(text$(no_Link_couleur%)))
  res% = dll_call3("SetTypeOfFlowChartLink",FC%,FCL%,item_index(no_NatureLink%)-1)
  res% = dll_call3("SelectLinkInFlowChart",FC%,0,adr(ccc%))
  res% = dll_call2("DrawFlowChart",FC%,5)
  hide no_AttributsLink%
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()
  annulerSelLien()
  AnnulerSelection()
  DoPoints% = 1
  npt% = 0
  show no_info%
  clear no_infotext%
  text no_infotext%,"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("SelectElementInFlowChart",FC%,0)
  res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  inactive no_AnnLink%
  inactive no_Tracer%
  hide no_info%
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
if 1=2
s$ = "final: npt%="+str$(npt%)
for i%=1 to npt%
  s$ = s$ + chr$(13)+chr$(10)+str$(xarray%(i%))+","+str$(yarray%(i%))
next i%
message s$
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("SelectElementInFlowChart",FC%,0)
  res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0)
'  res% = dll_call2("DrawFlowChart",FC%,1)
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  inactive no_AnnLink%
  inactive no_Tracer%
  hide no_info%
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()
  AnnulerSelection()
  DoPoints% = 6
  npt% = 0
  show no_info%
  clear no_infotext%
  text no_infotext%,"Cliquer sur un lien..."
  res% = dll_call2("DrawFlowChart",FC%,5)  
  active no_AnnSelLink%
  active no_DelLink%
  active no_DelLinkAll%
end_sub
  
sub annulerSelLien()
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  res% = dll_call3("SelectLinkInFlowChart",FC%,0,adr(ccc%))
  res% = dll_call2("DrawFlowChart",FC%,1)
  inactive no_AnnSelLink%
  inactive no_DelLink%
  inactive no_DelLinkAll%
  hide no_info%
  hide no_info%
end_sub
  
sub supprimerLien()
  res% = dll_call1("DeleteLinkFromFlowChart",FCL%)
  hide no_info%
end_sub

sub supprimerTousLiens()
  res% = dll_call1("DeleteAllLinksFromFlowChart",FC%)
  hide no_info%
end_sub

sub SelCouleurAction()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Action_Couleur%,no_ActionColor%,ccc%)
end_sub

sub SelCouleurCondition()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Condition_Couleur%,no_ConditionColor%,ccc%)
end_sub

sub SelCouleurSelection()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Selection_Couleur%,no_SelectionColor%,ccc%)
end_sub

sub SelCouleurStart()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Start_Couleur%,no_StartColor%,ccc%)
end_sub

sub SelCouleurEnd()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_End_Couleur%,no_EndColor%,ccc%)
end_sub

sub SelCouleurLink()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Link_Couleur%,no_LinkColor%,ccc%)
end_sub

sub DecoderRGB(no_Text%,no_Picture%,RGB%)
  dim_local R%, G%, B%, n%
  text no_text%,hex$(RGB%)
  R% = bin_and(RGB%,hex("FF"))
  G% = bin_and(RGB%/256,hex("FF"))
  B% = bin_and(RGB%,hex("FF0000"))/65536
  color no_Picture%,R%,G%,B%
end_sub

Et voici 3 liens transformés en Bézier:
Un essai de construction d'organigramme par Panoramic - Page 5 Aa154

Sympa, non ?
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyMer 21 Mar 2018 - 10:40

Nouvelle version:
dans le cas de sélection d'un lien sous forme de courbe Bézier, les points "attracteurs" de la courbe sont maintenant montrés par des cercles de la même couleur que la courbe sélectionnés. Ceci permet de "tirer" on point attracteur pour déformer la courbe en temps réel, jusqu'à lui donner la forme souhaitée. En validant les propriétés ou en annulant la sélection du lien, ce dernier sera à nouveau affiché normalement (une courbe de 1 pixel de large avec sa propre couleur) et les points attracteurs sont effacés.

La DLL est dans le WebDav, dossier DLLs. Le programme est inchangé.

Voici ce que ça donne, lors de la sélectiion d'un lien:
Un essai de construction d'organigramme par Panoramic - Page 5 Aa155
Les points jaunes sont les attracteurs qui peuvent être déplacés en les tirant par la souris avec le bouton droit enfoncé.

EDIT

En cas d'enregistrement sur disque, la proprété "Nature" des liens est bien entendu sauvegardée, et restaurée au chargement d'un projet. Le programme est compatible avec les projets existants et charge les liens comme ils étaient - en format polygone.
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 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyMer 21 Mar 2018 - 22:59

Bonsoir Klaus !

Tu ne te reposes jamais !

Pour la pose de tes carreaux de plâtre, je pense que tu as opté pour le montage "polygone" et non pas "Bézier" ! Very Happy

Merci de ton partage.

Je vais tester de ce pas...
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 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyMer 21 Mar 2018 - 23:15

Bravo Klaus !

Vraiment super !  cheers

Pourrais-tu ajouter une option pour supprimer un élément quand il est sélectionné ?

L'élément Connecteur ne passe pas en jaune quand il est sélectionné.

Tu as fait un utilitaire très sympa et convivial ! cheers

Merci !
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 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyMer 21 Mar 2018 - 23:52

JEU :
Trouvez le bon chemin qui mène à l’arrêt !

Un essai de construction d'organigramme par Panoramic - Page 5 Jeu10
Revenir en haut Aller en bas
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyMer 21 Mar 2018 - 23:56

Merci, Marc !

Et, justement, voici une nouvelle version ajoutant un bouton "Supprimer" dans le cadre des propriétés de chaque type d'élément. Ce cadre apparaît lorsqu'un élément est sélectionné. Ce bouton permet alors de le supprimer, ainsi que tous les liens qui partent de cet élément ou qui y arrivent. D'ailleurs, le bouton de suppression du lien sélectionné a été déplacé de son endroit actuel vers le cadre des propriétés d'un lien.

J'ai corrigé également une petite anomalie d'affichage de lien en mode Bézier.

La DLL est dans mon WebDav, dossier DLLs, et voici le programme correspondant:
[code:1:0462]' 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
   pos% =  user_event_lparam              : ' positon: yyyyxxxx
   xxp% = bin_and(pos%,hex("0000FFFF"))
   yyp% = pos%/65536
   
   if DoPoints%=5
     res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEnew%))
     if res%<0 then return
     if FCEnew%=FCE%
       annulerselection()
       return
     else
       DoPoints% = 0  
       annulerSelLien()
     end_if
   end_if
   if DoPoints%=0
     res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%))
     if res%<0 then return
     annulerSelLien()
     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_if
   
   if DoPoints%>0
     if DoPoints%=1
       NatureOutput% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%))
       if NatureOutput%<0  : ' c'est la nature de l'élément
         message "Ce n'est pas une sortie valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..."
         return
       end_if
       res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,output%)
       DoPoints% = 2
       show no_info%
       clear no_infotext%
       text no_infotext%,"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
       res% = dll_call2("SelectElementInFlowChart",FC%,FCEdest%)
       res% = dll_call2("ShowRulersInFlowChart",FC%,1)
       show no_info%
       clear no_infotext%
       text no_infotext%,"Cliquez maintenant les points d'étape"+chr$(13)+chr$(10)+"puis Tracez ou Annulez..."
       return
     end_if
     if DoPoints%=3
       ' ici, rectangulariser le tracé
       if npt%=0
         res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xx%),adr(yy%))    
       else
         xx% = xarray%(npt%)
         yy% = yarray%(npt%)
       end_if
       if (npt%=0) and (NatureOutput%<>0)   : ' NatureOutput%=0 => Connector seul
         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
       
if 1=2        
s$ = "avant: npt%="+str$(npt%)
for i%=1 to npt%
 s$ = s$ + chr$(13)+chr$(10)+str$(xarray%(i%))+","+str$(yarray%(i%))
next i%
message s$
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%
if 1=2
s$ = "après: npt%="+str$(npt%)
for i%=1 to npt%
 s$ = s$ + chr$(13)+chr$(10)+str$(xarray%(i%))+","+str$(yarray%(i%))
next i%
message s$
end_if      

     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é"
       hide no_info%
       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%
           DecoderRGB(no_Action_Couleur%,no_ActionColor%,ccc%)
'            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%
           DecoderRGB(no_Condition_Couleur%,no_ConditionColor%,ccc%)
'            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)
           DecoderRGB(no_Selection_Couleur%,no_SelectionColor%,ccc%)
'            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%
           DecoderRGB(no_Start_Couleur%,no_StartColor%,ccc%)
'            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%
           DecoderRGB(no_End_Couleur%,no_EndColor%,ccc%)
'            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."
         res% = dll_call2("DrawFlowChart",FC%,1)
         return
       end_if
'        message "Lien "+str$(res%)+" identifié"
       
       res% = dll_call3("SelectLinkInFlowChart",FC%,FCL%,adr(ccc%))
       res% = dll_call2("SelectComboBoxItem",handle(no_NatureLink%),res%+1)
       DecoderRGB(no_Link_Couleur%,no_LinkColor%,ccc%)
       res% = dll_call2("DrawFlowChart",FC%,5)
       show no_AttributsLink%
'        text no_Link_Couleur%,right$(hex$(ccc%),6)
     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
 
supprimerTousLiens:
 supprimerTousLiens()
 return
 
valider_Selection:
 valider_Selection()
 return

valider_start:
 valider_start()
 return
 
valider_end:
 valider_end()
 return
 
valider_Link:
 valider_Link()
 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
 
SelCouleurAction:
 SelCouleurAction()
 return
 
SelCouleurCondition:
 SelCouleurCondition()
 return
 
SelCouleurSelection:
 SelCouleurSelection()
 return
 
SelCouleurStart:
 SelCouleurStart()
 return
 
SelCouleurEnd:
 SelCouleurEnd()
 return
 
SelCouleurLink:
 SelCouleurLink()
 return  

supprimer_connector:
 supprimer_connector()
 return
 
supprimer_action:
 supprimer_action()
 return
 
supprimer_condition:
 supprimer_condition()
 return
 
supprimer_selector:
 supprimer_selector()
 return
 
supprimer_start:
 supprimer_start()
 return
 
supprimer_end:
 supprimer_end()
 end

supprimer_Link:
 supprimer_Link()
 return
 
 
sub labels()
 label AddConnector, AddAction, AddCondition, AddSelector, AddStart, AddEnd
 label valider_connector, valider_action, valider_Condition, valider_Selection
 label valider_Start, valider_End, valider_Link
 label selectionner, annulerselection, supprimerliens
 label  UserEvent, sortir
 label selectionLien, annulerSelLien, supprimerTousLiens
 label SelCouleurAction, SelCouleurCondition, SelCouleurSelection
 label SelCouleurStart, SelCouleurEnd, SelCouleurLink
 label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet
 label lier, annulerlier, tracer, exporter
 label supprimer_connector, supprimer_action, supprimer_condition, supprimer_selector
 label supprimer_start, supprimer_end, supprimer_link
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%, s$
 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%, no_AttributsLink%
 dim no_Connector_X%, no_Connector_Y%, no_AnnLink%, no_Tracer% , no_Info%, no_infotext%
 dim no_Action_X%, no_Action_Y%, no_Action_Titre%, no_action_Couleur%, no_ActionColor%
 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%, no_ConditionColor%
 dim no_Selection_X%, no_Selection_Y%, no_Selection_Titre%, no_selection_Couleur%, no_SelectionColor%
 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%, no_startcolor%
 dim no_End_X%, no_End_Y%, no_End_Largeur%, no_End_Hauteur%, no_end_Couleur%, no_EndColor%
 dim no_Link_Couleur%, no_LinkColor%, no_cStatus%, no_StatusText%, no_NatureLink%
 dim no_AnnSelLink%, no_DelLink%, no_DelLinkAll%
 dim FC%, FCE%, FCEstart%, FCEdest%, FCL%, FCEnew%
 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()
 dim_local hnd%
 dll_on KGF$
 no% = no% + 1 : form no% : hide no% : no_info% = no% : width no%,400 : height no%,200
 no% = no% + 1 : memo no% : no_infotext% = no% : parent no%,no_info% : full_space no% : bar_both no% : font_size no%,12
 
 no% = no% + 1 : container no% : no_cElements% = no% : width no%,200 : caption no%,"Eléments"
'  no% = no% + 1 : container no% : no_cStatus% = no% : width no%,width_client(0)-width(no_cElements%) : height no%,40
'    top no%,height_client(0)-40 : left no_cStatus%,width(no_cElements%) : caption no%,"Status"
 FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%)
 full_space 0
'  top no_cStatus%,height_client(0)-40 : width no%,width_client(0)-width(no_cElements%) : caption no_cStatus%,"Status"
'  no% = no% + 1 : alpha no% : parent no%,no_cStatus% : no_StatusText% = no%
 res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0))
 height no_cElements%,355
 res% = dll_call2("ShowRulersInFlowChart",FC%,0)
 top no_info%,0 : left no_info%,width_client(0)-width(no_info%)-width(no_cElements%)
 
 hnd% = dll_call1("GetHandleOfFlowChart",FC%)
 res% = dll_call3("SetFormParent",handle(no_info%),hnd%,0)
 
 no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Début"
   top no%,15 : left no%,10 : on_click no%,AddStart
 no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Connecteur"
   top no%,top(no%-1)+height(no%-1) : 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%,"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_DelLinkAll% = no% : caption no%,"Supprimer tous les liens" : inactive no%
   top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,supprimerTousLiens

   ' 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
 no% = no% + 1 : button no% : parent no%,no_AttributsConnector% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
   caption no%,"Supprimer" : on_click no%,supprimer_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 : panel no%  : no_ActionColor% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
   width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurAction
 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
 no% = no% + 1 : button no% : parent no%,no_AttributsAction% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
   caption no%,"Supprimer" : on_click no%,supprimer_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 : panel no%  : no_ConditionColor% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
   width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurCondition
 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
 no% = no% + 1 : button no% : parent no%,no_AttributsCondition% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
   caption no%,"Supprimer" : on_click no%,supprimer_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 : panel no%  : no_SelectionColor% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
   width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurSelection
 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
 no% = no% + 1 : button no% : parent no%,no_AttributsSelection% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
   caption no%,"Supprimer" : on_click no%,supprimer_selector


 ' 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 : panel no%  : no_StartColor% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
   width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurStart
 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
 no% = no% + 1 : button no% : parent no%,no_AttributsStart% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
   caption no%,"Supprimer" : on_click no%,supprimer_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 : panel no%  : no_EndColor% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
   width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurEnd
 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
 no% = no% + 1 : button no% : parent no%,no_AttributsEnd% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
   caption no%,"Supprimer" : on_click no%,supprimer_End

' Attributs Link
 no% = no% + 1 : container no% : no_AttributsLink% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
   height no%,300 : caption no%,"Attributs Lien" : hide no%
 no% = no% + 1 : alpha no% : parent no%,no_AttributsLink% : top no%,20 : left no%,10
   caption no%,"Couleur RGB:"
 no% = no% + 1 : edit no% : no_Link_Couleur% = no% : parent no%,no_AttributsLink% : top no%,top(no%-1) : left no%,80
   width no%,50
 no% = no% + 1 : panel no%  : no_LinkColor% = no% : parent no%,no_AttributsLink% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
   width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurLink
 no% = no% + 1 : alpha no% : parent no%,no_AttributsLink% : top no%,top(no%-1)+25 : left no%,10
   caption no%,"Nature:"
 no% = no% + 1 : combo no% : parent no%,no_AttributsLink% : no_NatureLink% = no% : top no%,top(no%-1) : left no%,80 : width no%,80
   item_add no%,"Polygon" : item_add no%,"Bézier"
 no% = no% + 1 : button no% : parent no%,no_AttributsLink% : top no%,height(no_AttributsLink%)-30 : left no%,20
   caption no%,"Valider" : on_click no%,valider_Link
 no% = no% + 1 : button no% : parent no%,no_AttributsLink% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
   caption no%,"Supprimer" : on_click no%,supprimer_Link

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()
 show no_info%
 clear no_infotext%
 text no_infotext%,"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%
 hide no_AttributsLink%
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%
 hide no_AttributsLink%
 res% = dll_call2("SelectElementInFlowChart",FC%,0)
 hide no_info%
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 valider_Link()
 res% = dll_call3("ColorForLinkOfFlowChart",FC%,FCL%,hex(text$(no_Link_couleur%)))
 res% = dll_call3("SetTypeOfFlowChartLink",FC%,FCL%,item_index(no_NatureLink%)-1)
 res% = dll_call3("SelectLinkInFlowChart",FC%,0,adr(ccc%))
 res% = dll_call2("DrawFlowChart",FC%,5)
 hide no_AttributsLink%
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()
 annulerSelLien()
 AnnulerSelection()
 DoPoints% = 1
 npt% = 0
 show no_info%
 clear no_infotext%
 text no_infotext%,"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("SelectElementInFlowChart",FC%,0)
 res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0)
 res% = dll_call2("DrawFlowChart",FC%,1)
 inactive no_AnnLink%
 inactive no_Tracer%
 hide no_info%
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
if 1=2
s$ = "final: npt%="+str$(npt%)
for i%=1 to npt%
 s$ = s$ + chr$(13)+chr$(10)+str$(xarray%(i%))+","+str$(yarray%(i%))
next i%
message s$
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("SelectElementInFlowChart",FC%,0)
 res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0)
'  res% = dll_call2("DrawFlowChart",FC%,1)
 DoPoints% = 0
 npt% = 0
 xarray%(0) = 0
 inactive no_AnnLink%
 inactive no_Tracer%
 hide no_info%
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()
 AnnulerSelection()
 DoPoints% = 6
 npt% = 0
 show no_info%
 clear no_infotext%
 text no_infotext%,"Cliquer sur un lien..."
 res% = dll_call2("DrawFlowChart",FC%,5)  
 active no_AnnSelLink%
 active no_DelLink%
 active no_DelLinkAll%
end_sub
 
sub annulerSelLien()
 DoPoints% = 0
 npt% = 0
 xarray%(0) = 0
 res% = dll_call3("SelectLinkInFlowChart",FC%,0,adr(ccc%))
 res% = dll_call2("DrawFlowChart",FC%,1)
 inactive no_AnnSelLink%
 inactive no_DelLinkAll%
 hide no_info%
end_sub
 
sub supprimerTousLiens()
 res% = dll_call1("DeleteAllLinksFromFlowChart",FC%)
 hide no_info%
end_sub

sub SelCouleurAction()
 dim_local R%, G%, B%
 res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
 if res%=0 then DecoderRGB(no_Action_Couleur%,no_ActionColor%,ccc%)
end_sub

sub SelCouleurCondition()
 dim_local R%, G%, B%
 res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
 if res%=0 then DecoderRGB(no_Condition_Couleur%,no_ConditionColor%,ccc%)
end_sub

sub SelCouleurSelection()
 dim_local R%, G%, B%
 res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
 if res%=0 then DecoderRGB(no_Selection_Couleur%,no_SelectionColor%,ccc%)
end_sub

sub SelCouleurStart()
 dim_local R%, G%, B%
 res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
 if res%=0 then DecoderRGB(no_Start_Couleur%,no_StartColor%,ccc%)
end_sub

sub SelCouleurEnd()
 dim_local R%, G%, B%
 res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
 if res%=0 then DecoderRGB(no_End_Couleur%,no_EndColor%,ccc%)
end_sub

sub SelCouleurLink()
 dim_local R%, G%, B%
 res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
 if res%=0 then DecoderRGB(no_Link_Couleur%,no_LinkColor%,ccc%)
end_sub

sub DecoderRGB(no_Text%,no_Picture%,RGB%)
 dim_local R%, G%, B%, n%
 text no_text%,hex$(RGB%)
 R% = bin_and(RGB%,hex("FF"))
 G% = bin_and(RGB%/256,hex("FF"))
 B% = bin_and(RGB%,hex("FF0000"))/65536
 color no_Picture%,R%,G%,B%
end_sub

sub supprimer_connector()
 res% = dll_call2("RemoveElementFromFlowChart",FC%,FCE%)
 res% = dll_call2("DrawFlowChart",FC%,1)
 hide no_AttributsConnector%
end_sub

sub supprimer_action()
 res% = dll_call2("RemoveElementFromFlowChart",FC%,FCE%)
 res% = dll_call2("DrawFlowChart",FC%,1)
 hide no_AttributsAction%
end_sub

sub supprimer_condition()
 res% = dll_call2("RemoveElementFromFlowChart",FC%,FCE%)
 res% = dll_call2("DrawFlowChart",FC%,1)
 hide no_AttributsCondition%
end_sub

sub supprimer_selector()
 res% = dll_call2("RemoveElementFromFlowChart",FC%,FCE%)
 res% = dll_call2("DrawFlowChart",FC%,1)
 hide no_AttributsSelector%
end_sub

sub supprimer_start()
 res% = dll_call2("RemoveElementFromFlowChart",FC%,FCE%)
 res% = dll_call2("DrawFlowChart",FC%,1)
 hide no_AttributsStart%
end_sub

sub suppr
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyJeu 22 Mar 2018 - 1:56

Nouvelle version:
En plus de la possibilité de supprimer n'importe quel objet sélectionné, il y a mantenant les deux nouveautés suivantes:
- correction de l'absence de récupération du texte du titre d'un élément Selecteur dans les propriétés
- possibilité de saisir le titre des éléments Start et End (ce qui avait été oublié)

La nouvelle DLL est dans le WebDav, dossier DLLs, et 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
    pos% =  user_event_lparam              : ' positon: yyyyxxxx
    xxp% = bin_and(pos%,hex("0000FFFF"))
    yyp% = pos%/65536
   
    if DoPoints%=5
      res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEnew%))
      if res%<0 then return
      if FCEnew%=FCE%
        annulerselection()
        return
      else
        DoPoints% = 0 
        annulerSelLien()
      end_if
    end_if
    if DoPoints%=0
      res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%))
      if res%<0 then return
      annulerSelLien()
      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_if
   
    if DoPoints%>0
      if DoPoints%=1
        NatureOutput% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%))
        if NatureOutput%<0  : ' c'est la nature de l'élément
          message "Ce n'est pas une sortie valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..."
          return
        end_if
        res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,output%)
        DoPoints% = 2
        show no_info%
        clear no_infotext%
        text no_infotext%,"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
        res% = dll_call2("SelectElementInFlowChart",FC%,FCEdest%)
        res% = dll_call2("ShowRulersInFlowChart",FC%,1)
        show no_info%
        clear no_infotext%
        text no_infotext%,"Cliquez maintenant les points d'étape"+chr$(13)+chr$(10)+"puis Tracez ou Annulez..."
        return
      end_if
      if DoPoints%=3
        ' ici, rectangulariser le tracé
        if npt%=0
          res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xx%),adr(yy%))   
        else
          xx% = xarray%(npt%)
          yy% = yarray%(npt%)
        end_if
        if (npt%=0) and (NatureOutput%<>0)  : ' NatureOutput%=0 => Connector seul
          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
       
if 1=2       
s$ = "avant: npt%="+str$(npt%)
for i%=1 to npt%
  s$ = s$ + chr$(13)+chr$(10)+str$(xarray%(i%))+","+str$(yarray%(i%))
next i%
message s$
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%
if 1=2
s$ = "après: npt%="+str$(npt%)
for i%=1 to npt%
  s$ = s$ + chr$(13)+chr$(10)+str$(xarray%(i%))+","+str$(yarray%(i%))
next i%
message s$
end_if     

      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é"
        hide no_info%
        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%
            DecoderRGB(no_Action_Couleur%,no_ActionColor%,ccc%)
'            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%
            DecoderRGB(no_Condition_Couleur%,no_ConditionColor%,ccc%)
'            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)
            DecoderRGB(no_Selection_Couleur%,no_SelectionColor%,ccc%)
            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%
            DecoderRGB(no_Start_Couleur%,no_StartColor%,ccc%)
            text no_Start_Titre%,item_read$(no_memo%,1)
            item_delete no_memo%,1
          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%
            DecoderRGB(no_End_Couleur%,no_EndColor%,ccc%)
            text no_End_Titre%,item_read$(no_memo%,1)
            item_delete no_memo%,1
        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."
          res% = dll_call2("DrawFlowChart",FC%,1)
          return
        end_if
'        message "Lien "+str$(res%)+" identifié"
       
        res% = dll_call3("SelectLinkInFlowChart",FC%,FCL%,adr(ccc%))
        res% = dll_call2("SelectComboBoxItem",handle(no_NatureLink%),res%+1)
        DecoderRGB(no_Link_Couleur%,no_LinkColor%,ccc%)
        res% = dll_call2("DrawFlowChart",FC%,5)
        show no_AttributsLink%
'        text no_Link_Couleur%,right$(hex$(ccc%),6)
      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
 
supprimerTousLiens:
  supprimerTousLiens()
  return
 
valider_Selection:
  valider_Selection()
  return

valider_start:
  valider_start()
  return
 
valider_end:
  valider_end()
  return
 
valider_Link:
  valider_Link()
  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
 
SelCouleurAction:
  SelCouleurAction()
  return
 
SelCouleurCondition:
  SelCouleurCondition()
  return
 
SelCouleurSelection:
  SelCouleurSelection()
  return
 
SelCouleurStart:
  SelCouleurStart()
  return
 
SelCouleurEnd:
  SelCouleurEnd()
  return
 
SelCouleurLink:
  SelCouleurLink()
  return 

supprimer_connector:
  supprimer_connector()
  return
 
supprimer_action:
  supprimer_action()
  return
 
supprimer_condition:
  supprimer_condition()
  return
 
supprimer_selector:
  supprimer_selector()
  return
 
supprimer_start:
  supprimer_start()
  return
 
supprimer_end:
  supprimer_end()
  end

supprimer_Link:
  supprimer_Link()
  return
 
 
sub labels()
  label AddConnector, AddAction, AddCondition, AddSelector, AddStart, AddEnd
  label valider_connector, valider_action, valider_Condition, valider_Selection
  label valider_Start, valider_End, valider_Link
  label selectionner, annulerselection, supprimerliens
  label  UserEvent, sortir
  label selectionLien, annulerSelLien, supprimerTousLiens
  label SelCouleurAction, SelCouleurCondition, SelCouleurSelection
  label SelCouleurStart, SelCouleurEnd, SelCouleurLink
  label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet
  label lier, annulerlier, tracer, exporter
  label supprimer_connector, supprimer_action, supprimer_condition, supprimer_selector
  label supprimer_start, supprimer_end, supprimer_link
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%, s$
  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%, no_AttributsLink%
  dim no_Connector_X%, no_Connector_Y%, no_AnnLink%, no_Tracer% , no_Info%, no_infotext%
  dim no_Action_X%, no_Action_Y%, no_Action_Titre%, no_action_Couleur%, no_ActionColor%
  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%, no_ConditionColor%
  dim no_Selection_X%, no_Selection_Y%, no_Selection_Titre%, no_selection_Couleur%, no_SelectionColor%
  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%, no_startcolor%
  dim no_End_X%, no_End_Y%, no_End_Largeur%, no_End_Hauteur%, no_end_Couleur%, no_EndColor%
  dim no_Link_Couleur%, no_LinkColor%, no_cStatus%, no_StatusText%, no_NatureLink%
  dim no_AnnSelLink%, no_DelLink%, no_DelLinkAll%, no_Start_Titre%, no_End_Titre%
  dim FC%, FCE%, FCEstart%, FCEdest%, FCL%, FCEnew%
  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()
  dim_local hnd%
  dll_on KGF$
  no% = no% + 1 : form no% : hide no% : no_info% = no% : width no%,400 : height no%,200
  no% = no% + 1 : memo no% : no_infotext% = no% : parent no%,no_info% : full_space no% : bar_both no% : font_size no%,12
 
  no% = no% + 1 : container no% : no_cElements% = no% : width no%,200 : caption no%,"Eléments"
'  no% = no% + 1 : container no% : no_cStatus% = no% : width no%,width_client(0)-width(no_cElements%) : height no%,40
'    top no%,height_client(0)-40 : left no_cStatus%,width(no_cElements%) : caption no%,"Status"
  FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%)
  full_space 0
'  top no_cStatus%,height_client(0)-40 : width no%,width_client(0)-width(no_cElements%) : caption no_cStatus%,"Status"
'  no% = no% + 1 : alpha no% : parent no%,no_cStatus% : no_StatusText% = no%
  res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0))
  height no_cElements%,355
  res% = dll_call2("ShowRulersInFlowChart",FC%,0)
  top no_info%,0 : left no_info%,width_client(0)-width(no_info%)-width(no_cElements%)
 
  hnd% = dll_call1("GetHandleOfFlowChart",FC%)
  res% = dll_call3("SetFormParent",handle(no_info%),hnd%,0)
 
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Début"
    top no%,15 : left no%,10 : on_click no%,AddStart
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Connecteur"
    top no%,top(no%-1)+height(no%-1) : 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%,"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_DelLinkAll% = no% : caption no%,"Supprimer tous les liens" : inactive no%
    top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,supprimerTousLiens

    ' 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
  no% = no% + 1 : button no% : parent no%,no_AttributsConnector% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
    caption no%,"Supprimer" : on_click no%,supprimer_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 : panel no%  : no_ActionColor% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurAction
  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
  no% = no% + 1 : button no% : parent no%,no_AttributsAction% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
    caption no%,"Supprimer" : on_click no%,supprimer_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 : panel no%  : no_ConditionColor% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurCondition
  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
  no% = no% + 1 : button no% : parent no%,no_AttributsCondition% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
    caption no%,"Supprimer" : on_click no%,supprimer_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 : panel no%  : no_SelectionColor% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurSelection
  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
  no% = no% + 1 : button no% : parent no%,no_AttributsSelection% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
    caption no%,"Supprimer" : on_click no%,supprimer_selector


  ' 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 : panel no%  : no_StartColor% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurStart
  no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Titre:"
  no% = no% + 1 : edit no% : no_Start_Titre% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80
    width no%,110
  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
  no% = no% + 1 : button no% : parent no%,no_AttributsStart% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
    caption no%,"Supprimer" : on_click no%,supprimer_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 : panel no%  : no_EndColor% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurEnd
  no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Titre:"
  no% = no% + 1 : edit no% : no_End_Titre% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80
    width no%,110
  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
  no% = no% + 1 : button no% : parent no%,no_AttributsEnd% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
    caption no%,"Supprimer" : on_click no%,supprimer_End

' Attributs Link
  no% = no% + 1 : container no% : no_AttributsLink% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Lien" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsLink% : top no%,20 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_Link_Couleur% = no% : parent no%,no_AttributsLink% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : panel no%  : no_LinkColor% = no% : parent no%,no_AttributsLink% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurLink
  no% = no% + 1 : alpha no% : parent no%,no_AttributsLink% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Nature:"
  no% = no% + 1 : combo no% : parent no%,no_AttributsLink% : no_NatureLink% = no% : top no%,top(no%-1) : left no%,80 : width no%,80
    item_add no%,"Polygon" : item_add no%,"Bézier"
  no% = no% + 1 : button no% : parent no%,no_AttributsLink% : top no%,height(no_AttributsLink%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_Link
  no% = no% + 1 : button no% : parent no%,no_AttributsLink% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
    caption no%,"Supprimer" : on_click no%,supprimer_Link

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()
  show no_info%
  clear no_infotext%
  text no_infotext%,"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%
  hide no_AttributsLink%
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%
  hide no_AttributsLink%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
  hide no_info%
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()
  dim_local titre$
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Start_X%),position(no_Start_Y%),position(no_Start_Largeur%),position(no_Start_Hauteur%))
  titre$ = trim$(text$(no_Start_Titre%))
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),0)
  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()
  dim_local titre$
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_End_X%),position(no_End_Y%),position(no_End_Largeur%),position(no_End_Hauteur%))
  titre$ = trim$(text$(no_End_Titre%))
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),0)
  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 valider_Link()
  res% = dll_call3("ColorForLinkOfFlowChart",FC%,FCL%,hex(text$(no_Link_couleur%)))
  res% = dll_call3("SetTypeOfFlowChartLink",FC%,FCL%,item_index(no_NatureLink%)-1)
  res% = dll_call3("SelectLinkInFlowChart",FC%,0,adr(ccc%))
  res% = dll_call2("DrawFlowChart",FC%,5)
  hide no_AttributsLink%
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()
  annulerSelLien()
  AnnulerSelection()
  DoPoints% = 1
  npt% = 0
  show no_info%
  clear no_infotext%
  text no_infotext%,"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("SelectElementInFlowChart",FC%,0)
  res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  inactive no_AnnLink%
  inactive no_Tracer%
  hide no_info%
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
if 1=2
s$ = "final: npt%="+str$(npt%)
for i%=1 to npt%
  s$ = s$ + chr$(13)+chr$(10)+str$(xarray%(i%))+","+str$(yarray%(i%))
next i%
message s$
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("SelectElementInFlowChart",FC%,0)
  res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0)
'  res% = dll_call2("DrawFlowChart",FC%,1)
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  inactive no_AnnLink%
  inactive no_Tracer%
  hide no_info%
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()
  AnnulerSelection()
  DoPoints% = 6
  npt% = 0
  show no_info%
  clear no_infotext%
  text no_infotext%,"Cliquer sur un lien..."
  res% = dll_call2("DrawFlowChart",FC%,5) 
  active no_AnnSelLink%
  active no_DelLink%
  active no_DelLinkAll%
end_sub
 
sub annulerSelLien()
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  res% = dll_call3("SelectLinkInFlowChart",FC%,0,adr(ccc%))
  res% = dll_call2("DrawFlowChart",FC%,1)
  inactive no_AnnSelLink%
  inactive no_DelLinkAll%
  hide no_info%
end_sub
 
sub supprimerTousLiens()
  res% = dll_call1("DeleteAllLinksFromFlowChart",FC%)
  hide no_info%
end_sub

sub SelCouleurAction()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Action_Couleur%,no_ActionColor%,ccc%)
end_sub

sub SelCouleurCondition()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Condition_Couleur%,no_ConditionColor%,ccc%)
end_sub

sub SelCouleurSelection()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Selection_Couleur%,no_SelectionColor%,ccc%)
end_sub

sub SelCouleurStart()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Start_Couleur%,no_StartColor%,ccc%)
end_sub

sub SelCouleurEnd()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_End_Couleur%,no_EndColor%,ccc%)
end_sub

sub SelCouleurLink()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Link_Couleur%,no_LinkColor%,ccc%)
end_sub

sub DecoderRGB(no_Text%,no_Picture%,RGB%)
  dim_local R%, G%, B%, n%
  text no_text%,hex$(RGB%)
  R% = bin_and(RGB%,hex("FF"))
  G% = bin_and(RGB%/256,hex("FF"))
  B% = bin_and(RGB%,hex("FF0000"))/65536
  color no_Picture%,R%,G%,B%
end_sub

sub supprimer_connector()
  res% = dll_call2("RemoveElementFromFlowChart",FC%,FCE%)
  res% = dll_call2("DrawFlowChart",FC%,1)
  hide no_AttributsConnector%
end_sub

sub supprimer_action()
  res% = dll_call2("RemoveElementFromFlowChart",FC%,FCE%)
  res% = dll_call2("DrawFlowChart",FC%,1)
  hide no_AttributsAction%
end_sub

sub supprimer_condition()
  res% = dll_call2("RemoveElementFromFlowChart",FC%,FCE%)
  res% = dll_call2("DrawFlowChart",FC%,1)
  hide no_AttributsCondition%
end_sub

sub supprimer_selector()
  res% = dll_call2("RemoveElementFromFlowChart",FC%,FCE%)
  res% = dll_call2("DrawFlowChart",FC%,1)
  hide no_AttributsSelector%
end_sub

sub supprimer_start()
  res% = dll_call2("RemoveElementFromFlowChart",FC%,FCE%)
  res% = dll_call2("DrawFlowChart",FC%,1)
  hide no_AttributsStart%
end_sub

sub supprimer_end()
  res% = dll_call2("RemoveElementFromFlowChart",FC%,FCE%)
  res% = dll_call2("DrawFlowChart",FC%,1)
  hide no_AttributsEnd%
end_sub

sub supprimer_link()
  DoPoints% = 0
  res% = dll_call1("DeleteLinkFromFlowChart",FCL%)
  hide no_info%
  hide no_attributsLink%
end_sub
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Minibug

Minibug


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyJeu 22 Mar 2018 - 7:27

Bonjour Klaus

J'ai fais un petit test rapide ce matin. les courbes de Béziers c'est super !

J'ai eu un problème pour supprimer un lien. Suspect
explication :

1/ j'ai créé un élément début
2/ j'ai créé un élément action
3/ j'ai positionné l'élément action à la même hauteur à gauche que début
4/ j'ai créé un lien avec 3 points de début vers action
5/ j'ai déplacé un peu les éléments (le lien s’arrondit parfaitement en sélectionnant courbe de Béziers Wink ).
6/ j'ai cliqué sur le bouton pour sel. lien et le lien est bien passé en 'gras'
7/ Mais je n'ai pas réussi à sélectionner le lien pour le passer en jaune comme je fais d'habitude !
   et le programme affiche le message habituel comme si je ne cliqué pas au bon endroit.

Autre chose...
Concernant les boutons sélectionner et annuler pour les éléments,
je pense que tu peux maintenant les supprimer. ils ne servent plus à grand chose...
Et du coup tu pourra déplacer le bouton supprimer lien juste au dessus du bouton supprimer tous les liens

Bonne journée et bon courage pour la suite. drunken
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyJeu 22 Mar 2018 - 9:36

J'ai tenté de reproduire ton problème de sélection de lien Bézier. Oui, si le pointage n'est pas "précis", ça peut arriver. Mais en principe, ça marche. Voici ce que j'ai fait:

1. Création des objets, puis un lien entre les deux:
Un essai de construction d'organigramme par Panoramic - Page 5 Aa156

2. Passer en mode Sélection de lien:
Un essai de construction d'organigramme par Panoramic - Page 5 Aa215

3. Sélectionner ce lien:
Un essai de construction d'organigramme par Panoramic - Page 5 Aa312

4. Transformer e, lien Bézier, passer en mode Sélection de lien et sélectionner ce lien :
Un essai de construction d'organigramme par Panoramic - Page 5 Aa411

5. Jouer sur les attracteurs pour arrondir le lien correctement:
Un essai de construction d'organigramme par Panoramic - Page 5 Aa511

Donc, tu sois, c'est certainement un problème de visée lors de la sélection du lien Bézier.

En ce qui concerne la simplification de l'interface par rapport aux boutons devenus inutiles, je vais regarder  cela. En tout cas,
Citation :
Et du coup tu pourra déplacer le bouton supprimer lien juste au dessus du bouton supprimer tous les liens
ceci est déjà fait dans la version ci-dessus...
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyJeu 22 Mar 2018 - 9:52

Voici une version simplifiée de l'interface. J'ai gardé un des boutons de suppression de liens et je l'ai agrandi - il sert à supprimer tous les liens concernant l'élémént actuellement sélectionné, sans toucher aux autres liens. Ceci peut être utile.

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
    pos% =  user_event_lparam              : ' positon: yyyyxxxx
    xxp% = bin_and(pos%,hex("0000FFFF"))
    yyp% = pos%/65536
   
    if DoPoints%=5
      res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEnew%))
      if res%<0 then return
      if FCEnew%=FCE%
        annulerselection()
        return
      else
        DoPoints% = 0 
        annulerSelLien()
      end_if
    end_if
    if DoPoints%=0
      res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%))
      if res%<0 then return
      annulerSelLien()
      DoPoints% = 4
      active no_SuppLiens%
      hide no_AttributsConnector%
      hide no_AttributsAction%
      hide no_AttributsCondition%
      hide no_AttributsSelection%
      hide no_AttributsStart%
      hide no_AttributsEnd%
    end_if
   
    if DoPoints%>0
      if DoPoints%=1
        NatureOutput% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%))
        if NatureOutput%<0  : ' c'est la nature de l'élément
          message "Ce n'est pas une sortie valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..."
          return
        end_if
        res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,output%)
        DoPoints% = 2
        show no_info%
        clear no_infotext%
        text no_infotext%,"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
        res% = dll_call2("SelectElementInFlowChart",FC%,FCEdest%)
        res% = dll_call2("ShowRulersInFlowChart",FC%,1)
        show no_info%
        clear no_infotext%
        text no_infotext%,"Cliquez maintenant les points d'étape"+chr$(13)+chr$(10)+"puis Tracez ou Annulez..."
        return
      end_if
      if DoPoints%=3
        ' ici, rectangulariser le tracé
        if npt%=0
          res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xx%),adr(yy%))   
        else
          xx% = xarray%(npt%)
          yy% = yarray%(npt%)
        end_if
        if (npt%=0) and (NatureOutput%<>0)  : ' NatureOutput%=0 => Connector seul
          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
       
if 1=2       
s$ = "avant: npt%="+str$(npt%)
for i%=1 to npt%
  s$ = s$ + chr$(13)+chr$(10)+str$(xarray%(i%))+","+str$(yarray%(i%))
next i%
message s$
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%
if 1=2
s$ = "après: npt%="+str$(npt%)
for i%=1 to npt%
  s$ = s$ + chr$(13)+chr$(10)+str$(xarray%(i%))+","+str$(yarray%(i%))
next i%
message s$
end_if     

      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é"
        hide no_info%
        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%
            DecoderRGB(no_Action_Couleur%,no_ActionColor%,ccc%)
'            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%
            DecoderRGB(no_Condition_Couleur%,no_ConditionColor%,ccc%)
'            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)
            DecoderRGB(no_Selection_Couleur%,no_SelectionColor%,ccc%)
            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%
            DecoderRGB(no_Start_Couleur%,no_StartColor%,ccc%)
            text no_Start_Titre%,item_read$(no_memo%,1)
            item_delete no_memo%,1
          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%
            DecoderRGB(no_End_Couleur%,no_EndColor%,ccc%)
            text no_End_Titre%,item_read$(no_memo%,1)
            item_delete no_memo%,1
        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."
          res% = dll_call2("DrawFlowChart",FC%,1)
          return
        end_if
'        message "Lien "+str$(res%)+" identifié"
       
        res% = dll_call3("SelectLinkInFlowChart",FC%,FCL%,adr(ccc%))
        res% = dll_call2("SelectComboBoxItem",handle(no_NatureLink%),res%+1)
        DecoderRGB(no_Link_Couleur%,no_LinkColor%,ccc%)
        res% = dll_call2("DrawFlowChart",FC%,5)
        show no_AttributsLink%
'        text no_Link_Couleur%,right$(hex$(ccc%),6)
      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

valider_connector:
  valider_connector()
  return
 
valider_action:
  valider_action()
  return
 
valider_Condition:
  valider_Condition()
  return
 
supprimerliens:
  supprimerliens()
  return
 
supprimerTousLiens:
  supprimerTousLiens()
  return
 
valider_Selection:
  valider_Selection()
  return

valider_start:
  valider_start()
  return
 
valider_end:
  valider_end()
  return
 
valider_Link:
  valider_Link()
  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
 
SelCouleurAction:
  SelCouleurAction()
  return
 
SelCouleurCondition:
  SelCouleurCondition()
  return
 
SelCouleurSelection:
  SelCouleurSelection()
  return
 
SelCouleurStart:
  SelCouleurStart()
  return
 
SelCouleurEnd:
  SelCouleurEnd()
  return
 
SelCouleurLink:
  SelCouleurLink()
  return 

supprimer_connector:
  supprimer_connector()
  return
 
supprimer_action:
  supprimer_action()
  return
 
supprimer_condition:
  supprimer_condition()
  return
 
supprimer_selector:
  supprimer_selector()
  return
 
supprimer_start:
  supprimer_start()
  return
 
supprimer_end:
  supprimer_end()
  end

supprimer_Link:
  supprimer_Link()
  return
 
 
sub labels()
  label AddConnector, AddAction, AddCondition, AddSelector, AddStart, AddEnd
  label valider_connector, valider_action, valider_Condition, valider_Selection
  label valider_Start, valider_End, valider_Link
  label supprimerliens, UserEvent, sortir
  label selectionLien, annulerSelLien, supprimerTousLiens
  label SelCouleurAction, SelCouleurCondition, SelCouleurSelection
  label SelCouleurStart, SelCouleurEnd, SelCouleurLink
  label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet
  label lier, annulerlier, tracer, exporter
  label supprimer_connector, supprimer_action, supprimer_condition, supprimer_selector
  label supprimer_start, supprimer_end, supprimer_link
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%, s$
  dim npt%, xarray%(100),yarray%(100)
  dim no%, no1%, no2%, no_cElements%, no_SuppLiens%, no_memo%, no_open%, no_save%
  dim no_AttributsConnector%, no_AttributsAction%, no_AttributsCondition%
  dim no_AttributsSelection%, no_AttributsStart%, no_AttributsEnd%, no_AttributsLink%
  dim no_Connector_X%, no_Connector_Y%, no_AnnLink%, no_Tracer% , no_Info%, no_infotext%
  dim no_Action_X%, no_Action_Y%, no_Action_Titre%, no_action_Couleur%, no_ActionColor%
  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%, no_ConditionColor%
  dim no_Selection_X%, no_Selection_Y%, no_Selection_Titre%, no_selection_Couleur%, no_SelectionColor%
  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%, no_startcolor%
  dim no_End_X%, no_End_Y%, no_End_Largeur%, no_End_Hauteur%, no_end_Couleur%, no_EndColor%
  dim no_Link_Couleur%, no_LinkColor%, no_cStatus%, no_StatusText%, no_NatureLink%
  dim no_AnnSelLink%, no_DelLink%, no_DelLinkAll%, no_Start_Titre%, no_End_Titre%
  dim FC%, FCE%, FCEstart%, FCEdest%, FCL%, FCEnew%
  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()
  dim_local hnd%
  dll_on KGF$
  no% = no% + 1 : form no% : hide no% : no_info% = no% : width no%,400 : height no%,200
  no% = no% + 1 : memo no% : no_infotext% = no% : parent no%,no_info% : full_space no% : bar_both no% : font_size no%,12
 
  no% = no% + 1 : container no% : no_cElements% = no% : width no%,200 : caption no%,"Eléments"
'  no% = no% + 1 : container no% : no_cStatus% = no% : width no%,width_client(0)-width(no_cElements%) : height no%,40
'    top no%,height_client(0)-40 : left no_cStatus%,width(no_cElements%) : caption no%,"Status"
  FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%)
  full_space 0
'  top no_cStatus%,height_client(0)-40 : width no%,width_client(0)-width(no_cElements%) : caption no_cStatus%,"Status"
'  no% = no% + 1 : alpha no% : parent no%,no_cStatus% : no_StatusText% = no%
  res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0))
  height no_cElements%,355
  res% = dll_call2("ShowRulersInFlowChart",FC%,0)
  top no_info%,0 : left no_info%,width_client(0)-width(no_info%)-width(no_cElements%)
 
  hnd% = dll_call1("GetHandleOfFlowChart",FC%)
  res% = dll_call3("SetFormParent",handle(no_info%),hnd%,0)
 
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Début"
    top no%,15 : left no%,10 : on_click no%,AddStart
  no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Connecteur"
    top no%,top(no%-1)+height(no%-1) : 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%,"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% : no_SuppLiens% = no% : caption no%,"Supprimer liens de l'élément" : inactive no%
    top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : width no%,2*width(no%) : 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_DelLinkAll% = no% : caption no%,"Supprimer tous les liens" : inactive no%
    top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,supprimerTousLiens

    ' 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
  no% = no% + 1 : button no% : parent no%,no_AttributsConnector% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
    caption no%,"Supprimer" : on_click no%,supprimer_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 : panel no%  : no_ActionColor% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurAction
  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
  no% = no% + 1 : button no% : parent no%,no_AttributsAction% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
    caption no%,"Supprimer" : on_click no%,supprimer_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 : panel no%  : no_ConditionColor% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurCondition
  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
  no% = no% + 1 : button no% : parent no%,no_AttributsCondition% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
    caption no%,"Supprimer" : on_click no%,supprimer_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 : panel no%  : no_SelectionColor% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurSelection
  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
  no% = no% + 1 : button no% : parent no%,no_AttributsSelection% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
    caption no%,"Supprimer" : on_click no%,supprimer_selector


  ' 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 : panel no%  : no_StartColor% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurStart
  no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Titre:"
  no% = no% + 1 : edit no% : no_Start_Titre% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80
    width no%,110
  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
  no% = no% + 1 : button no% : parent no%,no_AttributsStart% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
    caption no%,"Supprimer" : on_click no%,supprimer_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 : panel no%  : no_EndColor% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurEnd
  no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Titre:"
  no% = no% + 1 : edit no% : no_End_Titre% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80
    width no%,110
  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
  no% = no% + 1 : button no% : parent no%,no_AttributsEnd% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
    caption no%,"Supprimer" : on_click no%,supprimer_End

' Attributs Link
  no% = no% + 1 : container no% : no_AttributsLink% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%)
    height no%,300 : caption no%,"Attributs Lien" : hide no%
  no% = no% + 1 : alpha no% : parent no%,no_AttributsLink% : top no%,20 : left no%,10
    caption no%,"Couleur RGB:"
  no% = no% + 1 : edit no% : no_Link_Couleur% = no% : parent no%,no_AttributsLink% : top no%,top(no%-1) : left no%,80
    width no%,50
  no% = no% + 1 : panel no%  : no_LinkColor% = no% : parent no%,no_AttributsLink% : top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1)
    width no%,25 : height no%,20 : color no%,0,0,0 : on_click no%,SelCouleurLink
  no% = no% + 1 : alpha no% : parent no%,no_AttributsLink% : top no%,top(no%-1)+25 : left no%,10
    caption no%,"Nature:"
  no% = no% + 1 : combo no% : parent no%,no_AttributsLink% : no_NatureLink% = no% : top no%,top(no%-1) : left no%,80 : width no%,80
    item_add no%,"Polygon" : item_add no%,"Bézier"
  no% = no% + 1 : button no% : parent no%,no_AttributsLink% : top no%,height(no_AttributsLink%)-30 : left no%,20
    caption no%,"Valider" : on_click no%,valider_Link
  no% = no% + 1 : button no% : parent no%,no_AttributsLink% : top no%,height(no_AttributsConnector%)-30 : left no%,left(no%-1)+Width(no%-1)
    caption no%,"Supprimer" : on_click no%,supprimer_Link

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()
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()
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()
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()
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()
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()
end_sub

sub annulerselection()
  DoPoints% = 0
  inactive no_SuppLiens%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
  hide no_AttributsLink%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
  hide no_info%
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()
  dim_local titre$
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Start_X%),position(no_Start_Y%),position(no_Start_Largeur%),position(no_Start_Hauteur%))
  titre$ = trim$(text$(no_Start_Titre%))
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),0)
  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()
  dim_local titre$
  res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_End_X%),position(no_End_Y%),position(no_End_Largeur%),position(no_End_Hauteur%))
  titre$ = trim$(text$(no_End_Titre%))
  res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),0)
  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 valider_Link()
  res% = dll_call3("ColorForLinkOfFlowChart",FC%,FCL%,hex(text$(no_Link_couleur%)))
  res% = dll_call3("SetTypeOfFlowChartLink",FC%,FCL%,item_index(no_NatureLink%)-1)
  res% = dll_call3("SelectLinkInFlowChart",FC%,0,adr(ccc%))
  res% = dll_call2("DrawFlowChart",FC%,5)
  hide no_AttributsLink%
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()
  annulerSelLien()
  AnnulerSelection()
  DoPoints% = 1
  npt% = 0
  show no_info%
  clear no_infotext%
  text no_infotext%,"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("SelectElementInFlowChart",FC%,0)
  res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0)
  res% = dll_call2("DrawFlowChart",FC%,1)
  inactive no_AnnLink%
  inactive no_Tracer%
  hide no_info%
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
if 1=2
s$ = "final: npt%="+str$(npt%)
for i%=1 to npt%
  s$ = s$ + chr$(13)+chr$(10)+str$(xarray%(i%))+","+str$(yarray%(i%))
next i%
message s$
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("SelectElementInFlowChart",FC%,0)
  res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0)
'  res% = dll_call2("DrawFlowChart",FC%,1)
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  inactive no_AnnLink%
  inactive no_Tracer%
  hide no_info%
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()
  AnnulerSelection()
  DoPoints% = 6
  npt% = 0
  show no_info%
  clear no_infotext%
  text no_infotext%,"Cliquer sur un lien..."
  res% = dll_call2("DrawFlowChart",FC%,5) 
  active no_AnnSelLink%
  active no_DelLink%
  active no_DelLinkAll%
end_sub
 
sub annulerSelLien()
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  res% = dll_call3("SelectLinkInFlowChart",FC%,0,adr(ccc%))
  res% = dll_call2("DrawFlowChart",FC%,1)
  inactive no_AnnSelLink%
  inactive no_DelLinkAll%
  hide no_info%
end_sub
 
sub supprimerTousLiens()
  res% = dll_call1("DeleteAllLinksFromFlowChart",FC%)
  hide no_info%
end_sub

sub SelCouleurAction()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Action_Couleur%,no_ActionColor%,ccc%)
end_sub

sub SelCouleurCondition()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Condition_Couleur%,no_ConditionColor%,ccc%)
end_sub

sub SelCouleurSelection()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Selection_Couleur%,no_SelectionColor%,ccc%)
end_sub

sub SelCouleurStart()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Start_Couleur%,no_StartColor%,ccc%)
end_sub

sub SelCouleurEnd()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_End_Couleur%,no_EndColor%,ccc%)
end_sub

sub SelCouleurLink()
  dim_local R%, G%, B%
  res% = dll_call6("ColorSelector",handle_application,0,adr(R%),adr(G%),adr(B%),adr(ccc%))
  if res%=0 then DecoderRGB(no_Link_Couleur%,no_LinkColor%,ccc%)
end_sub

sub DecoderRGB(no_Text%,no_Picture%,RGB%)
  dim_local R%, G%, B%, n%
  text no_text%,hex$(RGB%)
  R% = bin_and(RGB%,hex("FF"))
  G% = bin_and(RGB%/256,hex("FF"))
  B% = bin_and(RGB%,hex("FF0000"))/65536
  color no_Picture%,R%,G%,B%
end_sub

sub supprimer_connector()
  res% = dll_call2("RemoveElementFromFlowChart",FC%,FCE%)
  res% = dll_call2("DrawFlowChart",FC%,1)
  hide no_AttributsConnector%
end_sub

sub supprimer_action()
  res% = dll_call2("RemoveElementFromFlowChart",FC%,FCE%)
  res% = dll_call2("DrawFlowChart",FC%,1)
  hide no_AttributsAction%
end_sub

sub supprimer_condition()
  res% = dll_call2("RemoveElementFromFlowChart",FC%,FCE%)
  res% = dll_call2("DrawFlowChart",FC%,1)
  hide no_AttributsCondition%
end_sub

sub supprimer_selector()
  res% = dll_call2("RemoveElementFromFlowChart",FC%,FCE%)
  res% = dll_call2("DrawFlowChart",FC%,1)
  hide no_AttributsSelection%
end_sub

sub supprimer_start()
  res% = dll_call2("RemoveElementFromFlowChart",FC%,FCE%)
  res% = dll_call2("DrawFlowChart",FC%,1)
  hide no_AttributsStart%
end_sub

sub supprimer_end()
  res% = dll_call2("RemoveElementFromFlowChart",FC%,FCE%)
  res% = dll_call2("DrawFlowChart",FC%,1)
  hide no_AttributsEnd%
end_sub

sub supprimer_link()
  DoPoints% = 0
  res% = dll_call1("DeleteLinkFromFlowChart",FCL%)
  hide no_info%
  hide no_attributsLink%
end_sub


Dernière édition par Klaus le Ven 23 Mar 2018 - 11:00, édité 2 fois
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
silverman

silverman


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyJeu 22 Mar 2018 - 12:03

Si tu veux que le tracé passe par les attracteurs, tu peux utiliser l'algoritme du 'catmull-rom'.
Un code rapidement traduit d'un autre langage (darkbasic classic):
Code:
' InitLibraryStart
   Dim Errorfnc$(10)
   Dim Resetchecking(3)
       Resetchecking(0)=1
   Dim MaxMatrix(0)
      ' 36 matrix can be created
       MaxMatrix(0)=36
   Dim MaxVector(0)
      ' 265 vectors can be created
       MaxVector(0)=265
   ' add 10 internals vectors/matrix
   dim MaxMaxVector,MaxMaxMatrix
   MaxMaxVector=MaxVector(0)+10
   MaxMaxMatrix=MaxMatrix(0)+10
   Dim Matrix4(MaxMaxMatrix, 19)
   Dim Vector4(MaxMaxVector, 6)
   Dim v257,v258,v259,v265,r
   Dim xa,ya,xb,yb,xc,yc,xd,yd
   Dim cx,cy,dx,dy,fx,fy
' InitLibraryEnd


' Catmull-Rom Spline:
'  The points that define a spline are known as "Control Points".
'  One of the features of the Catmull-Rom spline is that the specified curve will pass through all of the control
'  points - this is not true of all types of splines.
'
'  To calculate a point on the curve, two points on either side of the desired point are required, like this:
'
'              P
'              |
'              |
'              |
'   A-----B---------C-------D
'      t=0.0     t=1.0
'
'  The point is specified by a value t that signifies the portion of the distance between the two nearest
'  control points.
'  Given the control points "VectorA", "VectorB", "VectorC", and "VectorD", and the value t "Value#", the
'  location of the point P can be calculated in "VectorResult".


'  CatmullRomVector2(VectorResult, VectorA, VectorB, VectorC, VectorD, Value#)
'
' VectorResult : vector containing the coordinates of the point reached
' VectorA : control point A
' VectorB : control point B
' VectorC : control point C
' VectorD : control point D
' Value# : portion of the distance between(0.0 <= value# <= 1.0) the two nearest control points


color 0,0,0,0
font_bold 0
font_color 0,255,255,255

' make vectors
dim vecA,vecB,vecC,vecD,vecE,vecF,vecG,vecResult,null

vecA=1
vecB=2
vecC=3
vecD=4
vecE=5
vecF=6
vecG=7
vecResult=8
null=makevector2(vecA)
null=makevector2(vecB)
null=makevector2(vecC)
null=makevector2(vecD)
null=makevector2(vecE)
null=makevector2(vecF)
null=makevector2(vecG)
null=makevector2(vecResult)


' set coordinates
setvector2(vecA, -22.0,  -5.0)
setvector2(vecB, -18.0,  0.0)
setvector2(vecC, -12.0,  6.0)
setvector2(vecD,   2.0, 14.0)
setvector2(vecE,  10.0,  4.0)
setvector2(vecF,  12.0,  0.0)
setvector2(vecG,  16.0,  0.0)


' calcule the CatmullRomVector2
dim Value,vector

' red portion
2d_pen_color 255,0,0
Value=-0.05
repeat
   Value=Value+0.05
   CatmullRomVector2(vecResult, vecA, vecB, vecC, vecD, Value)
   ' view result
   tracepoint(vecResult,"")
   if scancode=27 then terminate
until Value>=1.0

' green portion
2d_pen_color 0,255,0
Value=-0.05
repeat
   Value=Value+0.05
   CatmullRomVector2(vecResult, vecB, vecC, vecD, vecE, Value)
   ' view result
   tracepoint(vecResult,"")
   if scancode=27 then terminate
until Value>=1.0

' blue portion
2d_pen_color 0,0,255
Value=-0.05
repeat
   Value=Value+0.05
   CatmullRomVector2(vecResult, vecC, vecD, vecE, vecF, Value)
   ' view result
   tracepoint(vecResult,"")
   if scancode=27 then terminate
until Value>=1.0

' yellow portion
2d_pen_color 255,255,0
Value=-0.05
repeat
   Value=Value+0.05
   CatmullRomVector2(vecResult, vecD, vecE, vecF, vecG, Value)
   ' view result
   tracepoint(vecResult,"")
   if scancode=27 then terminate
until Value>=1.0

' display coordinates vectors
2d_pen_color 255,255,255
for vector = vecA to vecG
   tracepoint(vector,chr$(64+vector))
next vector


' trace line between vecB to vecF
tracesegment(vecB,vecC)
tracesegment(vecC,vecD)
tracesegment(vecD,vecE)
tracesegment(vecE,vecF)




END
fnc SetVector2(Vector, X, Y)
   Vector4(Vector, 1)=X
   Vector4(Vector, 2)=Y
end_fnc

fnc MakeVector2(Vector)
 dim_local I
   For I=1 To 4
      Vector4(Vector, I)=0.0
   Next I
   result 0
end_fnc

fnc CatmullRomVector2(VectorResult, VectorA, VectorB, VectorC, VectorD, Value)
   v257=MaxVector(0)+2
   v258=MaxVector(0)+3
   v259=MaxVector(0)+4
   v265=MaxVector(0)+10
   r=MakeVector2(v257)
   r=MakeVector2(v258)
   r=MakeVector2(v259)
   r=MakeVector2(v265)
   XA=XVector2(VectorA)
   YA=YVector2(VectorA)
   XB=XVector2(VectorB)
   YB=YVector2(VectorB)
   XC=XVector2(VectorC)
   YC=YVector2(VectorC)
   XD=XVector2(VectorD)
   YD=YVector2(VectorD)
   SetVector2(v257, XA, YA)
   SetVector2(v258, XB, YB)
   SetVector2(v259, XC, YC)
   SetVector2(v265, XD, YD)
   MultiplyVector2(v257, (-1.0*power(Value,3))+( 2.0*power(Value,2))-Value)
   MultiplyVector2(v258, ( 3.0*power(Value,3))+(-5.0*power(Value,2))+2.0)
   MultiplyVector2(v259, (-3.0*power(Value,3))+( 4.0*power(Value,2))+Value)
   MultiplyVector2(v265, (power(Value,3))-(power(Value,2)))
   AddVector2(VectorResult, v257, v258)
   AddVector2(VectorResult, VectorResult, v259)
   AddVector2(VectorResult, VectorResult, v265)
   DivideVector2(VectorResult, 2.0)
end_fnc

fnc XVector2(Vector)
   Result Vector4(Vector, 1)
end_fnc


fnc YVector2(Vector)
   Result Vector4(Vector, 2)
end_fnc

fnc MultiplyVector2(VectorResult, Value)
   Vector4(VectorResult, 1)=Vector4(VectorResult, 1)*Value
   Vector4(VectorResult, 2)=Vector4(VectorResult, 2)*Value
end_fnc

fnc AddVector2(VectorResult, VectorA, VectorB)
   Vector4(VectorResult, 1)=Vector4(VectorA, 1)+Vector4(VectorB, 1)
   Vector4(VectorResult, 2)=Vector4(VectorA, 2)+Vector4(VectorB, 2)
end_fnc

fnc DivideVector2(VectorResult, Value)
   Vector4(VectorResult, 1)=Vector4(VectorResult, 1)*(power(Value,0-1))
   Vector4(VectorResult, 2)=Vector4(VectorResult, 2)*(power(Value,0-1))
end_fnc



' fonction pour la démo
fnc tracesegment(vectorA,vectorB)
   cx=width(0)/2
   cy=height(0)/2
   dx=cx+(xvector2(vectorA)*10)
   dy=cy-(yvector2(vectorA)*10)
   fx=cx+(xvector2(vectorB)*10)
   fy=cy-(yvector2(vectorB)*10)
   2d_line dx,dy,fx,fy
end_fnc

fnc tracepoint(vector,t$)
   cx=width(0)/2
   cy=height(0)/2
   fx=cx+(xvector2(vector)*10)
   fy=cy-(yvector2(vector)*10)
   2d_circle fx,fy,2
   print_locate fx+2,fy+2 : print t$
end_fnc
Revenir en haut Aller en bas
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyJeu 22 Mar 2018 - 12:13

Merci, Silverman. J'avais trouvé cet algorithme, et il y en a d'autres. Le gros problème, c'est que tous ces algorithmes génèrent la courbe point par point, et donc passent des 4, 8 ou 10 points d'itinéraire pointés à plusieurs centaines, voir plus. C'est ce que je veux éviter.

J'utilise une API Windows (rendue accessible en Delphi) pour générer une courbe Bézier directement dans le canvas d'un objet. Je ne mémorise que les attracteurs, le reste est fait par Windows. Les seuls méthodes de traçade de lignes directement accessible par API sont:
- segments de lignes droites ou polygone ouvert
- rectangle (fermé)
- ellipse (fermée !)
- courbe Bézier, transformant deux points sur trois en attracteurs, le trosième restant un point d'itinéraire

C'est cette dernière méthode que j'ai choisie.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


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

Un essai de construction d'organigramme par Panoramic - Page 5 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 5 EmptyVen 23 Mar 2018 - 18:42

Nouvelle version:

Maintenant, chaque élément a un nom propre. Par défaut, c'est le nom de la nature de l'élément, suivi du numéro d'ordre. Par exemple, Action1, Action2, Selector1, etc. Ce nom est présenté dans les propriétés de l'élément lors de la sélection, et il peut être remplacé par n'importe quelle chaîne de caractères. Il n'y a pas de contrôle de noms doubles.

Dans le premier cadre des touches fonctions, il y a maintenant une combo donnant les noms de tous les éléments existants. Un clic sur un de ces noms sélectionne l'élément exactement comme si l'on avait cliqué sur l'élément dans l'organigramme. Et si l'organigramme est plus grand que la fenêtre d'affichage et l'élément sélectionné n'est pas ou seulement partiellement visible, la fenêtre de visualisation sera automatiquement déplacée de sorte que l'élément choisi sera entièrement visible avec une marge minimale de 50 pixels autour.

Le programme est maintenant trop grand pour pouvoir être posté ici. J'ai donc créé un dossier FlowChartDesigner dans mon WebDav dans lequel je place KGF.dll et FlowChartDesigner.bas.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Contenu sponsorisé





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

Revenir en haut Aller en bas
 
Un essai de construction d'organigramme par Panoramic
Revenir en haut 
Page 5 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: