Dear Members,
I am a first time user of compaq visual fortran. I am currently attempting to write a GUI. I would like to be able to select an option from a floating menu that I get when I right click on the window. I have so far been able to obtain the menu upon right clicking but I cannot select an option. The code that I am using is as follows:
case (WM_RBUTTONDOWN)
iret = SetCapture(hWnd)
pt%x = INT4(LOWORD(lparam))
pt%y = INT4(HIWORD(lparam))
hMenu = LoadMenu (ghInstance, LOC("Floating"C))
hMenuTrackPopup = GetSubMenu (hMenu, 0)
if(option1 .eq. true) then
!code
endif
if(option2 .eq. true) then
!code
endif
bret = ClientToScreen (hwnd, pt)
bret = TrackPopupMenu (hMenuTrackPopup, 0,&
pt%x, pt%y, 0, hwnd, NULL_RECT)
bret = DestroyMenu (hMenu)
MainWndProc = 0
return
also I am trying to enable a button in a dialog box only when text in entered in an edit box within the dialog box. This effort has been a dismal failure. I am using the following code to initialise the dialog box
retlog = dlgset(dlg, IDCancel, .true. , dlg_enable )
retint = DlgModal( dlg )
and I have set the button to disabled. i want to use the control index dlg_clicked to call
dlgset( dlg, IDC_Button1, .true. , dlg_enable)
and enable the button.
I have also created the dialog box using
DialogBoxParam(hinstance, lpTemplate,...)
but I still cannot do what I wish.
Any assistance with these issues will be greatly appreciated
Regards
Marrisa
I am a first time user of compaq visual fortran. I am currently attempting to write a GUI. I would like to be able to select an option from a floating menu that I get when I right click on the window. I have so far been able to obtain the menu upon right clicking but I cannot select an option. The code that I am using is as follows:
case (WM_RBUTTONDOWN)
iret = SetCapture(hWnd)
pt%x = INT4(LOWORD(lparam))
pt%y = INT4(HIWORD(lparam))
hMenu = LoadMenu (ghInstance, LOC("Floating"C))
hMenuTrackPopup = GetSubMenu (hMenu, 0)
if(option1 .eq. true) then
!code
endif
if(option2 .eq. true) then
!code
endif
bret = ClientToScreen (hwnd, pt)
bret = TrackPopupMenu (hMenuTrackPopup, 0,&
pt%x, pt%y, 0, hwnd, NULL_RECT)
bret = DestroyMenu (hMenu)
MainWndProc = 0
return
also I am trying to enable a button in a dialog box only when text in entered in an edit box within the dialog box. This effort has been a dismal failure. I am using the following code to initialise the dialog box
retlog = dlgset(dlg, IDCancel, .true. , dlg_enable )
retint = DlgModal( dlg )
and I have set the button to disabled. i want to use the control index dlg_clicked to call
dlgset( dlg, IDC_Button1, .true. , dlg_enable)
and enable the button.
I have also created the dialog box using
DialogBoxParam(hinstance, lpTemplate,...)
but I still cannot do what I wish.
Any assistance with these issues will be greatly appreciated
Regards
Marrisa