Silverfrost Forums

Welcome to our forums

%gr [user_resize] apparent change in behaviour V8.0

5 Jul 2016 3:52 #17732

Hi Paul

IWIN = WINIO@('%pv%^`gr[white,user_resize,full_mouse_input]&', + IAX_WID, IAX_HIG, HANDLE, DND_RESIZE)

The seems to have been a change in the way the %gr is handling events at V8.0. In the previous version it would invoke the callback (DND_RESIZE) when the %gr windows opened thus drawing the required image. Now this does not seem to happen. Adding a WINIO@(%SC&',DND_RESIZE) restore this behaviour. The issue i am trying to handle is when the widow is maximised as it does not seem to generate a resize event. 'Minimise' and 'Restore' generate a resize event. The resize event is captured using the clearwin string@('callback_reason')

any ideas?

Steve

5 Jul 2016 6:11 #17733

It works for me using v8.05 and Windows 10. Here is my test program

winapp
program main
integer iwin, winio@, iax_wid, iax_hig, handle
integer,external::dnd_resize
handle = 7
iax_wid = 300
iax_hig = 200
iwin = winio@('%ww&')
iwin = winio@('%pv%^`gr[white,user_resize]', iax_wid, iax_hig, handle, dnd_resize)
end

integer function dnd_resize()
include <windows.ins>
character(80) event
event = clearwin_string@('callback_reason')
i = winio@(event)
dnd_resize = 1
end
5 Jul 2016 6:54 #17735

HI Paul

thanks for the quick response, your example works as expected on V8.0 but when i add the 'full_mouse_input' the event string is returned as a '?' when the window is maximised

steve

winapp program main integer iwin, winio@, iax_wid, iax_hig, handle integer,external::dnd_resize handle = 7 iax_wid = 300 iax_hig = 200 iwin = winio@('%ww&') iwin = winio@('%pv%^`gr[white,user_resize,full_mouse_input]', iax_wid, iax_hig, handle, dnd_resize) end

integer function dnd_resize() include <windows.ins> character(80) event event = clearwin_string@('callback_reason') !i = winio@(event) if(event(1:10).ne.'MOUSE_MOVE') then write(,) event endif dnd_resize = 1 end

5 Jul 2016 11:13 #17740

Try calling permit_another_callback@. I have put the call in the callback but you only need to call it once. It assumes that there is only one main winio@ otherwise you need to call permit_callback_in_window@.

winapp
program main
integer iwin, winio@, iax_wid, iax_hig, handle
integer,external::dnd_resize
pause
handle = 7
iax_wid = 300
iax_hig = 200
iwin = winio@('%ww&')
iwin = winio@('%pv%^`gr[full_mouse_input,user_resize]', iax_wid, iax_hig, handle, dnd_resize)
end

integer function dnd_resize()
include <windows.ins>
character(80) event
call permit_another_callback@()
event = clearwin_string@('callback_reason')
i = winio@(event)
dnd_resize = 1
end
5 Jul 2016 11:49 #17741

Paul

thanks for the suggestion but it do not change the callback reason to RESIZE

using negative logic in the callback restored the previous behaviour

  REASON= clearwin_string@('callback_reason') 
  IF (REASON(1:6) .NE. 'RESIZE' .and.REASON(1:1) .ne. '?') THEN
   call  process_reason(reason)
  else
    call resize_and_redraw_image
  endif

thanks

steve

5 Jul 2016 3:15 #17742

Paul

I tried your test example in win XP (sp3) and it returned 'RESIZE' when the child window was maximised so I guess the behaviour id windows version dependent

Steve

Please login to reply.