Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
transparent dialog
#14
ok thanks. My dialogs need to work on Win7 so will try to make with positioner function.
Thanks again!,
S

looked on StackOverflow and didn't see a better way than my proposed method. It works - see below!
Thanks again for talking me through this!
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 "" 0x90880A48 0x10300 0 0 222 173 "ParentDialog"
;5 Edit 0x54030080 0x200 22 42 96 14 ""
;6 ListBox 0x54230101 0x200 58 70 96 48 ""
;3 Button 0x54030040 0x0 126 0 96 24 "Grab To Move"
;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
,ont hDlg
,__GdiHandle-- hb=CreateSolidBrush(0xff00)
,Transparent hDlg 255 0xff00
,int- ChildDlgHwnd = ControlChildDlg(0 0 hDlg 0)
,out _s.getwintext(ChildDlgHwnd)    
,DialogDragSubclassControl id(3 hDlg) ;;subclass button 3
,SetTimer hDlg 1 10 0
,case WM_DESTROY
,case WM_TIMER
,,int x_Child y_Child
,,int x_Parent y_Parent
,,GetWinXY ChildDlgHwnd x_Child y_Child 0 0 hDlg
,,GetWinXY hDlg x_Parent y_Parent
,,if x_Child != x_Parent and y_Child != y_Parent
,,,mov x_Parent y_Parent ChildDlgHwnd        
,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 "" 0x90080A48 0x0 0 0 51 14 "ChildDlg"
;5 Button 0x54031003 0x0 2 0 48 14 "Transparency"
;END DIALOG
;DIALOG EDITOR: "" 0x2030605 "" "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,,DialogDragSubclassControl id(5 hDlg) ;;subclass button 3
,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)