Before version PB 10 LTS all was good
Code: Select all
Declare.l OpenWindow_2()
Declare Window_2_Events(event,GadgetID)
Global.l histo_0
Global.l Window_2
Global.l quitform2 = #False
Global.l Eventdeux,WindowIDdeux,GadgetIDdeux ,EventTypedeux
Global Button_6
Procedure WindowCallback(WindowID,Message,wParam,lParam)
ReturnValue=#PB_ProcessPureBasicEvents
If Message=#WM_CTLCOLORSTATIC Or Message=#WM_CTLCOLOREDIT Or Message=#WM_CTLCOLORLISTBOX
ReturnValue=PVDynamic_ColorGadget(lParam,wParam)
EndIf
ProcedureReturn ReturnValue
EndProcedure
Procedure.l OpenWindow_2()
Window_2 = OpenWindow(#PB_Any, 0, 0, 1090, 700, "ESSAI",#PB_Window_MinimizeGadget | #PB_Window_SizeGadget| #PB_Window_Invisible|#PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If Window_2
SetWindowCallback(@WindowCallback(), Window_2)
HideWindow(Window_2,1)
HISTO_0= EditorGadget(#PB_Any, 320, 550, 600, 130, #PB_String_ReadOnly|#PB_Editor_WordWrap)
SetGadgetColor(HISTO_0, #PB_Gadget_BackColor,RGB(232,250,255) )
SendMessage_(GadgetID(HISTO_0), #EM_SETTARGETDEVICE, 0, 0); <= 0 = WordWrap
SendMessage_(GadgetID(HISTO_0), #EM_SETTEXTMODE, #TM_RICHTEXT, 0)
Button_6 =ButtonGadget(#PB_Any, 240, 650, 160, 30, "Cliquez pour visualisation")
HideWindow(Window_2,0)
ProcedureReturn WindowID(Window_2)
EndIf
EndProcedure
Procedure Window_2_Events(event,GadgetID)
Select event
Case #PB_Event_CloseWindow
CloseWindow(Window_2)
Case #PB_Event_Gadget
Select GadgetID
Case button_6
curent_user.s="toto"
text.s ="{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1036{\fonttbl{\f0\fnil\fcharset0 Calibri;}}{\colortbl ;\red0\green64\blue128;}{\*\generator Riched20 10.0.22621}\viewkind4\uc1\pard\sl276\slmult1"
text+ "\pard\sl276\slmult1\cf1\b\f0\fs22\lang12"+"\cf1\b"+Chr(32)+dd4+Chr(32) +"\cf0\b0"+ " Cr\u233?ation mandat par "+ current_user+ "\cf0\b0\par"
Debug "Variable text = " + text
SetGadgetText(Histo_0,text)
Debug "Champ résultat editor =" + GetGadgetText(histo_0)
EndSelect
EndSelect
EndProcedure
If OpenWindow_2()
quitform2=0
Repeat
SetWindowCallback(@WindowCallback())
quitForm2=0
Eventdeux = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowIDdeux = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetIDdeux = EventGadget() ; Is it a gadget event?
EventTypedeux = EventType() ; The event type
;
Select Eventdeux
Case #PB_Event_Gadget,#PB_Event_Menu
If WindowIDdeux = Window_2
Window_2_Events(Eventdeux,GadgetIDdeux)
EndIf
Case #PB_Event_CloseWindow
If WindowIDdeux = Window_2
MessageRequester(""+Space(80), "Abandon Application à votre demande!.......", #MB_OK|#MB_ICONERROR|#MB_SYSTEMMODAL)
quitform2=1
EndIf
EndSelect
Until quitForm2=1
Else
MessageRequester("","Impossible de créer la fenêtre de saisie")
EndIf
I want to pass the value of var text in gadegteditor and the result was the following
If someone can help me ?Variable text = {\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1036{\fonttbl{\f0\fnil\fcharset0 Calibri;}}{\colortbl ;\red0\green64\blue128;}{\*\generator Riched20 10.0.22621}\viewkind4\uc1\pard\sl276\slmult1\pard\sl276\slmult1\cf1\b\f0\fs22\lang12\cf1\b 0 \cf0\b0 Cr\u233?ation mandat par 0\cf0\b0\par
Champ résultat editor =0 Création mandat par 0