forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

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

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
steveDoyle



Joined: 04 Sep 2009
Posts: 58
Location: Manchester

PostPosted: Tue Jul 05, 2016 4:52 am    Post subject: %gr [user_resize] apparent change in behaviour V8.0 Reply with quote

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
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4820
Location: Salford, UK

PostPosted: Tue Jul 05, 2016 7:11 am    Post subject: Reply with quote

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

Code:
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
Back to top
View user's profile Send private message
steveDoyle



Joined: 04 Sep 2009
Posts: 58
Location: Manchester

PostPosted: Tue Jul 05, 2016 7:54 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4820
Location: Salford, UK

PostPosted: Tue Jul 05, 2016 12:13 pm    Post subject: Reply with quote

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@.

Code:
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
Back to top
View user's profile Send private message
steveDoyle



Joined: 04 Sep 2009
Posts: 58
Location: Manchester

PostPosted: Tue Jul 05, 2016 12:49 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
steveDoyle



Joined: 04 Sep 2009
Posts: 58
Location: Manchester

PostPosted: Tue Jul 05, 2016 4:15 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group