Novembre 2024 | Lun | Mar | Mer | Jeu | Ven | Sam | Dim |
---|
| | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | | Calendrier |
|
|
| Un essai de construction d'organigramme par Panoramic | |
| | |
Auteur | Message |
---|
Minibug
Nombre de messages : 4570 Age : 58 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Dim 18 Mar 2018 - 11:57 | |
| - Citation :
- Seule solution: supprimer le lien en cause et le recréer. Heureusement, cela se fait maintenant sans difficultés.
Tout à fait d'accord avec toi. Mais excuses moi d'insister... Mais il me semble que la création du lien prends toujours un point supplémentaire à la fin. Et je pense que le problème et là. Lorsque je crée un lien d'un point à un autre en ligne droite et sans point intermédiaire (2 points), je me rends compte qu'il y a toujours un 'bout' de lien qui remonte du second point et longe le segment déjà créé. Pour moi, il s'agit d'un point en trop qui est tracé tout à la fin. C'est pas grave en soit mais c'est assez inesthétique. Surtout pour un organigramme ! | |
| | | Marc
Nombre de messages : 2466 Age : 63 Localisation : TOURS (37) Date d'inscription : 17/03/2014
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Dim 18 Mar 2018 - 12:33 | |
| Pardonne-moi Klaus de répondre à ta place. Et j'espère ne pas dire de bêtise... @Minibug Le dernier point, celui qui indique où est le connecteur d'arrivée, ne doit pas être renseigné manuellement avec les lignes de visée. Il est déjà "mémorisé" dans le futur tracé, la ligne se refermera proprement toute seule depuis ton dernier point manuel jusqu'au connecteur d'arrivée. Hum... je ne sais pas si je suis bien explicite...
Dernière édition par Marc le Dim 18 Mar 2018 - 13:46, édité 1 fois | |
| | | Minibug
Nombre de messages : 4570 Age : 58 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Dim 18 Mar 2018 - 12:50 | |
| Huuuum, je viens de comprendre ! Tout est de ma faute donc... Je viens de tester avec tes infos Marc et tout fonctionne parfaitement. Désolé Klaus et merci Marc pour tes explications très claires. De cette façon cela fonctionne parfaitement ! | |
| | | Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Dim 18 Mar 2018 - 13:22 | |
| J'étais parti un petit moment, pour poser des carreaux de plâtre. Et au retour, j'ai lu votre petit échange, Marc et Minibug.
Marc a parfaitement expliqué la situation. Je récapitule: Pour créer un lien, on fait dans l'ordre, les actions suivantes: 1. cliquer le bouton "Lier" pour activer la phase de création de lien. (Bien lire les messages qui s'afficheront à partir de là) 2. sélectionner un connecteur de sortie par un clic gauche sur le connecteur choisi 3. sélectionner l'élément de destination par un clic gauche dans l'élément choisi 4. (étape optionnelle) définir un point intermédiaire pour le passage du lien, à partir du connecteur de sortie, en s'aidant des lignes de visée. Répéter cette phase autant de fois que nécessaire pour tracer un chemin temporaire jusqu'à un point à l'aplomb du connecteur d'entrée de l'élément de destination - et PAS sur ce connecteur ! 5a. cliquer le bouton "Tracer" pour valider le lien, ou 5b. cliquer le bouton "Annuler" à droite du bouton "Lier" pour effacer la tentative de création de lien
Dans l'absolu, on n'a même pas besoin de la phase 4 - le programme trace alors un lien direct mais qui risque de traverses des éléments ou ne pas correspondre à un tracé acceptable. | |
| | | Minibug
Nombre de messages : 4570 Age : 58 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Dim 18 Mar 2018 - 14:03 | |
| Merci pour ces explications 'détaillées' Klaus. j'avoue ne pas toujours tout lire, et comme là en plus les messages apparaissent très régulièrement, je passe rapidement sans faire attention, et bien sûr je loupe certaines explications... | |
| | | Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Dim 18 Mar 2018 - 15:58 | |
| Nouvelle version: Lors de la création d'un lien, le connecteur de sortie sélectionné ainsi que l'élément de destination choisi sont maintenant "sélectionnés" (affichage en jaune). Les boutons "Annuler" ainsi que "Tracer" restorent l'état normal. La version est dans mon WebDav, dossier DLLs. Et voici le programme qui va avec: - Code:
-
' FlowChartDesigner.bas
labels() constantes() variables() menu() cadres() Objets()
on_user_event UserEvent
end
UserEvent: if bin_and(user_event_wparam,hex("FF000000"))=hex("0B000000") : ' ScrollImage if DoPoints%>0 pos% = user_event_lparam : ' positon: yyyyxxxx xxp% = bin_and(pos%,hex("0000FFFF")) yyp% = pos%/65536 if DoPoints%=1 NatureOutput% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%)) if NatureOutput%<0 message "Ce n'est pas une sortie valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..." return end_if res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,output%) 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 res% = dll_call2("SelectElementInFlowChart",FC%,FCEdest%) message "Cliquez maintenant les points d'étape"+chr$(13)+chr$(10)+"puis Tracez ou Annulez..." res% = dll_call2("ShowRulersInFlowChart",FC%,1) return end_if if DoPoints%=3 ' ici, rectangulariser le tracé if npt%=0 res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xx%),adr(yy%)) else xx% = xarray%(npt%) yy% = yarray%(npt%) end_if if (npt%=0) and (NatureOutput%<>0) if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% else npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yy% end_if end_if end_if if npt%>0 if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% else npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yy% end_if end_if end_if ' mémoriser le point npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% res% = dll_call3("DrawTemporaryMarkIntoFlowChart",FC%,xxp%,yyp%) res% = dll_call5("DrawTemporaryLineIntoFlowChart",FC%,xx%,yy%,xxp%,yyp%) ' message "Point "+str$(npt%)+": "+str$(xx%)+","+str$(yy% end_if if DoPoints%=4 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%)) if res%<0 message "Ce n'est pas un élément valide." return end_if message "Elément "+nature$(res%)+" identifié" DoPoints% = 5 select res% case 0 show no_AttributsConnector% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Connector_X%),handle(no_Connector_Y%),0,0) position no_Connector_X%,xxp% position no_Connector_Y%,yyp% case 1 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsAction% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Action_X%),handle(no_Action_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%)) position no_Action_X%,xxp% position no_Action_Y%,yyp% position no_Action_Largeur%,wwp% position no_Action_Hauteur%,hhp% text no_action_Couleur%,right$(hex$(ccc%),6) text no_Action_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Action_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Action_Contenu%,item_read$(no_memo%,i%) next i% end_if case 2 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsCondition% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Condition_X%),handle(no_Condition_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%)) position no_Condition_X%,xxp% position no_Condition_Y%,yyp% position no_Condition_Largeur%,wwp% position no_Condition_Hauteur%,hhp% text no_Condition_Couleur%,right$(hex$(ccc%),6) text no_Condition_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Condition_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Condition_Contenu%,item_read$(no_memo%,i%) next i% end_if case 3 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsSelection% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Selection_X%),handle(no_Selection_Y%),handle(no_Selection_Largeur%),handle(no_Selection_Hauteur%)) position no_Selection_X%,xxp% position no_Selection_Y%,yyp% position no_Selection_Largeur%,wwp% position no_Selection_Hauteur%,hhp% text no_Selection_Couleur%,right$(hex$(ccc%),6) text no_Selection_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Selection_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Selection_Contenu%,item_read$(no_memo%,i%) next i% end_if case 4 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsStart% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Start_X%),handle(no_Start_Y%),handle(no_Start_Largeur%),handle(no_Start_Hauteur%)) position no_Start_X%,xxp% position no_Start_Y%,yyp% position no_Start_Largeur%,wwp% position no_Start_Hauteur%,hhp% text no_Start_Couleur%,right$(hex$(ccc%),6) case 5 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsEnd% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_End_X%),handle(no_End_Y%),handle(no_End_Largeur%),handle(no_End_Hauteur%)) position no_End_X%,xxp% position no_End_Y%,yyp% position no_End_Largeur%,wwp% position no_End_Hauteur%,hhp% text no_End_Couleur%,right$(hex$(ccc%),6) end_select res% = dll_call2("SelectElementInFlowChart",FC%,FCE%) end_if if DoPoints%=6 res% = dll_call4("IdentifyFlowChartLink",FC%,xxp%,yyp%,adr(FCL%)) if res%<0 message "Ce n'est pas un lien valide." DoPoints% = 0 res% = dll_call2("DrawFlowChart",FC%,1) return end_if message "Lien "+str$(res%)+" identifié" res% = dll_call2("SelectLinkInFlowChart",FC%,FCL%) DoPoints% = 0 res% = dll_call2("DrawFlowChart",FC%,5) end_if end_if end_if
return
sortir: terminate
AddConnector: AddConnector() return
AddAction: AddAction() return
AddCondition: AddCondition() return
AddSelector: AddSelector() return
AddStart: AddStart() return
AddEnd: AddEnd() return
selectionner: selectionner() return valider_connector: valider_connector() return valider_action: valider_action() return valider_Condition: valider_Condition() return annulerselection: annulerselection() return supprimerliens: supprimerliens() return valider_Selection: valider_Selection() return
valider_start: valider_start() return valider_end: valider_end() return nouveauprojet: nouveauprojet() return
ouvrirprojet: ouvrirprojet() return enregistrerprojet: enregistrerprojet() return enregistrersousprojet: enregistrersousprojet() return lier: lier() return annulerlier: annulerlier() return tracer: tracer() return exporter: exporter() return
selectionLien: selectionLien() return annulerSelLien: annulerSelLien() return supprimerLien: supprimerLien() return sub labels() label AddConnector, AddAction, AddCondition, AddSelector, AddStart, AddEnd label valider_connector, valider_action, valider_Condition, valider_Selection label valider_Start, valider_End label selectionner, annulerselection, supprimerliens, UserEvent, sortir label selectionLien, annulerSelLien, supprimerLien label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet label lier, annulerlier, tracer, exporter end_sub
sub constantes() dim KGF$ : KGF$ = "KGF.dll" dim M1% : M1% = 0-1 dim DeltaRectangle% : DeltaRectangle% = 10 dim LignesDeVisee% : ' nombre de lignes de visée (0, 1 ou 2) LignesDeVisee% = 2 dim nature$(6) nature$(0) = "Connector" nature$(1) = "Action" nature$(2) = "Condition" nature$(3) = "Selector" nature$(4) = "Start" nature$(5) = "End" end_sub
sub variables() dim res%, DoPoints%, pos%, xxp%, yyp%, titre$, wwp%, hhp%, i%, ccc%, output% dim xx%, yy%, NatureOutput%, NatureInput% dim npt%, xarray%(100),yarray%(100) dim no%, no1%, no2%, no_cElements%, no_AnnSel%, no_SuppLiens%, no_memo%, no_open%, no_save% dim no_AttributsConnector%, no_AttributsAction%, no_AttributsCondition% dim no_AttributsSelection%, no_AttributsStart%, no_AttributsEnd% dim no_Connector_X%, no_Connector_Y%, no_AnnLink%, no_Tracer% dim no_Action_X%, no_Action_Y%, no_Action_Titre%, no_action_Couleur% dim no_Action_Largeur%, no_Action_Hauteur%, no_Action_Contenu%, no_export% dim no_Condition_X%, no_Condition_Y%, no_Condition_Titre%, no_condition_Couleur% dim no_Condition_Largeur%, no_Condition_Hauteur%, no_Condition_Contenu% dim no_Selection_X%, no_Selection_Y%, no_Selection_Titre%, no_selection_Couleur% dim no_Selection_Largeur%, no_Selection_Hauteur%, no_Selection_Contenu% dim no_Start_X%, no_Start_Y%, no_Start_Largeur%, no_Start_Hauteur%, no_start_Couleur% dim no_End_X%, no_End_Y%, no_End_Largeur%, no_End_Hauteur%, no_end_Couleur% dim no_AnnSelLink%, no_DelLink% dim FC%, FCE%, FCEstart%, FCEdest%, FCL% dim projet$ end_sub
sub menu() no% = no% + 1 : main_menu no% : no1% = no% no% = no% + 1 : sub_menu no% : parent no%,no1% : no2% = no% : caption no%,"Fichier" no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Nouveau" : on_click no%,nouveauprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Ouvrir..." : on_click no%,ouvrirprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer" : on_click no%,enregistrerprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer sous..." : on_click no%,enregistrersousprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Exporter..." : on_click no%,exporter no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"-" no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Sortir" : on_click no%,sortir end_sub
sub cadres() dll_on KGF$ no% = no% + 1 : container no% : no_cElements% = no% : width no%,200 : caption no%,"Eléments" FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%) full_space 0 res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0)) height no_cElements%,350 res% = dll_call2("ShowRulersInFlowChart",FC%,0) no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Connecteur" top no%,15 : left no%,10 : on_click no%,AddConnector no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Action" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddAction no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Condition" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddCondition no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Selecteur" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddSelector no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Début" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddStart no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Fin" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddEnd
no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sélectionner" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionner no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSel% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerselection no% = no% + 1 : button no% : parent no%,no_cElements% : no_SuppLiens% = no% : caption no%,"Supprimer lien" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,left(no%-1) : on_click no%,supprimerliens
no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Lier" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,lier no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnLink% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerlier no% = no% + 1 : button no% : parent no%,no_cElements% : no_Tracer% = no% : caption no%,"Tracer" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,tracer no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sel. Lien" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionLien no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSelLink% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerSelLien no% = no% + 1 : button no% : parent no%,no_cElements% : no_DelLink% = no% : caption no%,"Supprimer lien" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,supprimerLien
' attributs Connector no% = no% + 1 : container no% : no_AttributsConnector% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Connector" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Connector_X% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Connector_Y% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsConnector% : top no%,height(no_AttributsConnector%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_connector ' attributs Action no% = no% + 1 : container no% : no_AttributsAction% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Action" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Action_X% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Action_Y% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Action_Largeur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Action_Hauteur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Action_Couleur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Action_Titre% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Action_Contenu% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsAction% : top no%,height(no_AttributsAction%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_action
' attributs Condition no% = no% + 1 : container no% : no_AttributsCondition% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Condition" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Condition_X% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Condition_Y% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Condition_Largeur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Condition_Hauteur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Condition_Couleur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Condition_Titre% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Condition_Contenu% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsCondition% : top no%,height(no_AttributsCondition%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Condition
' attributs Selection no% = no% + 1 : container no% : no_AttributsSelection% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Selection" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Selection_X% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Selection_Y% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Selection_Largeur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Selection_Hauteur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Selection_Couleur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Selection_Titre% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Selection_Contenu% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsSelection% : top no%,height(no_AttributsSelection%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Selection
' attributs Start no% = no% + 1 : container no% : no_AttributsStart% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Start" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Start_X% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Start_Y% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Start_Largeur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Start_Hauteur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Start_Couleur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsStart% : top no%,height(no_AttributsStart%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Start
' attributs End no% = no% + 1 : container no% : no_AttributsEnd% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs End" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_End_X% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_End_Y% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_End_Largeur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_End_Hauteur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_End_Couleur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsEnd% : top no%,height(no_AttributsEnd%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_End
end_sub
sub Objets() no% = no% + 1 : memo no% : no_memo% = no% : hide no% : bar_both no% no% = no% + 1 : open_dialog no% : no_open% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj" no% = no% + 1 : save_dialog no% : no_save% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj" no% = no% + 1 : save_dialog no% : no_export% = no% : filter no%,"Images (BMP,JPG,GIF,PNG)|*.BMP;*.JPG;*.GIF;*.PNG" end_sub
sub AddConnector() FCE% = dll_call4("AddElementToFlowChart",FC%,0,0,0) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,20,20) res% = dll_call2("DrawFlowChart",FC%,1) position no_Connector_X%,0 position no_Connector_Y%,0 annulerselection() ' show no_AttributsConnector% end_sub
sub AddAction() dim_local titre$ titre$ = "Action" FCE% = dll_call4("AddElementToFlowChart",FC%,1,hex("FFFF00"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,200) res% = dll_call2("DrawFlowChart",FC%,1) position no_Action_X%,0 position no_Action_Y%,0 position no_Action_Largeur%,300 position no_Action_Hauteur%,200 text no_action_Couleur%,"FFFF00" text no_Action_Titre%,titre$ clear no_Action_Contenu% annulerselection() ' show no_AttributsAction% end_sub
sub AddCondition() dim_local titre$ titre$ = "Condition ?" FCE% = dll_call4("AddElementToFlowChart",FC%,2,hex("0000FF"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100) clear no_memo% item_add no_memo%,"." item_add no_memo%,"Oui" item_add no_memo%,"Non" res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%)) res% = dll_call2("DrawFlowChart",FC%,1) position no_Condition_X%,0 position no_Condition_Y%,0 position no_Condition_Largeur%,300 position no_Condition_Hauteur%,100 text no_Condition_Couleur%,"0000FF" text no_Condition_Titre%,titre$ clear no_Condition_Contenu% item_add no_Condition_Contenu%,"Oui" item_add no_Condition_Contenu%,"." item_add no_Condition_Contenu%,"Non" annulerselection() ' show no_AttributsCondition% end_sub
sub AddSelector() dim_local titre$ titre$ = "Sélection" FCE% = dll_call4("AddElementToFlowChart",FC%,3,hex("0000FF"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100) clear no_memo% item_add no_memo%,"1" item_add no_memo%,"2" item_add no_memo%,"3" res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%)) res% = dll_call2("DrawFlowChart",FC%,1) position no_Selection_X%,0 position no_Selection_Y%,0 position no_Selection_Largeur%,300 position no_Selection_Hauteur%,100 text no_Selection_Couleur%,"0000FF" text no_Selection_Titre%,titre$ clear no_Selection_Contenu% item_add no_Selection_Contenu%,"1" item_add no_Selection_Contenu%,"2" item_add no_Selection_Contenu%,"3" annulerselection() ' show no_AttributsSelection% end_sub
sub AddStart() dim_local titre$ titre$ = "Début" FCE% = dll_call4("AddElementToFlowChart",FC%,4,hex("F0F0F0"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100) res% = dll_call2("DrawFlowChart",FC%,1) position no_Start_X%,0 position no_Start_Y%,0 position no_Start_Largeur%,100 position no_Start_Hauteur%,100 text no_Start_Couleur%,"F0F0F0" annulerselection() ' show no_AttributsStart% end_sub
sub AddEnd() dim_local titre$ titre$ = "Arrêt" FCE% = dll_call4("AddElementToFlowChart",FC%,5,hex("F0F0F0"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100) res% = dll_call2("DrawFlowChart",FC%,1) position no_End_X%,0 position no_End_Y%,0 position no_End_Largeur%,100 position no_End_Hauteur%,100 text no_End_Couleur%,"F0F0F0" annulerselection() ' show no_AttributsEnd% end_sub
sub selectionner() message "Sélectionner un élément en cliquant dessus..." DoPoints% = 4 active no_AnnSel% active no_SuppLiens% hide no_AttributsConnector% hide no_AttributsAction% hide no_AttributsCondition% hide no_AttributsSelection% hide no_AttributsStart% hide no_AttributsEnd% end_sub
sub annulerselection() DoPoints% = 0 inactive no_AnnSel% inactive no_SuppLiens% hide no_AttributsConnector% hide no_AttributsAction% hide no_AttributsCondition% hide no_AttributsSelection% hide no_AttributsStart% hide no_AttributsEnd% res% = dll_call2("SelectElementInFlowChart",FC%,0) end_sub
sub supprimerliens() res% = dll_call2("RemoveAllLinksFromFlowChartElement",FC%,FCE%) end_sub
sub valider_connector() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Connector_X%),position(no_Connector_Y%),M1%,M1%) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsConnector% end_sub
sub valider_action() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Action_X%),position(no_Action_Y%),position(no_Action_Largeur%),position(no_Action_Hauteur%)) titre$ = trim$(text$(no_Action_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Action_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Action_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsAction% end_sub
sub valider_Condition() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Condition_X%),position(no_Condition_Y%),position(no_Condition_Largeur%),position(no_Condition_Hauteur%)) titre$ = trim$(text$(no_Condition_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Condition_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Condition_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsCondition% end_sub
sub valider_Selection() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Selection_X%),position(no_Selection_Y%),position(no_Selection_Largeur%),position(no_Selection_Hauteur%)) titre$ = trim$(text$(no_Selection_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Selection_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Selection_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsSelection% end_sub
sub valider_Start() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Start_X%),position(no_Start_Y%),position(no_Start_Largeur%),position(no_Start_Hauteur%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Start_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsStart% end_sub
sub valider_End() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_End_X%),position(no_End_Y%),position(no_End_Largeur%),position(no_End_Hauteur%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_End_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsEnd% end_sub
sub nouveauprojet() FC% = dll_call1("DeleteFlowChart",FC%) FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%) full_space 0 res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0)) ' height no_cElements%,300 projet$ = "" end_sub
sub ouvrirprojet() dim_local prj$ prj$ = file_name$(no_save%) if prj$="_" then exit_sub if lower$(file_extract_extension$(prj$))<>".fcproj" message "Extension erronnée (*.FCproj)" exit_sub end_if if file_exists(prj$)=0 message("Ce fichier n'existe pas." exit_sub end_if nouveauprojet() res% = dll_call2("LoadFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en chargement" else message "Le projet a été chargé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub enregistrerprojet() dim_local prj$ if projet$="" enregistrersousprojet() exit_sub end_if prj$ = projet$ if file_exists(prj$)=1 then file_delete prj$ res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en sauvegarde" else message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub enregistrersousprojet() dim_local prj$ prj$ = file_name$(no_save%) if prj$="_" then exit_sub if lower$(file_extract_extension$(prj$))<>".fcproj" message "Extension erronnée (*.FCproj)" exit_sub end_if if file_exists(prj$)=1 if message_confirmation_yes_no("Ce fichier existe déjà. Remplacer ?")<>1 then exit_sub file_delete prj$ end_if res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en sauvegarde" else message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub lier() DoPoints% = 1 npt% = 0 Message "Cliquer sur une sortie..." active no_AnnLink% active no_Tracer% end_sub
sub annulerlier() res% = dll_call2("ShowRulersInFlowChart",FC%,0) DoPoints% = 0 npt% = 0 xarray%(0) = 0 res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0) res% = dll_call2("DrawFlowChart",FC%,1) inactive no_AnnLink% inactive no_Tracer% end_sub
sub tracer() dim_local do1% ' rectangulariser le dernier segment NatureInput% = dll_call3("GetInputConnectorOfFlowChartElement",FCEdest%,adr(xx%),adr(yy%)) if NatureInput%<>0 if npt%=0 res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xxp%),adr(yyp%)) else xxp% = xArray%(npt%) yyp% = yArray%(npt%) end_if
do1% = 0 if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% do1% = 1 else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% do1% = 1 end_if end_if if do1%=1 npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if if yyp%>(yy%-DeltaRectangle%) yyp% = yy% - DeltaRectangle% npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if if xxp%<>xx% xxp% = xx% npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if end_if res% = dll_call6("ConnectElementsOfFlowChart",FC%,FCEstart%,output%,FCEdest%,adr(xArray%),adr(yArray%)) if res%=0 then message "Erreur en créant la connexion" res% = dll_call2("ShowRulersInFlowChart",FC%,0) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0) ' res% = dll_call2("DrawFlowChart",FC%,1) DoPoints% = 0 npt% = 0 xarray%(0) = 0 inactive no_AnnLink% inactive no_Tracer% end_sub
sub exporter() dim_local f$ f$ = file_name$(no_export%) if f$="_" then exit_sub if instr(".bmp.jpg.gif.png",lower$(file_extract_extension$(f$)))=0 message "Erreur d'extension" exit_sub end_if if file_exists(f$)=1 if message_confirmation_yes_no("Cette image existe déjà? Remplacer ?")<>1 then exit_sub end_if res% = dll_call1("CopyFlowChartToClipboard",FC%) res% = dll_call1("SaveAnyImageFile",adr(f$)) message "L'image est enregistrée dans:"+chr$(13)+chr$(10)+f$ end_sub
sub selectionLien() DoPoints% = 6 npt% = 0 Message "Cliquer sur un lien..." res% = dll_call2("DrawFlowChart",FC%,5) active no_AnnSelLink% active no_DelLink% end_sub sub annulerSelLien() DoPoints% = 0 npt% = 0 xarray%(0) = 0 res% = dll_call2("SelectLinkInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) inactive no_AnnSelLink% inactive no_DelLink% end_sub sub supprimerLien() res% = dll_call1("DeleteLinkFromFlowChart",FCL%) end_sub
Et le résultat: | |
| | | Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Dim 18 Mar 2018 - 17:56 | |
| Nouvelle version: Les petits messages de guidage lors des 3 fonctions: - sélection d'un objet - traçage d'un lien - sélection d'un lien ont été remplacés par des textes apparaissant dans une petite fenêtre en haut à droite de la zone de visualisation. Lorsque ces messages n'ont plus lieu d'être, ils disparaissent automatiquement. 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 NatureOutput% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%)) if NatureOutput%<0 message "Ce n'est pas une sortie valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..." return end_if res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,output%) DoPoints% = 2 show no_info% clear no_infotext% text no_infotext%,"Cliquez maintenant l'élémént de destination"+chr$(13)+chr$(10)+"ou Annulez..." return end_if if DoPoints%=2 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEdest%)) if res%<0 message "Ce n'est pas un élément valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..." return end_if DoPoints% = 3 res% = dll_call2("SelectElementInFlowChart",FC%,FCEdest%) show no_info% clear no_infotext% text no_infotext%,"Cliquez maintenant les points d'étape"+chr$(13)+chr$(10)+"puis Tracez ou Annulez..." res% = dll_call2("ShowRulersInFlowChart",FC%,1) return end_if if DoPoints%=3 ' ici, rectangulariser le tracé if npt%=0 res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xx%),adr(yy%)) else xx% = xarray%(npt%) yy% = yarray%(npt%) end_if if (npt%=0) and (NatureOutput%<>0) if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% else npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yy% end_if end_if end_if if npt%>0 if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% else npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yy% end_if end_if end_if ' mémoriser le point npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% res% = dll_call3("DrawTemporaryMarkIntoFlowChart",FC%,xxp%,yyp%) res% = dll_call5("DrawTemporaryLineIntoFlowChart",FC%,xx%,yy%,xxp%,yyp%) ' message "Point "+str$(npt%)+": "+str$(xx%)+","+str$(yy% end_if if DoPoints%=4 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%)) if res%<0 message "Ce n'est pas un élément valide." return end_if message "Elément "+nature$(res%)+" identifié" hide no_info% DoPoints% = 5 select res% case 0 show no_AttributsConnector% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Connector_X%),handle(no_Connector_Y%),0,0) position no_Connector_X%,xxp% position no_Connector_Y%,yyp% case 1 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsAction% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Action_X%),handle(no_Action_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%)) position no_Action_X%,xxp% position no_Action_Y%,yyp% position no_Action_Largeur%,wwp% position no_Action_Hauteur%,hhp% text no_action_Couleur%,right$(hex$(ccc%),6) text no_Action_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Action_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Action_Contenu%,item_read$(no_memo%,i%) next i% end_if case 2 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsCondition% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Condition_X%),handle(no_Condition_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%)) position no_Condition_X%,xxp% position no_Condition_Y%,yyp% position no_Condition_Largeur%,wwp% position no_Condition_Hauteur%,hhp% text no_Condition_Couleur%,right$(hex$(ccc%),6) text no_Condition_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Condition_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Condition_Contenu%,item_read$(no_memo%,i%) next i% end_if case 3 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsSelection% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Selection_X%),handle(no_Selection_Y%),handle(no_Selection_Largeur%),handle(no_Selection_Hauteur%)) position no_Selection_X%,xxp% position no_Selection_Y%,yyp% position no_Selection_Largeur%,wwp% position no_Selection_Hauteur%,hhp% text no_Selection_Couleur%,right$(hex$(ccc%),6) text no_Selection_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Selection_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Selection_Contenu%,item_read$(no_memo%,i%) next i% end_if case 4 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsStart% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Start_X%),handle(no_Start_Y%),handle(no_Start_Largeur%),handle(no_Start_Hauteur%)) position no_Start_X%,xxp% position no_Start_Y%,yyp% position no_Start_Largeur%,wwp% position no_Start_Hauteur%,hhp% text no_Start_Couleur%,right$(hex$(ccc%),6) case 5 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsEnd% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_End_X%),handle(no_End_Y%),handle(no_End_Largeur%),handle(no_End_Hauteur%)) position no_End_X%,xxp% position no_End_Y%,yyp% position no_End_Largeur%,wwp% position no_End_Hauteur%,hhp% text no_End_Couleur%,right$(hex$(ccc%),6) end_select res% = dll_call2("SelectElementInFlowChart",FC%,FCE%) end_if if DoPoints%=6 res% = dll_call4("IdentifyFlowChartLink",FC%,xxp%,yyp%,adr(FCL%)) if res%<0 message "Ce n'est pas un lien valide." DoPoints% = 0 res% = dll_call2("DrawFlowChart",FC%,1) return end_if message "Lien "+str$(res%)+" identifié" res% = dll_call2("SelectLinkInFlowChart",FC%,FCL%) DoPoints% = 0 res% = dll_call2("DrawFlowChart",FC%,5) end_if end_if end_if
return
sortir: terminate
AddConnector: AddConnector() return
AddAction: AddAction() return
AddCondition: AddCondition() return
AddSelector: AddSelector() return
AddStart: AddStart() return
AddEnd: AddEnd() return
selectionner: selectionner() return valider_connector: valider_connector() return valider_action: valider_action() return valider_Condition: valider_Condition() return annulerselection: annulerselection() return supprimerliens: supprimerliens() return valider_Selection: valider_Selection() return
valider_start: valider_start() return valider_end: valider_end() return nouveauprojet: nouveauprojet() return
ouvrirprojet: ouvrirprojet() return enregistrerprojet: enregistrerprojet() return enregistrersousprojet: enregistrersousprojet() return lier: lier() return annulerlier: annulerlier() return tracer: tracer() return exporter: exporter() return
selectionLien: selectionLien() return annulerSelLien: annulerSelLien() return supprimerLien: supprimerLien() return sub labels() label AddConnector, AddAction, AddCondition, AddSelector, AddStart, AddEnd label valider_connector, valider_action, valider_Condition, valider_Selection label valider_Start, valider_End label selectionner, annulerselection, supprimerliens, UserEvent, sortir label selectionLien, annulerSelLien, supprimerLien label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet label lier, annulerlier, tracer, exporter end_sub
sub constantes() dim KGF$ : KGF$ = "KGF.dll" dim M1% : M1% = 0-1 dim DeltaRectangle% : DeltaRectangle% = 10 dim LignesDeVisee% : ' nombre de lignes de visée (0, 1 ou 2) LignesDeVisee% = 2 dim nature$(6) nature$(0) = "Connector" nature$(1) = "Action" nature$(2) = "Condition" nature$(3) = "Selector" nature$(4) = "Start" nature$(5) = "End" end_sub
sub variables() dim res%, DoPoints%, pos%, xxp%, yyp%, titre$, wwp%, hhp%, i%, ccc%, output% dim xx%, yy%, NatureOutput%, NatureInput% dim npt%, xarray%(100),yarray%(100) dim no%, no1%, no2%, no_cElements%, no_AnnSel%, no_SuppLiens%, no_memo%, no_open%, no_save% dim no_AttributsConnector%, no_AttributsAction%, no_AttributsCondition% dim no_AttributsSelection%, no_AttributsStart%, no_AttributsEnd% dim no_Connector_X%, no_Connector_Y%, no_AnnLink%, no_Tracer% , no_Info%, no_infotext% dim no_Action_X%, no_Action_Y%, no_Action_Titre%, no_action_Couleur% dim no_Action_Largeur%, no_Action_Hauteur%, no_Action_Contenu%, no_export% dim no_Condition_X%, no_Condition_Y%, no_Condition_Titre%, no_condition_Couleur% dim no_Condition_Largeur%, no_Condition_Hauteur%, no_Condition_Contenu% dim no_Selection_X%, no_Selection_Y%, no_Selection_Titre%, no_selection_Couleur% dim no_Selection_Largeur%, no_Selection_Hauteur%, no_Selection_Contenu% dim no_Start_X%, no_Start_Y%, no_Start_Largeur%, no_Start_Hauteur%, no_start_Couleur% dim no_End_X%, no_End_Y%, no_End_Largeur%, no_End_Hauteur%, no_end_Couleur% dim no_AnnSelLink%, no_DelLink% dim FC%, FCE%, FCEstart%, FCEdest%, FCL% dim projet$ end_sub
sub menu() no% = no% + 1 : main_menu no% : no1% = no% no% = no% + 1 : sub_menu no% : parent no%,no1% : no2% = no% : caption no%,"Fichier" no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Nouveau" : on_click no%,nouveauprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Ouvrir..." : on_click no%,ouvrirprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer" : on_click no%,enregistrerprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer sous..." : on_click no%,enregistrersousprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Exporter..." : on_click no%,exporter no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"-" no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Sortir" : on_click no%,sortir end_sub
sub cadres() dim_local hnd% dll_on KGF$ no% = no% + 1 : form no% : hide no% : no_info% = no% : width no%,400 : height no%,200 no% = no% + 1 : memo no% : no_infotext% = no% : parent no%,no_info% : full_space no% : bar_both no% : font_size no%,12 no% = no% + 1 : container no% : no_cElements% = no% : width no%,200 : caption no%,"Eléments" FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%) full_space 0 res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0)) height no_cElements%,350 res% = dll_call2("ShowRulersInFlowChart",FC%,0) top no_info%,0 : left no_info%,width_client(0)-width(no_info%)-width(no_cElements%) hnd% = dll_call1("GetHandleOfFlowChart",FC%) res% = dll_call3("SetFormParent",handle(no_info%),hnd%,0) no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Connecteur" top no%,15 : left no%,10 : on_click no%,AddConnector no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Action" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddAction no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Condition" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddCondition no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Selecteur" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddSelector no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Début" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddStart no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Fin" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddEnd
no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sélectionner" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionner no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSel% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerselection no% = no% + 1 : button no% : parent no%,no_cElements% : no_SuppLiens% = no% : caption no%,"Supprimer lien" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,left(no%-1) : on_click no%,supprimerliens
no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Lier" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,lier no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnLink% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerlier no% = no% + 1 : button no% : parent no%,no_cElements% : no_Tracer% = no% : caption no%,"Tracer" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,tracer no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sel. Lien" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionLien no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSelLink% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerSelLien no% = no% + 1 : button no% : parent no%,no_cElements% : no_DelLink% = no% : caption no%,"Supprimer lien" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,supprimerLien
' attributs Connector no% = no% + 1 : container no% : no_AttributsConnector% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Connector" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Connector_X% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Connector_Y% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsConnector% : top no%,height(no_AttributsConnector%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_connector ' attributs Action no% = no% + 1 : container no% : no_AttributsAction% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Action" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Action_X% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Action_Y% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Action_Largeur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Action_Hauteur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Action_Couleur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Action_Titre% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Action_Contenu% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsAction% : top no%,height(no_AttributsAction%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_action
' attributs Condition no% = no% + 1 : container no% : no_AttributsCondition% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Condition" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Condition_X% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Condition_Y% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Condition_Largeur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Condition_Hauteur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Condition_Couleur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Condition_Titre% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Condition_Contenu% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsCondition% : top no%,height(no_AttributsCondition%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Condition
' attributs Selection no% = no% + 1 : container no% : no_AttributsSelection% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Selection" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Selection_X% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Selection_Y% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Selection_Largeur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Selection_Hauteur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Selection_Couleur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Selection_Titre% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Selection_Contenu% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsSelection% : top no%,height(no_AttributsSelection%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Selection
' attributs Start no% = no% + 1 : container no% : no_AttributsStart% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Start" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Start_X% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Start_Y% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Start_Largeur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Start_Hauteur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Start_Couleur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsStart% : top no%,height(no_AttributsStart%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Start
' attributs End no% = no% + 1 : container no% : no_AttributsEnd% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs End" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_End_X% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_End_Y% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_End_Largeur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_End_Hauteur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_End_Couleur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsEnd% : top no%,height(no_AttributsEnd%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_End
end_sub
sub Objets() no% = no% + 1 : memo no% : no_memo% = no% : hide no% : bar_both no% no% = no% + 1 : open_dialog no% : no_open% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj" no% = no% + 1 : save_dialog no% : no_save% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj" no% = no% + 1 : save_dialog no% : no_export% = no% : filter no%,"Images (BMP,JPG,GIF,PNG)|*.BMP;*.JPG;*.GIF;*.PNG" end_sub
sub AddConnector() FCE% = dll_call4("AddElementToFlowChart",FC%,0,0,0) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,20,20) res% = dll_call2("DrawFlowChart",FC%,1) position no_Connector_X%,0 position no_Connector_Y%,0 annulerselection() ' show no_AttributsConnector% end_sub
sub AddAction() dim_local titre$ titre$ = "Action" FCE% = dll_call4("AddElementToFlowChart",FC%,1,hex("FFFF00"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,200) res% = dll_call2("DrawFlowChart",FC%,1) position no_Action_X%,0 position no_Action_Y%,0 position no_Action_Largeur%,300 position no_Action_Hauteur%,200 text no_action_Couleur%,"FFFF00" text no_Action_Titre%,titre$ clear no_Action_Contenu% annulerselection() ' show no_AttributsAction% end_sub
sub AddCondition() dim_local titre$ titre$ = "Condition ?" FCE% = dll_call4("AddElementToFlowChart",FC%,2,hex("0000FF"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100) clear no_memo% item_add no_memo%,"." item_add no_memo%,"Oui" item_add no_memo%,"Non" res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%)) res% = dll_call2("DrawFlowChart",FC%,1) position no_Condition_X%,0 position no_Condition_Y%,0 position no_Condition_Largeur%,300 position no_Condition_Hauteur%,100 text no_Condition_Couleur%,"0000FF" text no_Condition_Titre%,titre$ clear no_Condition_Contenu% item_add no_Condition_Contenu%,"Oui" item_add no_Condition_Contenu%,"." item_add no_Condition_Contenu%,"Non" annulerselection() ' show no_AttributsCondition% end_sub
sub AddSelector() dim_local titre$ titre$ = "Sélection" FCE% = dll_call4("AddElementToFlowChart",FC%,3,hex("0000FF"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100) clear no_memo% item_add no_memo%,"1" item_add no_memo%,"2" item_add no_memo%,"3" res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%)) res% = dll_call2("DrawFlowChart",FC%,1) position no_Selection_X%,0 position no_Selection_Y%,0 position no_Selection_Largeur%,300 position no_Selection_Hauteur%,100 text no_Selection_Couleur%,"0000FF" text no_Selection_Titre%,titre$ clear no_Selection_Contenu% item_add no_Selection_Contenu%,"1" item_add no_Selection_Contenu%,"2" item_add no_Selection_Contenu%,"3" annulerselection() ' show no_AttributsSelection% end_sub
sub AddStart() dim_local titre$ titre$ = "Début" FCE% = dll_call4("AddElementToFlowChart",FC%,4,hex("F0F0F0"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100) res% = dll_call2("DrawFlowChart",FC%,1) position no_Start_X%,0 position no_Start_Y%,0 position no_Start_Largeur%,100 position no_Start_Hauteur%,100 text no_Start_Couleur%,"F0F0F0" annulerselection() ' show no_AttributsStart% end_sub
sub AddEnd() dim_local titre$ titre$ = "Arrêt" FCE% = dll_call4("AddElementToFlowChart",FC%,5,hex("F0F0F0"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100) res% = dll_call2("DrawFlowChart",FC%,1) position no_End_X%,0 position no_End_Y%,0 position no_End_Largeur%,100 position no_End_Hauteur%,100 text no_End_Couleur%,"F0F0F0" annulerselection() ' show no_AttributsEnd% end_sub
sub selectionner() show no_info% clear no_infotext% text no_infotext%,"Sélectionner un élément en cliquant dessus..." DoPoints% = 4 active no_AnnSel% active no_SuppLiens% hide no_AttributsConnector% hide no_AttributsAction% hide no_AttributsCondition% hide no_AttributsSelection% hide no_AttributsStart% hide no_AttributsEnd% 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) hide no_info% end_sub
sub supprimerliens() res% = dll_call2("RemoveAllLinksFromFlowChartElement",FC%,FCE%) end_sub
sub valider_connector() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Connector_X%),position(no_Connector_Y%),M1%,M1%) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsConnector% end_sub
sub valider_action() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Action_X%),position(no_Action_Y%),position(no_Action_Largeur%),position(no_Action_Hauteur%)) titre$ = trim$(text$(no_Action_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Action_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Action_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsAction% end_sub
sub valider_Condition() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Condition_X%),position(no_Condition_Y%),position(no_Condition_Largeur%),position(no_Condition_Hauteur%)) titre$ = trim$(text$(no_Condition_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Condition_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Condition_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsCondition% end_sub
sub valider_Selection() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Selection_X%),position(no_Selection_Y%),position(no_Selection_Largeur%),position(no_Selection_Hauteur%)) titre$ = trim$(text$(no_Selection_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Selection_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Selection_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsSelection% end_sub
sub valider_Start() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Start_X%),position(no_Start_Y%),position(no_Start_Largeur%),position(no_Start_Hauteur%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Start_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsStart% end_sub
sub valider_End() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_End_X%),position(no_End_Y%),position(no_End_Largeur%),position(no_End_Hauteur%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_End_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsEnd% end_sub
sub nouveauprojet() FC% = dll_call1("DeleteFlowChart",FC%) FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%) full_space 0 res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0)) ' height no_cElements%,300 projet$ = "" end_sub
sub ouvrirprojet() dim_local prj$ prj$ = file_name$(no_save%) if prj$="_" then exit_sub if lower$(file_extract_extension$(prj$))<>".fcproj" message "Extension erronnée (*.FCproj)" exit_sub end_if if file_exists(prj$)=0 message("Ce fichier n'existe pas." exit_sub end_if nouveauprojet() res% = dll_call2("LoadFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en chargement" else message "Le projet a été chargé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub enregistrerprojet() dim_local prj$ if projet$="" enregistrersousprojet() exit_sub end_if prj$ = projet$ if file_exists(prj$)=1 then file_delete prj$ res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en sauvegarde" else message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub enregistrersousprojet() dim_local prj$ prj$ = file_name$(no_save%) if prj$="_" then exit_sub if lower$(file_extract_extension$(prj$))<>".fcproj" message "Extension erronnée (*.FCproj)" exit_sub end_if if file_exists(prj$)=1 if message_confirmation_yes_no("Ce fichier existe déjà. Remplacer ?")<>1 then exit_sub file_delete prj$ end_if res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en sauvegarde" else message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub lier() DoPoints% = 1 npt% = 0 show no_info% clear no_infotext% text no_infotext%,"Cliquer sur une sortie..." active no_AnnLink% active no_Tracer% end_sub
sub annulerlier() res% = dll_call2("ShowRulersInFlowChart",FC%,0) DoPoints% = 0 npt% = 0 xarray%(0) = 0 res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0) res% = dll_call2("DrawFlowChart",FC%,1) inactive no_AnnLink% inactive no_Tracer% hide no_info% end_sub
sub tracer() dim_local do1% ' rectangulariser le dernier segment NatureInput% = dll_call3("GetInputConnectorOfFlowChartElement",FCEdest%,adr(xx%),adr(yy%)) if NatureInput%<>0 if npt%=0 res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xxp%),adr(yyp%)) else xxp% = xArray%(npt%) yyp% = yArray%(npt%) end_if
do1% = 0 if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% do1% = 1 else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% do1% = 1 end_if end_if if do1%=1 npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if if yyp%>(yy%-DeltaRectangle%) yyp% = yy% - DeltaRectangle% npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if if xxp%<>xx% xxp% = xx% npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if end_if res% = dll_call6("ConnectElementsOfFlowChart",FC%,FCEstart%,output%,FCEdest%,adr(xArray%),adr(yArray%)) if res%=0 then message "Erreur en créant la connexion" res% = dll_call2("ShowRulersInFlowChart",FC%,0) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0) ' res% = dll_call2("DrawFlowChart",FC%,1) DoPoints% = 0 npt% = 0 xarray%(0) = 0 inactive no_AnnLink% inactive no_Tracer% hide no_info% end_sub
sub exporter() dim_local f$ f$ = file_name$(no_export%) if f$="_" then exit_sub if instr(".bmp.jpg.gif.png",lower$(file_extract_extension$(f$)))=0 message "Erreur d'extension" exit_sub end_if if file_exists(f$)=1 if message_confirmation_yes_no("Cette image existe déjà? Remplacer ?")<>1 then exit_sub end_if res% = dll_call1("CopyFlowChartToClipboard",FC%) res% = dll_call1("SaveAnyImageFile",adr(f$)) message "L'image est enregistrée dans:"+chr$(13)+chr$(10)+f$ end_sub
sub selectionLien() DoPoints% = 6 npt% = 0 show no_info% clear no_infotext% text no_infotext%,"Cliquer sur un lien..." res% = dll_call2("DrawFlowChart",FC%,5) active no_AnnSelLink% active no_DelLink% end_sub sub annulerSelLien() DoPoints% = 0 npt% = 0 xarray%(0) = 0 res% = dll_call2("SelectLinkInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) inactive no_AnnSelLink% inactive no_DelLink% hide no_info% hide no_info% end_sub sub supprimerLien() res% = dll_call1("DeleteLinkFromFlowChart",FCL%) hide no_info% end_sub
| |
| | | Minibug
Nombre de messages : 4570 Age : 58 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Dim 18 Mar 2018 - 18:37 | |
| Alors là ça devient drôlement intéressant... Sans les messages, l'ensemble devient beaucoup plus sympa à utiliser. Cela dit, il reste encore les messages de confirmation de la sélection des éléments. Mais bon j'imagine que tu va intégrer tout ça dans la prochaine version. | |
| | | Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Dim 18 Mar 2018 - 18:43 | |
| Pourquoi pas - je vais intégrer cela dans la prochaine version. D'ici là, mets simplement la ligne 99 en commentaire... | |
| | | Minibug
Nombre de messages : 4570 Age : 58 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Dim 18 Mar 2018 - 18:55 | |
| Ok Klaus, comme ça plus de message. Au fait, il y a aussi les messages concernant la suppressions des liens... D'autre part, et c'est un détail, est ce qu'il ne serait pas mieux de mettre le bouton DEBUT tout en haut ? Comme on commence toujours par là, ça semble logique non ?
Dernière édition par Minibug le Dim 18 Mar 2018 - 18:59, édité 2 fois | |
| | | Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Dim 18 Mar 2018 - 18:55 | |
| D'accord avec toi sur les deux points ! Le message pour l'identification d'un lien: mets en commentaire la ligne 188 !En fait, voici la version qui inclut toutes ces modifications: - Code:
-
' FlowChartDesigner.bas
labels() constantes() variables() menu() cadres() Objets()
on_user_event UserEvent
end
UserEvent: if bin_and(user_event_wparam,hex("FF000000"))=hex("0B000000") : ' ScrollImage if DoPoints%>0 pos% = user_event_lparam : ' positon: yyyyxxxx xxp% = bin_and(pos%,hex("0000FFFF")) yyp% = pos%/65536 if DoPoints%=1 NatureOutput% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%)) if NatureOutput%<0 message "Ce n'est pas une sortie valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..." return end_if res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,output%) DoPoints% = 2 show no_info% clear no_infotext% text no_infotext%,"Cliquez maintenant l'élémént de destination"+chr$(13)+chr$(10)+"ou Annulez..." return end_if if DoPoints%=2 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEdest%)) if res%<0 message "Ce n'est pas un élément valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..." return end_if DoPoints% = 3 res% = dll_call2("SelectElementInFlowChart",FC%,FCEdest%) show no_info% clear no_infotext% text no_infotext%,"Cliquez maintenant les points d'étape"+chr$(13)+chr$(10)+"puis Tracez ou Annulez..." res% = dll_call2("ShowRulersInFlowChart",FC%,1) return end_if if DoPoints%=3 ' ici, rectangulariser le tracé if npt%=0 res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xx%),adr(yy%)) else xx% = xarray%(npt%) yy% = yarray%(npt%) end_if if (npt%=0) and (NatureOutput%<>0) if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% else npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yy% end_if end_if end_if if npt%>0 if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% else npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yy% end_if end_if end_if ' mémoriser le point npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% res% = dll_call3("DrawTemporaryMarkIntoFlowChart",FC%,xxp%,yyp%) res% = dll_call5("DrawTemporaryLineIntoFlowChart",FC%,xx%,yy%,xxp%,yyp%) ' message "Point "+str$(npt%)+": "+str$(xx%)+","+str$(yy% end_if if DoPoints%=4 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%)) if res%<0 message "Ce n'est pas un élément valide." return end_if ' message "Elément "+nature$(res%)+" identifié" hide no_info% DoPoints% = 5 select res% case 0 show no_AttributsConnector% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Connector_X%),handle(no_Connector_Y%),0,0) position no_Connector_X%,xxp% position no_Connector_Y%,yyp% case 1 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsAction% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Action_X%),handle(no_Action_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%)) position no_Action_X%,xxp% position no_Action_Y%,yyp% position no_Action_Largeur%,wwp% position no_Action_Hauteur%,hhp% text no_action_Couleur%,right$(hex$(ccc%),6) text no_Action_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Action_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Action_Contenu%,item_read$(no_memo%,i%) next i% end_if case 2 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsCondition% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Condition_X%),handle(no_Condition_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%)) position no_Condition_X%,xxp% position no_Condition_Y%,yyp% position no_Condition_Largeur%,wwp% position no_Condition_Hauteur%,hhp% text no_Condition_Couleur%,right$(hex$(ccc%),6) text no_Condition_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Condition_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Condition_Contenu%,item_read$(no_memo%,i%) next i% end_if case 3 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsSelection% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Selection_X%),handle(no_Selection_Y%),handle(no_Selection_Largeur%),handle(no_Selection_Hauteur%)) position no_Selection_X%,xxp% position no_Selection_Y%,yyp% position no_Selection_Largeur%,wwp% position no_Selection_Hauteur%,hhp% text no_Selection_Couleur%,right$(hex$(ccc%),6) text no_Selection_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Selection_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Selection_Contenu%,item_read$(no_memo%,i%) next i% end_if case 4 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsStart% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Start_X%),handle(no_Start_Y%),handle(no_Start_Largeur%),handle(no_Start_Hauteur%)) position no_Start_X%,xxp% position no_Start_Y%,yyp% position no_Start_Largeur%,wwp% position no_Start_Hauteur%,hhp% text no_Start_Couleur%,right$(hex$(ccc%),6) case 5 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsEnd% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_End_X%),handle(no_End_Y%),handle(no_End_Largeur%),handle(no_End_Hauteur%)) position no_End_X%,xxp% position no_End_Y%,yyp% position no_End_Largeur%,wwp% position no_End_Hauteur%,hhp% text no_End_Couleur%,right$(hex$(ccc%),6) end_select res% = dll_call2("SelectElementInFlowChart",FC%,FCE%) end_if if DoPoints%=6 res% = dll_call4("IdentifyFlowChartLink",FC%,xxp%,yyp%,adr(FCL%)) if res%<0 message "Ce n'est pas un lien valide." DoPoints% = 0 res% = dll_call2("DrawFlowChart",FC%,1) return end_if ' message "Lien "+str$(res%)+" identifié" res% = dll_call2("SelectLinkInFlowChart",FC%,FCL%) DoPoints% = 0 res% = dll_call2("DrawFlowChart",FC%,5) end_if end_if end_if
return
sortir: terminate
AddConnector: AddConnector() return
AddAction: AddAction() return
AddCondition: AddCondition() return
AddSelector: AddSelector() return
AddStart: AddStart() return
AddEnd: AddEnd() return
selectionner: selectionner() return valider_connector: valider_connector() return valider_action: valider_action() return valider_Condition: valider_Condition() return annulerselection: annulerselection() return supprimerliens: supprimerliens() return valider_Selection: valider_Selection() return
valider_start: valider_start() return valider_end: valider_end() return nouveauprojet: nouveauprojet() return
ouvrirprojet: ouvrirprojet() return enregistrerprojet: enregistrerprojet() return enregistrersousprojet: enregistrersousprojet() return lier: lier() return annulerlier: annulerlier() return tracer: tracer() return exporter: exporter() return
selectionLien: selectionLien() return annulerSelLien: annulerSelLien() return supprimerLien: supprimerLien() return sub labels() label AddConnector, AddAction, AddCondition, AddSelector, AddStart, AddEnd label valider_connector, valider_action, valider_Condition, valider_Selection label valider_Start, valider_End label selectionner, annulerselection, supprimerliens, UserEvent, sortir label selectionLien, annulerSelLien, supprimerLien label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet label lier, annulerlier, tracer, exporter end_sub
sub constantes() dim KGF$ : KGF$ = "KGF.dll" dim M1% : M1% = 0-1 dim DeltaRectangle% : DeltaRectangle% = 10 dim LignesDeVisee% : ' nombre de lignes de visée (0, 1 ou 2) LignesDeVisee% = 2 dim nature$(6) nature$(0) = "Connector" nature$(1) = "Action" nature$(2) = "Condition" nature$(3) = "Selector" nature$(4) = "Start" nature$(5) = "End" end_sub
sub variables() dim res%, DoPoints%, pos%, xxp%, yyp%, titre$, wwp%, hhp%, i%, ccc%, output% dim xx%, yy%, NatureOutput%, NatureInput% dim npt%, xarray%(100),yarray%(100) dim no%, no1%, no2%, no_cElements%, no_AnnSel%, no_SuppLiens%, no_memo%, no_open%, no_save% dim no_AttributsConnector%, no_AttributsAction%, no_AttributsCondition% dim no_AttributsSelection%, no_AttributsStart%, no_AttributsEnd% dim no_Connector_X%, no_Connector_Y%, no_AnnLink%, no_Tracer% , no_Info%, no_infotext% dim no_Action_X%, no_Action_Y%, no_Action_Titre%, no_action_Couleur% dim no_Action_Largeur%, no_Action_Hauteur%, no_Action_Contenu%, no_export% dim no_Condition_X%, no_Condition_Y%, no_Condition_Titre%, no_condition_Couleur% dim no_Condition_Largeur%, no_Condition_Hauteur%, no_Condition_Contenu% dim no_Selection_X%, no_Selection_Y%, no_Selection_Titre%, no_selection_Couleur% dim no_Selection_Largeur%, no_Selection_Hauteur%, no_Selection_Contenu% dim no_Start_X%, no_Start_Y%, no_Start_Largeur%, no_Start_Hauteur%, no_start_Couleur% dim no_End_X%, no_End_Y%, no_End_Largeur%, no_End_Hauteur%, no_end_Couleur% dim no_AnnSelLink%, no_DelLink% dim FC%, FCE%, FCEstart%, FCEdest%, FCL% dim projet$ end_sub
sub menu() no% = no% + 1 : main_menu no% : no1% = no% no% = no% + 1 : sub_menu no% : parent no%,no1% : no2% = no% : caption no%,"Fichier" no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Nouveau" : on_click no%,nouveauprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Ouvrir..." : on_click no%,ouvrirprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer" : on_click no%,enregistrerprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer sous..." : on_click no%,enregistrersousprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Exporter..." : on_click no%,exporter no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"-" no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Sortir" : on_click no%,sortir end_sub
sub cadres() dim_local hnd% dll_on KGF$ no% = no% + 1 : form no% : hide no% : no_info% = no% : width no%,400 : height no%,200 no% = no% + 1 : memo no% : no_infotext% = no% : parent no%,no_info% : full_space no% : bar_both no% : font_size no%,12 no% = no% + 1 : container no% : no_cElements% = no% : width no%,200 : caption no%,"Eléments" FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%) full_space 0 res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0)) height no_cElements%,350 res% = dll_call2("ShowRulersInFlowChart",FC%,0) top no_info%,0 : left no_info%,width_client(0)-width(no_info%)-width(no_cElements%) hnd% = dll_call1("GetHandleOfFlowChart",FC%) res% = dll_call3("SetFormParent",handle(no_info%),hnd%,0) no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Début" top no%,15 : left no%,10 : on_click no%,AddStart no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Connecteur" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddConnector no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Action" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddAction no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Condition" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddCondition no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Selecteur" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddSelector no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Fin" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddEnd
no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sélectionner" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionner no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSel% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerselection no% = no% + 1 : button no% : parent no%,no_cElements% : no_SuppLiens% = no% : caption no%,"Supprimer lien" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,left(no%-1) : on_click no%,supprimerliens
no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Lier" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,lier no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnLink% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerlier no% = no% + 1 : button no% : parent no%,no_cElements% : no_Tracer% = no% : caption no%,"Tracer" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,tracer no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sel. Lien" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionLien no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSelLink% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerSelLien no% = no% + 1 : button no% : parent no%,no_cElements% : no_DelLink% = no% : caption no%,"Supprimer lien" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,supprimerLien
' attributs Connector no% = no% + 1 : container no% : no_AttributsConnector% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Connector" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Connector_X% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Connector_Y% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsConnector% : top no%,height(no_AttributsConnector%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_connector ' attributs Action no% = no% + 1 : container no% : no_AttributsAction% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Action" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Action_X% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Action_Y% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Action_Largeur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Action_Hauteur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Action_Couleur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Action_Titre% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Action_Contenu% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsAction% : top no%,height(no_AttributsAction%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_action
' attributs Condition no% = no% + 1 : container no% : no_AttributsCondition% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Condition" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Condition_X% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Condition_Y% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Condition_Largeur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Condition_Hauteur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Condition_Couleur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Condition_Titre% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Condition_Contenu% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsCondition% : top no%,height(no_AttributsCondition%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Condition
' attributs Selection no% = no% + 1 : container no% : no_AttributsSelection% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Selection" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Selection_X% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Selection_Y% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Selection_Largeur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Selection_Hauteur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Selection_Couleur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Selection_Titre% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Selection_Contenu% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsSelection% : top no%,height(no_AttributsSelection%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Selection
' attributs Start no% = no% + 1 : container no% : no_AttributsStart% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Start" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Start_X% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Start_Y% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Start_Largeur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Start_Hauteur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Start_Couleur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsStart% : top no%,height(no_AttributsStart%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Start
' attributs End no% = no% + 1 : container no% : no_AttributsEnd% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs End" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_End_X% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_End_Y% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_End_Largeur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_End_Hauteur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_End_Couleur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsEnd% : top no%,height(no_AttributsEnd%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_End
end_sub
sub Objets() no% = no% + 1 : memo no% : no_memo% = no% : hide no% : bar_both no% no% = no% + 1 : open_dialog no% : no_open% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj" no% = no% + 1 : save_dialog no% : no_save% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj" no% = no% + 1 : save_dialog no% : no_export% = no% : filter no%,"Images (BMP,JPG,GIF,PNG)|*.BMP;*.JPG;*.GIF;*.PNG" end_sub
sub AddConnector() FCE% = dll_call4("AddElementToFlowChart",FC%,0,0,0) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,20,20) res% = dll_call2("DrawFlowChart",FC%,1) position no_Connector_X%,0 position no_Connector_Y%,0 annulerselection() ' show no_AttributsConnector% end_sub
sub AddAction() dim_local titre$ titre$ = "Action" FCE% = dll_call4("AddElementToFlowChart",FC%,1,hex("FFFF00"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,200) res% = dll_call2("DrawFlowChart",FC%,1) position no_Action_X%,0 position no_Action_Y%,0 position no_Action_Largeur%,300 position no_Action_Hauteur%,200 text no_action_Couleur%,"FFFF00" text no_Action_Titre%,titre$ clear no_Action_Contenu% annulerselection() ' show no_AttributsAction% end_sub
sub AddCondition() dim_local titre$ titre$ = "Condition ?" FCE% = dll_call4("AddElementToFlowChart",FC%,2,hex("0000FF"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100) clear no_memo% item_add no_memo%,"." item_add no_memo%,"Oui" item_add no_memo%,"Non" res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%)) res% = dll_call2("DrawFlowChart",FC%,1) position no_Condition_X%,0 position no_Condition_Y%,0 position no_Condition_Largeur%,300 position no_Condition_Hauteur%,100 text no_Condition_Couleur%,"0000FF" text no_Condition_Titre%,titre$ clear no_Condition_Contenu% item_add no_Condition_Contenu%,"Oui" item_add no_Condition_Contenu%,"." item_add no_Condition_Contenu%,"Non" annulerselection() ' show no_AttributsCondition% end_sub
sub AddSelector() dim_local titre$ titre$ = "Sélection" FCE% = dll_call4("AddElementToFlowChart",FC%,3,hex("0000FF"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100) clear no_memo% item_add no_memo%,"1" item_add no_memo%,"2" item_add no_memo%,"3" res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%)) res% = dll_call2("DrawFlowChart",FC%,1) position no_Selection_X%,0 position no_Selection_Y%,0 position no_Selection_Largeur%,300 position no_Selection_Hauteur%,100 text no_Selection_Couleur%,"0000FF" text no_Selection_Titre%,titre$ clear no_Selection_Contenu% item_add no_Selection_Contenu%,"1" item_add no_Selection_Contenu%,"2" item_add no_Selection_Contenu%,"3" annulerselection() ' show no_AttributsSelection% end_sub
sub AddStart() dim_local titre$ titre$ = "Début" FCE% = dll_call4("AddElementToFlowChart",FC%,4,hex("F0F0F0"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100) res% = dll_call2("DrawFlowChart",FC%,1) position no_Start_X%,0 position no_Start_Y%,0 position no_Start_Largeur%,100 position no_Start_Hauteur%,100 text no_Start_Couleur%,"F0F0F0" annulerselection() ' show no_AttributsStart% end_sub
sub AddEnd() dim_local titre$ titre$ = "Arrêt" FCE% = dll_call4("AddElementToFlowChart",FC%,5,hex("F0F0F0"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100) res% = dll_call2("DrawFlowChart",FC%,1) position no_End_X%,0 position no_End_Y%,0 position no_End_Largeur%,100 position no_End_Hauteur%,100 text no_End_Couleur%,"F0F0F0" annulerselection() ' show no_AttributsEnd% end_sub
sub selectionner() show no_info% clear no_infotext% text no_infotext%,"Sélectionner un élément en cliquant dessus..." DoPoints% = 4 active no_AnnSel% active no_SuppLiens% hide no_AttributsConnector% hide no_AttributsAction% hide no_AttributsCondition% hide no_AttributsSelection% hide no_AttributsStart% hide no_AttributsEnd% 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) hide no_info% end_sub
sub supprimerliens() res% = dll_call2("RemoveAllLinksFromFlowChartElement",FC%,FCE%) end_sub
sub valider_connector() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Connector_X%),position(no_Connector_Y%),M1%,M1%) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsConnector% end_sub
sub valider_action() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Action_X%),position(no_Action_Y%),position(no_Action_Largeur%),position(no_Action_Hauteur%)) titre$ = trim$(text$(no_Action_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Action_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Action_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsAction% end_sub
sub valider_Condition() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Condition_X%),position(no_Condition_Y%),position(no_Condition_Largeur%),position(no_Condition_Hauteur%)) titre$ = trim$(text$(no_Condition_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Condition_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Condition_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsCondition% end_sub
sub valider_Selection() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Selection_X%),position(no_Selection_Y%),position(no_Selection_Largeur%),position(no_Selection_Hauteur%)) titre$ = trim$(text$(no_Selection_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Selection_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Selection_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsSelection% end_sub
sub valider_Start() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Start_X%),position(no_Start_Y%),position(no_Start_Largeur%),position(no_Start_Hauteur%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Start_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsStart% end_sub
sub valider_End() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_End_X%),position(no_End_Y%),position(no_End_Largeur%),position(no_End_Hauteur%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_End_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsEnd% end_sub
sub nouveauprojet() FC% = dll_call1("DeleteFlowChart",FC%) FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%) full_space 0 res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0)) ' height no_cElements%,300 projet$ = "" end_sub
sub ouvrirprojet() dim_local prj$ prj$ = file_name$(no_save%) if prj$="_" then exit_sub if lower$(file_extract_extension$(prj$))<>".fcproj" message "Extension erronnée (*.FCproj)" exit_sub end_if if file_exists(prj$)=0 message("Ce fichier n'existe pas." exit_sub end_if nouveauprojet() res% = dll_call2("LoadFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en chargement" else message "Le projet a été chargé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub enregistrerprojet() dim_local prj$ if projet$="" enregistrersousprojet() exit_sub end_if prj$ = projet$ if file_exists(prj$)=1 then file_delete prj$ res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en sauvegarde" else message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub enregistrersousprojet() dim_local prj$ prj$ = file_name$(no_save%) if prj$="_" then exit_sub if lower$(file_extract_extension$(prj$))<>".fcproj" message "Extension erronnée (*.FCproj)" exit_sub end_if if file_exists(prj$)=1 if message_confirmation_yes_no("Ce fichier existe déjà. Remplacer ?")<>1 then exit_sub file_delete prj$ end_if res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en sauvegarde" else message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub lier() DoPoints% = 1 npt% = 0 show no_info% clear no_infotext% text no_infotext%,"Cliquer sur une sortie..." active no_AnnLink% active no_Tracer% end_sub
sub annulerlier() res% = dll_call2("ShowRulersInFlowChart",FC%,0) DoPoints% = 0 npt% = 0 xarray%(0) = 0 res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0) res% = dll_call2("DrawFlowChart",FC%,1) inactive no_AnnLink% inactive no_Tracer% hide no_info% end_sub
sub tracer() dim_local do1% ' rectangulariser le dernier segment NatureInput% = dll_call3("GetInputConnectorOfFlowChartElement",FCEdest%,adr(xx%),adr(yy%)) if NatureInput%<>0 if npt%=0 res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xxp%),adr(yyp%)) else xxp% = xArray%(npt%) yyp% = yArray%(npt%) end_if
do1% = 0 if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% do1% = 1 else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% do1% = 1 end_if end_if if do1%=1 npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if if yyp%>(yy%-DeltaRectangle%) yyp% = yy% - DeltaRectangle% npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if if xxp%<>xx% xxp% = xx% npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if end_if res% = dll_call6("ConnectElementsOfFlowChart",FC%,FCEstart%,output%,FCEdest%,adr(xArray%),adr(yArray%)) if res%=0 then message "Erreur en créant la connexion" res% = dll_call2("ShowRulersInFlowChart",FC%,0) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0) ' res% = dll_call2("DrawFlowChart",FC%,1) DoPoints% = 0 npt% = 0 xarray%(0) = 0 inactive no_AnnLink% inactive no_Tracer% hide no_info% end_sub
sub exporter() dim_local f$ f$ = file_name$(no_export%) if f$="_" then exit_sub if instr(".bmp.jpg.gif.png",lower$(file_extract_extension$(f$)))=0 message "Erreur d'extension" exit_sub end_if if file_exists(f$)=1 if message_confirmation_yes_no("Cette image existe déjà? Remplacer ?")<>1 then exit_sub end_if res% = dll_call1("CopyFlowChartToClipboard",FC%) res% = dll_call1("SaveAnyImageFile",adr(f$)) message "L'image est enregistrée dans:"+chr$(13)+chr$(10)+f$ end_sub
sub selectionLien() DoPoints% = 6 npt% = 0 show no_info% clear no_infotext% text no_infotext%,"Cliquer sur un lien..." res% = dll_call2("DrawFlowChart",FC%,5) active no_AnnSelLink% active no_DelLink% end_sub sub annulerSelLien() DoPoints% = 0 npt% = 0 xarray%(0) = 0 res% = dll_call2("SelectLinkInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) inactive no_AnnSelLink% inactive no_DelLink% hide no_info% hide no_info% end_sub sub supprimerLien() res% = dll_call1("DeleteLinkFromFlowChart",FCL%) hide no_info% end_sub
Dernière édition par Klaus le Dim 18 Mar 2018 - 19:00, édité 1 fois | |
| | | Minibug
Nombre de messages : 4570 Age : 58 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Dim 18 Mar 2018 - 18:59 | |
| Oui j'ai vu ! Pour la sélection des objets, est ce obligatoire d'avoir un bouton SELECTIONNERIl serait tellement plus intuitif de cliquer directement sur l'objet... mais tu as peut être des contraintes techniques ? | |
| | | Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Dim 18 Mar 2018 - 19:02 | |
| Je ne sais pas - je vais voir ça. | |
| | | Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Dim 18 Mar 2018 - 19:09 | |
| Volà... le bouton "Sélectionner" est toujours fonctionnel, mais un clic dans un élément le sélectionne d'office, et un clic ailleurs est ignore: - Code:
-
' FlowChartDesigner.bas
labels() constantes() variables() menu() cadres() Objets()
on_user_event UserEvent
end
UserEvent: if bin_and(user_event_wparam,hex("FF000000"))=hex("0B000000") : ' ScrollImage pos% = user_event_lparam : ' positon: yyyyxxxx xxp% = bin_and(pos%,hex("0000FFFF")) yyp% = pos%/65536 if DoPoints%=0 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%)) if res%<0 then return DoPoints% = 4 active no_AnnSel% active no_SuppLiens% hide no_AttributsConnector% hide no_AttributsAction% hide no_AttributsCondition% hide no_AttributsSelection% hide no_AttributsStart% hide no_AttributsEnd% end_if if DoPoints%>0 if DoPoints%=1 NatureOutput% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%)) if NatureOutput%<0 message "Ce n'est pas une sortie valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..." return end_if res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,output%) DoPoints% = 2 show no_info% clear no_infotext% text no_infotext%,"Cliquez maintenant l'élémént de destination"+chr$(13)+chr$(10)+"ou Annulez..." return end_if if DoPoints%=2 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEdest%)) if res%<0 message "Ce n'est pas un élément valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..." return end_if DoPoints% = 3 res% = dll_call2("SelectElementInFlowChart",FC%,FCEdest%) show no_info% clear no_infotext% text no_infotext%,"Cliquez maintenant les points d'étape"+chr$(13)+chr$(10)+"puis Tracez ou Annulez..." res% = dll_call2("ShowRulersInFlowChart",FC%,1) return end_if if DoPoints%=3 ' ici, rectangulariser le tracé if npt%=0 res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xx%),adr(yy%)) else xx% = xarray%(npt%) yy% = yarray%(npt%) end_if if (npt%=0) and (NatureOutput%<>0) if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% else npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yy% end_if end_if end_if if npt%>0 if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% else npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yy% end_if end_if end_if ' mémoriser le point npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% res% = dll_call3("DrawTemporaryMarkIntoFlowChart",FC%,xxp%,yyp%) res% = dll_call5("DrawTemporaryLineIntoFlowChart",FC%,xx%,yy%,xxp%,yyp%) ' message "Point "+str$(npt%)+": "+str$(xx%)+","+str$(yy% end_if if DoPoints%=4 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%)) if res%<0 message "Ce n'est pas un élément valide." return end_if ' message "Elément "+nature$(res%)+" identifié" hide no_info% DoPoints% = 5 select res% case 0 show no_AttributsConnector% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Connector_X%),handle(no_Connector_Y%),0,0) position no_Connector_X%,xxp% position no_Connector_Y%,yyp% case 1 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsAction% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Action_X%),handle(no_Action_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%)) position no_Action_X%,xxp% position no_Action_Y%,yyp% position no_Action_Largeur%,wwp% position no_Action_Hauteur%,hhp% text no_action_Couleur%,right$(hex$(ccc%),6) text no_Action_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Action_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Action_Contenu%,item_read$(no_memo%,i%) next i% end_if case 2 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsCondition% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Condition_X%),handle(no_Condition_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%)) position no_Condition_X%,xxp% position no_Condition_Y%,yyp% position no_Condition_Largeur%,wwp% position no_Condition_Hauteur%,hhp% text no_Condition_Couleur%,right$(hex$(ccc%),6) text no_Condition_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Condition_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Condition_Contenu%,item_read$(no_memo%,i%) next i% end_if case 3 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsSelection% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Selection_X%),handle(no_Selection_Y%),handle(no_Selection_Largeur%),handle(no_Selection_Hauteur%)) position no_Selection_X%,xxp% position no_Selection_Y%,yyp% position no_Selection_Largeur%,wwp% position no_Selection_Hauteur%,hhp% text no_Selection_Couleur%,right$(hex$(ccc%),6) text no_Selection_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Selection_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Selection_Contenu%,item_read$(no_memo%,i%) next i% end_if case 4 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsStart% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Start_X%),handle(no_Start_Y%),handle(no_Start_Largeur%),handle(no_Start_Hauteur%)) position no_Start_X%,xxp% position no_Start_Y%,yyp% position no_Start_Largeur%,wwp% position no_Start_Hauteur%,hhp% text no_Start_Couleur%,right$(hex$(ccc%),6) case 5 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsEnd% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_End_X%),handle(no_End_Y%),handle(no_End_Largeur%),handle(no_End_Hauteur%)) position no_End_X%,xxp% position no_End_Y%,yyp% position no_End_Largeur%,wwp% position no_End_Hauteur%,hhp% text no_End_Couleur%,right$(hex$(ccc%),6) end_select res% = dll_call2("SelectElementInFlowChart",FC%,FCE%) end_if if DoPoints%=6 res% = dll_call4("IdentifyFlowChartLink",FC%,xxp%,yyp%,adr(FCL%)) if res%<0 message "Ce n'est pas un lien valide." DoPoints% = 0 res% = dll_call2("DrawFlowChart",FC%,1) return end_if ' message "Lien "+str$(res%)+" identifié" res% = dll_call2("SelectLinkInFlowChart",FC%,FCL%) DoPoints% = 0 res% = dll_call2("DrawFlowChart",FC%,5) end_if end_if end_if
return
sortir: terminate
AddConnector: AddConnector() return
AddAction: AddAction() return
AddCondition: AddCondition() return
AddSelector: AddSelector() return
AddStart: AddStart() return
AddEnd: AddEnd() return
selectionner: selectionner() return valider_connector: valider_connector() return valider_action: valider_action() return valider_Condition: valider_Condition() return annulerselection: annulerselection() return supprimerliens: supprimerliens() return valider_Selection: valider_Selection() return
valider_start: valider_start() return valider_end: valider_end() return nouveauprojet: nouveauprojet() return
ouvrirprojet: ouvrirprojet() return enregistrerprojet: enregistrerprojet() return enregistrersousprojet: enregistrersousprojet() return lier: lier() return annulerlier: annulerlier() return tracer: tracer() return exporter: exporter() return
selectionLien: selectionLien() return annulerSelLien: annulerSelLien() return supprimerLien: supprimerLien() return sub labels() label AddConnector, AddAction, AddCondition, AddSelector, AddStart, AddEnd label valider_connector, valider_action, valider_Condition, valider_Selection label valider_Start, valider_End label selectionner, annulerselection, supprimerliens, UserEvent, sortir label selectionLien, annulerSelLien, supprimerLien label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet label lier, annulerlier, tracer, exporter end_sub
sub constantes() dim KGF$ : KGF$ = "KGF.dll" dim M1% : M1% = 0-1 dim DeltaRectangle% : DeltaRectangle% = 10 dim LignesDeVisee% : ' nombre de lignes de visée (0, 1 ou 2) LignesDeVisee% = 2 dim nature$(6) nature$(0) = "Connector" nature$(1) = "Action" nature$(2) = "Condition" nature$(3) = "Selector" nature$(4) = "Start" nature$(5) = "End" end_sub
sub variables() dim res%, DoPoints%, pos%, xxp%, yyp%, titre$, wwp%, hhp%, i%, ccc%, output% dim xx%, yy%, NatureOutput%, NatureInput% dim npt%, xarray%(100),yarray%(100) dim no%, no1%, no2%, no_cElements%, no_AnnSel%, no_SuppLiens%, no_memo%, no_open%, no_save% dim no_AttributsConnector%, no_AttributsAction%, no_AttributsCondition% dim no_AttributsSelection%, no_AttributsStart%, no_AttributsEnd% dim no_Connector_X%, no_Connector_Y%, no_AnnLink%, no_Tracer% , no_Info%, no_infotext% dim no_Action_X%, no_Action_Y%, no_Action_Titre%, no_action_Couleur% dim no_Action_Largeur%, no_Action_Hauteur%, no_Action_Contenu%, no_export% dim no_Condition_X%, no_Condition_Y%, no_Condition_Titre%, no_condition_Couleur% dim no_Condition_Largeur%, no_Condition_Hauteur%, no_Condition_Contenu% dim no_Selection_X%, no_Selection_Y%, no_Selection_Titre%, no_selection_Couleur% dim no_Selection_Largeur%, no_Selection_Hauteur%, no_Selection_Contenu% dim no_Start_X%, no_Start_Y%, no_Start_Largeur%, no_Start_Hauteur%, no_start_Couleur% dim no_End_X%, no_End_Y%, no_End_Largeur%, no_End_Hauteur%, no_end_Couleur% dim no_AnnSelLink%, no_DelLink% dim FC%, FCE%, FCEstart%, FCEdest%, FCL% dim projet$ end_sub
sub menu() no% = no% + 1 : main_menu no% : no1% = no% no% = no% + 1 : sub_menu no% : parent no%,no1% : no2% = no% : caption no%,"Fichier" no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Nouveau" : on_click no%,nouveauprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Ouvrir..." : on_click no%,ouvrirprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer" : on_click no%,enregistrerprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer sous..." : on_click no%,enregistrersousprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Exporter..." : on_click no%,exporter no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"-" no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Sortir" : on_click no%,sortir end_sub
sub cadres() dim_local hnd% dll_on KGF$ no% = no% + 1 : form no% : hide no% : no_info% = no% : width no%,400 : height no%,200 no% = no% + 1 : memo no% : no_infotext% = no% : parent no%,no_info% : full_space no% : bar_both no% : font_size no%,12 no% = no% + 1 : container no% : no_cElements% = no% : width no%,200 : caption no%,"Eléments" FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%) full_space 0 res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0)) height no_cElements%,350 res% = dll_call2("ShowRulersInFlowChart",FC%,0) top no_info%,0 : left no_info%,width_client(0)-width(no_info%)-width(no_cElements%) hnd% = dll_call1("GetHandleOfFlowChart",FC%) res% = dll_call3("SetFormParent",handle(no_info%),hnd%,0) no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Début" top no%,15 : left no%,10 : on_click no%,AddStart no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Connecteur" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddConnector no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Action" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddAction no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Condition" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddCondition no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Selecteur" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddSelector no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Fin" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddEnd
no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sélectionner" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionner no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSel% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerselection no% = no% + 1 : button no% : parent no%,no_cElements% : no_SuppLiens% = no% : caption no%,"Supprimer lien" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,left(no%-1) : on_click no%,supprimerliens
no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Lier" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,lier no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnLink% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerlier no% = no% + 1 : button no% : parent no%,no_cElements% : no_Tracer% = no% : caption no%,"Tracer" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,tracer no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sel. Lien" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionLien no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSelLink% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerSelLien no% = no% + 1 : button no% : parent no%,no_cElements% : no_DelLink% = no% : caption no%,"Supprimer lien" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,supprimerLien
' attributs Connector no% = no% + 1 : container no% : no_AttributsConnector% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Connector" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Connector_X% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Connector_Y% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsConnector% : top no%,height(no_AttributsConnector%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_connector ' attributs Action no% = no% + 1 : container no% : no_AttributsAction% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Action" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Action_X% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Action_Y% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Action_Largeur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Action_Hauteur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Action_Couleur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Action_Titre% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Action_Contenu% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsAction% : top no%,height(no_AttributsAction%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_action
' attributs Condition no% = no% + 1 : container no% : no_AttributsCondition% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Condition" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Condition_X% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Condition_Y% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Condition_Largeur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Condition_Hauteur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Condition_Couleur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Condition_Titre% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Condition_Contenu% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsCondition% : top no%,height(no_AttributsCondition%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Condition
' attributs Selection no% = no% + 1 : container no% : no_AttributsSelection% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Selection" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Selection_X% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Selection_Y% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Selection_Largeur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Selection_Hauteur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Selection_Couleur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Selection_Titre% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Selection_Contenu% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsSelection% : top no%,height(no_AttributsSelection%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Selection
' attributs Start no% = no% + 1 : container no% : no_AttributsStart% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Start" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Start_X% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Start_Y% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Start_Largeur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Start_Hauteur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Start_Couleur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsStart% : top no%,height(no_AttributsStart%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Start
' attributs End no% = no% + 1 : container no% : no_AttributsEnd% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs End" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_End_X% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_End_Y% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_End_Largeur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_End_Hauteur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_End_Couleur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsEnd% : top no%,height(no_AttributsEnd%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_End
end_sub
sub Objets() no% = no% + 1 : memo no% : no_memo% = no% : hide no% : bar_both no% no% = no% + 1 : open_dialog no% : no_open% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj" no% = no% + 1 : save_dialog no% : no_save% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj" no% = no% + 1 : save_dialog no% : no_export% = no% : filter no%,"Images (BMP,JPG,GIF,PNG)|*.BMP;*.JPG;*.GIF;*.PNG" end_sub
sub AddConnector() FCE% = dll_call4("AddElementToFlowChart",FC%,0,0,0) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,20,20) res% = dll_call2("DrawFlowChart",FC%,1) position no_Connector_X%,0 position no_Connector_Y%,0 annulerselection() ' show no_AttributsConnector% end_sub
sub AddAction() dim_local titre$ titre$ = "Action" FCE% = dll_call4("AddElementToFlowChart",FC%,1,hex("FFFF00"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,200) res% = dll_call2("DrawFlowChart",FC%,1) position no_Action_X%,0 position no_Action_Y%,0 position no_Action_Largeur%,300 position no_Action_Hauteur%,200 text no_action_Couleur%,"FFFF00" text no_Action_Titre%,titre$ clear no_Action_Contenu% annulerselection() ' show no_AttributsAction% end_sub
sub AddCondition() dim_local titre$ titre$ = "Condition ?" FCE% = dll_call4("AddElementToFlowChart",FC%,2,hex("0000FF"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100) clear no_memo% item_add no_memo%,"." item_add no_memo%,"Oui" item_add no_memo%,"Non" res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%)) res% = dll_call2("DrawFlowChart",FC%,1) position no_Condition_X%,0 position no_Condition_Y%,0 position no_Condition_Largeur%,300 position no_Condition_Hauteur%,100 text no_Condition_Couleur%,"0000FF" text no_Condition_Titre%,titre$ clear no_Condition_Contenu% item_add no_Condition_Contenu%,"Oui" item_add no_Condition_Contenu%,"." item_add no_Condition_Contenu%,"Non" annulerselection() ' show no_AttributsCondition% end_sub
sub AddSelector() dim_local titre$ titre$ = "Sélection" FCE% = dll_call4("AddElementToFlowChart",FC%,3,hex("0000FF"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100) clear no_memo% item_add no_memo%,"1" item_add no_memo%,"2" item_add no_memo%,"3" res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%)) res% = dll_call2("DrawFlowChart",FC%,1) position no_Selection_X%,0 position no_Selection_Y%,0 position no_Selection_Largeur%,300 position no_Selection_Hauteur%,100 text no_Selection_Couleur%,"0000FF" text no_Selection_Titre%,titre$ clear no_Selection_Contenu% item_add no_Selection_Contenu%,"1" item_add no_Selection_Contenu%,"2" item_add no_Selection_Contenu%,"3" annulerselection() ' show no_AttributsSelection% end_sub
sub AddStart() dim_local titre$ titre$ = "Début" FCE% = dll_call4("AddElementToFlowChart",FC%,4,hex("F0F0F0"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100) res% = dll_call2("DrawFlowChart",FC%,1) position no_Start_X%,0 position no_Start_Y%,0 position no_Start_Largeur%,100 position no_Start_Hauteur%,100 text no_Start_Couleur%,"F0F0F0" annulerselection() ' show no_AttributsStart% end_sub
sub AddEnd() dim_local titre$ titre$ = "Arrêt" FCE% = dll_call4("AddElementToFlowChart",FC%,5,hex("F0F0F0"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100) res% = dll_call2("DrawFlowChart",FC%,1) position no_End_X%,0 position no_End_Y%,0 position no_End_Largeur%,100 position no_End_Hauteur%,100 text no_End_Couleur%,"F0F0F0" annulerselection() ' show no_AttributsEnd% end_sub
sub selectionner() show no_info% clear no_infotext% text no_infotext%,"Sélectionner un élément en cliquant dessus..." DoPoints% = 4 active no_AnnSel% active no_SuppLiens% hide no_AttributsConnector% hide no_AttributsAction% hide no_AttributsCondition% hide no_AttributsSelection% hide no_AttributsStart% hide no_AttributsEnd% 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) hide no_info% end_sub
sub supprimerliens() res% = dll_call2("RemoveAllLinksFromFlowChartElement",FC%,FCE%) end_sub
sub valider_connector() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Connector_X%),position(no_Connector_Y%),M1%,M1%) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsConnector% end_sub
sub valider_action() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Action_X%),position(no_Action_Y%),position(no_Action_Largeur%),position(no_Action_Hauteur%)) titre$ = trim$(text$(no_Action_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Action_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Action_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsAction% end_sub
sub valider_Condition() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Condition_X%),position(no_Condition_Y%),position(no_Condition_Largeur%),position(no_Condition_Hauteur%)) titre$ = trim$(text$(no_Condition_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Condition_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Condition_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsCondition% end_sub
sub valider_Selection() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Selection_X%),position(no_Selection_Y%),position(no_Selection_Largeur%),position(no_Selection_Hauteur%)) titre$ = trim$(text$(no_Selection_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Selection_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Selection_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsSelection% end_sub
sub valider_Start() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Start_X%),position(no_Start_Y%),position(no_Start_Largeur%),position(no_Start_Hauteur%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Start_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsStart% end_sub
sub valider_End() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_End_X%),position(no_End_Y%),position(no_End_Largeur%),position(no_End_Hauteur%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_End_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsEnd% end_sub
sub nouveauprojet() FC% = dll_call1("DeleteFlowChart",FC%) FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%) full_space 0 res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0)) ' height no_cElements%,300 projet$ = "" end_sub
sub ouvrirprojet() dim_local prj$ prj$ = file_name$(no_save%) if prj$="_" then exit_sub if lower$(file_extract_extension$(prj$))<>".fcproj" message "Extension erronnée (*.FCproj)" exit_sub end_if if file_exists(prj$)=0 message("Ce fichier n'existe pas." exit_sub end_if nouveauprojet() res% = dll_call2("LoadFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en chargement" else message "Le projet a été chargé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub enregistrerprojet() dim_local prj$ if projet$="" enregistrersousprojet() exit_sub end_if prj$ = projet$ if file_exists(prj$)=1 then file_delete prj$ res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en sauvegarde" else message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub enregistrersousprojet() dim_local prj$ prj$ = file_name$(no_save%) if prj$="_" then exit_sub if lower$(file_extract_extension$(prj$))<>".fcproj" message "Extension erronnée (*.FCproj)" exit_sub end_if if file_exists(prj$)=1 if message_confirmation_yes_no("Ce fichier existe déjà. Remplacer ?")<>1 then exit_sub file_delete prj$ end_if res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en sauvegarde" else message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub lier() DoPoints% = 1 npt% = 0 show no_info% clear no_infotext% text no_infotext%,"Cliquer sur une sortie..." active no_AnnLink% active no_Tracer% end_sub
sub annulerlier() res% = dll_call2("ShowRulersInFlowChart",FC%,0) DoPoints% = 0 npt% = 0 xarray%(0) = 0 res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0) res% = dll_call2("DrawFlowChart",FC%,1) inactive no_AnnLink% inactive no_Tracer% hide no_info% end_sub
sub tracer() dim_local do1% ' rectangulariser le dernier segment NatureInput% = dll_call3("GetInputConnectorOfFlowChartElement",FCEdest%,adr(xx%),adr(yy%)) if NatureInput%<>0 if npt%=0 res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xxp%),adr(yyp%)) else xxp% = xArray%(npt%) yyp% = yArray%(npt%) end_if
do1% = 0 if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% do1% = 1 else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% do1% = 1 end_if end_if if do1%=1 npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if if yyp%>(yy%-DeltaRectangle%) yyp% = yy% - DeltaRectangle% npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if if xxp%<>xx% xxp% = xx% npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if end_if res% = dll_call6("ConnectElementsOfFlowChart",FC%,FCEstart%,output%,FCEdest%,adr(xArray%),adr(yArray%)) if res%=0 then message "Erreur en créant la connexion" res% = dll_call2("ShowRulersInFlowChart",FC%,0) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0) ' res% = dll_call2("DrawFlowChart",FC%,1) DoPoints% = 0 npt% = 0 xarray%(0) = 0 inactive no_AnnLink% inactive no_Tracer% hide no_info% end_sub
sub exporter() dim_local f$ f$ = file_name$(no_export%) if f$="_" then exit_sub if instr(".bmp.jpg.gif.png",lower$(file_extract_extension$(f$)))=0 message "Erreur d'extension" exit_sub end_if if file_exists(f$)=1 if message_confirmation_yes_no("Cette image existe déjà? Remplacer ?")<>1 then exit_sub end_if res% = dll_call1("CopyFlowChartToClipboard",FC%) res% = dll_call1("SaveAnyImageFile",adr(f$)) message "L'image est enregistrée dans:"+chr$(13)+chr$(10)+f$ end_sub
sub selectionLien() DoPoints% = 6 npt% = 0 show no_info% clear no_infotext% text no_infotext%,"Cliquer sur un lien..." res% = dll_call2("DrawFlowChart",FC%,5) active no_AnnSelLink% active no_DelLink% end_sub sub annulerSelLien() DoPoints% = 0 npt% = 0 xarray%(0) = 0 res% = dll_call2("SelectLinkInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) inactive no_AnnSelLink% inactive no_DelLink% hide no_info% hide no_info% end_sub sub supprimerLien() res% = dll_call1("DeleteLinkFromFlowChart",FCL%) hide no_info% end_sub
| |
| | | Minibug
Nombre de messages : 4570 Age : 58 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Dim 18 Mar 2018 - 19:17 | |
| Testé et approuvé Klaus ! Ça devient de plus en plus intuitif et c'est super. Bravo pour le travail réalisé. | |
| | | Minibug
Nombre de messages : 4570 Age : 58 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Dim 18 Mar 2018 - 19:57 | |
| Klaus, en testant de nouveau ton programme, Je me demandais s'il était possible : 1/ lorsqu'un objet est déjà sélectionné et que l'on clique de nouveau dessus, de le désélectionner. 2/ lorsqu'un objet est déjà sélectionné et que l'on clique sur un autre objet, de sélectionner cet autre objet à la place. Toujours selon les possibilités techniques de ton programme, bien sûr ! | |
| | | Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Dim 18 Mar 2018 - 20:42 | |
| Ouin c'est une idée... Je vais voir ça cette nuit. | |
| | | Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Lun 19 Mar 2018 - 0:01 | |
| Voilà une version qui fait exactement ça. Seul le programme Panoramic est modifié, la DLL est inchangé: - Code:
-
' FlowChartDesigner.bas
labels() constantes() variables() menu() cadres() Objets()
on_user_event UserEvent
end
UserEvent: if bin_and(user_event_wparam,hex("FF000000"))=hex("0B000000") : ' ScrollImage pos% = user_event_lparam : ' positon: yyyyxxxx xxp% = bin_and(pos%,hex("0000FFFF")) yyp% = pos%/65536 if DoPoints%=5 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEnew%)) if res%<0 then return if FCEnew%=FCE% annulerselection() return else DoPoints% = 0 end_if end_if if DoPoints%=0 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%)) if res%<0 then return DoPoints% = 4 active no_AnnSel% active no_SuppLiens% hide no_AttributsConnector% hide no_AttributsAction% hide no_AttributsCondition% hide no_AttributsSelection% hide no_AttributsStart% hide no_AttributsEnd% end_if if DoPoints%>0 if DoPoints%=1 NatureOutput% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%)) if NatureOutput%<0 message "Ce n'est pas une sortie valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..." return end_if res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,output%) DoPoints% = 2 show no_info% clear no_infotext% text no_infotext%,"Cliquez maintenant l'élémént de destination"+chr$(13)+chr$(10)+"ou Annulez..." return end_if if DoPoints%=2 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEdest%)) if res%<0 message "Ce n'est pas un élément valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..." return end_if DoPoints% = 3 res% = dll_call2("SelectElementInFlowChart",FC%,FCEdest%) show no_info% clear no_infotext% text no_infotext%,"Cliquez maintenant les points d'étape"+chr$(13)+chr$(10)+"puis Tracez ou Annulez..." res% = dll_call2("ShowRulersInFlowChart",FC%,1) return end_if if DoPoints%=3 ' ici, rectangulariser le tracé if npt%=0 res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xx%),adr(yy%)) else xx% = xarray%(npt%) yy% = yarray%(npt%) end_if if (npt%=0) and (NatureOutput%<>0) if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% else npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yy% end_if end_if end_if if npt%>0 if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% else npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yy% end_if end_if end_if ' mémoriser le point npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% res% = dll_call3("DrawTemporaryMarkIntoFlowChart",FC%,xxp%,yyp%) res% = dll_call5("DrawTemporaryLineIntoFlowChart",FC%,xx%,yy%,xxp%,yyp%) ' message "Point "+str$(npt%)+": "+str$(xx%)+","+str$(yy% end_if if DoPoints%=4 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%)) if res%<0 message "Ce n'est pas un élément valide." return end_if ' message "Elément "+nature$(res%)+" identifié" hide no_info% DoPoints% = 5 select res% case 0 show no_AttributsConnector% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Connector_X%),handle(no_Connector_Y%),0,0) position no_Connector_X%,xxp% position no_Connector_Y%,yyp% case 1 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsAction% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Action_X%),handle(no_Action_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%)) position no_Action_X%,xxp% position no_Action_Y%,yyp% position no_Action_Largeur%,wwp% position no_Action_Hauteur%,hhp% text no_action_Couleur%,right$(hex$(ccc%),6) text no_Action_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Action_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Action_Contenu%,item_read$(no_memo%,i%) next i% end_if case 2 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsCondition% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Condition_X%),handle(no_Condition_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%)) position no_Condition_X%,xxp% position no_Condition_Y%,yyp% position no_Condition_Largeur%,wwp% position no_Condition_Hauteur%,hhp% text no_Condition_Couleur%,right$(hex$(ccc%),6) text no_Condition_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Condition_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Condition_Contenu%,item_read$(no_memo%,i%) next i% end_if case 3 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsSelection% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Selection_X%),handle(no_Selection_Y%),handle(no_Selection_Largeur%),handle(no_Selection_Hauteur%)) position no_Selection_X%,xxp% position no_Selection_Y%,yyp% position no_Selection_Largeur%,wwp% position no_Selection_Hauteur%,hhp% text no_Selection_Couleur%,right$(hex$(ccc%),6) text no_Selection_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Selection_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Selection_Contenu%,item_read$(no_memo%,i%) next i% end_if case 4 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsStart% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Start_X%),handle(no_Start_Y%),handle(no_Start_Largeur%),handle(no_Start_Hauteur%)) position no_Start_X%,xxp% position no_Start_Y%,yyp% position no_Start_Largeur%,wwp% position no_Start_Hauteur%,hhp% text no_Start_Couleur%,right$(hex$(ccc%),6) case 5 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsEnd% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_End_X%),handle(no_End_Y%),handle(no_End_Largeur%),handle(no_End_Hauteur%)) position no_End_X%,xxp% position no_End_Y%,yyp% position no_End_Largeur%,wwp% position no_End_Hauteur%,hhp% text no_End_Couleur%,right$(hex$(ccc%),6) end_select res% = dll_call2("SelectElementInFlowChart",FC%,FCE%) end_if if DoPoints%=6 res% = dll_call4("IdentifyFlowChartLink",FC%,xxp%,yyp%,adr(FCL%)) if res%<0 message "Ce n'est pas un lien valide." DoPoints% = 0 res% = dll_call2("DrawFlowChart",FC%,1) return end_if ' message "Lien "+str$(res%)+" identifié" res% = dll_call2("SelectLinkInFlowChart",FC%,FCL%) DoPoints% = 0 res% = dll_call2("DrawFlowChart",FC%,5) end_if end_if end_if
return
sortir: terminate
AddConnector: AddConnector() return
AddAction: AddAction() return
AddCondition: AddCondition() return
AddSelector: AddSelector() return
AddStart: AddStart() return
AddEnd: AddEnd() return
selectionner: selectionner() return valider_connector: valider_connector() return valider_action: valider_action() return valider_Condition: valider_Condition() return annulerselection: annulerselection() return supprimerliens: supprimerliens() return valider_Selection: valider_Selection() return
valider_start: valider_start() return valider_end: valider_end() return nouveauprojet: nouveauprojet() return
ouvrirprojet: ouvrirprojet() return enregistrerprojet: enregistrerprojet() return enregistrersousprojet: enregistrersousprojet() return lier: lier() return annulerlier: annulerlier() return tracer: tracer() return exporter: exporter() return
selectionLien: selectionLien() return annulerSelLien: annulerSelLien() return supprimerLien: supprimerLien() return sub labels() label AddConnector, AddAction, AddCondition, AddSelector, AddStart, AddEnd label valider_connector, valider_action, valider_Condition, valider_Selection label valider_Start, valider_End label selectionner, annulerselection, supprimerliens, UserEvent, sortir label selectionLien, annulerSelLien, supprimerLien label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet label lier, annulerlier, tracer, exporter end_sub
sub constantes() dim KGF$ : KGF$ = "KGF.dll" dim M1% : M1% = 0-1 dim DeltaRectangle% : DeltaRectangle% = 10 dim LignesDeVisee% : ' nombre de lignes de visée (0, 1 ou 2) LignesDeVisee% = 2 dim nature$(6) nature$(0) = "Connector" nature$(1) = "Action" nature$(2) = "Condition" nature$(3) = "Selector" nature$(4) = "Start" nature$(5) = "End" end_sub
sub variables() dim res%, DoPoints%, pos%, xxp%, yyp%, titre$, wwp%, hhp%, i%, ccc%, output% dim xx%, yy%, NatureOutput%, NatureInput% dim npt%, xarray%(100),yarray%(100) dim no%, no1%, no2%, no_cElements%, no_AnnSel%, no_SuppLiens%, no_memo%, no_open%, no_save% dim no_AttributsConnector%, no_AttributsAction%, no_AttributsCondition% dim no_AttributsSelection%, no_AttributsStart%, no_AttributsEnd% dim no_Connector_X%, no_Connector_Y%, no_AnnLink%, no_Tracer% , no_Info%, no_infotext% dim no_Action_X%, no_Action_Y%, no_Action_Titre%, no_action_Couleur% dim no_Action_Largeur%, no_Action_Hauteur%, no_Action_Contenu%, no_export% dim no_Condition_X%, no_Condition_Y%, no_Condition_Titre%, no_condition_Couleur% dim no_Condition_Largeur%, no_Condition_Hauteur%, no_Condition_Contenu% dim no_Selection_X%, no_Selection_Y%, no_Selection_Titre%, no_selection_Couleur% dim no_Selection_Largeur%, no_Selection_Hauteur%, no_Selection_Contenu% dim no_Start_X%, no_Start_Y%, no_Start_Largeur%, no_Start_Hauteur%, no_start_Couleur% dim no_End_X%, no_End_Y%, no_End_Largeur%, no_End_Hauteur%, no_end_Couleur% dim no_AnnSelLink%, no_DelLink% dim FC%, FCE%, FCEstart%, FCEdest%, FCL%, FCEnew% dim projet$ end_sub
sub menu() no% = no% + 1 : main_menu no% : no1% = no% no% = no% + 1 : sub_menu no% : parent no%,no1% : no2% = no% : caption no%,"Fichier" no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Nouveau" : on_click no%,nouveauprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Ouvrir..." : on_click no%,ouvrirprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer" : on_click no%,enregistrerprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer sous..." : on_click no%,enregistrersousprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Exporter..." : on_click no%,exporter no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"-" no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Sortir" : on_click no%,sortir end_sub
sub cadres() dim_local hnd% dll_on KGF$ no% = no% + 1 : form no% : hide no% : no_info% = no% : width no%,400 : height no%,200 no% = no% + 1 : memo no% : no_infotext% = no% : parent no%,no_info% : full_space no% : bar_both no% : font_size no%,12 no% = no% + 1 : container no% : no_cElements% = no% : width no%,200 : caption no%,"Eléments" FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%) full_space 0 res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0)) height no_cElements%,350 res% = dll_call2("ShowRulersInFlowChart",FC%,0) top no_info%,0 : left no_info%,width_client(0)-width(no_info%)-width(no_cElements%) hnd% = dll_call1("GetHandleOfFlowChart",FC%) res% = dll_call3("SetFormParent",handle(no_info%),hnd%,0) no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Début" top no%,15 : left no%,10 : on_click no%,AddStart no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Connecteur" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddConnector no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Action" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddAction no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Condition" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddCondition no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Selecteur" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddSelector no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Fin" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddEnd
no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sélectionner" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionner no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSel% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerselection no% = no% + 1 : button no% : parent no%,no_cElements% : no_SuppLiens% = no% : caption no%,"Supprimer lien" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,left(no%-1) : on_click no%,supprimerliens
no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Lier" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,lier no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnLink% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerlier no% = no% + 1 : button no% : parent no%,no_cElements% : no_Tracer% = no% : caption no%,"Tracer" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,tracer no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sel. Lien" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionLien no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSelLink% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerSelLien no% = no% + 1 : button no% : parent no%,no_cElements% : no_DelLink% = no% : caption no%,"Supprimer lien" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,supprimerLien
' attributs Connector no% = no% + 1 : container no% : no_AttributsConnector% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Connector" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Connector_X% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Connector_Y% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsConnector% : top no%,height(no_AttributsConnector%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_connector ' attributs Action no% = no% + 1 : container no% : no_AttributsAction% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Action" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Action_X% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Action_Y% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Action_Largeur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Action_Hauteur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Action_Couleur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Action_Titre% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Action_Contenu% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsAction% : top no%,height(no_AttributsAction%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_action
' attributs Condition no% = no% + 1 : container no% : no_AttributsCondition% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Condition" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Condition_X% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Condition_Y% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Condition_Largeur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Condition_Hauteur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Condition_Couleur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Condition_Titre% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Condition_Contenu% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsCondition% : top no%,height(no_AttributsCondition%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Condition
' attributs Selection no% = no% + 1 : container no% : no_AttributsSelection% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Selection" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Selection_X% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Selection_Y% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Selection_Largeur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Selection_Hauteur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Selection_Couleur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Selection_Titre% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Selection_Contenu% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsSelection% : top no%,height(no_AttributsSelection%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Selection
' attributs Start no% = no% + 1 : container no% : no_AttributsStart% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Start" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Start_X% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Start_Y% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Start_Largeur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Start_Hauteur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Start_Couleur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsStart% : top no%,height(no_AttributsStart%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Start
' attributs End no% = no% + 1 : container no% : no_AttributsEnd% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs End" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_End_X% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_End_Y% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_End_Largeur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_End_Hauteur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_End_Couleur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsEnd% : top no%,height(no_AttributsEnd%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_End
end_sub
sub Objets() no% = no% + 1 : memo no% : no_memo% = no% : hide no% : bar_both no% no% = no% + 1 : open_dialog no% : no_open% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj" no% = no% + 1 : save_dialog no% : no_save% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj" no% = no% + 1 : save_dialog no% : no_export% = no% : filter no%,"Images (BMP,JPG,GIF,PNG)|*.BMP;*.JPG;*.GIF;*.PNG" end_sub
sub AddConnector() FCE% = dll_call4("AddElementToFlowChart",FC%,0,0,0) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,20,20) res% = dll_call2("DrawFlowChart",FC%,1) position no_Connector_X%,0 position no_Connector_Y%,0 annulerselection() ' show no_AttributsConnector% end_sub
sub AddAction() dim_local titre$ titre$ = "Action" FCE% = dll_call4("AddElementToFlowChart",FC%,1,hex("FFFF00"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,200) res% = dll_call2("DrawFlowChart",FC%,1) position no_Action_X%,0 position no_Action_Y%,0 position no_Action_Largeur%,300 position no_Action_Hauteur%,200 text no_action_Couleur%,"FFFF00" text no_Action_Titre%,titre$ clear no_Action_Contenu% annulerselection() ' show no_AttributsAction% end_sub
sub AddCondition() dim_local titre$ titre$ = "Condition ?" FCE% = dll_call4("AddElementToFlowChart",FC%,2,hex("0000FF"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100) clear no_memo% item_add no_memo%,"." item_add no_memo%,"Oui" item_add no_memo%,"Non" res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%)) res% = dll_call2("DrawFlowChart",FC%,1) position no_Condition_X%,0 position no_Condition_Y%,0 position no_Condition_Largeur%,300 position no_Condition_Hauteur%,100 text no_Condition_Couleur%,"0000FF" text no_Condition_Titre%,titre$ clear no_Condition_Contenu% item_add no_Condition_Contenu%,"Oui" item_add no_Condition_Contenu%,"." item_add no_Condition_Contenu%,"Non" annulerselection() ' show no_AttributsCondition% end_sub
sub AddSelector() dim_local titre$ titre$ = "Sélection" FCE% = dll_call4("AddElementToFlowChart",FC%,3,hex("0000FF"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100) clear no_memo% item_add no_memo%,"1" item_add no_memo%,"2" item_add no_memo%,"3" res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%)) res% = dll_call2("DrawFlowChart",FC%,1) position no_Selection_X%,0 position no_Selection_Y%,0 position no_Selection_Largeur%,300 position no_Selection_Hauteur%,100 text no_Selection_Couleur%,"0000FF" text no_Selection_Titre%,titre$ clear no_Selection_Contenu% item_add no_Selection_Contenu%,"1" item_add no_Selection_Contenu%,"2" item_add no_Selection_Contenu%,"3" annulerselection() ' show no_AttributsSelection% end_sub
sub AddStart() dim_local titre$ titre$ = "Début" FCE% = dll_call4("AddElementToFlowChart",FC%,4,hex("F0F0F0"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100) res% = dll_call2("DrawFlowChart",FC%,1) position no_Start_X%,0 position no_Start_Y%,0 position no_Start_Largeur%,100 position no_Start_Hauteur%,100 text no_Start_Couleur%,"F0F0F0" annulerselection() ' show no_AttributsStart% end_sub
sub AddEnd() dim_local titre$ titre$ = "Arrêt" FCE% = dll_call4("AddElementToFlowChart",FC%,5,hex("F0F0F0"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100) res% = dll_call2("DrawFlowChart",FC%,1) position no_End_X%,0 position no_End_Y%,0 position no_End_Largeur%,100 position no_End_Hauteur%,100 text no_End_Couleur%,"F0F0F0" annulerselection() ' show no_AttributsEnd% end_sub
sub selectionner() show no_info% clear no_infotext% text no_infotext%,"Sélectionner un élément en cliquant dessus..." DoPoints% = 4 active no_AnnSel% active no_SuppLiens% hide no_AttributsConnector% hide no_AttributsAction% hide no_AttributsCondition% hide no_AttributsSelection% hide no_AttributsStart% hide no_AttributsEnd% 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) hide no_info% end_sub
sub supprimerliens() res% = dll_call2("RemoveAllLinksFromFlowChartElement",FC%,FCE%) end_sub
sub valider_connector() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Connector_X%),position(no_Connector_Y%),M1%,M1%) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsConnector% end_sub
sub valider_action() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Action_X%),position(no_Action_Y%),position(no_Action_Largeur%),position(no_Action_Hauteur%)) titre$ = trim$(text$(no_Action_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Action_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Action_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsAction% end_sub
sub valider_Condition() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Condition_X%),position(no_Condition_Y%),position(no_Condition_Largeur%),position(no_Condition_Hauteur%)) titre$ = trim$(text$(no_Condition_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Condition_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Condition_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsCondition% end_sub
sub valider_Selection() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Selection_X%),position(no_Selection_Y%),position(no_Selection_Largeur%),position(no_Selection_Hauteur%)) titre$ = trim$(text$(no_Selection_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Selection_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Selection_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsSelection% end_sub
sub valider_Start() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Start_X%),position(no_Start_Y%),position(no_Start_Largeur%),position(no_Start_Hauteur%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Start_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsStart% end_sub
sub valider_End() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_End_X%),position(no_End_Y%),position(no_End_Largeur%),position(no_End_Hauteur%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_End_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsEnd% end_sub
sub nouveauprojet() FC% = dll_call1("DeleteFlowChart",FC%) FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%) full_space 0 res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0)) ' height no_cElements%,300 projet$ = "" end_sub
sub ouvrirprojet() dim_local prj$ prj$ = file_name$(no_save%) if prj$="_" then exit_sub if lower$(file_extract_extension$(prj$))<>".fcproj" message "Extension erronnée (*.FCproj)" exit_sub end_if if file_exists(prj$)=0 message("Ce fichier n'existe pas." exit_sub end_if nouveauprojet() res% = dll_call2("LoadFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en chargement" else message "Le projet a été chargé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub enregistrerprojet() dim_local prj$ if projet$="" enregistrersousprojet() exit_sub end_if prj$ = projet$ if file_exists(prj$)=1 then file_delete prj$ res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en sauvegarde" else message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub enregistrersousprojet() dim_local prj$ prj$ = file_name$(no_save%) if prj$="_" then exit_sub if lower$(file_extract_extension$(prj$))<>".fcproj" message "Extension erronnée (*.FCproj)" exit_sub end_if if file_exists(prj$)=1 if message_confirmation_yes_no("Ce fichier existe déjà. Remplacer ?")<>1 then exit_sub file_delete prj$ end_if res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en sauvegarde" else message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub lier() DoPoints% = 1 npt% = 0 show no_info% clear no_infotext% text no_infotext%,"Cliquer sur une sortie..." active no_AnnLink% active no_Tracer% end_sub
sub annulerlier() res% = dll_call2("ShowRulersInFlowChart",FC%,0) DoPoints% = 0 npt% = 0 xarray%(0) = 0 res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0) res% = dll_call2("DrawFlowChart",FC%,1) inactive no_AnnLink% inactive no_Tracer% hide no_info% end_sub
sub tracer() dim_local do1% ' rectangulariser le dernier segment NatureInput% = dll_call3("GetInputConnectorOfFlowChartElement",FCEdest%,adr(xx%),adr(yy%)) if NatureInput%<>0 if npt%=0 res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xxp%),adr(yyp%)) else xxp% = xArray%(npt%) yyp% = yArray%(npt%) end_if
do1% = 0 if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% do1% = 1 else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% do1% = 1 end_if end_if if do1%=1 npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if if yyp%>(yy%-DeltaRectangle%) yyp% = yy% - DeltaRectangle% npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if if xxp%<>xx% xxp% = xx% npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if end_if res% = dll_call6("ConnectElementsOfFlowChart",FC%,FCEstart%,output%,FCEdest%,adr(xArray%),adr(yArray%)) if res%=0 then message "Erreur en créant la connexion" res% = dll_call2("ShowRulersInFlowChart",FC%,0) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0) ' res% = dll_call2("DrawFlowChart",FC%,1) DoPoints% = 0 npt% = 0 xarray%(0) = 0 inactive no_AnnLink% inactive no_Tracer% hide no_info% end_sub
sub exporter() dim_local f$ f$ = file_name$(no_export%) if f$="_" then exit_sub if instr(".bmp.jpg.gif.png",lower$(file_extract_extension$(f$)))=0 message "Erreur d'extension" exit_sub end_if if file_exists(f$)=1 if message_confirmation_yes_no("Cette image existe déjà? Remplacer ?")<>1 then exit_sub end_if res% = dll_call1("CopyFlowChartToClipboard",FC%) res% = dll_call1("SaveAnyImageFile",adr(f$)) message "L'image est enregistrée dans:"+chr$(13)+chr$(10)+f$ end_sub
sub selectionLien() DoPoints% = 6 npt% = 0 show no_info% clear no_infotext% text no_infotext%,"Cliquer sur un lien..." res% = dll_call2("DrawFlowChart",FC%,5) active no_AnnSelLink% active no_DelLink% end_sub sub annulerSelLien() DoPoints% = 0 npt% = 0 xarray%(0) = 0 res% = dll_call2("SelectLinkInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) inactive no_AnnSelLink% inactive no_DelLink% hide no_info% hide no_info% end_sub sub supprimerLien() res% = dll_call1("DeleteLinkFromFlowChart",FCL%) hide no_info% end_sub
| |
| | | Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Lun 19 Mar 2018 - 1:26 | |
| Nouvelle version: en plus des modifications fonctionnelles concernant la sélection des éléments, j'ai levé unne restrictiion absolument ridicule: le nombre de liens identifiables par la sélection de liens était de 255 alors qu'un peut créer autant de liens qu'on veut (dans la limite des 32 bits, tout de même). Ceci est corrigé, sans changement d'apparence ni de fonctionnalité. Recharger KGF.dll du WebDav, dossier DLLs. Voici le programme qui gère cela: - Code:
-
' FlowChartDesigner.bas
labels() constantes() variables() menu() cadres() Objets()
on_user_event UserEvent
end
UserEvent: if bin_and(user_event_wparam,hex("FF000000"))=hex("0B000000") : ' ScrollImage pos% = user_event_lparam : ' positon: yyyyxxxx xxp% = bin_and(pos%,hex("0000FFFF")) yyp% = pos%/65536 if DoPoints%=5 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEnew%)) if res%<0 then return if FCEnew%=FCE% annulerselection() return else DoPoints% = 0 end_if end_if if DoPoints%=0 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%)) if res%<0 then return DoPoints% = 4 active no_AnnSel% active no_SuppLiens% hide no_AttributsConnector% hide no_AttributsAction% hide no_AttributsCondition% hide no_AttributsSelection% hide no_AttributsStart% hide no_AttributsEnd% end_if if DoPoints%>0 if DoPoints%=1 NatureOutput% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%)) if NatureOutput%<0 message "Ce n'est pas une sortie valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..." return end_if res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,output%) DoPoints% = 2 show no_info% clear no_infotext% text no_infotext%,"Cliquez maintenant l'élémént de destination"+chr$(13)+chr$(10)+"ou Annulez..." return end_if if DoPoints%=2 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEdest%)) if res%<0 message "Ce n'est pas un élément valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..." return end_if DoPoints% = 3 res% = dll_call2("SelectElementInFlowChart",FC%,FCEdest%) show no_info% clear no_infotext% text no_infotext%,"Cliquez maintenant les points d'étape"+chr$(13)+chr$(10)+"puis Tracez ou Annulez..." res% = dll_call2("ShowRulersInFlowChart",FC%,1) return end_if if DoPoints%=3 ' ici, rectangulariser le tracé if npt%=0 res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xx%),adr(yy%)) else xx% = xarray%(npt%) yy% = yarray%(npt%) end_if if (npt%=0) and (NatureOutput%<>0) if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% else npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yy% end_if end_if end_if if npt%>0 if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% else npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yy% end_if end_if end_if ' mémoriser le point npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% res% = dll_call3("DrawTemporaryMarkIntoFlowChart",FC%,xxp%,yyp%) res% = dll_call5("DrawTemporaryLineIntoFlowChart",FC%,xx%,yy%,xxp%,yyp%) ' message "Point "+str$(npt%)+": "+str$(xx%)+","+str$(yy% end_if if DoPoints%=4 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%)) if res%<0 message "Ce n'est pas un élément valide." return end_if ' message "Elément "+nature$(res%)+" identifié" hide no_info% DoPoints% = 5 select res% case 0 show no_AttributsConnector% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Connector_X%),handle(no_Connector_Y%),0,0) position no_Connector_X%,xxp% position no_Connector_Y%,yyp% case 1 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsAction% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Action_X%),handle(no_Action_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%)) position no_Action_X%,xxp% position no_Action_Y%,yyp% position no_Action_Largeur%,wwp% position no_Action_Hauteur%,hhp% text no_action_Couleur%,right$(hex$(ccc%),6) text no_Action_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Action_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Action_Contenu%,item_read$(no_memo%,i%) next i% end_if case 2 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsCondition% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Condition_X%),handle(no_Condition_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%)) position no_Condition_X%,xxp% position no_Condition_Y%,yyp% position no_Condition_Largeur%,wwp% position no_Condition_Hauteur%,hhp% text no_Condition_Couleur%,right$(hex$(ccc%),6) text no_Condition_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Condition_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Condition_Contenu%,item_read$(no_memo%,i%) next i% end_if case 3 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsSelection% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Selection_X%),handle(no_Selection_Y%),handle(no_Selection_Largeur%),handle(no_Selection_Hauteur%)) position no_Selection_X%,xxp% position no_Selection_Y%,yyp% position no_Selection_Largeur%,wwp% position no_Selection_Hauteur%,hhp% text no_Selection_Couleur%,right$(hex$(ccc%),6) text no_Selection_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Selection_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Selection_Contenu%,item_read$(no_memo%,i%) next i% end_if case 4 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsStart% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Start_X%),handle(no_Start_Y%),handle(no_Start_Largeur%),handle(no_Start_Hauteur%)) position no_Start_X%,xxp% position no_Start_Y%,yyp% position no_Start_Largeur%,wwp% position no_Start_Hauteur%,hhp% text no_Start_Couleur%,right$(hex$(ccc%),6) case 5 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsEnd% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_End_X%),handle(no_End_Y%),handle(no_End_Largeur%),handle(no_End_Hauteur%)) position no_End_X%,xxp% position no_End_Y%,yyp% position no_End_Largeur%,wwp% position no_End_Hauteur%,hhp% text no_End_Couleur%,right$(hex$(ccc%),6) end_select res% = dll_call2("SelectElementInFlowChart",FC%,FCE%) end_if if DoPoints%=6 res% = dll_call4("IdentifyFlowChartLink",FC%,xxp%,yyp%,adr(FCL%)) if res%<0 message "Ce n'est pas un lien valide." DoPoints% = 0 res% = dll_call2("DrawFlowChart",FC%,1) return end_if ' message "Lien "+str$(res%)+" identifié" res% = dll_call2("SelectLinkInFlowChart",FC%,FCL%) DoPoints% = 0 res% = dll_call2("DrawFlowChart",FC%,5) end_if end_if end_if
return
sortir: terminate
AddConnector: AddConnector() return
AddAction: AddAction() return
AddCondition: AddCondition() return
AddSelector: AddSelector() return
AddStart: AddStart() return
AddEnd: AddEnd() return
selectionner: selectionner() return valider_connector: valider_connector() return valider_action: valider_action() return valider_Condition: valider_Condition() return annulerselection: annulerselection() return supprimerliens: supprimerliens() return valider_Selection: valider_Selection() return
valider_start: valider_start() return valider_end: valider_end() return nouveauprojet: nouveauprojet() return
ouvrirprojet: ouvrirprojet() return enregistrerprojet: enregistrerprojet() return enregistrersousprojet: enregistrersousprojet() return lier: lier() return annulerlier: annulerlier() return tracer: tracer() return exporter: exporter() return
selectionLien: selectionLien() return annulerSelLien: annulerSelLien() return supprimerLien: supprimerLien() return sub labels() label AddConnector, AddAction, AddCondition, AddSelector, AddStart, AddEnd label valider_connector, valider_action, valider_Condition, valider_Selection label valider_Start, valider_End label selectionner, annulerselection, supprimerliens, UserEvent, sortir label selectionLien, annulerSelLien, supprimerLien label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet label lier, annulerlier, tracer, exporter end_sub
sub constantes() dim KGF$ : KGF$ = "KGF.dll" dim M1% : M1% = 0-1 dim DeltaRectangle% : DeltaRectangle% = 10 dim LignesDeVisee% : ' nombre de lignes de visée (0, 1 ou 2) LignesDeVisee% = 2 dim nature$(6) nature$(0) = "Connector" nature$(1) = "Action" nature$(2) = "Condition" nature$(3) = "Selector" nature$(4) = "Start" nature$(5) = "End" end_sub
sub variables() dim res%, DoPoints%, pos%, xxp%, yyp%, titre$, wwp%, hhp%, i%, ccc%, output% dim xx%, yy%, NatureOutput%, NatureInput% dim npt%, xarray%(100),yarray%(100) dim no%, no1%, no2%, no_cElements%, no_AnnSel%, no_SuppLiens%, no_memo%, no_open%, no_save% dim no_AttributsConnector%, no_AttributsAction%, no_AttributsCondition% dim no_AttributsSelection%, no_AttributsStart%, no_AttributsEnd% dim no_Connector_X%, no_Connector_Y%, no_AnnLink%, no_Tracer% , no_Info%, no_infotext% dim no_Action_X%, no_Action_Y%, no_Action_Titre%, no_action_Couleur% dim no_Action_Largeur%, no_Action_Hauteur%, no_Action_Contenu%, no_export% dim no_Condition_X%, no_Condition_Y%, no_Condition_Titre%, no_condition_Couleur% dim no_Condition_Largeur%, no_Condition_Hauteur%, no_Condition_Contenu% dim no_Selection_X%, no_Selection_Y%, no_Selection_Titre%, no_selection_Couleur% dim no_Selection_Largeur%, no_Selection_Hauteur%, no_Selection_Contenu% dim no_Start_X%, no_Start_Y%, no_Start_Largeur%, no_Start_Hauteur%, no_start_Couleur% dim no_End_X%, no_End_Y%, no_End_Largeur%, no_End_Hauteur%, no_end_Couleur% dim no_AnnSelLink%, no_DelLink% dim FC%, FCE%, FCEstart%, FCEdest%, FCL%, FCEnew% dim projet$ end_sub
sub menu() no% = no% + 1 : main_menu no% : no1% = no% no% = no% + 1 : sub_menu no% : parent no%,no1% : no2% = no% : caption no%,"Fichier" no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Nouveau" : on_click no%,nouveauprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Ouvrir..." : on_click no%,ouvrirprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer" : on_click no%,enregistrerprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer sous..." : on_click no%,enregistrersousprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Exporter..." : on_click no%,exporter no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"-" no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Sortir" : on_click no%,sortir end_sub
sub cadres() dim_local hnd% dll_on KGF$ no% = no% + 1 : form no% : hide no% : no_info% = no% : width no%,400 : height no%,200 no% = no% + 1 : memo no% : no_infotext% = no% : parent no%,no_info% : full_space no% : bar_both no% : font_size no%,12 no% = no% + 1 : container no% : no_cElements% = no% : width no%,200 : caption no%,"Eléments" FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%) full_space 0 res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0)) height no_cElements%,350 res% = dll_call2("ShowRulersInFlowChart",FC%,0) top no_info%,0 : left no_info%,width_client(0)-width(no_info%)-width(no_cElements%) hnd% = dll_call1("GetHandleOfFlowChart",FC%) res% = dll_call3("SetFormParent",handle(no_info%),hnd%,0) no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Début" top no%,15 : left no%,10 : on_click no%,AddStart no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Connecteur" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddConnector no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Action" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddAction no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Condition" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddCondition no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Selecteur" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddSelector no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Fin" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddEnd
no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sélectionner" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionner no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSel% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerselection no% = no% + 1 : button no% : parent no%,no_cElements% : no_SuppLiens% = no% : caption no%,"Supprimer lien" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,left(no%-1) : on_click no%,supprimerliens
no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Lier" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,lier no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnLink% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerlier no% = no% + 1 : button no% : parent no%,no_cElements% : no_Tracer% = no% : caption no%,"Tracer" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,tracer no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sel. Lien" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionLien no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSelLink% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerSelLien no% = no% + 1 : button no% : parent no%,no_cElements% : no_DelLink% = no% : caption no%,"Supprimer lien" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,supprimerLien
' attributs Connector no% = no% + 1 : container no% : no_AttributsConnector% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Connector" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Connector_X% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Connector_Y% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsConnector% : top no%,height(no_AttributsConnector%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_connector ' attributs Action no% = no% + 1 : container no% : no_AttributsAction% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Action" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Action_X% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Action_Y% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Action_Largeur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Action_Hauteur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Action_Couleur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Action_Titre% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Action_Contenu% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsAction% : top no%,height(no_AttributsAction%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_action
' attributs Condition no% = no% + 1 : container no% : no_AttributsCondition% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Condition" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Condition_X% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Condition_Y% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Condition_Largeur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Condition_Hauteur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Condition_Couleur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Condition_Titre% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Condition_Contenu% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsCondition% : top no%,height(no_AttributsCondition%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Condition
' attributs Selection no% = no% + 1 : container no% : no_AttributsSelection% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Selection" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Selection_X% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Selection_Y% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Selection_Largeur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Selection_Hauteur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Selection_Couleur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Selection_Titre% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Selection_Contenu% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsSelection% : top no%,height(no_AttributsSelection%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Selection
' attributs Start no% = no% + 1 : container no% : no_AttributsStart% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Start" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Start_X% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Start_Y% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Start_Largeur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Start_Hauteur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Start_Couleur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsStart% : top no%,height(no_AttributsStart%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Start
' attributs End no% = no% + 1 : container no% : no_AttributsEnd% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs End" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_End_X% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_End_Y% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_End_Largeur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_End_Hauteur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_End_Couleur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsEnd% : top no%,height(no_AttributsEnd%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_End
end_sub
sub Objets() no% = no% + 1 : memo no% : no_memo% = no% : hide no% : bar_both no% no% = no% + 1 : open_dialog no% : no_open% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj" no% = no% + 1 : save_dialog no% : no_save% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj" no% = no% + 1 : save_dialog no% : no_export% = no% : filter no%,"Images (BMP,JPG,GIF,PNG)|*.BMP;*.JPG;*.GIF;*.PNG" end_sub
sub AddConnector() FCE% = dll_call4("AddElementToFlowChart",FC%,0,0,0) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,20,20) res% = dll_call2("DrawFlowChart",FC%,1) position no_Connector_X%,0 position no_Connector_Y%,0 annulerselection() ' show no_AttributsConnector% end_sub
sub AddAction() dim_local titre$ titre$ = "Action" FCE% = dll_call4("AddElementToFlowChart",FC%,1,hex("FFFF00"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,200) res% = dll_call2("DrawFlowChart",FC%,1) position no_Action_X%,0 position no_Action_Y%,0 position no_Action_Largeur%,300 position no_Action_Hauteur%,200 text no_action_Couleur%,"FFFF00" text no_Action_Titre%,titre$ clear no_Action_Contenu% annulerselection() ' show no_AttributsAction% end_sub
sub AddCondition() dim_local titre$ titre$ = "Condition ?" FCE% = dll_call4("AddElementToFlowChart",FC%,2,hex("0000FF"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100) clear no_memo% item_add no_memo%,"." item_add no_memo%,"Oui" item_add no_memo%,"Non" res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%)) res% = dll_call2("DrawFlowChart",FC%,1) position no_Condition_X%,0 position no_Condition_Y%,0 position no_Condition_Largeur%,300 position no_Condition_Hauteur%,100 text no_Condition_Couleur%,"0000FF" text no_Condition_Titre%,titre$ clear no_Condition_Contenu% item_add no_Condition_Contenu%,"Oui" item_add no_Condition_Contenu%,"." item_add no_Condition_Contenu%,"Non" annulerselection() ' show no_AttributsCondition% end_sub
sub AddSelector() dim_local titre$ titre$ = "Sélection" FCE% = dll_call4("AddElementToFlowChart",FC%,3,hex("0000FF"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100) clear no_memo% item_add no_memo%,"1" item_add no_memo%,"2" item_add no_memo%,"3" res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%)) res% = dll_call2("DrawFlowChart",FC%,1) position no_Selection_X%,0 position no_Selection_Y%,0 position no_Selection_Largeur%,300 position no_Selection_Hauteur%,100 text no_Selection_Couleur%,"0000FF" text no_Selection_Titre%,titre$ clear no_Selection_Contenu% item_add no_Selection_Contenu%,"1" item_add no_Selection_Contenu%,"2" item_add no_Selection_Contenu%,"3" annulerselection() ' show no_AttributsSelection% end_sub
sub AddStart() dim_local titre$ titre$ = "Début" FCE% = dll_call4("AddElementToFlowChart",FC%,4,hex("F0F0F0"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100) res% = dll_call2("DrawFlowChart",FC%,1) position no_Start_X%,0 position no_Start_Y%,0 position no_Start_Largeur%,100 position no_Start_Hauteur%,100 text no_Start_Couleur%,"F0F0F0" annulerselection() ' show no_AttributsStart% end_sub
sub AddEnd() dim_local titre$ titre$ = "Arrêt" FCE% = dll_call4("AddElementToFlowChart",FC%,5,hex("F0F0F0"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100) res% = dll_call2("DrawFlowChart",FC%,1) position no_End_X%,0 position no_End_Y%,0 position no_End_Largeur%,100 position no_End_Hauteur%,100 text no_End_Couleur%,"F0F0F0" annulerselection() ' show no_AttributsEnd% end_sub
sub selectionner() show no_info% clear no_infotext% text no_infotext%,"Sélectionner un élément en cliquant dessus..." DoPoints% = 4 active no_AnnSel% active no_SuppLiens% hide no_AttributsConnector% hide no_AttributsAction% hide no_AttributsCondition% hide no_AttributsSelection% hide no_AttributsStart% hide no_AttributsEnd% 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) hide no_info% end_sub
sub supprimerliens() res% = dll_call2("RemoveAllLinksFromFlowChartElement",FC%,FCE%) end_sub
sub valider_connector() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Connector_X%),position(no_Connector_Y%),M1%,M1%) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsConnector% end_sub
sub valider_action() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Action_X%),position(no_Action_Y%),position(no_Action_Largeur%),position(no_Action_Hauteur%)) titre$ = trim$(text$(no_Action_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Action_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Action_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsAction% end_sub
sub valider_Condition() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Condition_X%),position(no_Condition_Y%),position(no_Condition_Largeur%),position(no_Condition_Hauteur%)) titre$ = trim$(text$(no_Condition_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Condition_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Condition_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsCondition% end_sub
sub valider_Selection() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Selection_X%),position(no_Selection_Y%),position(no_Selection_Largeur%),position(no_Selection_Hauteur%)) titre$ = trim$(text$(no_Selection_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Selection_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Selection_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsSelection% end_sub
sub valider_Start() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Start_X%),position(no_Start_Y%),position(no_Start_Largeur%),position(no_Start_Hauteur%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Start_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsStart% end_sub
sub valider_End() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_End_X%),position(no_End_Y%),position(no_End_Largeur%),position(no_End_Hauteur%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_End_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsEnd% end_sub
sub nouveauprojet() FC% = dll_call1("DeleteFlowChart",FC%) FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%) full_space 0 res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0)) ' height no_cElements%,300 projet$ = "" end_sub
sub ouvrirprojet() dim_local prj$ prj$ = file_name$(no_save%) if prj$="_" then exit_sub if lower$(file_extract_extension$(prj$))<>".fcproj" message "Extension erronnée (*.FCproj)" exit_sub end_if if file_exists(prj$)=0 message("Ce fichier n'existe pas." exit_sub end_if nouveauprojet() res% = dll_call2("LoadFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en chargement" else message "Le projet a été chargé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub enregistrerprojet() dim_local prj$ if projet$="" enregistrersousprojet() exit_sub end_if prj$ = projet$ if file_exists(prj$)=1 then file_delete prj$ res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en sauvegarde" else message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub enregistrersousprojet() dim_local prj$ prj$ = file_name$(no_save%) if prj$="_" then exit_sub if lower$(file_extract_extension$(prj$))<>".fcproj" message "Extension erronnée (*.FCproj)" exit_sub end_if if file_exists(prj$)=1 if message_confirmation_yes_no("Ce fichier existe déjà. Remplacer ?")<>1 then exit_sub file_delete prj$ end_if res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en sauvegarde" else message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub lier() DoPoints% = 1 npt% = 0 show no_info% clear no_infotext% text no_infotext%,"Cliquer sur une sortie..." active no_AnnLink% active no_Tracer% end_sub
sub annulerlier() res% = dll_call2("ShowRulersInFlowChart",FC%,0) DoPoints% = 0 npt% = 0 xarray%(0) = 0 res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0) res% = dll_call2("DrawFlowChart",FC%,1) inactive no_AnnLink% inactive no_Tracer% hide no_info% end_sub
sub tracer() dim_local do1% ' rectangulariser le dernier segment NatureInput% = dll_call3("GetInputConnectorOfFlowChartElement",FCEdest%,adr(xx%),adr(yy%)) if NatureInput%<>0 if npt%=0 res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xxp%),adr(yyp%)) else xxp% = xArray%(npt%) yyp% = yArray%(npt%) end_if
do1% = 0 if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% do1% = 1 else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% do1% = 1 end_if end_if if do1%=1 npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if if yyp%>(yy%-DeltaRectangle%) yyp% = yy% - DeltaRectangle% npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if if xxp%<>xx% xxp% = xx% npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if end_if res% = dll_call6("ConnectElementsOfFlowChart",FC%,FCEstart%,output%,FCEdest%,adr(xArray%),adr(yArray%)) if res%=0 then message "Erreur en créant la connexion" res% = dll_call2("ShowRulersInFlowChart",FC%,0) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0) ' res% = dll_call2("DrawFlowChart",FC%,1) DoPoints% = 0 npt% = 0 xarray%(0) = 0 inactive no_AnnLink% inactive no_Tracer% hide no_info% end_sub
sub exporter() dim_local f$ f$ = file_name$(no_export%) if f$="_" then exit_sub if instr(".bmp.jpg.gif.png",lower$(file_extract_extension$(f$)))=0 message "Erreur d'extension" exit_sub end_if if file_exists(f$)=1 if message_confirmation_yes_no("Cette image existe déjà? Remplacer ?")<>1 then exit_sub end_if res% = dll_call1("CopyFlowChartToClipboard",FC%) res% = dll_call1("SaveAnyImageFile",adr(f$)) message "L'image est enregistrée dans:"+chr$(13)+chr$(10)+f$ end_sub
sub selectionLien() DoPoints% = 6 npt% = 0 show no_info% clear no_infotext% text no_infotext%,"Cliquer sur un lien..." res% = dll_call2("DrawFlowChart",FC%,5) active no_AnnSelLink% active no_DelLink% end_sub sub annulerSelLien() DoPoints% = 0 npt% = 0 xarray%(0) = 0 res% = dll_call2("SelectLinkInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) inactive no_AnnSelLink% inactive no_DelLink% hide no_info% hide no_info% end_sub sub supprimerLien() res% = dll_call1("DeleteLinkFromFlowChart",FCL%) hide no_info% end_sub
| |
| | | Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Lun 19 Mar 2018 - 2:19 | |
| Un petit exemple d'application: un arbre généalogique entièrement dessiné avec cet outil, de façon interactive. Cet exemple montre un homme marié avec 3 enfants, puis divorcé et remarié avec 2 enfants. On peut compléter les cases à l'envie, avec les informations pertinentes: date de naissance, date de mariage et divorce, lieu de naissance, ... Voici le fichier Généalogie.FCproj: - Spoiler:
- Citation :
- FlowChartProject
FlowChart 1150 728 FlowChartElements 12 Element 0 1 137 105 157 85 16764879 Dupond, Martin 1 Né le: xxx Element 1 1 339 108 169 82 13619199 Le Ferrier, Martine 1 Née le: xxxx Element 2 1 778 116 176 83 13619199 Boulanger, Colette 1 Née le: xxxx Element 3 3 198 360 235 100 255 Enfants 3 Hortense Jacques Pierre Element 4 3 681 355 186 102 255 Enfants 2 Paul Sabine Element 5 1 56 540 147 105 13619199 Dupond, Hortense 1 Née le: xxx Element 6 1 234 540 167 105 16764879 Dupond, Jacques 1 Né le: xxx Element 7 1 444 539 164 104 16764879 Dupond, Pierre 1 Né le: xxx Element 8 1 674 536 160 106 16764879 Dupond, Paul 1 Né le: xxxx Element 9 1 862 535 165 106 13619199 Dupond, Sabine 1 Née le: xxx Element 10 0 761 304 20 20 0
0 Element 11 0 301 252 20 20 0
0 FlowChartLinks 11 Link 0 0 1 3 218 200 218 229 298 229 311 252 11 Link 1 1 1 3 426 200 426 229 338 229 311 252 11 Link 2 2 1 3 869 209 869 288 780 288 771 304 10 Link 3 0 1 3 218 200 218 289 753 289 771 304 10 Link 4 11 1 2 311 272 312 272 312 350 3 Link 5 10 1 2 771 324 771 324 771 345 4 Link 6 3 2 2 315 455 314 455 314 530 6 Link 7 3 1 4 265 455 265 500 127 500 126 500 126 530 5 Link 8 3 3 4 365 455 365 502 521 502 523 502 523 529 7 Link 9 4 1 2 749 452 751 452 751 526 8 Link 10 4 2 4 799 452 799 502 940 502 941 502 941 525 9 EndOfFlowchartProject
Et voici le résultat: | |
| | | Minibug
Nombre de messages : 4570 Age : 58 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Lun 19 Mar 2018 - 7:14 | |
| Bonjour Klaus ! J'ai pris quelques minutes pour tester... Et je confirme que c'est fonctionnel et intuitif ! L'exemple que tu présente est une très bonne approche pour ton logiciel. Un grand BRAVO ! | |
| | | Jicehel
Nombre de messages : 5947 Age : 52 Localisation : 77500 Date d'inscription : 18/04/2011
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Lun 19 Mar 2018 - 8:39 | |
| Bravo plus qu'à l'associer à ta BDDR pour que l'arbre se construise tout seul 'autour' d'une personne sélectionnée sur un nombre de générations paramétrable... Bon en tous cas, c'est encore une belle réussite. | |
| | | Marc
Nombre de messages : 2466 Age : 63 Localisation : TOURS (37) Date d'inscription : 17/03/2014
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Lun 19 Mar 2018 - 10:01 | |
| Bravo Klaus !
Très belle avancée !
C'est super ! | |
| | | Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Lun 19 Mar 2018 - 11:31 | |
| Merci ! Tenez, voici une version légèrement améliorée pourmieux gérer les transitions entre sélection d'éléments, sélection de liens et oahse de création de liens. En plus, maintenant, lorsqu'on est en "Selection de lien", on peut cliquer les différents liens pour passer d'un lien à un autre, comme c'est le cas pour la sélection des éléments. - Code:
-
' FlowChartDesigner.bas
labels() constantes() variables() menu() cadres() Objets()
on_user_event UserEvent
end
UserEvent: if bin_and(user_event_wparam,hex("FF000000"))=hex("0B000000") : ' ScrollImage pos% = user_event_lparam : ' positon: yyyyxxxx xxp% = bin_and(pos%,hex("0000FFFF")) yyp% = pos%/65536 if DoPoints%=5 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEnew%)) if res%<0 then return if FCEnew%=FCE% annulerselection() return else DoPoints% = 0 annulerSelLien() end_if end_if if DoPoints%=0 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%)) if res%<0 then return annulerSelLien() DoPoints% = 4 active no_AnnSel% active no_SuppLiens% hide no_AttributsConnector% hide no_AttributsAction% hide no_AttributsCondition% hide no_AttributsSelection% hide no_AttributsStart% hide no_AttributsEnd% end_if if DoPoints%>0 if DoPoints%=1 NatureOutput% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%)) if NatureOutput%<0 message "Ce n'est pas une sortie valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..." return end_if res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,output%) DoPoints% = 2 show no_info% clear no_infotext% text no_infotext%,"Cliquez maintenant l'élémént de destination"+chr$(13)+chr$(10)+"ou Annulez..." return end_if if DoPoints%=2 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEdest%)) if res%<0 message "Ce n'est pas un élément valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..." return end_if DoPoints% = 3 res% = dll_call2("SelectElementInFlowChart",FC%,FCEdest%) show no_info% clear no_infotext% text no_infotext%,"Cliquez maintenant les points d'étape"+chr$(13)+chr$(10)+"puis Tracez ou Annulez..." res% = dll_call2("ShowRulersInFlowChart",FC%,1) return end_if if DoPoints%=3 ' ici, rectangulariser le tracé if npt%=0 res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xx%),adr(yy%)) else xx% = xarray%(npt%) yy% = yarray%(npt%) end_if if (npt%=0) and (NatureOutput%<>0) if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% else npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yy% end_if end_if end_if if npt%>0 if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% else npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yy% end_if end_if end_if ' mémoriser le point npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% res% = dll_call3("DrawTemporaryMarkIntoFlowChart",FC%,xxp%,yyp%) res% = dll_call5("DrawTemporaryLineIntoFlowChart",FC%,xx%,yy%,xxp%,yyp%) ' message "Point "+str$(npt%)+": "+str$(xx%)+","+str$(yy% end_if if DoPoints%=4 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%)) if res%<0 message "Ce n'est pas un élément valide." return end_if ' message "Elément "+nature$(res%)+" identifié" hide no_info% DoPoints% = 5 select res% case 0 show no_AttributsConnector% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Connector_X%),handle(no_Connector_Y%),0,0) position no_Connector_X%,xxp% position no_Connector_Y%,yyp% case 1 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsAction% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Action_X%),handle(no_Action_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%)) position no_Action_X%,xxp% position no_Action_Y%,yyp% position no_Action_Largeur%,wwp% position no_Action_Hauteur%,hhp% text no_action_Couleur%,right$(hex$(ccc%),6) text no_Action_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Action_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Action_Contenu%,item_read$(no_memo%,i%) next i% end_if case 2 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsCondition% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Condition_X%),handle(no_Condition_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%)) position no_Condition_X%,xxp% position no_Condition_Y%,yyp% position no_Condition_Largeur%,wwp% position no_Condition_Hauteur%,hhp% text no_Condition_Couleur%,right$(hex$(ccc%),6) text no_Condition_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Condition_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Condition_Contenu%,item_read$(no_memo%,i%) next i% end_if case 3 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsSelection% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Selection_X%),handle(no_Selection_Y%),handle(no_Selection_Largeur%),handle(no_Selection_Hauteur%)) position no_Selection_X%,xxp% position no_Selection_Y%,yyp% position no_Selection_Largeur%,wwp% position no_Selection_Hauteur%,hhp% text no_Selection_Couleur%,right$(hex$(ccc%),6) text no_Selection_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Selection_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Selection_Contenu%,item_read$(no_memo%,i%) next i% end_if case 4 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsStart% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Start_X%),handle(no_Start_Y%),handle(no_Start_Largeur%),handle(no_Start_Hauteur%)) position no_Start_X%,xxp% position no_Start_Y%,yyp% position no_Start_Largeur%,wwp% position no_Start_Hauteur%,hhp% text no_Start_Couleur%,right$(hex$(ccc%),6) case 5 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsEnd% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_End_X%),handle(no_End_Y%),handle(no_End_Largeur%),handle(no_End_Hauteur%)) position no_End_X%,xxp% position no_End_Y%,yyp% position no_End_Largeur%,wwp% position no_End_Hauteur%,hhp% text no_End_Couleur%,right$(hex$(ccc%),6) end_select res% = dll_call2("SelectElementInFlowChart",FC%,FCE%) end_if if DoPoints%=6 res% = dll_call4("IdentifyFlowChartLink",FC%,xxp%,yyp%,adr(FCL%)) if res%<0 message "Ce n'est pas un lien valide." res% = dll_call2("DrawFlowChart",FC%,1) return end_if ' message "Lien "+str$(res%)+" identifié" res% = dll_call2("SelectLinkInFlowChart",FC%,FCL%) res% = dll_call2("DrawFlowChart",FC%,5) end_if end_if end_if
return
sortir: terminate
AddConnector: AddConnector() return
AddAction: AddAction() return
AddCondition: AddCondition() return
AddSelector: AddSelector() return
AddStart: AddStart() return
AddEnd: AddEnd() return
selectionner: selectionner() return valider_connector: valider_connector() return valider_action: valider_action() return valider_Condition: valider_Condition() return annulerselection: annulerselection() return supprimerliens: supprimerliens() return valider_Selection: valider_Selection() return
valider_start: valider_start() return valider_end: valider_end() return nouveauprojet: nouveauprojet() return
ouvrirprojet: ouvrirprojet() return enregistrerprojet: enregistrerprojet() return enregistrersousprojet: enregistrersousprojet() return lier: lier() return annulerlier: annulerlier() return tracer: tracer() return exporter: exporter() return
selectionLien: selectionLien() return annulerSelLien: annulerSelLien() return supprimerLien: supprimerLien() return sub labels() label AddConnector, AddAction, AddCondition, AddSelector, AddStart, AddEnd label valider_connector, valider_action, valider_Condition, valider_Selection label valider_Start, valider_End label selectionner, annulerselection, supprimerliens, UserEvent, sortir label selectionLien, annulerSelLien, supprimerLien label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet label lier, annulerlier, tracer, exporter end_sub
sub constantes() dim KGF$ : KGF$ = "KGF.dll" dim M1% : M1% = 0-1 dim DeltaRectangle% : DeltaRectangle% = 10 dim LignesDeVisee% : ' nombre de lignes de visée (0, 1 ou 2) LignesDeVisee% = 2 dim nature$(6) nature$(0) = "Connector" nature$(1) = "Action" nature$(2) = "Condition" nature$(3) = "Selector" nature$(4) = "Start" nature$(5) = "End" end_sub
sub variables() dim res%, DoPoints%, pos%, xxp%, yyp%, titre$, wwp%, hhp%, i%, ccc%, output% dim xx%, yy%, NatureOutput%, NatureInput% dim npt%, xarray%(100),yarray%(100) dim no%, no1%, no2%, no_cElements%, no_AnnSel%, no_SuppLiens%, no_memo%, no_open%, no_save% dim no_AttributsConnector%, no_AttributsAction%, no_AttributsCondition% dim no_AttributsSelection%, no_AttributsStart%, no_AttributsEnd% dim no_Connector_X%, no_Connector_Y%, no_AnnLink%, no_Tracer% , no_Info%, no_infotext% dim no_Action_X%, no_Action_Y%, no_Action_Titre%, no_action_Couleur% dim no_Action_Largeur%, no_Action_Hauteur%, no_Action_Contenu%, no_export% dim no_Condition_X%, no_Condition_Y%, no_Condition_Titre%, no_condition_Couleur% dim no_Condition_Largeur%, no_Condition_Hauteur%, no_Condition_Contenu% dim no_Selection_X%, no_Selection_Y%, no_Selection_Titre%, no_selection_Couleur% dim no_Selection_Largeur%, no_Selection_Hauteur%, no_Selection_Contenu% dim no_Start_X%, no_Start_Y%, no_Start_Largeur%, no_Start_Hauteur%, no_start_Couleur% dim no_End_X%, no_End_Y%, no_End_Largeur%, no_End_Hauteur%, no_end_Couleur% dim no_AnnSelLink%, no_DelLink% dim FC%, FCE%, FCEstart%, FCEdest%, FCL%, FCEnew% dim projet$ end_sub
sub menu() no% = no% + 1 : main_menu no% : no1% = no% no% = no% + 1 : sub_menu no% : parent no%,no1% : no2% = no% : caption no%,"Fichier" no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Nouveau" : on_click no%,nouveauprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Ouvrir..." : on_click no%,ouvrirprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer" : on_click no%,enregistrerprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer sous..." : on_click no%,enregistrersousprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Exporter..." : on_click no%,exporter no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"-" no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Sortir" : on_click no%,sortir end_sub
sub cadres() dim_local hnd% dll_on KGF$ no% = no% + 1 : form no% : hide no% : no_info% = no% : width no%,400 : height no%,200 no% = no% + 1 : memo no% : no_infotext% = no% : parent no%,no_info% : full_space no% : bar_both no% : font_size no%,12 no% = no% + 1 : container no% : no_cElements% = no% : width no%,200 : caption no%,"Eléments" FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%) full_space 0 res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0)) height no_cElements%,350 res% = dll_call2("ShowRulersInFlowChart",FC%,0) top no_info%,0 : left no_info%,width_client(0)-width(no_info%)-width(no_cElements%) hnd% = dll_call1("GetHandleOfFlowChart",FC%) res% = dll_call3("SetFormParent",handle(no_info%),hnd%,0) no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Début" top no%,15 : left no%,10 : on_click no%,AddStart no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Connecteur" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddConnector no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Action" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddAction no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Condition" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddCondition no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Selecteur" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddSelector no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Fin" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddEnd
no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sélectionner" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionner no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSel% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerselection no% = no% + 1 : button no% : parent no%,no_cElements% : no_SuppLiens% = no% : caption no%,"Supprimer lien" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,left(no%-1) : on_click no%,supprimerliens
no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Lier" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,lier no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnLink% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerlier no% = no% + 1 : button no% : parent no%,no_cElements% : no_Tracer% = no% : caption no%,"Tracer" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,tracer no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sel. Lien" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionLien no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSelLink% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerSelLien no% = no% + 1 : button no% : parent no%,no_cElements% : no_DelLink% = no% : caption no%,"Supprimer lien" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,supprimerLien
' attributs Connector no% = no% + 1 : container no% : no_AttributsConnector% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Connector" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Connector_X% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Connector_Y% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsConnector% : top no%,height(no_AttributsConnector%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_connector ' attributs Action no% = no% + 1 : container no% : no_AttributsAction% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Action" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Action_X% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Action_Y% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Action_Largeur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Action_Hauteur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Action_Couleur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Action_Titre% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Action_Contenu% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsAction% : top no%,height(no_AttributsAction%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_action
' attributs Condition no% = no% + 1 : container no% : no_AttributsCondition% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Condition" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Condition_X% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Condition_Y% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Condition_Largeur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Condition_Hauteur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Condition_Couleur% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Condition_Titre% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Condition_Contenu% = no% : parent no%,no_AttributsCondition% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsCondition% : top no%,height(no_AttributsCondition%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Condition
' attributs Selection no% = no% + 1 : container no% : no_AttributsSelection% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Selection" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Selection_X% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Selection_Y% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Selection_Largeur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Selection_Hauteur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Selection_Couleur% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Titre:" no% = no% + 1 : edit no% : no_Selection_Titre% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1) : left no%,80 width no%,110 no% = no% + 1 : alpha no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Contenu:" no% = no% + 1 : memo no% : no_Selection_Contenu% = no% : parent no%,no_AttributsSelection% : top no%,top(no%-1)+15 : left no%,10 width no%,180 : bar_both no% no% = no% + 1 : button no% : parent no%,no_AttributsSelection% : top no%,height(no_AttributsSelection%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Selection
' attributs Start no% = no% + 1 : container no% : no_AttributsStart% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Start" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Start_X% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Start_Y% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Start_Largeur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Start_Hauteur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsStart% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Start_Couleur% = no% : parent no%,no_AttributsStart% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsStart% : top no%,height(no_AttributsStart%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Start
' attributs End no% = no% + 1 : container no% : no_AttributsEnd% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs End" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_End_X% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_End_Y% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_End_Largeur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_End_Hauteur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsEnd% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_End_Couleur% = no% : parent no%,no_AttributsEnd% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsEnd% : top no%,height(no_AttributsEnd%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_End
end_sub
sub Objets() no% = no% + 1 : memo no% : no_memo% = no% : hide no% : bar_both no% no% = no% + 1 : open_dialog no% : no_open% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj" no% = no% + 1 : save_dialog no% : no_save% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj" no% = no% + 1 : save_dialog no% : no_export% = no% : filter no%,"Images (BMP,JPG,GIF,PNG)|*.BMP;*.JPG;*.GIF;*.PNG" end_sub
sub AddConnector() FCE% = dll_call4("AddElementToFlowChart",FC%,0,0,0) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,20,20) res% = dll_call2("DrawFlowChart",FC%,1) position no_Connector_X%,0 position no_Connector_Y%,0 annulerselection() ' show no_AttributsConnector% end_sub
sub AddAction() dim_local titre$ titre$ = "Action" FCE% = dll_call4("AddElementToFlowChart",FC%,1,hex("FFFF00"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,200) res% = dll_call2("DrawFlowChart",FC%,1) position no_Action_X%,0 position no_Action_Y%,0 position no_Action_Largeur%,300 position no_Action_Hauteur%,200 text no_action_Couleur%,"FFFF00" text no_Action_Titre%,titre$ clear no_Action_Contenu% annulerselection() ' show no_AttributsAction% end_sub
sub AddCondition() dim_local titre$ titre$ = "Condition ?" FCE% = dll_call4("AddElementToFlowChart",FC%,2,hex("0000FF"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100) clear no_memo% item_add no_memo%,"." item_add no_memo%,"Oui" item_add no_memo%,"Non" res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%)) res% = dll_call2("DrawFlowChart",FC%,1) position no_Condition_X%,0 position no_Condition_Y%,0 position no_Condition_Largeur%,300 position no_Condition_Hauteur%,100 text no_Condition_Couleur%,"0000FF" text no_Condition_Titre%,titre$ clear no_Condition_Contenu% item_add no_Condition_Contenu%,"Oui" item_add no_Condition_Contenu%,"." item_add no_Condition_Contenu%,"Non" annulerselection() ' show no_AttributsCondition% end_sub
sub AddSelector() dim_local titre$ titre$ = "Sélection" FCE% = dll_call4("AddElementToFlowChart",FC%,3,hex("0000FF"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100) clear no_memo% item_add no_memo%,"1" item_add no_memo%,"2" item_add no_memo%,"3" res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%)) res% = dll_call2("DrawFlowChart",FC%,1) position no_Selection_X%,0 position no_Selection_Y%,0 position no_Selection_Largeur%,300 position no_Selection_Hauteur%,100 text no_Selection_Couleur%,"0000FF" text no_Selection_Titre%,titre$ clear no_Selection_Contenu% item_add no_Selection_Contenu%,"1" item_add no_Selection_Contenu%,"2" item_add no_Selection_Contenu%,"3" annulerselection() ' show no_AttributsSelection% end_sub
sub AddStart() dim_local titre$ titre$ = "Début" FCE% = dll_call4("AddElementToFlowChart",FC%,4,hex("F0F0F0"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100) res% = dll_call2("DrawFlowChart",FC%,1) position no_Start_X%,0 position no_Start_Y%,0 position no_Start_Largeur%,100 position no_Start_Hauteur%,100 text no_Start_Couleur%,"F0F0F0" annulerselection() ' show no_AttributsStart% end_sub
sub AddEnd() dim_local titre$ titre$ = "Arrêt" FCE% = dll_call4("AddElementToFlowChart",FC%,5,hex("F0F0F0"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100) res% = dll_call2("DrawFlowChart",FC%,1) position no_End_X%,0 position no_End_Y%,0 position no_End_Largeur%,100 position no_End_Hauteur%,100 text no_End_Couleur%,"F0F0F0" annulerselection() ' show no_AttributsEnd% end_sub
sub selectionner() show no_info% clear no_infotext% text no_infotext%,"Sélectionner un élément en cliquant dessus..." DoPoints% = 4 active no_AnnSel% active no_SuppLiens% hide no_AttributsConnector% hide no_AttributsAction% hide no_AttributsCondition% hide no_AttributsSelection% hide no_AttributsStart% hide no_AttributsEnd% 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) hide no_info% end_sub
sub supprimerliens() res% = dll_call2("RemoveAllLinksFromFlowChartElement",FC%,FCE%) end_sub
sub valider_connector() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Connector_X%),position(no_Connector_Y%),M1%,M1%) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsConnector% end_sub
sub valider_action() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Action_X%),position(no_Action_Y%),position(no_Action_Largeur%),position(no_Action_Hauteur%)) titre$ = trim$(text$(no_Action_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Action_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Action_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsAction% end_sub
sub valider_Condition() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Condition_X%),position(no_Condition_Y%),position(no_Condition_Largeur%),position(no_Condition_Hauteur%)) titre$ = trim$(text$(no_Condition_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Condition_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Condition_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsCondition% end_sub
sub valider_Selection() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Selection_X%),position(no_Selection_Y%),position(no_Selection_Largeur%),position(no_Selection_Hauteur%)) titre$ = trim$(text$(no_Selection_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Selection_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Selection_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsSelection% end_sub
sub valider_Start() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Start_X%),position(no_Start_Y%),position(no_Start_Largeur%),position(no_Start_Hauteur%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Start_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsStart% end_sub
sub valider_End() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_End_X%),position(no_End_Y%),position(no_End_Largeur%),position(no_End_Hauteur%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_End_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsEnd% end_sub
sub nouveauprojet() FC% = dll_call1("DeleteFlowChart",FC%) FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%) full_space 0 res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0)) ' height no_cElements%,300 projet$ = "" end_sub
sub ouvrirprojet() dim_local prj$ prj$ = file_name$(no_save%) if prj$="_" then exit_sub if lower$(file_extract_extension$(prj$))<>".fcproj" message "Extension erronnée (*.FCproj)" exit_sub end_if if file_exists(prj$)=0 message("Ce fichier n'existe pas." exit_sub end_if nouveauprojet() res% = dll_call2("LoadFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en chargement" else message "Le projet a été chargé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub enregistrerprojet() dim_local prj$ if projet$="" enregistrersousprojet() exit_sub end_if prj$ = projet$ if file_exists(prj$)=1 then file_delete prj$ res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en sauvegarde" else message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub enregistrersousprojet() dim_local prj$ prj$ = file_name$(no_save%) if prj$="_" then exit_sub if lower$(file_extract_extension$(prj$))<>".fcproj" message "Extension erronnée (*.FCproj)" exit_sub end_if if file_exists(prj$)=1 if message_confirmation_yes_no("Ce fichier existe déjà. Remplacer ?")<>1 then exit_sub file_delete prj$ end_if res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en sauvegarde" else message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub lier() annulerSelLien() AnnulerSelection() DoPoints% = 1 npt% = 0 show no_info% clear no_infotext% text no_infotext%,"Cliquer sur une sortie..." active no_AnnLink% active no_Tracer% end_sub
sub annulerlier() res% = dll_call2("ShowRulersInFlowChart",FC%,0) DoPoints% = 0 npt% = 0 xarray%(0) = 0 res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0) res% = dll_call2("DrawFlowChart",FC%,1) inactive no_AnnLink% inactive no_Tracer% hide no_info% end_sub
sub tracer() dim_local do1% ' rectangulariser le dernier segment NatureInput% = dll_call3("GetInputConnectorOfFlowChartElement",FCEdest%,adr(xx%),adr(yy%)) if NatureInput%<>0 if npt%=0 res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xxp%),adr(yyp%)) else xxp% = xArray%(npt%) yyp% = yArray%(npt%) end_if
do1% = 0 if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% do1% = 1 else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% do1% = 1 end_if end_if if do1%=1 npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if if yyp%>(yy%-DeltaRectangle%) yyp% = yy% - DeltaRectangle% npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if if xxp%<>xx% xxp% = xx% npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if end_if res% = dll_call6("ConnectElementsOfFlowChart",FC%,FCEstart%,output%,FCEdest%,adr(xArray%),adr(yArray%)) if res%=0 then message "Erreur en créant la connexion" res% = dll_call2("ShowRulersInFlowChart",FC%,0) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0) ' res% = dll_call2("DrawFlowChart",FC%,1) DoPoints% = 0 npt% = 0 xarray%(0) = 0 inactive no_AnnLink% inactive no_Tracer% hide no_info% end_sub
sub exporter() dim_local f$ f$ = file_name$(no_export%) if f$="_" then exit_sub if instr(".bmp.jpg.gif.png",lower$(file_extract_extension$(f$)))=0 message "Erreur d'extension" exit_sub end_if if file_exists(f$)=1 if message_confirmation_yes_no("Cette image existe déjà? Remplacer ?")<>1 then exit_sub end_if res% = dll_call1("CopyFlowChartToClipboard",FC%) res% = dll_call1("SaveAnyImageFile",adr(f$)) message "L'image est enregistrée dans:"+chr$(13)+chr$(10)+f$ end_sub
sub selectionLien() AnnulerSelection() DoPoints% = 6 npt% = 0 show no_info% clear no_infotext% text no_infotext%,"Cliquer sur un lien..." res% = dll_call2("DrawFlowChart",FC%,5) active no_AnnSelLink% active no_DelLink% end_sub sub annulerSelLien() DoPoints% = 0 npt% = 0 xarray%(0) = 0 res% = dll_call2("SelectLinkInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) inactive no_AnnSelLink% inactive no_DelLink% hide no_info% hide no_info% end_sub sub supprimerLien() res% = dll_call1("DeleteLinkFromFlowChart",FCL%) hide no_info% end_sub
| |
| | | Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: Un essai de construction d'organigramme par Panoramic Lun 19 Mar 2018 - 12:23 | |
| Et voici une nouvelle version avec une nouveauté intéressante: on peut maintenant colorer les liens ! Par défaut, leur couleur est noire. En sélectionnant on lien, il s'affiche en jaune (comme un élément sélectionné). Mais maintenant, il y a un cadre d'attributs du lien qui s'affiche en bas à gauche, avec un seul attrbut: sa couleur. On peut la changer avec une valeur hexa de type RGB (sachant que la représentatiion hexa d'une valeur RGB est BBGGRR !). en validant, le lien prend cette couleur. Si l'on sélectionne un lien qui est naturellement jaune, il s'afichera en rouge, tout comme un élément jaune lors de sa sélection. La nouvelle version de la DLL est dans le WebDav, dossier DLLs, et le nouveau programme est ici: - Code:
-
' FlowChartDesigner.bas
labels() constantes() variables() menu() cadres() Objets()
on_user_event UserEvent
end
UserEvent: if bin_and(user_event_wparam,hex("FF000000"))=hex("0B000000") : ' ScrollImage pos% = user_event_lparam : ' positon: yyyyxxxx xxp% = bin_and(pos%,hex("0000FFFF")) yyp% = pos%/65536 if DoPoints%=5 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEnew%)) if res%<0 then return if FCEnew%=FCE% annulerselection() return else DoPoints% = 0 annulerSelLien() end_if end_if if DoPoints%=0 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%)) if res%<0 then return annulerSelLien() DoPoints% = 4 active no_AnnSel% active no_SuppLiens% hide no_AttributsConnector% hide no_AttributsAction% hide no_AttributsCondition% hide no_AttributsSelection% hide no_AttributsStart% hide no_AttributsEnd% end_if if DoPoints%>0 if DoPoints%=1 NatureOutput% = dll_call5("IdentifyOutputOfFlowChartElement",FC%,xxp%,yyp%,adr(FCEstart%),adr(output%)) if NatureOutput%<0 message "Ce n'est pas une sortie valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..." return end_if res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,output%) DoPoints% = 2 show no_info% clear no_infotext% text no_infotext%,"Cliquez maintenant l'élémént de destination"+chr$(13)+chr$(10)+"ou Annulez..." return end_if if DoPoints%=2 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCEdest%)) if res%<0 message "Ce n'est pas un élément valide."+chr$(13)+chr$(10)+"Recommencez ou Annulez..." return end_if DoPoints% = 3 res% = dll_call2("SelectElementInFlowChart",FC%,FCEdest%) show no_info% clear no_infotext% text no_infotext%,"Cliquez maintenant les points d'étape"+chr$(13)+chr$(10)+"puis Tracez ou Annulez..." res% = dll_call2("ShowRulersInFlowChart",FC%,1) return end_if if DoPoints%=3 ' ici, rectangulariser le tracé if npt%=0 res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xx%),adr(yy%)) else xx% = xarray%(npt%) yy% = yarray%(npt%) end_if if (npt%=0) and (NatureOutput%<>0) if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% else npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yy% end_if end_if end_if if npt%>0 if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% else npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yy% end_if end_if end_if ' mémoriser le point npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% res% = dll_call3("DrawTemporaryMarkIntoFlowChart",FC%,xxp%,yyp%) res% = dll_call5("DrawTemporaryLineIntoFlowChart",FC%,xx%,yy%,xxp%,yyp%) ' message "Point "+str$(npt%)+": "+str$(xx%)+","+str$(yy% end_if if DoPoints%=4 res% = dll_call4("IdentifyFlowChartElement",FC%,adr(xxp%),adr(yyp%),adr(FCE%)) if res%<0 message "Ce n'est pas un élément valide." return end_if ' message "Elément "+nature$(res%)+" identifié" hide no_info% DoPoints% = 5 select res% case 0 show no_AttributsConnector% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Connector_X%),handle(no_Connector_Y%),0,0) position no_Connector_X%,xxp% position no_Connector_Y%,yyp% case 1 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsAction% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Action_X%),handle(no_Action_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%)) position no_Action_X%,xxp% position no_Action_Y%,yyp% position no_Action_Largeur%,wwp% position no_Action_Hauteur%,hhp% text no_action_Couleur%,right$(hex$(ccc%),6) text no_Action_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Action_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Action_Contenu%,item_read$(no_memo%,i%) next i% end_if case 2 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsCondition% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Condition_X%),handle(no_Condition_Y%),handle(no_Action_Largeur%),handle(no_Action_Hauteur%)) position no_Condition_X%,xxp% position no_Condition_Y%,yyp% position no_Condition_Largeur%,wwp% position no_Condition_Hauteur%,hhp% text no_Condition_Couleur%,right$(hex$(ccc%),6) text no_Condition_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Condition_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Condition_Contenu%,item_read$(no_memo%,i%) next i% end_if case 3 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsSelection% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Selection_X%),handle(no_Selection_Y%),handle(no_Selection_Largeur%),handle(no_Selection_Hauteur%)) position no_Selection_X%,xxp% position no_Selection_Y%,yyp% position no_Selection_Largeur%,wwp% position no_Selection_Hauteur%,hhp% text no_Selection_Couleur%,right$(hex$(ccc%),6) text no_Selection_Titre%,item_read$(no_memo%,1) item_delete no_memo%,1 clear no_Selection_Contenu% if count(no_memo%)>0 for i%=1 to count(no_memo%) item_add no_Selection_Contenu%,item_read$(no_memo%,i%) next i% end_if case 4 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsStart% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_Start_X%),handle(no_Start_Y%),handle(no_Start_Largeur%),handle(no_Start_Hauteur%)) position no_Start_X%,xxp% position no_Start_Y%,yyp% position no_Start_Largeur%,wwp% position no_Start_Hauteur%,hhp% text no_Start_Couleur%,right$(hex$(ccc%),6) case 5 res% = dll_call5("GetFlowChartElementAttributes",FCE%,adr(wwp%),adr(hhp%),adr(ccc%),handle(no_memo%)) show no_AttributsEnd% res% = dll_call5("SetSpinControlsForFlowChart",FC%,handle(no_End_X%),handle(no_End_Y%),handle(no_End_Largeur%),handle(no_End_Hauteur%)) position no_End_X%,xxp% position no_End_Y%,yyp% position no_End_Largeur%,wwp% position no_End_Hauteur%,hhp% text no_End_Couleur%,right$(hex$(ccc%),6) end_select res% = dll_call2("SelectElementInFlowChart",FC%,FCE%) end_if if DoPoints%=6 res% = dll_call4("IdentifyFlowChartLink",FC%,xxp%,yyp%,adr(FCL%)) if res%<0 message "Ce n'est pas un lien valide." res% = dll_call2("DrawFlowChart",FC%,1) return end_if ' message "Lien "+str$(res%)+" identifié" res% = dll_call3("SelectLinkInFlowChart",FC%,FCL%,adr(ccc%)) res% = dll_call2("DrawFlowChart",FC%,5) show no_AttributsLink% text no_Link_Couleur%,right$(hex$(ccc%),6) end_if end_if end_if
return
sortir: terminate
AddConnector: AddConnector() return
AddAction: AddAction() return
AddCondition: AddCondition() return
AddSelector: AddSelector() return
AddStart: AddStart() return
AddEnd: AddEnd() return
selectionner: selectionner() return valider_connector: valider_connector() return valider_action: valider_action() return valider_Condition: valider_Condition() return annulerselection: annulerselection() return supprimerliens: supprimerliens() return valider_Selection: valider_Selection() return
valider_start: valider_start() return valider_end: valider_end() return valider_Link: valider_Link() return nouveauprojet: nouveauprojet() return
ouvrirprojet: ouvrirprojet() return enregistrerprojet: enregistrerprojet() return enregistrersousprojet: enregistrersousprojet() return lier: lier() return annulerlier: annulerlier() return tracer: tracer() return exporter: exporter() return
selectionLien: selectionLien() return annulerSelLien: annulerSelLien() return supprimerLien: supprimerLien() return sub labels() label AddConnector, AddAction, AddCondition, AddSelector, AddStart, AddEnd label valider_connector, valider_action, valider_Condition, valider_Selection label valider_Start, valider_End, valider_Link label selectionner, annulerselection, supprimerliens, UserEvent, sortir label selectionLien, annulerSelLien, supprimerLien label nouveauprojet, ouvrirprojet, enregistrerprojet, enregistrersousprojet label lier, annulerlier, tracer, exporter end_sub
sub constantes() dim KGF$ : KGF$ = "KGF.dll" dim M1% : M1% = 0-1 dim DeltaRectangle% : DeltaRectangle% = 10 dim LignesDeVisee% : ' nombre de lignes de visée (0, 1 ou 2) LignesDeVisee% = 2 dim nature$(6) nature$(0) = "Connector" nature$(1) = "Action" nature$(2) = "Condition" nature$(3) = "Selector" nature$(4) = "Start" nature$(5) = "End" end_sub
sub variables() dim res%, DoPoints%, pos%, xxp%, yyp%, titre$, wwp%, hhp%, i%, ccc%, output% dim xx%, yy%, NatureOutput%, NatureInput% dim npt%, xarray%(100),yarray%(100) dim no%, no1%, no2%, no_cElements%, no_AnnSel%, no_SuppLiens%, no_memo%, no_open%, no_save% dim no_AttributsConnector%, no_AttributsAction%, no_AttributsCondition% dim no_AttributsSelection%, no_AttributsStart%, no_AttributsEnd%, no_AttributsLink% dim no_Connector_X%, no_Connector_Y%, no_AnnLink%, no_Tracer% , no_Info%, no_infotext% dim no_Action_X%, no_Action_Y%, no_Action_Titre%, no_action_Couleur% dim no_Action_Largeur%, no_Action_Hauteur%, no_Action_Contenu%, no_export% dim no_Condition_X%, no_Condition_Y%, no_Condition_Titre%, no_condition_Couleur% dim no_Condition_Largeur%, no_Condition_Hauteur%, no_Condition_Contenu% dim no_Selection_X%, no_Selection_Y%, no_Selection_Titre%, no_selection_Couleur% dim no_Selection_Largeur%, no_Selection_Hauteur%, no_Selection_Contenu% dim no_Start_X%, no_Start_Y%, no_Start_Largeur%, no_Start_Hauteur%, no_start_Couleur% dim no_End_X%, no_End_Y%, no_End_Largeur%, no_End_Hauteur%, no_end_Couleur% dim no_Link_Couleur% dim no_AnnSelLink%, no_DelLink% dim FC%, FCE%, FCEstart%, FCEdest%, FCL%, FCEnew% dim projet$ end_sub
sub menu() no% = no% + 1 : main_menu no% : no1% = no% no% = no% + 1 : sub_menu no% : parent no%,no1% : no2% = no% : caption no%,"Fichier" no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Nouveau" : on_click no%,nouveauprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Ouvrir..." : on_click no%,ouvrirprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer" : on_click no%,enregistrerprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Enregistrer sous..." : on_click no%,enregistrersousprojet no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Exporter..." : on_click no%,exporter no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"-" no% = no% + 1 : sub_menu no% : parent no%,no2% : caption no%,"Sortir" : on_click no%,sortir end_sub
sub cadres() dim_local hnd% dll_on KGF$ no% = no% + 1 : form no% : hide no% : no_info% = no% : width no%,400 : height no%,200 no% = no% + 1 : memo no% : no_infotext% = no% : parent no%,no_info% : full_space no% : bar_both no% : font_size no%,12 no% = no% + 1 : container no% : no_cElements% = no% : width no%,200 : caption no%,"Eléments" FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%) full_space 0 res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0)) height no_cElements%,350 res% = dll_call2("ShowRulersInFlowChart",FC%,0) top no_info%,0 : left no_info%,width_client(0)-width(no_info%)-width(no_cElements%) hnd% = dll_call1("GetHandleOfFlowChart",FC%) res% = dll_call3("SetFormParent",handle(no_info%),hnd%,0) no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Début" top no%,15 : left no%,10 : on_click no%,AddStart no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Connecteur" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddConnector no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Action" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddAction no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Condition" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddCondition no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Selecteur" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddSelector no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Fin" top no%,top(no%-1)+height(no%-1) : left no%,10 : on_click no%,AddEnd
no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sélectionner" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionner no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSel% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerselection no% = no% + 1 : button no% : parent no%,no_cElements% : no_SuppLiens% = no% : caption no%,"Supprimer lien" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,left(no%-1) : on_click no%,supprimerliens
no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Lier" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,lier no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnLink% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerlier no% = no% + 1 : button no% : parent no%,no_cElements% : no_Tracer% = no% : caption no%,"Tracer" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,tracer no% = no% + 1 : button no% : parent no%,no_cElements% : caption no%,"Sel. Lien" top no%,top(no%-1)+height(no%-1)+10 : left no%,10 : on_click no%,selectionLien no% = no% + 1 : button no% : parent no%,no_cElements% : no_AnnSelLink% = no% : caption no%,"Annuler" : inactive no% top no%,top(no%-1) : left no%,left(no%-1)+width(no%-1) : on_click no%,annulerSelLien no% = no% + 1 : button no% : parent no%,no_cElements% : no_DelLink% = no% : caption no%,"Supprimer lien" : inactive no% top no%,top(no%-1)+height(no%-1) : left no%,10 : width no%,width(no%-2)+width(no%-1) : on_click no%,supprimerLien
' attributs Connector no% = no% + 1 : container no% : no_AttributsConnector% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Connector" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Connector_X% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsConnector% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Connector_Y% = no% : parent no%,no_AttributsConnector% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsConnector% : top no%,height(no_AttributsConnector%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_connector ' attributs Action no% = no% + 1 : container no% : no_AttributsAction% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Action" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,20 : left no%,10 caption no%,"Position X:" no% = no% + 1 : spin no% : no_Action_X% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Position Y:" no% = no% + 1 : spin no% : no_Action_Y% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,4000 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Largeur:" no% = no% + 1 : spin no% : no_Action_Largeur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Hauteur:" no% = no% + 1 : spin no% : no_Action_Hauteur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 min no%,0 : max no%,500 : position no%,0 : width no%,50 no% = no% + 1 : alpha no% : parent no%,no_AttributsAction% : top no%,top(no%-1)+25 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Action_Couleur% = no% : parent no%,no_AttributsAction% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : 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
' Attributs Link no% = no% + 1 : container no% : no_AttributsLink% = no% : top no%,height(no_cElements%) : width no%,width(no_cElements%) height no%,300 : caption no%,"Attributs Lien" : hide no% no% = no% + 1 : alpha no% : parent no%,no_AttributsLink% : top no%,20 : left no%,10 caption no%,"Couleur RGB:" no% = no% + 1 : edit no% : no_Link_Couleur% = no% : parent no%,no_AttributsLink% : top no%,top(no%-1) : left no%,80 width no%,50 no% = no% + 1 : button no% : parent no%,no_AttributsLink% : top no%,height(no_AttributsLink%)-30 : left no%,20 caption no%,"Valider" : on_click no%,valider_Link
end_sub
sub Objets() no% = no% + 1 : memo no% : no_memo% = no% : hide no% : bar_both no% no% = no% + 1 : open_dialog no% : no_open% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj" no% = no% + 1 : save_dialog no% : no_save% = no% : filter no%,"Projet FlowChart (*.FCproj)|*.FCproj" no% = no% + 1 : save_dialog no% : no_export% = no% : filter no%,"Images (BMP,JPG,GIF,PNG)|*.BMP;*.JPG;*.GIF;*.PNG" end_sub
sub AddConnector() FCE% = dll_call4("AddElementToFlowChart",FC%,0,0,0) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,20,20) res% = dll_call2("DrawFlowChart",FC%,1) position no_Connector_X%,0 position no_Connector_Y%,0 annulerselection() ' show no_AttributsConnector% end_sub
sub AddAction() dim_local titre$ titre$ = "Action" FCE% = dll_call4("AddElementToFlowChart",FC%,1,hex("FFFF00"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,200) res% = dll_call2("DrawFlowChart",FC%,1) position no_Action_X%,0 position no_Action_Y%,0 position no_Action_Largeur%,300 position no_Action_Hauteur%,200 text no_action_Couleur%,"FFFF00" text no_Action_Titre%,titre$ clear no_Action_Contenu% annulerselection() ' show no_AttributsAction% end_sub
sub AddCondition() dim_local titre$ titre$ = "Condition ?" FCE% = dll_call4("AddElementToFlowChart",FC%,2,hex("0000FF"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100) clear no_memo% item_add no_memo%,"." item_add no_memo%,"Oui" item_add no_memo%,"Non" res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%)) res% = dll_call2("DrawFlowChart",FC%,1) position no_Condition_X%,0 position no_Condition_Y%,0 position no_Condition_Largeur%,300 position no_Condition_Hauteur%,100 text no_Condition_Couleur%,"0000FF" text no_Condition_Titre%,titre$ clear no_Condition_Contenu% item_add no_Condition_Contenu%,"Oui" item_add no_Condition_Contenu%,"." item_add no_Condition_Contenu%,"Non" annulerselection() ' show no_AttributsCondition% end_sub
sub AddSelector() dim_local titre$ titre$ = "Sélection" FCE% = dll_call4("AddElementToFlowChart",FC%,3,hex("0000FF"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,300,100) clear no_memo% item_add no_memo%,"1" item_add no_memo%,"2" item_add no_memo%,"3" res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,0,handle(no_memo%)) res% = dll_call2("DrawFlowChart",FC%,1) position no_Selection_X%,0 position no_Selection_Y%,0 position no_Selection_Largeur%,300 position no_Selection_Hauteur%,100 text no_Selection_Couleur%,"0000FF" text no_Selection_Titre%,titre$ clear no_Selection_Contenu% item_add no_Selection_Contenu%,"1" item_add no_Selection_Contenu%,"2" item_add no_Selection_Contenu%,"3" annulerselection() ' show no_AttributsSelection% end_sub
sub AddStart() dim_local titre$ titre$ = "Début" FCE% = dll_call4("AddElementToFlowChart",FC%,4,hex("F0F0F0"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100) res% = dll_call2("DrawFlowChart",FC%,1) position no_Start_X%,0 position no_Start_Y%,0 position no_Start_Largeur%,100 position no_Start_Hauteur%,100 text no_Start_Couleur%,"F0F0F0" annulerselection() ' show no_AttributsStart% end_sub
sub AddEnd() dim_local titre$ titre$ = "Arrêt" FCE% = dll_call4("AddElementToFlowChart",FC%,5,hex("F0F0F0"),adr(titre$)) res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,0,0,100,100) res% = dll_call2("DrawFlowChart",FC%,1) position no_End_X%,0 position no_End_Y%,0 position no_End_Largeur%,100 position no_End_Hauteur%,100 text no_End_Couleur%,"F0F0F0" annulerselection() ' show no_AttributsEnd% end_sub
sub selectionner() show no_info% clear no_infotext% text no_infotext%,"Sélectionner un élément en cliquant dessus..." DoPoints% = 4 active no_AnnSel% active no_SuppLiens% hide no_AttributsConnector% hide no_AttributsAction% hide no_AttributsCondition% hide no_AttributsSelection% hide no_AttributsStart% hide no_AttributsEnd% hide no_AttributsLink% end_sub
sub annulerselection() DoPoints% = 0 inactive no_AnnSel% inactive no_SuppLiens% hide no_AttributsConnector% hide no_AttributsAction% hide no_AttributsCondition% hide no_AttributsSelection% hide no_AttributsStart% hide no_AttributsEnd% hide no_AttributsLink% res% = dll_call2("SelectElementInFlowChart",FC%,0) hide no_info% end_sub
sub supprimerliens() res% = dll_call2("RemoveAllLinksFromFlowChartElement",FC%,FCE%) end_sub
sub valider_connector() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Connector_X%),position(no_Connector_Y%),M1%,M1%) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsConnector% end_sub
sub valider_action() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Action_X%),position(no_Action_Y%),position(no_Action_Largeur%),position(no_Action_Hauteur%)) titre$ = trim$(text$(no_Action_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Action_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Action_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsAction% end_sub
sub valider_Condition() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Condition_X%),position(no_Condition_Y%),position(no_Condition_Largeur%),position(no_Condition_Hauteur%)) titre$ = trim$(text$(no_Condition_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Condition_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Condition_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsCondition% end_sub
sub valider_Selection() dim_local titre$ res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Selection_X%),position(no_Selection_Y%),position(no_Selection_Largeur%),position(no_Selection_Hauteur%)) titre$ = trim$(text$(no_Selection_Titre%)) res% = dll_call4("TextForElementOfFlowChart",FC%,FCE%,adr(titre$),handle(no_Selection_Contenu%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Selection_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsSelection% end_sub
sub valider_Start() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_Start_X%),position(no_Start_Y%),position(no_Start_Largeur%),position(no_Start_Hauteur%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_Start_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsStart% end_sub
sub valider_End() res% = dll_call6("LocateElementOfFlowChart",FC%,FCE%,position(no_End_X%),position(no_End_Y%),position(no_End_Largeur%),position(no_End_Hauteur%)) res% = dll_call3("ColorForElementOfFlowChart",FC%,FCE%,hex(text$(no_End_couleur%))) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call2("DrawFlowChart",FC%,1) hide no_AttributsEnd% end_sub
sub valider_Link() res% = dll_call3("ColorForLinkOfFlowChart",FC%,FCL%,hex(text$(no_Link_couleur%))) res% = dll_call3("SelectLinkInFlowChart",FC%,0,adr(ccc%)) res% = dll_call2("DrawFlowChart",FC%,5) hide no_AttributsLink% end_sub
sub nouveauprojet() FC% = dll_call1("DeleteFlowChart",FC%) FC% = dll_call6("CreateFlowChart",handle(0),0,0,0,0,LignesDeVisee%) full_space 0 res% = dll_call5("LocateFlowChart",FC%,width(no_cElements%),0,width_client(0)-width(no_cElements%),height_client(0)) ' height no_cElements%,300 projet$ = "" end_sub
sub ouvrirprojet() dim_local prj$ prj$ = file_name$(no_save%) if prj$="_" then exit_sub if lower$(file_extract_extension$(prj$))<>".fcproj" message "Extension erronnée (*.FCproj)" exit_sub end_if if file_exists(prj$)=0 message("Ce fichier n'existe pas." exit_sub end_if nouveauprojet() res% = dll_call2("LoadFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en chargement" else message "Le projet a été chargé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub enregistrerprojet() dim_local prj$ if projet$="" enregistrersousprojet() exit_sub end_if prj$ = projet$ if file_exists(prj$)=1 then file_delete prj$ res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en sauvegarde" else message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub enregistrersousprojet() dim_local prj$ prj$ = file_name$(no_save%) if prj$="_" then exit_sub if lower$(file_extract_extension$(prj$))<>".fcproj" message "Extension erronnée (*.FCproj)" exit_sub end_if if file_exists(prj$)=1 if message_confirmation_yes_no("Ce fichier existe déjà. Remplacer ?")<>1 then exit_sub file_delete prj$ end_if res% = dll_call2("SaveFlowChartProject",FC%,adr(prj$)) if res%<0 message "Erreur en sauvegarde" else message "Le ficher a été créé:"+chr$(13)+chr$(10)+prj$ projet$ = prj$ end_if end_sub
sub lier() annulerSelLien() AnnulerSelection() DoPoints% = 1 npt% = 0 show no_info% clear no_infotext% text no_infotext%,"Cliquer sur une sortie..." active no_AnnLink% active no_Tracer% end_sub
sub annulerlier() res% = dll_call2("ShowRulersInFlowChart",FC%,0) DoPoints% = 0 npt% = 0 xarray%(0) = 0 res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0) res% = dll_call2("DrawFlowChart",FC%,1) inactive no_AnnLink% inactive no_Tracer% hide no_info% end_sub
sub tracer() dim_local do1% ' rectangulariser le dernier segment NatureInput% = dll_call3("GetInputConnectorOfFlowChartElement",FCEdest%,adr(xx%),adr(yy%)) if NatureInput%<>0 if npt%=0 res% = dll_call4("GetOutputConnectorOfFlowChartElement",FCEstart%,output%,adr(xxp%),adr(yyp%)) else xxp% = xArray%(npt%) yyp% = yArray%(npt%) end_if
do1% = 0 if abs(xxp%-xx%)<=DeltaRectangle% xxp% = xx% do1% = 1 else if abs(yyp%-yy%)<=DeltaRectangle% yyp% = yy% do1% = 1 end_if end_if if do1%=1 npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if if yyp%>(yy%-DeltaRectangle%) yyp% = yy% - DeltaRectangle% npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if if xxp%<>xx% xxp% = xx% npt% = npt% + 1 xarray%(0) = npt% xarray%(npt%) = xxp% yarray%(npt%) = yyp% end_if end_if res% = dll_call6("ConnectElementsOfFlowChart",FC%,FCEstart%,output%,FCEdest%,adr(xArray%),adr(yArray%)) if res%=0 then message "Erreur en créant la connexion" res% = dll_call2("ShowRulersInFlowChart",FC%,0) res% = dll_call2("SelectElementInFlowChart",FC%,0) res% = dll_call3("SelectOutputConnectorOfFlowChartElement",FC%,FCEstart%,0) ' res% = dll_call2("DrawFlowChart",FC%,1) DoPoints% = 0 npt% = 0 xarray%(0) = 0 inactive no_AnnLink% inactive no_Tracer% hide no_info% end_sub
sub exporter() dim_local f$ f$ = file_name$(no_export%) if f$="_" then exit_sub if instr(".bmp.jpg.gif.png",lower$(file_extract_extension$(f$)))=0 message "Erreur d'extension" exit_sub end_if if file_exists(f$)=1 if message_confirmation_yes_no("Cette image existe déjà? Remplacer ?")<>1 then exit_sub end_if res% = dll_call1("CopyFlowChartToClipboard",FC%) res% = dll_call1("SaveAnyImageFile",adr(f$)) message "L'image est enregistrée dans:"+chr$(13)+chr$(10)+f$ end_sub
sub selectionLien() AnnulerSelection() DoPoints% = 6 npt% = 0 show no_info% clear no_infotext% text no_infotext%,"Cliquer sur un lien..." res% = dll_call2("DrawFlowChart",FC%,5) active no_AnnSelLink% active no_DelLink% end_sub sub annulerSelLien() DoPoints% = 0 npt% = 0 xarray%(0) = 0 res% = dll_call3("SelectLinkInFlowChart",FC%,0,adr(ccc%)) res% = dll_call2("DrawFlowChart",FC%,1) inactive no_AnnSelLink% inactive no_DelLink% hide no_info% hide no_info% end_sub sub supprimerLien() res% = dll_call1("DeleteLinkFromFlowChart",FCL%) hide no_info% end_sub
| |
| | | Contenu sponsorisé
| Sujet: Re: Un essai de construction d'organigramme par Panoramic | |
| |
| | | | Un essai de construction d'organigramme par Panoramic | |
|
Sujets similaires | |
|
| Permission de ce forum: | Vous ne pouvez pas répondre aux sujets dans ce forum
| |
| |
| |