Hello, I've been working on building an MDI frame that has dynamic scrollbars for when a child window gets moved outside the frame. When no child is outside the frame edge then no scrollbars are visible. Everything is working great apart from when a child window is maximised when a scrollbar is present, then a strange edge is left where the scrollbar was originally. regards Albert Has anyone an idea how to work around this?
WINAPP
use funcs
implicit none
!!!!!!!! MDI frame with dynamic scrollbars for when child !!!!
!!!!!!!! windows go out of the extremities of the frame !!!!
width_frame=500
height_frame=500
hmax_val=0
hstep=0 !set hstep == hmax_val to make scrollbar invisible
hcur_val=0
vmax_val=0
vstep=0
vcur_val=0
hlow=0
vlow=0
hhigh=width_frame
vhigh=height_frame
childnum=0 !counter for child windows
i=winio@('%ww[no_border]%hw&',frame_hnd)
!i=winio@('%^bt[test]%nl&',cback) !! toolbar
i=winio@('%^hx&',hstep, hmax_val, hcur_val, hmove_child_windows)
i=winio@('%^vx&',vstep, vmax_val, vcur_val, vmove_child_windows)
i=winio@('%pv%^`fr&',width_frame,height_frame,cur_child,scrollfunc)
i=winio@('%mn[&File[&Open]]&',open_func)
i=winio@('%mn[[&Cascade]]&','cascade')
i=winio@('%lw&',ctrl)
i=winio@('%`mv',resize_main_win) !!!! called if frame is resized
end
module funcs
implicit none
!!!!!!! Global Variables !!!!!!!!
integer ctrl,winio@, i, cur_child, frame_hnd
integer :: x, child_width
integer :: y, child_height
integer :: hlow, hhigh
integer :: vlow, vhigh
integer :: x_frame, y_frame, width_frame, height_frame
integer :: hstep, hmax_val, hcur_val, hcur_val_old
integer :: vstep, vmax_val, vcur_val, vcur_val_old
integer,allocatable :: childhnd(:,:), childhndtemp(:,:)
integer :: childnum
contains
!!!!! creates child window containing graphic region
integer function open_func()
i=winio@('%aw&',ctrl)
i=winio@('%hw&',cur_child)
i=winio@('%pv%^gr[user_resize, grey]&',200,200,cback)
i=winio@('%bd&',0.0d0,0.0d0,0.0d0,0.0d0) !!!!set border for child windows
i=winio@('%2.1ob[status,depressed]&') !!!!status bar
i=winio@('%`rs%cb&','1.234')
i=winio@('%`rs%cb&','sssssss') !!!! blah
i=winio@('%mv&',scrollfunc) !!!! called if child window moved
i=winio@('%cc', exit_scrollfunc) !!!! called if child closed
childnum=childnum+1
!!!!! make list of child window handles in array
!!!!! if a child window is deleted the handle is set to zero
if(childnum==1)then
allocate(childhnd(childnum,3))
childhnd(childnum,1)=cur_child
else
allocate(childhndtemp(size(childhnd,1),3))
childhndtemp=childhnd
deallocate(childhnd)
allocate(childhnd(childnum,3))
childhnd(1:childnum-1,:)=childhndtemp
childhnd(childnum,1)=cur_child
deallocate(childhndtemp)
endif
open_func=1
end function
!!!!!!! function called when child window closed
integer function exit_scrollfunc()
integer :: i
do i=1,size(childhnd,1)
if(childhnd(i,1)==cur_child)then
childhnd(i,1)=0
endif
enddo
exit_scrollfunc= -1
end function