- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page