/* ------------------------------------------------------------------ */ /* Macro: SYNCH.AML */ /* Written by: nuText Systems */ /* */ /* Description: This macro allows you to scroll the topmost two */ /* windows 'in synch' with each other. Synchronized */ /* scrolling can be toggled ON and OFF with . */ /* */ /* Usage: Run this macro from the macro picklist */ /* ------------------------------------------------------------------ */ include bootpath "define.aml" // check for a previous install obj = lookup "synch" "prf" if obj then if (okbox "Synchronized scrolling already installed, remove it?") == "Ok" then destroyobject obj unsetx "synch" "prf" msgbox "Synchronized scrolling removed." end return else obj = getcurrobj setxobj "synch" obj "prf" end // keep this macro resident stayresident object edit // scroll the previous window in synch with the current window function synch if _sscv then win = getprevwin if win then display scrollrow getviewtop - (_sscv - 1) win scrollcol getviewleft - (_ssch - 1) win end end end // turn synchronized scrolling ON/OFF key // replace < with < and > with > msg = "Synchronized scrolling " if _sscv then _sscv = '' say msg + "OFF" else win = getprevwin if win then _sscv = getviewtop - (getviewtop win) + 1 _ssch = getviewleft - (getviewleft win) + 1 say msg + "ON" else say "No other window" 'b' end end end // modified key definitions for edit windows key passprev synch end key passprev synch end key passprev synch end key passprev synch end key passprev synch end key passprev synch end msgbox "Synch scrolling is installed. Enter to toggle ON/OFF.\n(run this macro again to un-install)"