in the last 1.9.0.0 you linked in other thread the SET SIZE and creation is still broken for VIEWPORT, other controls seem ok.
'
' Viewport test
'
Uses "UI"
' -- ID numbers of controls
Begin ControlID
%vViewport
End ControlID
Local hRecyclableDialog As DWord
' -- Create dialog here
Function TBMain()
Local hDlg As DWord
Dialog New 0, "Viewport test",-1,-1, 800, 490, _
%WS_MAXIMIZEBOX |
%WS_MINIMIZEBOX |
%WS_SYSMENU |
%WS_CLIPCHILDREN |
%WS_CLIPSIBLINGS |
%DS_CENTER
To hDlg
' -- Viewport should be over whole window, with 5 units offset
Control Add VIEWPORT hDlg, %vViewport, "", 5, 5, 790, 480
Control Set Size hDlg, %vViewport, 790, 480
Dialog Show Modal hDlg, Call cbDialog
End Function
' -- Callback for dialog
CallBack Function cbDialog()
' -- Test for messages
Select Case CBMSG
Case %WM_INITDIALOG
BuildViewportDialog(Control_GetHandle(CBHNDL, %vViewport))
Case %WM_COMMAND
' -- You can handle controls here
'SELECT CASE CBCTL
'
' CASE ...
' IF CBCTLMSG = ... THEN
'
' END IF
'
'END SELECT
Case %WM_CLOSE
' -- Put code to be executed before Dialog End here
End Select
End Function
Function BuildViewportDialog( hViewport As DWord ) As Long
' -- If it exists, destroy it
If hRecyclableDialog <> 0 Then Dialog End hRecyclableDialog
Local w, h As Long
w = 800
h = 600
Dialog New hViewport, "", 0, 0, w, h, _
%WS_CHILD Or %WS_CLIPCHILDREN To hRecyclableDialog
Dialog Set Color hRecyclableDialog, %BLACK, %BLACK
Dialog Show Modeless hRecyclableDialog, Call cbViewportDialog
ViewPort_SetChild(hViewPort, hRecyclableDialog, %FALSE )
End Function
' -- Callback for dialog
CallBack Function cbViewportDialog()
' -- Test for messages
Select Case CBMSG
Case %WM_INITDIALOG
' -- Put code to be executed after dialog creation here
Case %WM_COMMAND
' -- You can handle controls here
'SELECT CASE CBCTL
'
' CASE ...
' IF CBCTLMSG = ... THEN
'
' END IF
'
'END SELECT
Case %WM_CLOSE
' -- Put code to be executed before dialog end here
End Select
End Function