Hi Danilo
Do think Germany will win the Soccer World Cup ?
@staringfrog
SetGadgetColor() use the window callback
If you insist to use SetParent_() you have to SubClass the EditorGadget
to respond to the StringGadget calls
Code: Select all
Global OldCallback
Procedure EditCallback(hwnd, msg, wparam, lparam)
result = CallWindowProc_(OldCallback, hwnd, msg, wparam, lparam)
Select msg
Case #WM_CTLCOLOREDIT
hdc = wParam
SetTextColor_(hdc, 8421376)
SetBkMode_(hdc, #TRANSPARENT)
EndSelect
ProcedureReturn result
EndProcedure
If OpenWindow(0, 0, 0, 300, 200, "Editor With String Overlay", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
EditorGadget(1, 10, 10, 275, 170,#PB_Editor_WordWrap|#WS_CLIPCHILDREN)
StringGadget(2,20,20,100,30,"Child")
StringGadget(3,30,70,100,30,"Orphan")
SetGadgetColor(3,#PB_Gadget_FrontColor,8421376)
SetParent_(GadgetID(2),GadgetID(1))
OldCallback = SetWindowLong_(GadgetID(1), #GWL_WNDPROC, @EditCallback())
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Or if it is a matter of Z-Order then
Code: Select all
If OpenWindow(0, 0, 0, 300, 200, "Editor With String Overlay", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
StringGadget(2,30,30,100,30,"Child")
StringGadget(3,30,70,100,30,"Orphan")
EditorGadget(1, 10, 10, 275, 170,#PB_Editor_WordWrap|#WS_CLIPSIBLINGS)
SetGadgetColor(2,#PB_Gadget_FrontColor,8421376)
SetGadgetColor(3,#PB_Gadget_FrontColor,8421376)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf