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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
| [code] PUBLIC SUB Form_Open()
DIM siLoop AS SHORT 'Loop variable DIM siAnswer AS SHORT DIM element AS STRING 'element of Dict collection
oSwitchButt = [SwitchButtonOrientation, SwitchButtonSort, SwitchButtonOrder, SwitchButtonPan, SwitchButtonFaceDetect, SwitchButtonArchive] 'cles des boutons de settings sOptfGallery = ["fGallery/orentation", "fGallery/sort", "fGallery/order", "fGallery/pan", "fGallery/facedetect", "fGallery/archive"] 'cles des settings Dict["1"] = "fgallery" 'liste des scripts potentiels
CheckBoxSon.Value = IIf(Settings["noSons"] = 1, TRUE, FALSE) ' CheckBox des sons pour les enlever Cerf.ShowModal() ' splash form (cerf) BuildOptions ' les options de fGallery
FOR EACH element IN Dict sMot = element ' le script DoesScriptExist ' est il installé NEXT
IF sMot = "fgallery" AND bSortie THEN ' pour le retour d'Authenticate Message(("fGallery is not installed, goodbye")) ' sortie si fGallery pas installé ME.Close ENDIF
FMain.SelectPhotoFolder 'choix du dossier des photos FMain.Center TextAreaAbout.Pos = 0 'position du texte au début sPhotoPath = Settings["PhotoPath"] 's'il existe le dossier des photos IF NOT Exist(Settings["SavePath"]) THEN IF NOT Exist(User.home &/ "Galerie_Web") THEN MKDIR User.home &/ "Galerie_Web" 'création d'un dossier de galerie de début Settings["SavePath"] = User.Home &/ "Galerie_Web" 'sauvegarde de ce dossier de début ENDIF sSavePath = Settings["SavePath"] 'utilisation au début du dossier de galerie de début LabelVersion.Text = Application.Name & " Version : " & Application.Version TextAreafGallery.Pos = 0
IF Settings["first_time", TRUE] = TRUE THEN 'If this the first time the program has run then.. Settings["first_time"] = FALSE 'Set the first_time setting to False Settings.Save 'Save the settings siAnswer = Message.Question(("Would you like to see an example of what can be created with this tool?"), "OK", ("No thanks")) 'Ask if the user wants to see an example IF siAnswer = 1 THEN 'If the user selects 'OK' then.. Desktop.Open("http://www.gambas.one/fgallerydemo/") 'Open the users browser to the demo page Message.Info(("Now it's your turn to create a gallery"), "OK") 'Now it's your turn ENDIF ENDIF
FOR siLoop = 0 TO sOptfGallery.Max 'Loop through each option IF Settings[sOptfGallery[siLoop], "False"] = TRUE THEN oSwitchButt[siLoop].Value = TRUE ELSE oSwitchButt[siLoop].Value = FALSE NEXT CATCH Message(("An error : ") & Error.Text)
END [/code]
|
Pour créer une galerie de photos pour le Web avec le script fGallery.