Ca fait un petit bout de temps que je suis pas passer dans le coin et que j'ai pas pu continuer mon projet de Trombinoscope.
Vu que j'ai eu un peu de temps de libre cette aprem, j'en ai profité pour essayé de continuer ce que j'avais commencer mais rien n'y fait ... Je suis toujours autant paumé.
J'aurais donc voulu savoir si une âme bien charitable pouvais me développer ma fonction "Recherche" de mon trombi svp.
Un truc simple, pas prise de tête. Je demande juste a ce que ça fonctionne.
Si besoin de précisions, n'hésitez pas a demander.
► Afficher le texte
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#NoTrayIcon
Trombi()
Func Trombi()
$Trombi = GUICreate("Trombinoscope", 514, 480, 355, 256)
$Groupe_photo = GUICtrlCreateGroup(" Photo ", 8, 32, 161, 201)
$Photo = GUICtrlCreatePic("C:\Documents and Settings\renfort.info\Bureau\identite.jpg", 16, 48, 145, 178)
$Groupe_information = GUICtrlCreateGroup(" Information ", 176, 32, 329, 201)
$Nom = GUICtrlCreateLabel("Nom :", 192, 56, 32, 17)
$Prenom = GUICtrlCreateLabel("Prénom :", 192, 80, 46, 17)
$Service = GUICtrlCreateLabel("Service :", 192, 104, 46, 17)
$Fonction = GUICtrlCreateLabel("Fonction :", 192, 128, 51, 17)
$Num_externe = GUICtrlCreateLabel("Num de tel externe :", 192, 152, 99, 17)
$Num_interne = GUICtrlCreateLabel("Num de tel interne :", 192, 176, 96, 17)
$Mail = GUICtrlCreateLabel("Adresse @mail :", 192, 200, 80, 17)
$Nom_label_info = GUICtrlCreateLabel("", 304, 56, 196, 17)
$Prenom_label_info = GUICtrlCreateLabel("", 304, 80, 196, 17)
$Service_label_info = GUICtrlCreateLabel("", 304, 104, 196, 17)
$Fonction_label_info = GUICtrlCreateLabel("", 304, 128, 196, 17)
$Num_tel_ext_label_info = GUICtrlCreateLabel("", 304, 152, 196, 17)
$Num_tel_int_label_info = GUICtrlCreateLabel("", 304, 176, 196, 17)
$Mail_label_info = GUICtrlCreateLabel("", 304, 200, 196, 17)
$Groupe_recherche = GUICtrlCreateGroup(" Recherche ", 8, 240, 497, 201)
$Categorie = GUICtrlCreateList("", 16, 256, 153, 175)
GUICtrlSetData(-1, "A. Nom|B. Prénom|C. Service|D. Fonction|E. Num de tel interne|F. Num de tel externe|G. Adresse @mail")
$Recherche = GUICtrlCreateInput("Recherche", 176, 256, 209, 21)
$Groupe_resultat = GUICtrlCreateGroup(" Resultat ", 176, 280, 321, 153)
$Resultat = GUICtrlCreateList("", 184, 296, 305, 123)
$Rechercher = GUICtrlCreateButton("Rechercher", 392, 254, 105, 25, 0)
$Ajouter = GUICtrlCreateButton("Ajouter", 8, 448, 171, 25, 0)
$Quitter = GUICtrlCreateButton("Quitter", 336, 448, 171, 25, 0)
$Barre_de_progression = GUICtrlCreateProgress(184, 450, 148, 21)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Rechercher
$filee = "_" & GuictrlRead($Recherche) & ".ini"
If FileExists($filee) Then
GUICtrlSetData($Nom_label_info, IniRead ( $filee, "Information", "Nom", ""))
GUICtrlSetData($Prenom_label_info, IniRead ( $filee, "", "Prenom", ""))
GUICtrlSetData($Service_label_info, IniRead ( $filee, "", "Service", ""))
GUICtrlSetData($Fonction_label_info, IniRead ( $filee, "", "Fonction", ""))
GUICtrlSetData($Num_tel_ext_label_info, IniRead ( $filee, "", "Numero de telephone externe", ""))
GUICtrlSetData($Num_tel_int_label_info, IniRead ( $filee, "", "Numero de telephone interne", ""))
GUICtrlSetData($Mail_label_info, IniRead ( $filee, "", "Mail", ""))
GUICtrlSetData($Resultat, "")
Else
GUICtrlSetData($Nom_label_info, "")
GUICtrlSetData($Prenom_label_info, "")
GUICtrlSetData($Service_label_info, "")
GUICtrlSetData($Fonction_label_info, "")
GUICtrlSetData($Num_tel_ext_label_info, "")
GUICtrlSetData($Num_tel_int_label_info, "")
GUICtrlSetData($Mail_label_info, "")
GUICtrlSetData($Resultat, "Aucun résultat")
EndIf
Case $Ajouter
GUISetState(@SW_hide)
Ajout_fiche_perso()
Case $Quitter
Exit
EndSwitch
WEnd
EndFunc
Func Ajout_fiche_perso()
$Trombi_ajout = GUICreate("Trombinoscope - Ajout d'un profil", 514, 271, 343, 326)
$Group_photo_ajout = GUICtrlCreateGroup(" Photo ", 8, 32, 161, 201)
$Photo_ajout = GUICtrlCreatePic("C:\Documents and Settings\renfort.info\Bureau\identite.jpg", 16, 48, 145, 178)
$Ajout_photo = GUICtrlCreateButton("Ajouter une photo", 8, 240, 161, 25, 0)
$Group_info_ajout = GUICtrlCreateGroup(" Information ", 176, 33, 329, 201)
$Nom_label = GUICtrlCreateLabel("Nom :", 184, 57, 32, 17)
$Prenom_label = GUICtrlCreateLabel("Prénom :", 184, 81, 46, 17)
$Service_label = GUICtrlCreateLabel("Service :", 184, 105, 46, 17)
$Fonction_label = GUICtrlCreateLabel("Fonction :", 184, 129, 51, 17)
$Num_tel_externe_label = GUICtrlCreateLabel("Num de tel externe :", 184, 153, 99, 17)
$Num_tel_interne_label = GUICtrlCreateLabel("Num de tel interne :", 184, 177, 96, 17)
$Mail_label = GUICtrlCreateLabel("Adresse @mail :", 184, 201, 80, 17)
$Nom_ajout = GUICtrlCreateInput("", 296, 53, 201, 21)
$Prenom_ajout = GUICtrlCreateInput("", 296, 77, 201, 21)
$Service_ajout = GUICtrlCreateInput("", 296, 101, 201, 21)
$Fonction_ajout = GUICtrlCreateInput("", 296, 125, 201, 21)
$Num_tel_externe_ajout = GUICtrlCreateInput("", 296, 149, 201, 21)
$Num_tel_interne_ajout = GUICtrlCreateInput("", 296, 173, 201, 21)
$Mail_ajout = GUICtrlCreateInput("", 296, 197, 141, 21)
$fin_mail = GUICtrlCreateLabel("@ville-vif.fr", 440, 201, 56, 17)
$Annuler = GUICtrlCreateButton("Annuler", 344, 240, 161, 25, 0)
$Valider = GUICtrlCreateButton("Valider", 176, 240, 161, 25, 0)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
GUIDelete()
Return
Case $Annuler
GUISetState(@SW_hide)
Trombi()
Case $Ajout_photo
Ajout_photo()
case $Valider
If FileExists ("_" & GuictrlRead($Nom_ajout) & ".ini") Then
MsgBox(0, "Erreur", "La fiche existe déjà")
GUISetState(@SW_hide)
Ajout_fiche_perso()
ElseIf Not FileExists ("_" & GuictrlRead($Nom_ajout) & ".ini") Then
$recencement = FileOpen("recencement.txt", 1)
$file = FileOpen("_" & GuictrlRead($Nom_ajout) & ".ini",9)
If $file = -1 Then
MsgBox(0, "Erreur", "Impossible de créer la fiche.")
GUISetState(@SW_hide)
Ajout_fiche_perso()
EndIf
IniWrite ( "_" & GuictrlRead($Nom_ajout) & ".ini", "Information", "Nom", "" & GuictrlRead($Nom_ajout) )
IniWrite ( "_" & GuictrlRead($Nom_ajout) & ".ini", "", "Prenom", "" & GuictrlRead($Prenom_ajout) )
IniWrite ( "_" & GuictrlRead($Nom_ajout) & ".ini", "", "Service", "" & GuictrlRead($Service_ajout) )
IniWrite ( "_" & GuictrlRead($Nom_ajout) & ".ini", "", "Fonction", "" & GuictrlRead($Fonction_ajout) )
IniWrite ( "_" & GuictrlRead($Nom_ajout) & ".ini", "", "Numero de telephone externe", "" & GuictrlRead($Num_tel_externe_ajout) )
IniWrite ( "_" & GuictrlRead($Nom_ajout) & ".ini", "", "Numero de telephone interne", "" & GuictrlRead($Num_tel_interne_ajout) )
IniWrite ( "_" & GuictrlRead($Nom_ajout) & ".ini", "", "Mail", "" & GuictrlRead($Mail_ajout) & "@ville-vif.fr")
GUIDelete()
trombi()
Return
EndIf
EndSwitch
WEnd
EndFunc
Func Ajout_photo() ; A FAIRE
$image = FileOpenDialog("Selectionner une photo", @DocumentsCommonDir & "\", "Images (*.jpg;*.bmp)")
EndFunc

