home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 113 / EnigmaAmiga113CD.iso / software / grafica / showgui / piclist < prev    next >
Encoding:
Text File  |  2000-05-26  |  6.6 KB  |  388 lines

  1. G4C
  2.  
  3. WINBIG 440 234 335 390 "BOOKMARKS"
  4. wintype 11010001
  5. WINBACKGROUND SOLID 1 0
  6.  
  7. xONLOAD
  8. Set help on
  9. VARPATH ShowGUI/ListConfig
  10.  
  11.  
  12. ifexists FILE S:Picture.data
  13. changed = 0
  14. else
  15. gosub PicList ListeMachen
  16. changed = 1
  17. lvuse PicList 1
  18. lvchange S:Picture.data
  19. endif
  20.  
  21. guiopen PicList
  22.  
  23.  
  24. lvuse PicList 1
  25. setgad PicList 1 HIDE
  26. LVMove #0
  27. setgad PicList 1 SHOW
  28.  
  29.  
  30.  
  31. XLISTVIEW 5 10 240 355 '' liste S:Picture.data 0 SHOW
  32. gadid 1
  33. Gadhelp "Select Entry to activate"
  34. gosub PicList UpdList
  35.  
  36. xONCLOSE
  37. guiclose PicList
  38.  
  39. XRoutine PicHolen
  40.  
  41. if $pics > ''
  42. Parsevar pics
  43. setvar w 0
  44. setgad PicList 1 HIDE
  45.  
  46. while $w < $$parse.total
  47. sp = $$parse.$w
  48. EXTRACT sp FILE *name
  49. lvadd ''
  50. %name = $*name
  51. %artist = $artist ;''
  52. %type = $type ;''
  53. %date = $date ;''
  54. %path = $$parse.$w
  55. w == $w + 1
  56. endwhile
  57. lvmove #0
  58. lvmove #$$LV.TOTAL
  59. lvgo #$$LV.TOTAL
  60. setgad PicList 1 SHOW
  61. changed = 1
  62. endif
  63.  
  64. XRoutine UpdList
  65. if $$lv.line > 1
  66. extract %name CLEAN *name
  67. extract %artist CLEAN *artist
  68. extract %type CLEAN *type
  69. extract %date CLEAN *date
  70. extract %path CLEAN *path
  71.  
  72. ifexists GUI Editor
  73. update Editor 1 $*name
  74. update Editor 2 $*artist
  75. update Editor 3 $*type
  76. update Editor 4 $*date
  77. endif
  78. endif
  79. xROUTINE ListeMachen
  80.  
  81. TEXTFILE ram:Picture.data
  82. GCDB
  83. 0
  84. 5
  85. %name 15 S
  86. %artist 15 S
  87. %type 8 S
  88. %date 15 S
  89. %path 150 S
  90. ###
  91.  
  92. LVUse PicList 101
  93.  
  94. lvadd ''
  95. %name = 'Name'
  96. %artist = 'Artist'
  97. %type = 'Type'
  98. %date = 'Date'
  99. %path = 'Path'
  100. lvadd ''
  101.  
  102. ifexists FILE s:Picture.data
  103. ;
  104. else
  105. lvsave s:Picture.data
  106. ;
  107. endif
  108.  
  109. lvuse PicList 1
  110.  
  111.  
  112. XLISTVIEW 600 600 290 38 "" deppy "ram:Picture.data" 0 SHOW
  113.     gadid 101
  114.  
  115.  
  116. xRoutine ListSave
  117.          ReqFile 0 0 200 400 "Save List as..." SAVE listy ShowGUI:
  118.          if $listy > ''
  119.          lvuse PicList 1
  120.          lvsave $listy
  121.          changed = 0
  122.          else
  123.          ezreq "There's no file to save!" "Ok" ok
  124.          endif
  125.  
  126.  
  127. image 247 10 bshow
  128. Attr RESIZE 1002
  129. XAREA 250 11 78 17 BOX
  130. Attr RESIZE 1000
  131. Gadhelp "Shows a picture from the list"
  132. if $$lv.line > 1
  133. ShowGUI/pic = $%path
  134. SET BUFFERS 5000
  135. .ShowGUIconfig = 'G4C\n\nxOnLoad\n'
  136. appvar .ShowGUIconfig '\nShowGUI/ppicture = "$ppicture"'
  137. appvar .ShowGUIconfig '\nShowGUI/pcopy = "$pcopy"'
  138. appvar .ShowGUIconfig '\nShowGUI/pproggy = "$pproggy"'
  139. appvar .ShowGUIconfig '\nShowGUI/pic = $pic'
  140. appvar .ShowGUIconfig '\nShowGUI/viewer = "$viewer"'
  141. appvar .ShowGUIconfig '\nShowGUI/befehl = "$befehl"'
  142. appvar .ShowGUIconfig '\nShowGUI/PLISTE = "$PLISTE"'
  143. appvar .ShowGUIconfig '\nShowGUI/artist = "$artist"'
  144. appvar .ShowGUIconfig '\nShowGUI/type = "$type"'
  145. appvar .ShowGUIconfig '\nShowGUI/date = "$date"'
  146. appvar .SHOWGUIconfig '\nShowGUI/PICSTART = "$PICSTART"'
  147. appvar .SHOWGUIconfig '\nShowGUI/PATTERN = "$PATTERN"'
  148. appvar .SHOWGUIconfig '\nShowGUI/PATTERNPATH = "$PATTERNPATH"'
  149. appvar .SHOWGUIconfig '\nShowGUI/extviewer = "$extviewer"'
  150. appvar .SHOWGUIconfig '\nShowGUI/argu = "$argu"'
  151. appvar .ShowGUIconfig '\nGuiQuit #This'
  152. copy env:.ShowGUIconfig ShowGUI:Config/ShowGUIconfig
  153. guiload ShowGUI:Config/ShowGUIconfig
  154. gosub ShowGUI JetztLaden2
  155. endif
  156.  
  157. image 247 40 bload
  158. Attr RESIZE 1000
  159. XAREA 250 41 78 17 BOX
  160. Attr RESIZE 1000
  161. Gadhelp "Load a picture LIST"
  162. ReqFile 0 0 200 400 "Load List" LOAD listy $PLISTE
  163. if $listy > ''
  164. ifexists file $listy
  165. lvuse PicList 1
  166. lvchange $listy
  167. changed = 0
  168. endif
  169. else
  170. ezreq "There's no list to load!" "Ok" ok
  171. endif
  172.  
  173. image 247 130 bsavedef
  174. Attr RESIZE 1000
  175. XAREA 250 131 78 17 BOX
  176. Attr RESIZE 1000
  177. Gadhelp "Save list as the default list"
  178.      lvsave s:Picture.data
  179.      changed = 0
  180.  
  181.  
  182. image 247 70 bsave
  183. Attr RESIZE 1000
  184. xAREA 250 71 78 17 BOX
  185. Attr RESIZE 1000
  186. Gadhelp "Save list"
  187. if $listy > ''
  188. lvuse PicList 1
  189. lvsave $listy
  190. changed = 0
  191. else
  192. ezreq "There's no list to save!" "Ok" ok
  193. endif
  194.  
  195.  
  196. image 247 100 bsaveas
  197. Attr RESIZE 1000
  198. XAREA 250 101 78 17 BOX
  199. Attr RESIZE 1000
  200. Gadhelp "Save list as..."
  201. ReqFile 0 0 200 400 "Save list as..." SAVE listy $PLISTE
  202. if $listy > ''
  203. lvuse PicList 1
  204. lvsave $listy
  205. changed = 0
  206. else
  207. ezreq "There's no list to save!" "Ok" ok
  208. endif
  209.  
  210. image 247 225 bconfig
  211. Attr RESIZE 1000
  212. XAREA 250 226 78 17 BOX
  213. Attr RESIZE 1000
  214. Gadhelp "Configure the piclist"
  215. Update ListConfig 13 $viewer
  216. Update ListConfig 14 $PLISTE
  217. Update ListConfig 15 $befehl
  218. Update ListConfig 16 $artist
  219. Update ListConfig 17 $type
  220. Update ListConfig 18 $date
  221. guiopen ListConfig
  222.  
  223. image 247 168 badd
  224. Attr RESIZE 1000
  225. XAREA 250 169 78 17 BOX
  226. Attr RESIZE 1000
  227. Gadhelp "Add a picture to the list"
  228. set buffers 60000
  229. ReqFile 0 0 200 400 "Select pictures..." MULTI pics $ppicture
  230. gosub PicList PicHolen
  231. gosub PicList UpdList
  232.  
  233. image 247 188 bbook
  234. Attr RESIZE 1000
  235. xAREA 250 189 78 17 BOX
  236. Attr RESIZE 1000
  237. Gadhelp "Take current pic and place it in the list"
  238. extract pic FILE picname
  239. lvadd ''
  240. %name = "$picname"
  241. %artist = ''
  242. %type = ''
  243. %date = ''
  244. %path = $pic
  245.  
  246.         lvmove #0
  247.      lvmove #$$LV.TOTAL
  248.      lvgo #$$LV.TOTAL
  249.  
  250.         changed = 1
  251.         setgad PicList 1 SHOW
  252.  
  253.  
  254. image 247 255 bedit
  255. Attr RESIZE 1000
  256. XAREA 250 256 78 17 BOX
  257. Attr RESIZE 1000
  258. Gadhelp "Edit list entry"
  259. if $$lv.line > 1
  260. update Editor 1 $*name
  261. update Editor 2 $*artist
  262. update Editor 3 $*type
  263. update Editor 4 $*date
  264. guiopen Editor
  265. endif
  266.  
  267. image 247 315 bclear
  268. Attr RESIZE 1000
  269. XAREA 250 316 78 17 BOX
  270. Attr RESIZE 1000
  271. Gadhelp "Clear the whole list"
  272. TEXTFILE ram:Picture.data
  273. GCDB
  274. 0
  275. 5
  276. %name 15 S
  277. %artist 15 S
  278. %type 8 S
  279. %date 15 S
  280. %path 150 S
  281. ###
  282. lvclear
  283. lvchange ram:Picture.data
  284.  
  285. lvadd ''
  286.  %name = 'Name'
  287.  %artist = 'Artist'
  288.  %type = 'Type'
  289.  %date = 'Date'
  290.  %path = 'Path'
  291. lvadd ''
  292.  
  293. image 247 285 bdelete
  294. Attr RESIZE 1000
  295. XAREA 250 286 78 17 BOX
  296. Attr RESIZE 1000
  297. Gadhelp "Delete an entry from the list"
  298. if $$lv.line > 1
  299. gosub PicList Löschen
  300. endif
  301.  
  302. image 247 345 bview
  303. Attr RESIZE 1000
  304. XAREA 250 346 78 17 BOX
  305. Attr RESIZE 1000
  306. Gadhelp "View with external viewer"
  307. if $$lv.line > 1
  308. ShowGUI/pic = $%path
  309. CLI 'C:run >NIL: $viewer $befehl $pic'
  310. endif
  311.  
  312.  
  313. xMenu 'Sort' 'Name' '' '1'
  314.  
  315.      setgad PicList 1 HIDE
  316.      lvdel 0
  317.      lvsort %name
  318.      gosub PicList Ordnung
  319.  
  320.  
  321.  
  322. xMenu 'Sort' 'Artist' '' '2'
  323.  
  324.      setgad PicList 1 HIDE
  325.      lvdel 0
  326.      lvsort %artist
  327.      gosub PicList Ordnung
  328.  
  329.  
  330. xMenu 'Sort' 'Type' '' '3'
  331.  
  332.      setgad PicList 1 HIDE
  333.      lvdel 0
  334.      lvsort %type
  335.      gosub PicList Ordnung
  336.  
  337.  
  338. xMenu 'Sort' 'Date' '' '4'
  339.  
  340.      setgad PicList 1 HIDE
  341.      lvdel 0
  342.      lvsort %date
  343.      gosub PicList Ordnung
  344.  
  345.  
  346. xMenu 'Sort' 'Path' '' '5'
  347.  
  348.      setgad PicList 1 HIDE
  349.      lvdel 0
  350.      lvsort %path
  351.      gosub PicList Ordnung
  352.  
  353. xRoutine Ordnung
  354.  
  355. lvinsert 0 ''
  356. %name = 'Name'
  357. %artist = 'Artist'
  358. %type = 'Type'
  359. %date = 'Date'
  360. %path = 'Path'
  361. lvmove #0
  362. changed = 1
  363. setgad PicList 1 SHOW
  364.  
  365.  
  366.  
  367. XRoutine Löschen
  368. if $$LV.LIST > 1
  369.  
  370.  EXTRACT %name CLEAN pname
  371.  
  372.  setgad PicList 1 HIDE
  373.  
  374.  ezreq "Delete $pname ?" "Yes|No" wosjetzt
  375.  if $wosjetzt = 1
  376.  LVdel -1
  377.  lvgo #$$LV.LIST
  378.  lvmove #$$LV.LIST
  379.  changed = 1
  380.  endif
  381.  
  382.  setgad PicList 1 SHOW
  383.  
  384. endif
  385.  
  386.  
  387.  
  388.