module global use dflib use dfwin use DFLOGM USE IFLOGM implicit none integer iwrite1,iwrite2 real xmin,xmax end module global program test ! How to customize the standard QuickWin menu use dflib use dfwin use DFLOGM USE IFLOGM use global implicit none include 'resource.fd' integer i,j,io integer(4) iret,unit,font,keystate integer(4) ibackcolor,ifrontcolor character(1) key / 'A' / logical(4) bret logical checked type (dialog) dlg type (QWINFO) winfo record /qwinfo/qw integer(4) ixPos,iyPos character(15) szMessage character(50) szCursorPos type (windowconfig) wc type (rccoord) rc type (xycoord) pos external pointer1 xmin=-1.0 xmax= 1.0 iwrite1=3 iwrite2=4 open(unit = iwrite1, file = 'user', title = 'Terminal 1'C) ! set screen colors for window 1 ibackcolor = rgb(255,255,255) ! white ifrontcolor = rgb(0,0,0) ! black iret = SETCOLORRGB(ifrontcolor) iret = SETBKCOLORRGB(ibackcolor) iret = SETTEXTCOLORRGB(ifrontcolor) font = SETFONT('t''Arial''h8w8pvb') call CLEARSCREEN($GCLEARSCREEN) write(iwrite1,'(a)')'Terminal' open(unit = iwrite2, file = 'user',title = 'Terminal 2'C) ! set screen colors for window 2 iret = SETCOLORRGB(ifrontcolor) iret = SETBKCOLORRGB(ibackcolor) iret = SETTEXTCOLORRGB(ifrontcolor) call CLEARSCREEN($GCLEARSCREEN) ! write(4,*)'This file is unit 4' iret = FOCUSQQ(3) ! set exit for no message iret = SETEXITQQ(QWIN$EXITNOPERSIST) ! maximize the size of the main window qw%type =QWIN$MAX iret = SETWSIZEQQ(QWIN$FRAMEWINDOW,qw) ! Fifth Column bret = appendmenuqq(1, $MENUENABLED , 'Input Pointer'C,pointer1) iret = CLICKMENUQQ (loc(WINTILE)) do while (.true.) call sleepqq(500) enddo end subroutine pointer1() use dflib use dflogm use global implicit none include 'resource.fd ' type (dialog) dlg integer(4) iret,test,i,j logical(4) bret,checked_state,retlog external Update,cancel2 character*8 number bret = DLGINIT(IDD_pointer_keyboard,dlg) write (number, '(f8.2)') xmin bret = DlgSet(dlg,IDC_left_k, number) bret = DlgSet(dlg,IDC_left_k, 20, DLG_TEXTLENGTH) !bret = DlgSetSub( dlg, IDC_left_k, Update, dlg_change ) !bret = DlgSetSub( dlg, IDC_left_k, Update, dlg_update ) !call Update( dlg, IDC_left_k, dlg_update ) write (number, '(f8.2)') xmax bret = DlgSet(dlg,IDC_right_k, number) bret = DlgSet(dlg,IDC_right_k, 20, DLG_TEXTLENGTH) !bret = DlgSetSub( dlg, IDC_right_k, Update, dlg_change ) !bret = DlgSetSub( dlg, IDC_right_k, Update, dlg_update ) !call Update( dlg, IDC_right_k, dlg_update ) !bret = DlgSetSub( dlg, IDCANCEL, cancel2 ) !call Update( dlg, IDCANCEL, dlg_update ) iret = DlgModal(dlg) if (iret /= IDCANCEL) then retlog = DLGGET (dlg, IDC_left_k, number) read(number, *) xmin retlog = DLGGET (dlg, IDC_right_k, number) read(number, *) xmax write(iwrite1,*) xmin,xmax else write(iwrite1,*) "Operation Cancelled" end if call DlgUninit(dlg) end subroutine pointer1 subroutine cancel2(dlg,id, callbacktype ) use global use dflogm implicit none type(dialog) dlg integer id integer callbacktype write(iwrite1,*) "Operation Cancelled" return end subroutine Update( dlg, id, callbacktype ) use dflogm use global implicit none type (dialog) dlg integer id,i_fit,i_temp,i integer callbacktype character*256 temp logical retlog,logi include 'resource.fd' ! supress compiler warnings for unreferenced arguments integer local_id, local_callbacktype,iostat,stat local_id = id local_callbacktype = callbacktype temp=" " if (local_callbacktype == DLG_INIT) return select case(local_id) case(IDCANCEL) write(iwrite1,*) "Operation Cancelled" case(IDC_left_k) retlog = DLGGET (dlg, IDC_left_k, temp) read(temp, *) xmin case(IDC_right_k) retlog = DLGGET (dlg, IDC_right_k, temp) read(temp, *) xmax end select end subroutine Update