Intercepter #EN_CHANGE
- Progi1984
- Messages : 2659
- Inscription : mar. 14/déc./2004 13:56
- Localisation : France > Rennes
- Contact :
Intercepter #EN_CHANGE
Avec un editorgadget, comment puis je intercepter un #EN_CHANGE (cad une modification du contenu de l'editorgadget) sans callback ?
Librairies & Applications : https://www.purebasic.fr/french/viewtop ... f=8&t=6220
Site Web : https://rootslabs.net
Site Web : https://rootslabs.net
- Progi1984
- Messages : 2659
- Inscription : mar. 14/déc./2004 13:56
- Localisation : France > Rennes
- Contact :
J'ai eu une réponse de ElChoni du site anglais :
Code : Tout sélectionner
If OpenWindow(0, 100, 200, 195, 260, #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget, "PureBasic Window")=0:End:EndIf
If CreateGadgetList(WindowID())=0:End:EndIf
EditorGadget(0, 0, 0, WindowWidth(), WindowHeight())
SendMessage_(GadgetID(0), #EM_SETEVENTMASK, 0, #ENM_CHANGE|SendMessage_(GadgetID(0), #EM_GETEVENTMASK, 0, 0))
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_EventGadget
If EventwParam()>>16=#EN_CHANGE
Debug "Changed!"
EndIf
EndIf
Until EventID=#PB_Event_CloseWindow
End
Librairies & Applications : https://www.purebasic.fr/french/viewtop ... f=8&t=6220
Site Web : https://rootslabs.net
Site Web : https://rootslabs.net
- Progi1984
- Messages : 2659
- Inscription : mar. 14/déc./2004 13:56
- Localisation : France > Rennes
- Contact :
Petite question : j'ai deux editor gadget sur une feuille. comment puis je savoir lql a été modifié ?
Librairies & Applications : https://www.purebasic.fr/french/viewtop ... f=8&t=6220
Site Web : https://rootslabs.net
Site Web : https://rootslabs.net
Normalement, dans la notification #EN_CHANGE, EventlParam() te retourne le handle de l'éditeur, et EventwParam() & $FFFF te retourne l'ID de l'Editor
Code : Tout sélectionner
If OpenWindow(0, 100, 200, 400, 260, #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget, "PureBasic Window")=0:End:EndIf
If CreateGadgetList(WindowID())=0:End:EndIf
EditorGadget(1, 0, 0, 200, WindowHeight())
EditorGadget(2, 200, 0, 200, WindowHeight())
SendMessage_(GadgetID(1), #EM_SETEVENTMASK, 0, #ENM_CHANGE|SendMessage_(GadgetID(1), #EM_GETEVENTMASK, 0, 0))
SendMessage_(GadgetID(2), #EM_SETEVENTMASK, 0, #ENM_CHANGE|SendMessage_(GadgetID(2), #EM_GETEVENTMASK, 0, 0))
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_EventGadget
If EventwParam()>>16=#EN_CHANGE
If EventwParam() & $FFFF = 1
Debug "Change sur 1"
ElseIf EventwParam() & $FFFF = 2
Debug "Change sur 2"
EndIf
EndIf
EndIf
Until EventID=#PB_Event_CloseWindow
End
- Progi1984
- Messages : 2659
- Inscription : mar. 14/déc./2004 13:56
- Localisation : France > Rennes
- Contact :
Merci !
Librairies & Applications : https://www.purebasic.fr/french/viewtop ... f=8&t=6220
Site Web : https://rootslabs.net
Site Web : https://rootslabs.net
- Progi1984
- Messages : 2659
- Inscription : mar. 14/déc./2004 13:56
- Localisation : France > Rennes
- Contact :
:p
Librairies & Applications : https://www.purebasic.fr/french/viewtop ... f=8&t=6220
Site Web : https://rootslabs.net
Site Web : https://rootslabs.net
- Progi1984
- Messages : 2659
- Inscription : mar. 14/déc./2004 13:56
- Localisation : France > Rennes
- Contact :
Pourquoi ce code ne marche t il pas avec la V4 ?
Code : Tout sélectionner
If OpenWindow(0, 100, 200, 400, 260, #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget, "PureBasic Window")=0:End:EndIf
If CreateGadgetList(WindowID(0))=0:End:EndIf
EditorGadget(1, 0, 0, 200, WindowHeight(0))
EditorGadget(2, 200, 0, 200, WindowHeight(0))
SendMessage_(GadgetID(1), #EM_SETEVENTMASK, 0, #ENM_CHANGE|SendMessage_(GadgetID(1), #EM_GETEVENTMASK, 0, 0))
SendMessage_(GadgetID(2), #EM_SETEVENTMASK, 0, #ENM_CHANGE|SendMessage_(GadgetID(2), #EM_GETEVENTMASK, 0, 0))
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_Gadget
If EventwParam()>>16=#EN_CHANGE
If EventwParam() & $FFFF = 1
Debug "Change sur 1"
ElseIf EventwParam() & $FFFF = 2
Debug "Change sur 2"
EndIf
EndIf
EndIf
Until EventID=#PB_Event_CloseWindow
End
Librairies & Applications : https://www.purebasic.fr/french/viewtop ... f=8&t=6220
Site Web : https://rootslabs.net
Site Web : https://rootslabs.net