Page 1 sur 1
[R] Input report
Posté : sam. 03 avr. 2010 22:30
par Mikaas
Bonjour !
Je souhaiterai savoir comment je pourrais reporter un input dans un cadre log ?
mon explication n'est pas très explicite je pense bien alors j'ai un petit bout de code à présenter :
► Afficher le texte
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form2 = GUICreate("Form2", 391, 298, 210, 149)
$Input1 = GUICtrlCreateInput("", 135, 12, 241, 21)
$Label1 = GUICtrlCreateLabel("AJOUTER UNE LIGNE", 8, 16, 115, 17)
$Button1 = GUICtrlCreateButton("AJOUTER", 208, 56, 75, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("SUPPRIMER", 296, 56, 83, 25, $WS_GROUP)
$Label2 = GUICtrlCreateLabel("LES LIGNES AJOUTEES", 16, 104, 125, 17)
GUICtrlCreateEdit("", 16, 136, 361, 113)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Je tape une phrase dans le 1er input si je clic sur ajouter il l'envois dans le edit1 si je clic supprimer il la supprime.
sur quelle partie dois je m'orienter s'il vous plait ? merci !
Re: [..] Input report
Posté : dim. 04 avr. 2010 01:21
par matwachich
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiListBox.au3>
$Form2 = GUICreate("Form2", 391, 298, 210, 149)
$Input = GUICtrlCreateInput("", 135, 12, 241, 21)
GUICtrlCreateLabel("AJOUTER UNE LIGNE", 8, 16, 115, 17)
$B_add = GUICtrlCreateButton("AJOUTER", 208, 56, 75, 25, $WS_GROUP)
$B_del = GUICtrlCreateButton("SUPPRIMER", 296, 56, 83, 25, $WS_GROUP)
GUICtrlCreateLabel("LES LIGNES AJOUTEES", 16, 104, 125, 17)
$liste = _GUICtrlListBox_Create($Form2, "", 16, 136, 361, 150)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $B_add
$read = GUICtrlRead($Input)
If $read <> "" Then _GUICtrlListBox_InsertString($liste, $read)
Case $B_del
$index = _GUICtrlListBox_GetAnchorIndex($liste)
_GUICtrlListBox_DeleteString($liste, $index)
EndSwitch
WEnd
Re: [..] Input report
Posté : dim. 04 avr. 2010 04:02
par Mikaas
Merci beaucoup c'est impécable !
Re: [R] Input report
Posté : dim. 04 avr. 2010 12:02
par Mikaas
Dite moi, vous sauriez faire reporter les lignes ajouté sur un ini par hasard ?
un genre de iniwhrite ...?
merci de votre aide !
Edite : Je pense avoir trouvé avec $read ^^
Re: [R] Input report
Posté : lun. 05 avr. 2010 01:06
par matwachich
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiListBox.au3>
$Form2 = GUICreate("Form2", 391, 298, 210, 149)
$Input = GUICtrlCreateInput("", 135, 12, 241, 21)
GUICtrlCreateLabel("AJOUTER UNE LIGNE", 8, 16, 115, 17)
$B_add = GUICtrlCreateButton("AJOUTER", 208, 56, 75, 25, $WS_GROUP)
$B_del = GUICtrlCreateButton("SUPPRIMER", 296, 56, 83, 25, $WS_GROUP)
GUICtrlCreateLabel("LES LIGNES AJOUTEES", 16, 104, 125, 17)
$liste = _GUICtrlListBox_Create($Form2, "", 16, 136, 361, 150)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $B_add
$read = GUICtrlRead($Input)
If $read <> "" Then
$index_Ajoute = _GUICtrlListBox_InsertString($liste, $read)
; #####
IniWrite("fichier.ini", "Section", "Entrée_" & $index_Ajoute, $read)
; #####
EndIf
Case $B_del
$index = _GUICtrlListBox_GetAnchorIndex($liste)
_GUICtrlListBox_DeleteString($liste, $index)
EndSwitch
WEnd