Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!usc!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!news.funet.fi!funic!santra!hila.hut.fi!jmunkki From: jmunkki@hila.hut.fi (Juri Munkki) Newsgroups: comp.sys.mac.system Subject: Re: System 7.0 compatible stuff Message-ID: <1991Apr28.112031.26078@santra.uucp> Date: 28 Apr 91 11:20:31 GMT References: <3102@sparko.gwu.edu> <10200001@hpnmdla.hp.com> <1991Apr26.220236.8364@sdd.hp.com> Sender: news@santra.uucp (Cnews - USENET news system) Reply-To: jmunkki@hila.hut.fi (Juri Munkki) Organization: Helsinki University of Technology, FINLAND Lines: 79 In article <1991Apr26.220236.8364@sdd.hp.com> marshall@sdd.hp.com (Marshall Clow) writes: >That is not a system 7 specific bug. The problem is that FW checks the location >of the page-setup window using port^.portBits.bounds. Unfortuantely, this >assumes that the page setup window is a black and white window. Under System 7 >the LaserWriter ( and probably ImageWriter, et. al. ) use color windows for >page-setup and print dialogs, so FW gets a bogus rectangle for the location >of the window, and centers the "Margins" dialog in some random place >( usually off the screen ). If you have a two-page display, you can sometimes >see the dialog. So, the dialog is there, just off the screen. Now that the problem has been identified, someone can easily fix it with a binary patch. I still use FullWrite 1.0 (and I use it quite a lot) and it also has that problem. I'll probably try to patch it the next time I need the set margins dialog. The easiest fix would be to write an FKEY that moves the front window onto the main screen. Running this FKEY would then make the invisible dialog visible. To patch FullWrite itself, one has to drop into the debugger at the correct spot (easy to detect with TMON) make changes to the code resource, call ChangedResource and WriteResource on the CODE resource that was changed. This will make the application slightly larger, because FullWrite compresses most CODE resources. Fortunately it checks for the compression, so writing the uncompressed resource doesn't make it malfunction. I've done some FullWrite binary patching a few years ago. The FKEY solution is by far the easiest and as such I recommend it. Actually, I just noticed I had some time on my hands, so I wrote the FKEY for you. It took me 15 minutes and it seems to work with everything I tried (a few applications), so it's not really FullWrite-specific. The Set Margins dialog works now beautifully. I'm including the source code and a very short BinHex file with this message. Use ResEdit to paste this resource into your copy of FullWrite and hit cmd-shift-8 after the Set Margins button. Voila! Think C source: void main() { GrafPort DummyPort; Rect MainScreen; WindowPtr FunkyFront; Point Movement; OpenPort(&DummyPort); MainScreen = DummyPort.portBits.bounds; ClosePort(&DummyPort); FunkyFront = FrontWindow(); Movement.h = (MainScreen.right-MainScreen.left -FunkyFront->portRect.right+FunkyFront->portRect.left)/2; Movement.v = (MainScreen.bottom-MainScreen.top -FunkyFront->portRect.bottom+FunkyFront->portRect.top)/2; MoveWindow(FunkyFront,Movement.h,Movement.v,0); } (This file must be converted with BinHex 4.0) :$NCeE'aAFQPdC5"'5d9C!$q3#!#3#!(PXVN!N!3"!*!$!DB!N!1Q!*!$2dqep2Y IN!2%a)@eY9YE9B99a%@Na&A%T-5&9EA9fNe0$NCeE'aAFQPdC5"'5d9CC3)!N!- rN!J!N!BrN!J!N"LN3)MT!*!'!HAm6da&6%9F6%KF6%T-5N5eT+5-4%6D6Ga06D6 8fefNe0T)fNh%h8e0YGa&YIA%a04%r%A%YD5N68T2484"&9Z3"&@-5&L3"-5&JBa ,@eA%YE&26m6dqNr%qeqNr%q3!m6dr%p&@e99@e@&9F48YF6%5&a-40AD6D6F6F6 D6EAEA3#3!k*J$J!!4NY&@3!)!*!'3IVrlNja6R&J!!!#6PErK%KZrj5SEd(Zria $l[qF)0NJf8KZrj5SI8+RU53JAbe)riJ`,[q5N!"ZriiJE[q)N!"S!"BJE[q)d'J !%NM!JI`!!Me!riB`,[q3!*!!E[q-)'lrL*!!D!!8)'lrL0"S!"")`)(m!!)p32q %,blrL$mZriBr,[q%3QHT'djH6R9038P1)*!%!!!"!*!$!DB!N!1Q!*!$2`!ab,J (@J#3!a`!-J!!4NY&@3#3!`S!#!!!&!#3"$()%!a$C@jdCA*AD@jNEhICc!: Let me know if you like this kludgey solution. ____________________________________________________________________________ / Juri Munkki / Helsinki University of Technology / Wind / Project / / jmunkki@hut.fi / Computing Center Macintosh Support / Surf / STORM / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~