Voici une version7 plus complète MANDALA3D
avec un fichier ascii " Mandalas.csv " est à la suite
Je ne pouvais pas mettre toutes les options dans mon code session Punch ,
Il se trouve qu'avec la matrice 3D et l'ajout d'un 4ème calcul on obtient des graphiques
avec de beaux battements d'ailes, cette option est avec touche delete = 2
à la demande de Vera
Maintenant une sauvegarde dans la fenêtre avec un Popmenu et ListViewGadget Select et boutons enregistrer ou supprimer
et pour le mode plein écran la touche « S » enregistre les paramètres graphiques seulement pas de touche de suppression dans ce mode
et dans les deux modes les touches + et - du clavier permettent de choisir dans la base un paramètrages enregistré
J'ai utiliser un ListViewGadget simple avec un numéro d'index pour rendre adaptable le code sous LInux et Mac
[réédit]
Ajout d'une police "courrier new" pour listviewGadget(), car la tabulation n'était pas top
et pour cela reformatage du fichier mandalas.csv adapté à la police dans le ListviewGadget
je n'ai pas utilisé de Listicongadget ni de grille pour essayé d' être cross plateforme.
Cordialement
Code : Tout sélectionner
;##################################################################################################
;# English forum session punch XMas 2014 : http://www.purebasic.fr/english/viewtopic.php?f=14&t=61104
;# Author: kernadec , Date: XMas 2014
;# PureBasic 5.22 : OS: Windows : (no tests Linux and Mac)
;#
;# Titre: MANDALAS3D V8 ( Ellipsoid variations )
;#
;# Display : Full Screen And windows 800/600
;# Use a very basic ListViewGadget() via index to facilitate the Linux and Mac OS compatibility
;# Mode Save/Read to file for the restoration of the parameters elements Mandalas
;###################################################################################################
Enumeration
#Window0
#Window1
#Window2
EndEnumeration
Enumeration
#ListView
#Button0
#Button1
#TextGadget
#FrameGadget
EndEnumeration
Enumeration
#PopMenu
#Menu1
EndEnumeration
Enumeration
#File
EndEnumeration
Structure Text
L$
EndStructure
Global Dim Cl(7)
Global NewList Mandala.Text()
Procedure.s Fmt(n)
n$ = Str(n)
n$ = RSet(n$, 5, " ") ; Spaces Previous for Tab ListView and File
ProcedureReturn n$
EndProcedure
Procedure sauvefichier(Chemin$,Formtext$,type)
If type = 0 ; Mode window Save global listview function add or delete line
If FileSize(chemin$+".csv") <> -1
CopyFile(chemin$+".csv", chemin$+".bak") ; creation in backup old file
EndIf
CreateFile(#File , Chemin$ + ".csv") ; creation new file
For W = 0 To CountGadgetItems(#ListView)
Tmp$ = ReplaceString(GetGadgetItemText(#ListView, W), Chr(#LF), ";", 1)
Tmp$ = Right(Tmp$, Len(Tmp$)-Len(StringField(Tmp$, 1, ";")))
If Tmp$ <> "" ; Listview Format 1000 fields index Numbers
If Len(Str(W)) = 1 : Tmp$ = "00" + Str(W) + Tmp$ : EndIf
If Len(Str(W)) = 2 : Tmp$ = "0" + Str(W) + Tmp$ : EndIf
If Len(Str(W)) = 3 : Tmp$ = Str(W) + Tmp$ : EndIf
WriteStringN(#File, Tmp$)
EndIf
Next W
CloseFile(#File)
Else ; Mode Save Key "S" full screen and add just line
W = -1
If ReadFile(#File, Chemin$ + ".csv")
While Eof(#File) = 0
Tmp$ = ReadString(#File)
If Tmp$ <> ""
W + 1 ; Read Count Total line number
EndIf
Wend
CloseFile(#File)
Else
MessageRequester("Information","Unable to open file!")
EndIf
W + 1 ; next number index for add line
If Len(Str(W)) = 1 : Tmp$ = "00" + Str(W) + ";" + Formtext$ : EndIf
If Len(Str(W)) = 2 : Tmp$ = "0" + Str(W) + ";" + Formtext$ : EndIf
If Len(Str(W)) = 3 : Tmp$ = Str(W) + ";" + Formtext$ : EndIf
OpenFile (#File , Chemin$ + ".csv", #PB_File_Append) ; update file
FileSeek (#File , Lof(#File))
WriteStringN(#File , Tmp$) ; write new line file
CloseFile (#File)
EndIf
EndProcedure
Procedure.s chargefichier(Chemin$,type)
If type = 0 ; mode window load to listview
If ReadFile(#File, Chemin$ + ".csv")
ClearGadgetItems(#ListView)
While Eof(#File) = 0
Tmp$ = ReadString(#File)
If Tmp$<> ""
AddGadgetItem(#ListView, -1, Tmp$)
EndIf
Wend
CloseFile(#File)
Else
MessageRequester("Information","Unable to open file!")
EndIf
Else ; mode Full Screen key "+" & "-" read file to write newlist mandala()
If ReadFile(#File, Chemin$ + ".csv")
While Eof(#File) = 0
Tmp$ = ReadString(#File)
If Tmp$<> ""
AddElement(Mandala())
Mandala()\L$ = Tmp$
EndIf
Wend
CloseFile(#File)
Else
MessageRequester("Information","Unable to open file!")
EndIf
EndIf
ProcedureReturn Tmp$
EndProcedure
Procedure Ellipse_Rotation(Axex.l, Axey.l, Xr.l, Yr.l, Zr.l, Rtx.d, Rty.d, Rtz.d, Debut.l, Fin.l, Polygone.l, Col.l, Mode.l, Styl.l)
Protected v.d, RB.d, Rx.d, Ry.d, Rz.d, X.d, Y.d, Z.d, X1.d, Y1.d, Z1.d, Psx1.l, Psy1.l, Psx2.l, Psy2.l, Side.d, Stp.d
If Polygone <> 0 : Side = 360 / Polygone : Else : Side = 360 : EndIf
Rx = Radian(Rtx)
Ry = Radian(Rty)
Rz = Radian(Rtz)
Stp = debut
Repeat
v = Radian(Stp)
If Mode = 0 ; ellipsoid
X = Xr * Sin(v)
Y = Yr * Sin(v)
Z = Zr * Cos(v)
EndIf
If Mode = 1 ; Bowl + conical sphere
X = Xr * Sin(v)
Y = Yr * Sin(v*0.2)
Z = Zr * Sin(v*0.6)
EndIf
If Mode = 2 ; ellipsoid drilled poles
X = Xr * Cos(v-0.5)
Y = Yr * Sin(v)
Z = Zr * Cos(v)
EndIf
If Mode = 3 ; 2 inverted bowls + conical sphere
X = Xr * Sin(v*2)
Y = Yr * Cos(v*0.25)
Z = Zr * Sin(v)
EndIf
If Mode = 4 ; 3 spheres discs drilled
X = Xr * Cos(v * -3)
Y = Yr * Cos(v / -2)
Z = Zr * Sin(v)
EndIf
If Mode = 5 ; discs + 2 disks spheres
X = Xr * Sin(v * 0.25)
Y = Yr * Cos(v * 2)
Z = Zr * Sin(v * 0.35)
EndIf
If Mode = 6 ; 2 bowls + 1 conical sphere bunk
X = Xr * Sin(v * 1.5)
Y = Yr * Cos(v)
Z = Zr * Sin(v * 0.65)
EndIf
If Mode = 7 ; 5 discs spheres
X = Xr * Sin(v * 0.68)
Y = Yr * Cos(v * 2.5)
Z = Zr * Sin(v)
EndIf
If Mode = 8 ; tapered cylinders
X = Xr * Sin(v * 0.5)
Y = Yr * Cos(v * -3)
Z = Zr * Sin(v * 1.4)
EndIf
If Mode = 9 ; tapered cylinders and 2 cones
X = Xr * Cos(v)
Y = Yr * Cos(v * 0.35)
Z = Zr * Cos(v * 1.7)
EndIf
; ------- matrice 3D -----------
X1 = X * Cos(rz) + Y * Sin(rz)
y1 = Y * Cos(rz) - X * Sin(rz)
Z1 = Z
RB = Y1 * Cos(ry) - Z1 * Sin(ry)
z1 = Y1 * Sin(ry) + Z1 * Cos(ry)
Y1 = RB
RB = X1 * Cos(rx) + Z1 * Sin(rx)
z1 = X1 * Sin(rx) - Z1 * Cos(rx)
Y1 = RB
; -Option Wing --fourth-calculation-
If styl = 2 Or styl = 3
X = X1
Y = Y1
Z = z1
X1 = X * Cos(rz) - Y * Sin(rz)
y1 = Y * Cos(rz) + X * Sin(rz)
Z1 = Z
EndIf
; ------------------------------
Psx1 = Z1 + Axex
Psy1 = Y1 + Axey
If Psx2 = 0 And Psy2 = 0 : Psx2 = Psx1 : Psy2 = Psy1: EndIf
If styl = 1 Or styl =3 : Swap Psy2,psy1 : EndIf
If Stp => 0 And Stp <= 90
LineXY(Psx2, Psy2, Psx1, Psy1, Cl(0))
EndIf
If Stp => 90 And Stp <= 180
LineXY(Psx2, Psy2, Psx1, Psy1, Cl(1))
EndIf
If Stp => 180 And Stp <= 270
LineXY(Psx2, Psy2, Psx1, Psy1, Cl(2))
EndIf
If Stp => 270 And Stp <= 360
LineXY(Psx2, Psy2, Psx1, Psy1, Cl(3))
EndIf
If styl = 1 Or styl =3 : Swap Psy2,psy1 : EndIf
Psx2 = Psx1
Psy2 = Psy1
Stp + Side
Until Stp => Fin + 1
EndProcedure
ExamineDesktops()
InitSprite()
InitKeyboard()
If LoadFont(1, "Courier New", 8) ; Font For Tab ListView
SetGadgetFont(#PB_Default, FontID(1))
EndIf
Chemin$=GetCurrentDirectory()+"mandalas"
chargefichier(Chemin$,1)
R1 = MessageRequester("SCREEN",Space(16)+"FULL SCREEN",#PB_MessageRequester_YesNo)
Xs = DesktopWidth(0) ; Xscreen
Ys = DesktopHeight(0) ; Yscreen
If R1 = 6
OpenWindow(#Window2, 0, 0, 0, 0, "", #PB_Window_Invisible)
OpenScreen(Xs, Ys, 32, "")
Else
Xs = 800 : Ys = 600
OpenWindow(#Window0, 0, 0, Xs, Ys, "MANDALAS 3D by kernadec XMas 2014", #PB_Window_WindowCentered|#PB_Window_ScreenCentered )
If CreatePopupMenu(#PopMenu)
MenuItem(#Menu1, "List")
EndIf
OpenWindowedScreen(WindowID(#Window0) , 0, 0, Xs, Ys, 0, 0, 0,#PB_Screen_SmartSynchronization)
EndIf
Axex.l = Xs/2 ; Axis X Screen
Axey.l = Ys/2 ; Axis Y Screen
Debut.l = 0 ; Start Xircle
Fin.l = 360 ; End Circle
Wh.l = 0 ; Switch Wheel
Pass.l = 0 ; Switch Vars
Nl.l = 0 ; Numbers Display Mandala List
Mode.l = 6 ; Mode Draw Mandala
Styl.l = 2 ; Pixels or Stick, Wing
Plt.l = 12 ; Polygon Side Parallel
Plg.l = 3 ; Polygon Side Meridian
Inc = 10 ; Speed Key Shift to X1 or X10
Vi.l = 1 ; Speed Rotate x1,x2,x3,x4.....
Xd = 30 ; Corner X
Yd =-210 ; Corner Y
Zd = 280 ; Corner Z
Zr.l = 1 ; Radius Z
Yr.l =-115 ; Radius Y
Xr.l = 290 ; Radius X
a.l = 0 ; Color 0
b.l = 1 ; Color 1
c.l = 2 ; Color 2
d.l = 3 ; Color 3
Cl(a) = RGB(255, 0, 0) ; Red
Cl(b) = RGB( 0, 0,255) ; Blue
Cl(c) = RGB( 0,255, 0) ; Green
Cl(d) = RGB(255,255,0) ; Yellow
Cl(4) = Cl(a) : Cl(5) = Cl(b) : Cl(6) = Cl(c) : Cl(7) = Cl(d) ; Order Color
Repeat
ExamineKeyboard()
StartDrawing(ScreenOutput())
If Plt < 0 : Plt = 360 : EndIf
Zd = Mod(Zd + Vi , 360)
For i = 0 To 360
Ellipse_Rotation(Axex, Axey, Xr, Yr, Zr, Xd, Yd, Zd + i , Debut, Fin, Plt, 0, Mode, Styl)
i + Plg
Next i
StopDrawing()
If KeyboardPushed(#PB_Key_Tab) : Delay(100) : Mode + 1 : If Mode > 9 : Mode = 0 : EndIf : EndIf
If KeyboardReleased(#PB_Key_LeftShift) : If Inc = 1 : Inc = 10 : Else : Inc = 1 : EndIf : EndIf
If KeyboardReleased(#PB_Key_Space) : If Lt = 0 : Lt = 1 : Else : Lt = 0 : EndIf : EndIf
If KeyboardReleased(#PB_Key_Delete) : Styl + 1 : If Styl > 3 : Styl = 0 : EndIf : EndIf
; Test Speed Change x1 Or x10 For Change Polygon Or Radius Speed X1 Corners < 20
If Abs(Plt) = 180 : Plt + 180 : Tmp = 10 : Else : Tmp = Inc : EndIf
If Abs(Plt) = 0 : Plt = 360 : Tmp = 10 : Else : Tmp = Inc : EndIf
If Abs(Plt) < 21 : Tmp = 1 : Else : Tmp = Inc : EndIf
If Abs(Plg) < 21 : Tmp1 = 1 : Else : Tmp1 = Inc : EndIf
If Abs(Zr ) < 31 : Tmp2 = 1 : Else : Tmp2 = Inc : EndIf
If KeyboardPushed(#PB_Key_Up) : Yd = Mod(Yd + Inc , 360): EndIf
If KeyboardPushed(#PB_Key_Down) : Yd = Mod(Yd - Inc , 360): EndIf
If KeyboardPushed(#PB_Key_Left) : Xd = Mod(Xd + Inc , 360): EndIf
If KeyboardPushed(#PB_Key_Right) : Xd = Mod(Xd - Inc , 360): EndIf
If KeyboardPushed(#PB_Key_PageUp) : Plt = Mod(Plt + Tmp , 180): EndIf
If KeyboardPushed(#PB_Key_PageDown): Delay(100) : Plt = Mod(Plt - Tmp , 180): Plt = Abs(Plt) : EndIf
If KeyboardPushed(#PB_Key_Home) : Delay(100) : Plg = Mod(Plg + Tmp1, 360): EndIf
If KeyboardPushed(#PB_Key_End) : Delay(100) : Plg = Mod(Plg - Tmp1, 360): Plg = Abs(Plg) : EndIf
If KeyboardPushed(#PB_Key_1) Or KeyboardPushed(#PB_Key_Pad1): Zr = Mod(Zr - Tmp2, Ys) : EndIf
If KeyboardPushed(#PB_Key_4) Or KeyboardPushed(#PB_Key_Pad4): Zr = Mod(Zr + Tmp2, Ys) : EndIf
If KeyboardPushed(#PB_Key_2) Or KeyboardPushed(#PB_Key_Pad2): Yr = Mod(Yr - Inc , Ys) : EndIf
If KeyboardPushed(#PB_Key_3) Or KeyboardPushed(#PB_Key_Pad3): Yr = Mod(Yr + Inc , Ys) : EndIf
If KeyboardPushed(#PB_Key_5) Or KeyboardPushed(#PB_Key_Pad5): Xr = Mod(Xr - Inc , Ys) : EndIf
If KeyboardPushed(#PB_Key_6) Or KeyboardPushed(#PB_Key_Pad6): Xr = Mod(Xr + Inc , Ys) : EndIf
If KeyboardPushed(#PB_Key_7) Or KeyboardPushed(#PB_Key_Pad7): Delay(100) : Vi = Mod(Vi + 1, 180) : EndIf
If KeyboardPushed(#PB_Key_8) Or KeyboardPushed(#PB_Key_Pad8): Delay(100) : Vi = Mod(Vi - 1, 180) : EndIf
If KeyboardPushed(#PB_Key_9) Or KeyboardPushed(#PB_Key_Pad9): Vi = 0 : EndIf
If KeyboardPushed(#PB_Key_0) Or KeyboardPushed(#PB_Key_Pad0): a=Random(3):Repeat:b=Random(3):Until b<>a:Repeat:c=Random(3):Until c<>a And c<>b:Repeat:d=Random(3):Until d<>a And d<>b And d<>c: cl(0)=cl(4+a):cl(1)=cl(4+b):cl(2)=cl(4+c):cl(3)=cl(4+d): EndIf
If KeyboardReleased(#PB_Key_S) ; Save Element to File
; format chaine for the file base and element newlist
Formtext$ = Fmt(mode) + ";" + Fmt(styl) + ";" + Fmt(Plt) + ";" + Fmt(Plg) + ";" + Fmt(Inc) + ";" + Fmt(Vi) + ";" + Fmt(Xd) + ";" + Fmt(Yd) + ";" + Fmt(Zd) + ";" + Fmt(Xr) + ";" + Fmt(Yr) + ";" + Fmt(Zr) + ";" + Fmt(a) + ";" + Fmt(b) + ";" + Fmt(c) + ";" + Fmt(d)
sauvefichier(Chemin$,Formtext$, 1) ; Save new element in update file and add element in Newlist mandala
ClearList(Mandala())
chargefichier(Chemin$, 1) ; Restore NewList Mandala
EndIf
If KeyboardReleased(#PB_Key_Add) : Wh = 1 : Nl = Mod(nl + 1, ListSize(Mandala())) : EndIf ; key Read file mandala base
If KeyboardReleased(#PB_Key_Subtract): Wh = 1 : Nl - 1 : If Nl < 0 : Nl = ListSize(Mandala())-1 : EndIf : EndIf
If Wh <> 0 : Wh = 0 ; Wheel Key "+/-" Display Mandala
ResetList(Mandala())
For i = 0 To ListSize(Mandala())
NextElement(Mandala())
If Val(StringField(Mandala()\L$, 1, ";")) = Nl
Tmp$ = Mandala()\L$ ; Read newlist element to tmp$
Break
EndIf
Next i
pass = 1 ; switch Vars
EndIf
If pass <> 0 : pass = 0 ; tmp$ Restore To Vars
num = Val(StringField(Tmp$, 1, ";")) ; Number Index ListView
mode = Val(StringField(Tmp$, 2, ";")) ; Mode Draw Mandala
styl = Val(StringField(Tmp$, 3, ";")) ; Pixels or Stick
Plt = Val(StringField(Tmp$, 4, ";")) ; Polygon Side Parallel
Plg = Val(StringField(Tmp$, 5, ";")) ; Polygon Side Meridian
Inc = Val(StringField(Tmp$, 6, ";")) ; Speed Key Shift to x1 or x10
Vi = Val(StringField(Tmp$, 7, ";")) ; Speed Rotate x1,x2,x3,x4.....
Xd = Val(StringField(Tmp$, 8, ";")) ; Corner X
Yd = Val(StringField(Tmp$, 9, ";")) ; Corner Y
Zd = Val(StringField(Tmp$, 10, ";")) ; Corner Z
Xr = Val(StringField(Tmp$, 11, ";")) ; Radius X
Yr = Val(StringField(Tmp$, 12, ";")) ; Radius Y
Zr = Val(StringField(Tmp$, 13, ";")) ; Radius Z
a = Val(StringField(Tmp$, 14, ";")) ; Color Random RGBY
b = Val(StringField(Tmp$, 15, ";")) ; Color Random RGBY
c = Val(StringField(Tmp$, 16, ";")) ; Color Random RGBY
d = Val(StringField(Tmp$, 17, ";")) ; Color Random RGBY
Cl(0) = Cl(4 + a) : Cl(1) = Cl(4 + b) : Cl(2) = Cl(4 + c) : Cl(3) = Cl(4 + d) ; Restore Order Color
EndIf
If Lt = 0
StartDrawing(ScreenOutput())
DrawText(10, 190, "1",Cl(0))
DrawText(30, 190, "2",Cl(1))
DrawText(50, 190, "3",Cl(2))
DrawText(70, 190, "4",Cl(3))
DrawText(10, 10, "-Key Shift left y/n >inc/dec< x1 or x10= " + Str(inc))
DrawText(10, 30, "-Key Space y/n menu text")
DrawText(10, 50, "-PgU/PgD +/- Plt= " + Str(Plt) + " / 180")
DrawText(10, 70, "-Hom/End +/- Plg= " + Str(Plg) + " / 360")
DrawText(10, 90, "-Key 7/8 +/- Vit/Rt= " + Str(Vi ) + " / 180")
DrawText(10, 110, "-Key 9 Vit/Rt in 0")
DrawText(10, 130, "-Key del > 0 Style= " + Str(Styl))
DrawText(10, 150, "-Key 0 Move color")
DrawText(10, 170, "-Tab M = " + Str(Mode) + " / 9")
DrawText(10, Ys-178, "-Key Esc = Quit")
DrawText(10, Ys-158, "-Key S Save Draw")
DrawText(10, Ys-138, "- +/- Load list n°" + Str(nl))
DrawText(10, Ys-118, "-ClickMRight = Listview ")
DrawText(10, Ys- 98, "- <- -> +/- = " + Str(Xd) + " / 360")
DrawText(10, Ys- 78, "-Up/Down +/- = " + Str(Yd) + " / 360")
DrawText(10, Ys- 58, "-Key 1/4 +/- Zradius= " + Str(Zr) + " / " +Str(Ys))
DrawText(10, Ys- 38, "-Key 2/3 +/- Yradius= " + Str(Yr) + " / " +Str(Ys))
DrawText(10, Ys- 18, "-Key 5/6 +/- Xradius= " + Str(Xr) + " / " +Str(Ys))
StopDrawing()
EndIf
FlipBuffers()
ClearScreen(0)
Repeat
Event = WindowEvent()
Select event
Case #WM_RBUTTONDOWN
DisplayPopupMenu(#PopMenu, WindowID(#Window0))
Case #PB_Event_Menu
Select EventMenu()
Case #Menu1 ;"Pop Menu List"
quit = 0
If OpenWindow (#Window1, 0, 0, 750, 170, "File-Mandalas-List ", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListViewGadget(#ListView, 10, 20, 720, 120)
FrameGadget (#FrameGadget, 10, 5, 700, 135, "N°| Mod | Styl| Plt | Plg | Inc | Spd | Xd | Yd | Zd | Xr | Yr | Zr | R | G | B | Y |")
ButtonGadget (#Button0, 70, 143, 100, 25, "Add Item")
ButtonGadget (#Button1, 580, 143, 100, 25, "Delete Item")
TextGadget (#TextGadget, 247, 140, 256, 200, "Selection = Double click on the line")
StartDrawing(WindowOutput(#Window1)) : Col.l = Point(1, 1) : StopDrawing()
SetGadgetColor(#TextGadget, #PB_Gadget_BackColor , Col)
chargefichier(Chemin$,0)
Formtext$=Fmt(mode) + ";" + Fmt(styl) + ";" + Fmt(Plt) + ";" + Fmt(Plg) + ";" + Fmt(Inc) + ";" + Fmt(Vi) + ";" + Fmt(Xd) + ";" + Fmt(Yd) + ";" + Fmt(Zd) + ";" + Fmt(Xr) + ";" + Fmt(Yr) + ";" + Fmt(Zr) + ";" + Fmt(a) + ";" + Fmt(b) + ";" + Fmt(c) + ";" + Fmt(d)
Repeat
Event2 = WaitWindowEvent()
Select Event2
Case #PB_Event_CloseWindow : CloseWindow(#Window1) : quit = 1
Case #PB_Event_Gadget
Select EventGadget()
Case #ListView ; Show the selected listview entry on doubleclick
If EventType() = #PB_EventType_LeftDoubleClick
; Element listView Item to Var Tmp$
Tmp$ = GetGadgetItemText(#ListView, GetGadgetState(#ListView))
Pass = 1 ; switch Vars
Nl = GetGadgetState(#ListView) ; Restore Count Position Newlist Screen
CloseWindow(#Window1) : quit = 1
EndIf
Case #Button0 ; Button: Add
AddGadgetItem(#ListView ,-1 ,Str(CountGadgetItems(#ListView)-1) + ";" + Formtext$) ; Write Element ListView,
sauvefichier(Chemin$,Formtext$,0) ; Update File
chargefichier(Chemin$,0) ; Read Update Elements
ClearList(Mandala())
chargefichier(Chemin$,1) ; Update Newlist
CloseWindow(#Window1) : quit = 1
Case #Button1 ; Button: Delete
RemoveGadgetItem(#ListView , GetGadgetState(#ListView))
sauvefichier(Chemin$,Formtext$,0) ; Update File
chargefichier(Chemin$,0) ; Update Read Element
ClearList(Mandala())
chargefichier(Chemin$,1) ; Update Newlist
EndSelect
EndSelect
Until quit = 1
EndIf
EndSelect
Case #PB_Event_CloseWindow
End
EndSelect
Until Event = 0
Until KeyboardPushed(#PB_Key_Escape)
End
fichier ascii : Mandalas.csv
Code : Tout sélectionner
000; 6; 2; 12; 3; 10; 1; 30; -210; 282; 290; -115; 3; 0; 1; 2; 3
001; 5; 0; 10; 5; 10; 19; 90; 50; 127; 160; -315; -1; 2; 3; 0; 1
002; 1; 0; 10; 5; 10; 19; 90; 50; 339; 160; -315; -1; 2; 3; 0; 1
003; 6; 1; 10; 5; 10; 19; 350; -280; 258; -70; 325; -8; 2; 3; 1; 1
004; 2; 0; 10; 5; 10; 19; 90; 50; 277; 160; -315; -1; 2; 3; 0; 1
005; 4; 0; 10; 5; 10; 19; 90; 50; 166; 160; -315; -1; 2; 3; 0; 1
006; 0; 1; 16; 18; 10; 1; -150; -170; 312; 80; 225; -235; 0; 3; 2; 1
007; 0; 1; 5; 18; 10; 1; -90; -20; 152; 50; 95; -141; 0; 3; 2; 1
008; 5; 1; 11; 10; 10; 1; -358; -131; 160; 0; -235; -6; 0; 1; 3; 2
009; 8; 1; 11; 10; 10; 1; -18; -261; 277; 0; -245; -6; 0; 1; 3; 2
010; 0; 1; 11; 10; 10; 1; -18; -261; 109; 0; -245; -6; 0; 1; 3; 2
011; 2; 1; 10; 5; 10; -1; -50; -290; -313; 440; 15; -1; 2; 1; 0; 3
012; 6; 2; 12; 3; 10; 1; 160 -280; 315; 110; 205; -24; 0; 1; 2; 3
013; 9; 2; 12; 3; 10; 1; 230; -270; 193; -300; -185;-1011; 0; 1; 2; 3
014; 3; 2; 31; 3; 10; 1; 290; -20; 265; -220; -435; 6; 3; 0; 1; 2
015; 6; 2; 12; 3; 10; 1; 120; -240; 147; 290; -165; 3; 1; 3; 2; 0
016; 7; 2; 12; 3; 10; 1; -310; -130; 218; 400; 175; 3; 2; 0; 1; 3
017; 7; 2; 12; 3; 10; 1; -310; -240; 124; 400; 175; 0; 2; 0; 1; 3
018; 7; 2; 12; 3; 1; 1; -59; -41; 152; 400; 175; 0; 2; 0; 1; 3
019; 4; 2; 8; 3; 1; 27; -251; -252; 35; 400; 175; 0; 3; 0; 2; 1
020; 2; 2; 5; 3; 1; 27; -339; -90; 233; 400; 175; 0; 0; 3; 1; 2
021; 7; 2; 6; 2; 1; 1; -186; -294; 323; 351; 181; 0; 1; 0; 3; 2
022; 7; 2; 6; 2; 1; 1; 222; -104; 331; 351; 181; 0; 3; 0; 1; 2
023; 8; 2; 36; 2; 1; 1; -132; -88; 36; 351; 181; 0; 1; 2; 0; 3
024; 0; 2; 30; 2; 10; 1; -61; -48; 263; -286; 207; -71; 1; 3; 0; 2
025; 7; 2; 12; 3; 1; 4; -270; 180; 269; 240; -237; 0; 0; 2; 1; 3
026; 0; 2; 5; 2; 1; 0; -90; 180; 128; -215; -5; 266; 2; 3; 0; 1
027; 1; 2; 10; 2; 10; 4; -308; -326; 7; -363; -134; 0; 2; 1; 3; 0