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 2 Emptypar papydall Aujourd'hui à 0:49

» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
Un essai de construction d'organigramme par Panoramic - Page 2 Emptypar Yannick Hier à 18:32

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

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

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

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

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

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

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

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

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

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

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

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

» Form(résolu)
Un essai de construction d'organigramme par Panoramic - Page 2 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
-29%
Le deal à ne pas rater :
PC portable – MEDION 15,6″ FHD Intel i7 – 16 Go / 512Go (CDAV : ...
499.99 € 699.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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyMar 13 Mar 2018 - 22:37

Citation :
Je n'ai pas pu sélectionner le point de connexion qui s'affiche dès que l'on clique sur l'élément "Début"
Je viens de remettre une version de KGF.dll sur le WebDav qui corrige cela. Elle affiche également le point de connexion au bin endroit... Very Happy .

Citation :
Autre remarque : les couleurs R et B sont inversées. Ainsi la couleur FF0000 donne du bleu et 0000FF donne du rouge.
Oh non ! C'est bien dans le bon ordre. Regarde le poids des octets: R est bien dans l'octet de poids faible, puis vient G, pour finir par B ayant le poids le plus fort.


Je continue à compléter et perfectionner ce programme.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Marc

Marc


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

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

Citation :
Oh non ! C'est bien dans le bon ordre. Regarde le poids des octets: R est bien dans l'octet de poids faible, puis vient G, pour finir par B ayant le poids le plus fort.

Pour moi, c'est l'inverse... R est le poids fort et B le poids faible.

Donc FF0000 devrait donner du rouge

et 0000FF devrait donner du bleu.

Quant au G, nous sommes d'accord ! Very Happy
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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyMar 13 Mar 2018 - 23:54

Désolé, Marc, mais tu fais erreur. Ce n'est pas parce que le R est la première lettre du triplet RGB que cette valeur doit figurer à gauche dans une représentation hexadécimale d'un entier de 32 bits ! Cette valeur est au contraire le premier octet dans un mot de 32 bits, le R est le deuxième octet, et le B est le troisième octet, ce qui explique l'ordre des lettres RGB, dans le même ordre que le rangement en mémoire: R en offset 0, G en offset 1 et B en offset 2. Voici la documentation de Embarcadero:
Un essai de construction d'organigramme par Panoramic - Page 2 Aa148
Regarde bien les valeurs pour Bleu et Rouge...
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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyMar 13 Mar 2018 - 23:57

Nouvelle version de KGF.dll dans le WebDav, avec une amélioration visuelle:
- séparation nette entre la phase de création d'un objet et la phase de sélection
- visualisation de l'objet sélectionné en jaune, sauf s'il était déjà en jaune - dans ce cas, il devient rouge. Sélectionner un autre objet ou annuler la sélection fait revenir l'objet sélectionné à sa couleur d'oirigine.

Voici le programme qui va avec cette version:
Code:
' FlowChartDesigner.bas

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

on_user_event UserEvent

end

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

  return


sortir:
  terminate

AddConnector:
  AddConnector()
  return

AddAction:
  AddAction()
  return

AddCondition:
  AddCondition()
  return

AddSelector:
  AddSelector()
  return

AddStart:
  AddStart()
  return

AddEnd:
  AddEnd()
  return

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

end_sub

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

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

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

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

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

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

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

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

sub annulerselection()
  DoPoints% = 0
  inactive no_AnnSel%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
end_sub

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Marc


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

Un essai de construction d'organigramme par Panoramic - Page 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyMer 14 Mar 2018 - 0:41

Citation :
Nouvelle version de KGF.dll dans le WebDav, avec une amélioration visuelle:
Parfaitement opérationnel ! L'objet sélectionné passe bien au jaune.

Autrement, un petit bug : les sorties du Sélecteur ne sont pas où il faut :

Un essai de construction d'organigramme par Panoramic - Page 2 167

Quant au codage hexa de la couleur, je pense que nous avons tous les deux raison. Il semble exister 2 normes : RRGGBB et BBGGRR.
La plupart des convertisseurs en ligne donne la norme RRGGBB.

Spoiler:
Spoiler:

Pardonne-moi d'avoir pollué ton fil de discussion avec cette histoire de couleur.

Bonne continuation.
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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyMer 14 Mar 2018 - 1:27

Il n'y a pas de problème Marc ! Ce genre d'échange est utile pour d'autres, également. Et je suis heureux de voir que quelqu'un s'intéresse à mon code et plonge dedans, avant même que la doc officielle ne soit disponible !

En ce qui concerne le sélecteur, je l'ai constaté éalement. Je vais y remédier, mais pour le moment, je poursuis la suite de ce que j'ai commencé avec la sélection: le déplacement d'un objet à l'aide de la souris. Délicat, car la partie visible des objets est juste une portion de canvas d'une vaste bitmap, il n'y a pas de handle, et déplacer cela est délicat. Mais j'y travaille.
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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyMer 14 Mar 2018 - 7:26

Bonjour klaus !

J'ai testé aussi la dernière version et l'élément sélectionné fonctionne bien avec le passage à la couleur jaune.
Le plus rébarbatif maintenant c'est le message mais j'imagine que tu les retirera ensuite ou bien avec une option d'affichage...

Bravo Klaus, ton constructeur avance bien. Bon courage pour la suite

PS : Comme Marc, j'ai rencontré 1 ou 2 fois le problème de sortie mais c'était sur l'élément DÉBUT et dès le départ.
c'était hier soir sur une version précédente. 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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyMer 14 Mar 2018 - 9:24

Citation :
Le plus rébarbatif maintenant c'est le message
Tu parles des deux messages qui précèdent et suivent la sélection, n'est-ce oas ? C'est en effet provisoire - une sorte d'aide à l'exploitation. Je pense remplacer cela par un texte affiché dans une barre d'état en bas de l'écran.

Citation :
Comme Marc, j'ai rencontré 1 ou 2 fois le problème de sortie mais c'était sur l'élément DÉBUT et dès le départ.
c'était hier soir sur une version précédente.
Je pense que c'est corrigé, maintenant ?
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Marc

Marc


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

Un essai de construction d'organigramme par Panoramic - Page 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyMer 14 Mar 2018 - 10:33

Bonjour à tous !

@Klaus
Juste une petite idée (tu y as peut-être déjà pensé) : pouvoir afficher une grille pour aligner les éléments.
Peut-être une matrice de points comme sur l'exemple ci-dessous ou un quadrillage.
Quant au pas ... 50x50 pixels ?

Bonne journée et bonne continuation !

Spoiler:
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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyJeu 15 Mar 2018 - 1:33

@Marc:
L'idée du cadrillage est bonne. Je vais voir ce que je peux faire. Cela ne devrait pas être trop difficile.

Nouvelle version (KGF.dll sur le WebDav, dossier DLLs):
Maintenant, on peut déplacer un objet sélectionné (dont la couleur a changé !) par la souris. On l'accroche en enfonçant le bouton droit sur l'objet et, tout en maintenant le bouton droit enfoncé, on tire la souris. L'objet avec ses connecteurs suivra, et restera en place en relâchant le bouton droit. Et les champs "Position X" et "Position Y" sont actualisés automatiquement !

Les deux prochaines étapes en préparation:
1. faire suivre automatiquement les liens
2. ajuster la taille de l'objet par la molette de la souris

Voici la version du programme qui fait ça:
Code:
' FlowChartDesigner.bas

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

on_user_event UserEvent

end

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

  return


sortir:
  terminate

AddConnector:
  AddConnector()
  return

AddAction:
  AddAction()
  return

AddCondition:
  AddCondition()
  return

AddSelector:
  AddSelector()
  return

AddStart:
  AddStart()
  return

AddEnd:
  AddEnd()
  return

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

end_sub

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

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

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

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

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

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

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

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

sub annulerselection()
  DoPoints% = 0
  inactive no_AnnSel%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
end_sub

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  res% = dll_call6("ConnectElementsOfFlowChart",FC%,FCEstart%,output%,FCEdest%,adr(xArray%),adr(yArray%))
  if res%=0 then message "Erreur en créant la connexion"
  res% = dll_call2("ShowRulersInFlowChart",FC%,0)
  res% = dll_call1("DrawFlowChart",FC%)
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  inactive no_AnnLink%
  inactive no_Tracer%
end_sub
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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyJeu 15 Mar 2018 - 7:58

Pas le temps de regarder le matin mais je prendrai du temps ce soir... 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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyJeu 15 Mar 2018 - 16:58

Nouvelle version dans le WebDav, dossier DLLs. Maintenant, en déplaçant un objet sélectionné par la souris bouton droit enfoncé, non seulement l'objet se déplace et met à jour les valeurs des SPINs de position dans les propriétés de l'IDE, mais les liens égalenemt restent attachés et suivent l'objet. Bon, c'est rudimentaire pour le moment, mais le plus dur est fait - faire suivre les liens.

Suite prévue:
1. améliorer la présentation des liens après un déplacement d'objet
2. ajuster la taille de l'objet par la molette de la souris

Voici la version actuelle du programme:
Code:
' FlowChartDesigner.bas

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

on_user_event UserEvent

end

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

  return


sortir:
  terminate

AddConnector:
  AddConnector()
  return

AddAction:
  AddAction()
  return

AddCondition:
  AddCondition()
  return

AddSelector:
  AddSelector()
  return

AddStart:
  AddStart()
  return

AddEnd:
  AddEnd()
  return

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

end_sub

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

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

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

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

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

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

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

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

sub annulerselection()
  DoPoints% = 0
  inactive no_AnnSel%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
end_sub

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  res% = dll_call6("ConnectElementsOfFlowChart",FC%,FCEstart%,output%,FCEdest%,adr(xArray%),adr(yArray%))
  if res%=0 then message "Erreur en créant la connexion"
  res% = dll_call2("ShowRulersInFlowChart",FC%,0)
  res% = dll_call1("DrawFlowChart",FC%)
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  inactive no_AnnLink%
  inactive no_Tracer%
end_sub
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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyJeu 15 Mar 2018 - 18:21

Nouvelle version de KGF.dll dans le WebDav, dossier DLLs. On peut maintenant supprimer tous les liens concernant un objet particulier. Ceci est utilisé dans la version ci-dessous de l'IDE. Si, lors d'un déplacement d'un objet par la souris, le tracé des liens n'est plus acceptable, on peut maintenant utiliser le nouveau bouton "Supprimer Liens" pour supprimer tous les liens concernant l'objet sélectionné.

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

  return


sortir:
  terminate

AddConnector:
  AddConnector()
  return

AddAction:
  AddAction()
  return

AddCondition:
  AddCondition()
  return

AddSelector:
  AddSelector()
  return

AddStart:
  AddStart()
  return

AddEnd:
  AddEnd()
  return

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

end_sub

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

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

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

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

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

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

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

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

sub annulerselection()
  DoPoints% = 0
  inactive no_AnnSel%
  inactive no_SuppLiens%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
end_sub

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  res% = dll_call6("ConnectElementsOfFlowChart",FC%,FCEstart%,output%,FCEdest%,adr(xArray%),adr(yArray%))
  if res%=0 then message "Erreur en créant la connexion"
  res% = dll_call2("ShowRulersInFlowChart",FC%,0)
  res% = dll_call1("DrawFlowChart",FC%)
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  inactive no_AnnLink%
  inactive no_Tracer%
end_sub
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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyJeu 15 Mar 2018 - 18:46

Je viens de tester le déplacement des objets Klaus ! Je confirme que cela fonctionne bien. cheers
Il faut juste s'habituer au clic de droite sinon rien ne se passe. Laughing

Concernant la mise en place des liens, je pense que tu devrais chercher une autre piste...
Je trouve qu'elle est approximative et peu pratique. mais bon c'est mon point de vu.

C'est vrai que pour le moment, le principal c'est de tester le fonctionnement de l'ensemble,
et c'est plutôt pas mal comme résultat !  

Continue comme çà. Je suis ton projet de près... 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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyJeu 15 Mar 2018 - 19:18

Citation :
Je trouve qu'elle est approximative et peu pratique.
Entièrement d'accord avec toi. Je suis en train de coder une façon différente, mais c'est compliqué. Faudra attendre...
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Marc

Marc


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

Un essai de construction d'organigramme par Panoramic - Page 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyJeu 15 Mar 2018 - 21:19

Bonsoir à tous !

Bonsoir Klaus et Minibug !

@Klaus :

Très belle avancée !

Les liens qui suivent l'élément en cours de déplacement : SUPER !
La suppression de tous les liens d'un objet fonctionne bien.
Le déplacement d'un objet sélectionné avec le clic droit de la souris fonctionne bien.

Minibug a écrit:
Continue comme çà. Je suis ton projet de près...
Tu es surveillé de près !

Hors sujet  : Dans quelques temps, quand tu auras un moment de libre, j'aurai besoin, s'il te plait, d'un coup de main pour faire fonctionner une DLL via Panoramic.

Bonne continuation !
Revenir en haut Aller en bas
Marc

Marc


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

Un essai de construction d'organigramme par Panoramic - Page 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyJeu 15 Mar 2018 - 21:46

.... Suite...

Je viens de voir que les connexions de sortie de l'élément Sélection ne suivent pas en abscisse si on déplace ce dernier :

Spoiler:

EDIT :

Parfois je remarque un déphasage entre le curseur de la souris et les règles rouges.
Dans ce cas, c'est bien le pointage de la souris qui est bon et pas l'intersection des lignes rouges.

Spoiler:

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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyVen 16 Mar 2018 - 0:12

Pour l'objet Sélection, je sais qu'il y a un problème de positionnement des connecteurs. Je vais m'y attaquer dès que j'aurai fini le travail avec les liens qui concerne tous les objets. Tu signales un autre problème de positionnement que je n'ai pas encore rencontré. Je vais surveiller cela.

Je te suis reconnaissant des essais que tu fais - ces résultats s'ajoutent à ma propre liste de diagnostics et feront avancer le projet.
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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyVen 16 Mar 2018 - 0:52

Nouvelle version de KGF.dll dans le WebDav, dossier DLLs.

L'objet FlowChart aide mieux maintenant à tracer des liens. Outre l'apparition de petits cercles rouges, le lien est maintenant tracé en rouge, segment par segment, dès qu'on clique sur un endroit visé. Pour le point suivant, on peut aisément viser le cercle rouge précédent ppur obtenir une ligne droite ou à angle droit. Lorqu'on arrive en face du connecteur d'entrée de l'élément ciblé, il suffit de cliquer sur "Tracer", et les cercles rouges ainsi que les segments rouges disparaissent et un lien  noir est affiché. Si l'on voit qu'on s'est trompé dans le traçage, il suffit de cliquer sur "Annuler" à droite du bouton "Lier", et tout s'efface.

Accessoirement, le ciblage d'un point d'itinéraire a été rendu un peu plus facile.

Voici la version de l'IDE qui va avec:
Code:
' FlowChartDesigner.bas

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

on_user_event UserEvent

end

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

  return


sortir:
  terminate

AddConnector:
  AddConnector()
  return

AddAction:
  AddAction()
  return

AddCondition:
  AddCondition()
  return

AddSelector:
  AddSelector()
  return

AddStart:
  AddStart()
  return

AddEnd:
  AddEnd()
  return

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

end_sub

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

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

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

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

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

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

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

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

sub annulerselection()
  DoPoints% = 0
  inactive no_AnnSel%
  inactive no_SuppLiens%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
end_sub

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Je suis en train de réfléchir sur une construction automatique du lien, mais c'est compliqué. A la limite, déterminer le traçage du premier lien peut encore se concevoir, mais dès l'ajout d'un deuxième lien, cela se compique car il faut éviter d'empeinter le chemin d'un lien déjà existant - on ne pourrait plus les distinguer.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Marc

Marc


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

Un essai de construction d'organigramme par Panoramic - Page 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyVen 16 Mar 2018 - 5:13

Citation :
Tu signales un autre problème de positionnement que je n'ai pas encore rencontré.

J'ai remarqué que la "désynchronisation" se produit quand la zone de travail est déplacée avec les ascenseurs :

Spoiler:
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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyVen 16 Mar 2018 - 8:04

Merci, Marc ! J'arrive à le reproduire, et donc à le corriger bientôt !
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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyVen 16 Mar 2018 - 9:22

C'est fait. Le décalage de positionnement des lignes de visée est corrigé.
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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyVen 16 Mar 2018 - 9:29

Nouvelle version dans le WebDav dossier DLLs:
lors du traçage de liens, les lignes de visée restent maintenant à l'intérieur de la fenêtre de l'organigramme, sans être par-dessus toutes les fenêtres. Si le prgramme est minimisé ou recouvert par une autre application, les barres de visée ne sont plus visibles.
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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyVen 16 Mar 2018 - 15:04

Nouvelle version dans le WebDav dossier DLLs:
Le programme peut maintenant changer des dimensions des objets sélectionnés par la souris: bouton droit et SHIFT enfoncé simultanément. Mouvements:
à droite - élargir en largeur
à gauche - rétrécir en largeur
en haut -  réduire en hauteur
en bas - agrandir en hauteur
L'affichage de l'objet Selecteur est corrigé. Les connecteurs sont à la bonne place quelque soient les dimensions, et ils suivent le déplacement de l'objet.

Voici le code du programme:
Code:
' FlowChartDesigner.bas

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

on_user_event UserEvent

end

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

  return


sortir:
  terminate

AddConnector:
  AddConnector()
  return

AddAction:
  AddAction()
  return

AddCondition:
  AddCondition()
  return

AddSelector:
  AddSelector()
  return

AddStart:
  AddStart()
  return

AddEnd:
  AddEnd()
  return

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

end_sub

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

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

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

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

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

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

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

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

sub annulerselection()
  DoPoints% = 0
  inactive no_AnnSel%
  inactive no_SuppLiens%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
end_sub

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  res% = dll_call6("ConnectElementsOfFlowChart",FC%,FCEstart%,output%,FCEdest%,adr(xArray%),adr(yArray%))
  if res%=0 then message "Erreur en créant la connexion"
  res% = dll_call2("ShowRulersInFlowChart",FC%,0)
  res% = dll_call1("DrawFlowChart",FC%)
  DoPoints% = 0
  npt% = 0
  xarray%(0) = 0
  inactive no_AnnLink%
  inactive no_Tracer%
end_sub
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 2 Empty
MessageSujet: Re: Un essai de construction d'organigramme par Panoramic   Un essai de construction d'organigramme par Panoramic - Page 2 EmptyVen 16 Mar 2018 - 16:56

Nouvelle version dans le WebDav dossier DLLs:
Il y a maintenant une ligne "Exporter" dans le menu. Cela ouvre un dialoge pour enregistrer l'image dans un fichier de type BMP, JPG, GOF ou PNG.

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

  return


sortir:
  terminate

AddConnector:
  AddConnector()
  return

AddAction:
  AddAction()
  return

AddCondition:
  AddCondition()
  return

AddSelector:
  AddSelector()
  return

AddStart:
  AddStart()
  return

AddEnd:
  AddEnd()
  return

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

end_sub

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

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

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

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

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

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

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

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

sub annulerselection()
  DoPoints% = 0
  inactive no_AnnSel%
  inactive no_SuppLiens%
  hide no_AttributsConnector%
  hide no_AttributsAction%
  hide no_AttributsCondition%
  hide no_AttributsSelection%
  hide no_AttributsStart%
  hide no_AttributsEnd%
  res% = dll_call2("SelectElementInFlowChart",FC%,0)
end_sub

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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





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

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