Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Up-DOWN SPIN CONTROL Callback

Brooks_Van_Horn
New Contributor I
287 Views

I am looking for any code fragment that shows the proper use for a callback routine for a spin control. I've read https://software.intel.com/en-us/node/535415 but it does not help. My shot, which doesn' work, is:

Subroutine OnSpinEdit (dlg, control_name, callback_type)
use ifwin
use user32
use gdi32
use kernel32
use ifqwin
use PearsonGlobals

Implicit None

TYPE (dialog), intent(in):: dlg
INTEGER,Intent(IN):: control_name
INTEGER,Intent(in):: callback_type

integer::         i
character(80)::   myBuffer
Integer(BOOL):: bret
integer(UINT)::   num, iostat

! IDC_PCTYPE is my edit buddy & IDC_MYSPIN is my up/down spin control

   i = DlgGet(dlg, control_name, myBuffer, DLG_STATE)
   myBuffer = Trim(AdjustL(myBuffer))
   read(myBuffer,*,iostat=iostat) num
   if (iostat /= 0) Then
      i = DlgSetInt(dlg, control_name, 0)
      mType = 0
   else
      num = max(0, num)
      num = min (num, 8)
      myBuffer = '  '
      write(myBuffer,'(i1)') num
      myBuffer = Trim(AdjustL(myBuffer))
      mType = num
      i = DlgSet(dlg, IDC_PCTYPE, myBuffer, 1)
      bret = DlgSetInt(dlg, IDC_MYSPIN,num,DLG_POSITION)
   end if
   return

End Subroutine OnSpinEdit

Brooks V

0 Kudos
1 Solution
andrew_4619
Honored Contributor II
287 Views

Is OnSpinEdit the callback for the spin control? If so then control_name passed will be that of the spin control. You cannot GET a character buffer from the spin control only an integer index. 

View solution in original post

0 Kudos
1 Reply
andrew_4619
Honored Contributor II
288 Views

Is OnSpinEdit the callback for the spin control? If so then control_name passed will be that of the spin control. You cannot GET a character buffer from the spin control only an integer index. 

0 Kudos
Reply