Thanks byo,
Yes i use the Canvas for draw a moleling area.
Look the code for the draw
Code: Select all
Procedure FEN_MAIN_Draw()
Protected W,H,TG,N,I,Nb_X,Nb_Y,X,Y,W_Txt,Txt$
W=GadgetWidth(#MAIN_CANVAS)
H=GadgetHeight(#MAIN_CANVAS)
TG=Val(GetGadgetText(#MAIN_SPIN))
Nb_X=Round(W/TG,#PB_Round_Nearest)
Nb_Y=Round(H/TG,#PB_Round_Nearest)
GereLink()
StartDrawing(CanvasOutput(#MAIN_CANVAS))
Box(0,0,W,H,gColorCanvas)
If GetGadgetState(#MAIN_BT_GRILLE)=1
For N=1 To Nb_X
For I=1 To Nb_Y
X=TG*N
Y=TG*I
If X<W And Y<H
Plot(X,Y,gColorGrille)
EndIf
Next
Next
EndIf
DrawingFont(FontID(#Font_File))
ForEach monAnalyse\mesFichiers()
X=monAnalyse\mesFichiers()\X
Y=monAnalyse\mesFichiers()\Y
W=monAnalyse\mesFichiers()\W
H=monAnalyse\mesFichiers()\H
Box(X-2,Y-2,W+4,H+4,$000000)
H=gHeightEntete
Box(X,Y,W,H,monAnalyse\mesFichiers()\CoulEntete)
Y+gHeightEntete
H=monAnalyse\mesFichiers()\H-gHeightEntete
Box(X,Y,W,H,monAnalyse\mesFichiers()\Coul)
Y=monAnalyse\mesFichiers()\Y+10
Txt$=monAnalyse\mesFichiers()\Nom$
W_Txt=TextWidth(Txt$)
;Reduction du titre si plus grand
While W_Txt>W
Txt$=Left( monAnalyse\mesFichiers()\Nom$,Len(Txt$)-4)+"..."
W_Txt=TextWidth(Txt$)
Wend
X+(W/2)-(W_Txt/2)
DrawText(X,Y,Txt$,monAnalyse\mesFichiers()\CoulTxtEntete,monAnalyse\mesFichiers()\CoulEntete)
;Impression des rubriques
X=monAnalyse\mesFichiers()\X
Y=monAnalyse\mesFichiers()\Y
X+5
Y+gHeightEntete
Y+10
DrawingMode(#PB_2DDrawing_Transparent)
SortStructuredList(monAnalyse\mesFichiers()\myRubrique(),#PB_Sort_Ascending,OffsetOf(Rubrique\Order),TypeOf(Rubrique\Order))
ForEach monAnalyse\mesFichiers()\myRubrique()
Txt$=monAnalyse\mesFichiers()\myRubrique()\Name$
W_Txt=TextWidth(Txt$)
;Reduction du titre si plus grand
While W_Txt>W
Txt$=Left( monAnalyse\mesFichiers()\myRubrique()\Name$,Len(Txt$)-4)+"..."
W_Txt=TextWidth(Txt$)
Wend
If monAnalyse\mesFichiers()\myRubrique()\Type=#TP_PRIMARY_KEY
DrawingFont(FontID(#ARIAL_14_BOLD))
Else
DrawingFont(FontID(#ARIAL_14))
EndIf
If Y+TextHeight("TESTE")<monAnalyse\mesFichiers()\Y+monAnalyse\mesFichiers()\H
DrawText(X,Y,Txt$,$000000)
Else
Break
EndIf
Y+TextHeight(Txt$)
Next
If monAnalyse\mesFichiers()\Selected=#True
DrawPoignee()
EndIf
Next
DrawLink()
StopDrawing()
EndProcedure
Code: Select all
Procedure DrawLink()
Protected X2,Y2,X1,Y1,Txt$,Txt2$
ForEach monAnalyse\mesLink()
X1=0
ForEach monAnalyse\mesLink()\myPunt()
If X1<>0
X2= monAnalyse\mesLink()\myPunt()\X
Y2=monAnalyse\mesLink()\myPunt()\Y
LineXY(X1,Y1,X2,Y2,$000000)
X1=0
Y1=0
X2=0
Y2=0
EndIf
If X1=0
X1= monAnalyse\mesLink()\myPunt()\X
Y1=monAnalyse\mesLink()\myPunt()\Y
EndIf
Next
Next
EndProcedure
Code: Select all
Procedure DrawPoignee()
Protected X,Y
DrawingMode(#PB_2DDrawing_Default)
;Poignée HG
X=monAnalyse\mesFichiers()\X-(gTaillePoignees/2)
Y=monAnalyse\mesFichiers()\Y-(gTaillePoignees/2)
HG\X=X
HG\Y=Y
Box(X,Y,gTaillePoignees,gTaillePoignees,gCouleurPoignees)
;Poignee HD
X+monAnalyse\mesFichiers()\W
HD\X=X
HD\Y=Y
Box(X,Y,gTaillePoignees,gTaillePoignees,gCouleurPoignees)
;Poignee BG
X=monAnalyse\mesFichiers()\X-(gTaillePoignees/2)
Y=monAnalyse\mesFichiers()\Y-(gTaillePoignees/2)
Y+monAnalyse\mesFichiers()\H
BG\X=X
BG\Y=Y
Box(X,Y,gTaillePoignees,gTaillePoignees,gCouleurPoignees)
;Poignee BD
X+monAnalyse\mesFichiers()\W
BD\X=X
BD\Y=Y
Box(X,Y,gTaillePoignees,gTaillePoignees,gCouleurPoignees)
;Poignee MG
X=monAnalyse\mesFichiers()\X-(gTaillePoignees/2)
Y=monAnalyse\mesFichiers()\Y-(gTaillePoignees/2)
Y+(monAnalyse\mesFichiers()\H/2)
MG\X=X
MG\Y=Y
Box(X,Y,gTaillePoignees,gTaillePoignees,gCouleurPoignees)
;Poignee MD
X+monAnalyse\mesFichiers()\W
MD\X=X
MD\Y=Y
Box(X,Y,gTaillePoignees,gTaillePoignees,gCouleurPoignees)
;Poignee HM
X=monAnalyse\mesFichiers()\X-(gTaillePoignees/2)
Y=monAnalyse\mesFichiers()\Y-(gTaillePoignees/2)
X+(monAnalyse\mesFichiers()\W/2)
HM\X=X
HM\Y=Y
Box(X,Y,gTaillePoignees,gTaillePoignees,gCouleurPoignees)
;Poignee BM
Y+monAnalyse\mesFichiers()\H
BM\X=X
BM\Y=Y
Box(X,Y,gTaillePoignees,gTaillePoignees,gCouleurPoignees)
EndProcedure