I have modified one of the examples in the documentation to convince myself that its possible to scroll over a graphics area embedded in a child with scroll bars:
program main
implicit none
include<windows.ins>
integer i, control_var1
integer gr_cb ; external gr_cb
! First sheet with 1600 x 800 graphics
i=winio@('%sh&',control_var1)
i=winio@('%bg[grey]&')
i=winio@('%^gr[red]&',1600,800, gr_cb)
call draw_filled_rectangle@(1600/4, 800/4, 3*1600/4, 3*800/4, rgb@(0,255,0))
i=winio@(' ')
! Main window to show child
i=winio@('%mn[Exit]&','exit')
i=winio@('%bg[grey]&')
i=winio@('%sz&',800,400)
i=winio@('%ch[vscrollbar,hscrollbar]&',control_var1)
i=winio@(' ')
end
integer function gr_cb()
include<windows.ins>
integer x, y, i
call get_mouse_info@(x,y,i)
print *,x,y
gr_cb=1
end function gr_cb
Taking this one step further suppose what was the main window is itself a child embedded in the main window:
program main
implicit none
include<windows.ins>
integer i, control_var1, control_var2
integer gr_cb ; external gr_cb
! First sheet with 1600 x 800 graphics
i=winio@('%sh&',control_var1)
i=winio@('%bg[grey]&')
i=winio@('%^gr[red]&',1600,800, gr_cb)
call draw_filled_rectangle@(1600/4, 800/4, 3*1600/4, 3*800/4, rgb@(0,255,0))
i=winio@(' ')
! Second sheet, only 800 x 400, first sheet embedded as child with scroll bars
i=winio@('%sh&',control_var2)
i=winio@('%bg[grey]&')
i=winio@('%sz&',800,400)
i=winio@('%ch[vscrollbar,hscrollbar]&',control_var1)
i=winio@(' ')
! Main window to show child
i=winio@('%mn[Exit]&','exit')
i=winio@('%bg[grey]&')
i=winio@('%ch&',control_var2)
i = winio@(' ')
end program main
integer function gr_cb()
include<windows.ins>
integer x, y, i
call get_mouse_info@(x,y,i)
print *,x,y
gr_cb=1
end function gr_cb
I still get the desired scroll bars but the size specified using %sz is neglected. I get similar results using %ww along with %'lw instead of %sh
Any ideas / pointers on how to achieve the desired result i.e. display of a quarter of the graphics area which I can move about using the scroll bars? There will be another child window along side with controls for the user to interact with.
Thanks ken


