transparent StringGadget
Posted: Sun Sep 19, 2004 11:13 pm
Hi,
I was trying to set a transparent background to my string gadget (gadget containing many lines of text with a scroll on the right).
I successed to do it by using this code, originally done for transparent labels:
Then you use in the open window :
The background is transparent, I can see the window background image and the string gadget text, all seems right.
But when I scroll down, the text is not redrawed properly and does "traces", it is unreadable :
http://perso.wanadoo.fr/jugesoftware/bugPB.JPG
there was not an image backgrounf for this example, I was just using the transparent trick.
Is it possible to make a transparent effect on a string gadget ?
I was trying to set a transparent background to my string gadget (gadget containing many lines of text with a scroll on the right).
I successed to do it by using this code, originally done for transparent labels:
Code: Select all
; Original code by Danilo and Num3 (thanks, guys).
; Modified by PB to get a transparent TextGadget.
Global TextGadgetBackground,TextGadgetForeground
TextGadgetBackground=GetStockObject_(#HOLLOW_BRUSH)
TextGadgetForeground=RGB($00,$00,$00)
Procedure WinProc(hwnd,Msg,wParam,lParam)
If Msg=#WM_CTLCOLORSTATIC
SetBkMode_(wParam,#TRANSPARENT)
SetTextColor_(wParam,TextGadgetForeground)
ProcedureReturn TextGadgetBackground
Else
ProcedureReturn #PB_ProcessPureBasicEvents
EndIf
EndProcedure
Code: Select all
SetWindowCallback(@WinProc())
But when I scroll down, the text is not redrawed properly and does "traces", it is unreadable :
http://perso.wanadoo.fr/jugesoftware/bugPB.JPG
there was not an image backgrounf for this example, I was just using the transparent trick.
Is it possible to make a transparent effect on a string gadget ?