06-24-2020, 12:00 AM
Ron,
if i am reading this correctly i think this is what your after
Function rollupToMenu
if i am reading this correctly i think this is what your after
Function rollupToMenu
str md=
;BEGIN MENU
;↑↑ :410
;item 1 :411
;item 2 :412
;item 3 :413
;END MENU
str dd=
;BEGIN DIALOG
;0 "" 0x90CC0AC8 0x0 0 0 246 42 "Dialog" "4"
;3 Edit 0x54030080 0x200 65 15 96 12 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2040A00 "*" "" "" ""
str controls = "3"
str e3
if(!ShowDialog(dd &sub.DlgProc &controls 0 0 0 0 0 0 0 0 md)) ret
#sub DlgProc
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,int-- rollUpDown
,case WM_DESTROY
,if(GetProp(hDlg "qm_roll_cy"))
,,RemoveProp hDlg "qm_roll_cy"
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 410 ;;↑↑|↓↓
,RECT rmb
,int hmenu=GetMenu(hDlg)
,GetMenuItemRect(hDlg hmenu 0 rmb)
,int mbh=(rmb.bottom-rmb.top)*2-2
,rollUpDown=!rollUpDown
,sub.WindowRollUp(hDlg rollUpDown mbh)
,
ret 1
#sub WindowRollUp
function hwnd !up [mh];;up: 1 roll up, 0 restore
;Resizes window so that only the title bar and the menu bar is visible.
;hwnd - window handle.
int hmenu2
if up
,if(GetProp(hwnd "qm_roll_cy")) ret
,int cy
,GetWinXY hwnd 0 0 0 cy hwnd
,SetProp hwnd "qm_roll_cy" cy
,TITLEBARINFO ti.cbSize=sizeof(TITLEBARINFO)
,GetTitleBarInfo hwnd &ti
,int mbh= (ti.rcTitleBar.bottom-ti.rcTitleBar.top) +mh
,str md2=
,;BEGIN MENU
,;↓↓ :410
,;END MENU
,hmenu2=DT_CreateMenu(md2)
,DT_SetMenu hwnd hmenu2
,siz 0 mbh hwnd 1
else
,cy=GetProp(hwnd "qm_roll_cy")
,if(!cy) ret
,RemoveProp hwnd "qm_roll_cy"
,str md1=
,;BEGIN MENU
,;↑↑ :410
,;item 1 :411
,;item 2 :412
,;item 3 :413
,;END MENU
,
,hmenu2=DT_CreateMenu(md1)
,DT_SetMenu hwnd hmenu2
,siz 0 cy hwnd 1