very well, your technique are very useful, thank you very much to dear both .
just there is a small problem, can be TextGadget on top level of all gadget?
Added:
ok, i make test it Lot, the results:
#1
In this example if we change :
Code: Select all
TextGadget(2, 10, 10, #Wsize, #Hsize, "Hello", #PB_Text_Center | #SS_CENTERIMAGE | #WS_CLIPSIBLINGS)
to:
Code: Select all
TextGadget(2, 10, 10, #Wsize, #Hsize, "Hello", #PB_Text_Center | #SS_CENTERIMAGE | #MA_ACTIVATE)
That's great
#2
but if adding numbers of gadget, like this :
Code: Select all
#Wsize = 50
#Hsize = 25
imgid = LoadImage(0, #PB_Compiler_Home + "\Examples\Sources\Data\Background.bmp")
fonid = LoadFont(0, "Arial", 8, #PB_Font_Bold)
icoid = LoadIcon_(0, #IDI_ASTERISK)
OpenLibrary(0, "Msimg32.dll")
Prototype GradientFill(hdc, *Vert, Int1, *Rect, Int2, Flags)
GradientFill.GradientFill = GetFunction(0, "GradientFill")
Dim vert.TRIVERTEX(1)
gRect.GRADIENT_RECT
vert(0) \x = 0
vert(0) \y = 0
vert(0) \Red = $0000
vert(0) \Green = $ffff
vert(0) \Blue = $ffff
vert(0) \Alpha = $0000
vert(1) \x = 300
vert(1) \y = 240
vert(1) \Red = $ffff
vert(1) \Green = $0ff0
vert(1) \Blue = $ffff
vert(1) \Alpha = $0000
gRect\UpperLeft = 0
gRect\LowerRight = 1
; CreateImage(0, 300, 240, 32)
; hDC = StartDrawing(ImageOutput(0))
; GradientFill(hdc, @vert(), 2, @gRect, 1, #GRADIENT_FILL_RECT_H)
; StopDrawing()
CloseLibrary(0)
Procedure WindowProc(hWnd, Msg, wParam, lParam)
result = #PB_ProcessPureBasicEvents
If Msg = #WM_CTLCOLORSTATIC
Select GetDlgCtrlID_(lparam)
Case 2
SetBkMode_(wParam, #TRANSPARENT)
SetTextColor_(wParam, #Black)
result = GetStockObject_(#HOLLOW_BRUSH)
EndSelect
EndIf
ProcedureReturn result
EndProcedure
Procedure MoveGadjet(Gadget)
MoveWindow_(GadgetID(Gadget), WindowMouseX(0)-40, WindowMouseY(0)-20, #Wsize, #Hsize, 1);
GetWindowRect_(GadgetID(2), gr.RECT)
MapWindowPoints_(0, WindowID(0), gr, 2)
InvalidateRect_(WindowID(0), gr, 1)
EndProcedure
OpenWindow(0, 100, 100, 300, 240, "Test", #PB_Window_SystemMenu | #SS_CENTER)
SetWindowCallback(@WindowProc())
CreateGadgetList(WindowID(0))
PanelGadget(0,0,0,WindowX(0),WindowY(0))
AddGadgetItem(0,-1,"Test on Gadgets")
ButtonImageGadget(1, 10, 25, 50, 50, icoid)
TextGadget(2, 10, 10, #Wsize, #Hsize, "Hello", #PB_Text_Center | #SS_CENTERIMAGE | #WS_CLIPSIBLINGS) : SetGadgetFont(2, fonid)
OptionGadget(3, 100, 50, 50, 20, "test gt")
ImageGadget(4, 100, 175, 0, 0, imgid)
hBrush = CreatePatternBrush_(ImageID(0))
SetClassLong_(WindowID(0), #GCL_HBRBACKGROUND, hBrush)
InvalidateRect_(WindowID(0), 0, #True)
Repeat
ev = WaitWindowEvent()
tp = EventType()
gt = EventGadget()
Select ev
Case #WM_MOUSEMOVE ;And tp = #PB_EventType_LeftClick
MoveGadjet(2)
EndSelect
Until ev = #PB_Event_CloseWindow
DeleteObject_(hBrush)
I'm looking for a respons to top level in TextGadget.
I think your technique is very useful in Transparency and will completed if
can be add to it a overloping.
btw , i'm thanksful to you too.
please help me if have a little time.