1. ...latest 'tutorials' bug

For anyone who's downloaded the latest win32lib tutorials.
This replacement for track_main() in center.exw solves an obvious problem
with the original when it's used for modal windows... you might not be able
to kill-em!.. sad
Wolf


procedure track_main(atom win_id,atom modal_win_id,
                      atom xoffset,atom yoffset)
sequence loc,loc2
atom xsize,ysize,posx,posy,maxx,maxy,diff
loc=getSize(win_id)
loc2=getSize(modal_win_id)
xsize=loc2[3]-loc2[1]
ysize=loc2[4]-loc2[2]
posx=loc[1]+xoffset
--find left edge of screen.
--don't go beyond left edge.
if posx > maxx-xsize then posx=maxx-xsize  end if
--don't go beyond right edge either.
if posx < 0 then posx=0 end if
posy=loc[2]+yoffset
--find bottom edge of screen.
--account for task-bar.
           (c_func(xGetSystemMetrics,{SM_CYFULLSCREEN})))
--don't go below bottom edge, or under task-bar.
if posy > maxy-ysize then posy=floor(maxy-(ysize+diff/2)-3)  end if
moveWindow(modal_win_id,posx,posy,xsize,ysize,1 )
end procedure

http://www.king.igs.net/~wolfritz
http://www.king.igs.net/~wolfritz/tutor.htm

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu