Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
transparent dialog
#12
Thank you Gintaras! I see that this bypassed the whole method of transparency by essentially making the whole window the RECT of the control. Elegant and effective (and super quick response!). Amazing!
I will assume however that it therefore is much more complicated to do this while allowing for variable transparency of the rest of the dialog elements, rather than complete transparency (invisible, pass through clicks, etc).
I imagine I could do this by having the transparency control be part of a child dialog like below but if WS_CHILD is added it will inherit the transparency level. If I take that out, it works, but then I have to write Positioner WM_TIMER function. Is this the correct approach to this or is there a way that it can behave like a WS_CHILD in terms of positioning but no in inheritance of transparency?
Thanks again for any thoughts or assurances that I am taking the right approach,
S

Function ParentDialog
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "5 6"
str e5 lb6
if(!ShowDialog("ParentDialog" &ParentDialog &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80A48 0x10100 0 0 221 159 "ParentDialog"
;5 Edit 0x54030080 0x200 22 42 96 14 ""
;6 ListBox 0x54230101 0x200 58 70 96 48 ""
;1 Button 0x54030001 0x4 120 140 48 14 "OK"
;2 Button 0x54030000 0x4 170 140 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030605 "" "" "" ""

ret
;messages

sel message
,case WM_INITDIALOG
,__GdiHandle-- hb=CreateSolidBrush(0xff00)
,Transparent hDlg 255 0xff00
,ControlChildDlg(0 0 hDlg 0)
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_CTLCOLORDLG
,ret hb
ret
;messages2
sel wParam
,case IDOK

,
,case IDCANCEL
ret 1

Function ControlChildDlg
Code:
Copy      Help
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "5"
str c5Tra
sel message
,case 0 ;;on WM_INITDIALOG of the parent dialog
,ret ShowDialog("" &ControlChildDlg &controls wParam 1 WS_CHILD 0 0 2 lParam)
,case 1 ;;on OK of the parent dialog
,hDlg=lParam
,DT_GetControls hDlg &controls
,out c5Tra

;BEGIN DIALOG
;0 "" 0x10000648 0x0 0 0 51 14 ""
;5 Button 0x54031003 0x0 2 0 48 14 "Transparency"
;END DIALOG
;DIALOG EDITOR: "" 0x2030605 "" "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 5
,,int hParentDlg = win("ParentDialog" "#32770")
,,if(but(lParam))
,,,Transparent hParentDlg 50 0xff00
,,else
,,,Transparent hParentDlg 255 0xff00
ret 1


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)