home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / csmpdigest / csmp-digest-v3-041 < prev    next >
Text File  |  2010-09-21  |  67KB  |  1,820 lines

  1. Received-Date: Sat, 2 Jul 1994 17:46:55 +0200
  2. From: pottier@clipper.ens.fr (Francois Pottier)
  3. Subject: csmp-digest-v3-041
  4. To: csmp-digest@ens.fr
  5. Date: Sat, 2 Jul 1994 17:46:50 +0200 (MET DST)
  6. X-Mailer: ELM [version 2.4 PL23]
  7. Mime-Version: 1.0
  8. Content-Type: text/plain; charset=ISO-8859-1
  9. Content-Transfer-Encoding: 8bit
  10. Errors-To: listman@ens.fr
  11. Reply-To: pottier@clipper.ens.fr
  12. X-Sequence: 44
  13.  
  14. C.S.M.P. Digest             Sat, 02 Jul 94       Volume 3 : Issue 41
  15.  
  16. Today's Topics:
  17.  
  18.         Detecting pre-68020 CPU for 68020 code
  19.         Fast Animations (WAS: Fast full screen scrolling: impossible?)
  20.         FlattenMovieData bug???
  21.         Here's how to get OpenDoc
  22.         How to know the cursor is into a polygon?
  23.         PowerPC load-store (was Re: Fast full screen scrolling: impossible?)
  24.         Q: Default button & Return key in Modeless Dialog
  25.         Questions about Tmon?
  26.         Saving PICT files - Here's CODE!!
  27.         Scroll Bars in DLOG?
  28.         Why should't you move baseAddrs?
  29.         cntl-opt-esc
  30.         scroll bars in modal dialogs
  31.  
  32.  
  33.  
  34. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  35. (pottier@clipper.ens.fr).
  36.  
  37. The digest is a collection of article threads from the internet newsgroup
  38. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  39. regularly and want an archive of the discussions.  If you don't know what a
  40. newsgroup is, you probably don't have access to it.  Ask your systems
  41. administrator(s) for details.  If you don't have access to news, you may
  42. still be able to post messages to the group by using a mail server like
  43. anon.penet.fi (mail help@anon.penet.fi for more information).
  44.  
  45. Each issue of the digest contains one or more sets of articles (called
  46. threads), with each set corresponding to a 'discussion' of a particular
  47. subject.  The articles are not edited; all articles included in this digest
  48. are in their original posted form (as received by our news server at
  49. nef.ens.fr).  Article threads are not added to the digest until the last
  50. article added to the thread is at least two weeks old (this is to ensure that
  51. the thread is dead before adding it to the digest).  Article threads that
  52. consist of only one message are generally not included in the digest.
  53.  
  54. The digest is officially distributed by two means, by email and ftp.
  55.  
  56. If you want to receive the digest by mail, send email to listserv@ens.fr
  57. with no subject and one of the following commands as body:
  58.     help                        Sends you a summary of commands
  59.     subscribe csmp-digest Your Name    Adds you to the mailing list
  60.     signoff csmp-digest            Removes you from the list
  61. Once you have subscribed, you will automatically receive each new
  62. issue as it is created.
  63.  
  64. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  65. Questions related to the ftp site should be directed to
  66. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  67. digest are available there.
  68.  
  69. Also, the digests are available to WAIS users.  To search back issues
  70. with WAIS, use comp.sys.mac.programmer.src. With Mosaic, use
  71. http://www.wais.com/wais-dbs/comp.sys.mac.programmer.html.
  72.  
  73.  
  74. -------------------------------------------------------
  75.  
  76. >From nagle@netcom.com (John Nagle)
  77. Subject: Detecting pre-68020 CPU for 68020 code
  78. Date: Thu, 16 Jun 1994 16:44:14 GMT
  79. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  80.  
  81.        Now that Symantec C++ is finally generating 68020 code when asked to
  82. do so (for years, that switch did nothing), it's worth nothing that this
  83. creates a problem in C++.
  84.  
  85.        In C programs, even Think C type programs, the first code executed
  86. is in "main", so it's sufficient to check CPU type there.  But in C++,
  87. static constructors run before "main".  Now that TCL is starting to use
  88. constructors, and constructors are starting to work right in SC++, it's
  89. more likely that code with a 68020 instruction might be executed before
  90. "main".
  91.  
  92.        It's hard to deal with this in a way that's guaranteed to work
  93. from the user program.  The check for 68020 needs to be made in
  94. "CODE 1", the startup code block cranked out by the compiler for every
  95. C++ program.  The user can't do this; only Symantec can.
  96.  
  97.        Anybody still care about pre-68020 machines, anyway?
  98.  
  99.                         John Nagle
  100.  
  101. +++++++++++++++++++++++++++
  102.  
  103. >From jwbaxter@olympus.net (John W. Baxter)
  104. Date: Thu, 16 Jun 1994 19:10:32 -0700
  105. Organization: Internet for the Olympic Peninsula
  106.  
  107. In article <nagleCrI15q.Kru@netcom.com>, nagle@netcom.com (John Nagle)
  108. wrote:
  109.  
  110. >        Anybody still care about pre-68020 machines, anyway?
  111.  
  112. I don't, and I have two of them (a Plus, and a first 100-days Mac now in
  113. 512KE form).
  114.  
  115. However, there still are some Mac Portable owners around who do.  By now,
  116. they must be used to programs which claim to require a 68020 or better
  117. crashing on their machine, but it certainly isn't a nice thing to do to
  118. them.
  119.  
  120. Do the constructors for the static objects actually *use* any 68020
  121. instructions on a regular basis?  [Gestalt is available if you really want
  122. to check in each such constructor...or in a phoney or real object you
  123. arrange to have constructed first.]
  124. -- 
  125. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  126.    No hablo Intel.
  127.    jwbaxter@pt.olympus.net
  128.  
  129. +++++++++++++++++++++++++++
  130.  
  131. >From nagle@netcom.com (John Nagle)
  132. Date: Fri, 17 Jun 1994 15:39:19 GMT
  133. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  134.  
  135. jwbaxter@olympus.net (John W. Baxter) writes:
  136. >Do the constructors for the static objects actually *use* any 68020
  137. >instructions on a regular basis?  [Gestalt is available if you really want
  138. >to check in each such constructor...or in a phoney or real object you
  139. >arrange to have constructed first.]
  140.  
  141.       If you do any subscript calculations involving 2D arrays or arrays
  142. of structures, you'll probably use the 32-bit multiply on a 68020.  
  143. On 68000 machines, a subroutine is called for every 32-bit multiply.
  144.  
  145.       You can't have an object you "arrange to have constructed first".
  146. It's a feature of C++ that order of static constructor execution is
  147. random across file boundaries.  ARM 12.6.1.
  148.  
  149.       You can't even call Gestalt from the constructor usefully unless
  150. your class is a base class.  Base class constructors get called first,
  151. so if your class is derived from another class, its constructor will be
  152. called only after the base class constructor has already run.  It
  153. won't help to override functions in the base class, either; the base class
  154. versions will be called when the base class constructor is called.
  155.  
  156.       So there really isn't a sound way to do this.
  157.  
  158.                     John Nagle
  159.  
  160.  
  161.                     John Nagle
  162.  
  163. ---------------------------
  164.  
  165. >From cfranz@home.malg.imp.com (Christian Franz)
  166. Subject: Fast Animations (WAS: Fast full screen scrolling: impossible?)
  167. Date: Thu, 16 Jun 1994 09:14:27 GMT
  168. Organization: Union Bank of Switzerland, CH
  169.  
  170. In article <1994Jun13.212936.24879@dal1>, seanmcd@ac.dal.ca wrote:
  171. > In article <CrCFxp.79K@park.uvsc.edu>, stay@park.uvsc.edu (Steve Taylor) writes:
  172. > > From article <1994Jun12.232257.24853@dal1>, by seanmcd@ac.dal.ca:
  173. > >> I think Chuck Yeager's Air Combat does this too. You can see interlacing
  174. > >> in the terrain if you rock the plane back and forth.
  175. > >> 
  176. > >> Sean
  177. > > 
  178. > > Could someone describe this technique in more detail?  Are you talking
  179. > > about leaving the other lines there and blitting the other half or
  180. > > are you talking about doubling the height of the lines or what?
  181. > > Thanks.
  182. > > 
  183. > Well the description given above makes AstroChase 3D sound like CYAC,
  184. > although the only thing I've seen in AstroChase 3D is the venetian blind
  185. > style, rendering the frame onto every other line. Deliverance also has the
  186. > option to do this, as does a game called Gate. It looks to me like CYAC
  187. > does interlacing, i.e., there are no black lines alternating with the
  188. > graphics, but if you rock the plane
  189. > or turn rapidly, you can see the interlacing effect fairly easy in large
  190. > polygons. 
  191.  
  192. I'm currently developing a 3D space game and of course, I have the same
  193. problems. I have tried many things, among them the alternate line modes
  194. used by Astrochase (draw every other line) and CYAC (draw even lines on
  195. even frames, odd lines on odd frames). 
  196.  
  197. All these algorithms make one main assumption: 
  198. You draw the image in an off-screen buffer and after you are done drawing
  199. it, you blast the image to screen. It usually takes three steps:
  200.  
  201.   1. erase offscreen buffer
  202.   2. draw new frame offscreen
  203.   3. blast offscreen image on-screen.
  204.  
  205. Tuning step 3 can speed up your program, but usually only by 1/6 max 
  206. (optimized blitting is usually one third of the time per frame and I
  207. assume you double the speed of blitting by halving the lines to copy).
  208.  
  209. I have found out that there is a much better method (however, I doubt 
  210. if this technique can be applied to moving backgrounds as is the
  211. main title of this thread). Actually I didn't find out myself but
  212. Juri Munkki, Mac Animations Guru DeLuxe, did. Since my program uses
  213. polygon-oriented graphics, you collect all your polygons as if you 
  214. would draw them. Then you compare them with all polygons drawn in
  215. the last frame and output *the*difference* to screen. This eliminates
  216. the need to erase your offscreen map and since two successive frames 
  217. are usually similar to each other, you just draw a fraction of what
  218. you usually do. Although the overhead for collecting the polygons
  219. is probably a bit more than drawing them, the subsequent elimination 
  220. of 90% that needs to be redrawn makes up for this. Also, if you just
  221. output the difference, this eliminates the need to as this is included 
  222. into the algorithm. 
  223.  
  224. Mhhh. On second thought, this doesn't work at all for a scrolling 
  225. background... But then, neither CYAC nor AC3D have moving background.
  226.  
  227. > I don't know enough about 3D graphics to know whether you could
  228. > actually render even/odd scanlines or whether he's just splitting an 
  229. > off-screen drawing into two blits.
  230.  
  231. Well, I have some experience with 3D graphics and there are to 
  232. fundamental different approaches. On is called object-space, the
  233. other scan-space (well, at least in german. They seem to translate
  234. badly). In object space you calculate all surfaces of the objects 
  235. and project them on your (off)screen using normal projection methods.
  236. To tune your animation you use object coherencies (you take 
  237. advantage of the fact that an object doesn't change much between
  238. two frames). In this algorithm you can't render only for odd lines.
  239. You have to render the whole scene and then transfer every other
  240. line.
  241.  
  242. In scan space you take the inverted approach. For each pixel you
  243. decide which surface is frontmost and set this pixel to the 
  244. appropriate color/texture. To tune this algorithm you can use
  245. scan-line coherencies (the fact that two pixels in any direction
  246. usually don't change much in color, both in x and y direction).
  247. With scan-space, you *can* render every other line directly.
  248.  
  249. The third possibility is a combination of both methods. It's what
  250. Juri's program does (as I suspect. I havn't seen a single line of
  251. his code, but the performance of the demos he sent me leave no
  252. other explanation). You use object space to pre-calculate all
  253. objects (i.e. all vertices that define your surfaces), collect
  254. them to polygons that are not drawn but *mathematically* compared
  255. to the last frame, collect the difference to other polygons and
  256. finally draw the new polygons (using scan coherencies). You
  257. can draw directly to screen since you change so few things that
  258. it seems instantaneous. Juri claims that his algorithm is a
  259. bit faster than the one used in FA-18 (I think they use
  260. a similar approach) and quite frankly, I believe every word
  261. of it.
  262.  
  263. > Sean
  264.  
  265. OK, sorry to have held you up with this rather lengthy discussion
  266. of some arcane and irrelevant topic, but I have spent a lot of
  267. time investigating this and maybe someone can make some use out
  268. of it. Have a nice day.
  269.  
  270.  
  271. Cheers,
  272. Christian
  273.  
  274. - -
  275. Christian Franz                    *       Union Bank of Switzerland, CH
  276. cfranz@home.malg.imp.com     <- at home ->               +41-1-261 26 96
  277.  
  278. ---------------------------
  279.  
  280. >From Frank Manshande <frankm@and.nl>
  281. Subject: FlattenMovieData bug???
  282. Date: Mon, 13 Jun 1994 14:47:53 GMT
  283. Organization: AND Software BV
  284.  
  285. Hi,
  286.  
  287. According to the Q/A in Develop 16 (page 130)...
  288.  
  289. "Since FlattenMovieData" will simply append to a data fork of
  290. a file, you can pass it any data file and it will append the
  291. movie data to that file. Quicktime doesn't care what's stored
  292. before or after the movie data, as long as you don't reposition
  293. the movie data within the data dile."
  294.  
  295. Well, if I try this, and append a movie using FlattenMovieData",
  296. the first 8 bytes will be overwritten with 4 bytes and then 'mdat'.
  297.  
  298. Even if I pass the flag 'flattenAddMovieToDataFork' !
  299.  
  300. It seems like this is a bug! I don't want that data stored before
  301. the movie overwritten. My solution now is to read the first 8
  302. bytes, then FlattenMovieData one or more quicktimes movie files
  303. and then restore the first 8 bytes. But I am not certain that
  304. replacing those 8 bytes won't have any side effects. What I do
  305. is store the "Movie" structure, using PutMovieIntoDataFork at
  306. a specific offset.
  307.  
  308. My datafile looks like this:
  309.  
  310. - -------------------------------
  311. | some data (other than movies) |
  312. - -------------------------------
  313. | flattened movie               |
  314. - -------------------------------
  315. | "Movie" structure             |
  316. - -------------------------------
  317. | flattened movie               |
  318. - -------------------------------
  319. | "Movie" structure             |
  320. - -------------------------------
  321. | flattened movie               |
  322. - -------------------------------
  323. | "Movie" structure             |
  324. - -------------------------------
  325.  
  326. This works. But the first 8 bytes are overwritten in "some data".
  327.  
  328. Any info would be very much appreciated!
  329.  
  330. Frank Manshande
  331. frankm@and.nl
  332.  
  333. +++++++++++++++++++++++++++
  334.  
  335. >From ivanski@world.std.com (Ivan M CaveroBelaunde)
  336. Date: Mon, 13 Jun 1994 18:05:25 GMT
  337. Organization: The World Public Access UNIX, Brookline, MA
  338.  
  339. Frank Manshande <frankm@and.nl> writes:
  340.  
  341. >This works. But the first 8 bytes are overwritten in "some data".
  342.  
  343. What happens is that QT stores the info in a Bento-like atomic form. The
  344. single-fork movie (flattened means "self-contained", not "single-fork").
  345. must contain "atoms" in order for QT to properly navigate it. Atoms are
  346. structured as follows:
  347.  
  348.     {
  349.         long    atomSize;    //    includes atomSize+atomType
  350.         OSType    atomType;
  351.         ... atom specific data ...
  352.     }
  353.  
  354. So for your multimovie file to work it needs to contain atom headers
  355. before each movie data atom of the right size. It also needs an 
  356. atom header in front of your data to allow QT to traverse the movie.
  357. This isn't a bug AFAIK; it seems Develop 16 was wrong in the general
  358. case (you can't just append the movie data for single fork files). If
  359. you control the file format, however, and you can add the atom header
  360. yourself, then it is feasible to do what they say. Given this structure,
  361. however, I'd avoid "restoring" the first 8 bytes as you were doing,
  362. since it's bound to affect your ability to access the multiple movies...
  363.  
  364. Additionally, you might want to check out John Wang's article
  365. in Develop 17 ("Somewhere in QuickTime"), since I seem to remember
  366. there is a bug in FlattenMovieData in which the size field is not
  367. properly set when using multiple movies, and a fix (BetterFlattenMovieData)
  368. is discussed in it.
  369.  
  370. Hope this helps,
  371.  
  372. -Ivan
  373. - -
  374. Ivan Cavero Belaunde (ivanski@world.std.com)
  375. Avid VideoShop Project Lead
  376. Avid Technology, Inc.
  377.  
  378. +++++++++++++++++++++++++++
  379.  
  380. >From Frank Manshande <frankm@and.nl>
  381. Date: Tue, 14 Jun 1994 06:51:11 GMT
  382. Organization: AND Software BV
  383.  
  384. In article <CrCKx2.952@world.std.com> Ivan M CaveroBelaunde,
  385. ivanski@world.std.com writes:
  386. >If you control the file format, however, and you can add the atom header
  387. >yourself, then it is feasible to do what they say. Given this structure,
  388. >however, I'd avoid "restoring" the first 8 bytes as you were doing,
  389. >since it's bound to affect your ability to access the multiple movies...
  390.  
  391. Well,
  392.  
  393. First of all thanks for your time!
  394.  
  395. I have written two small programs. One that adds a movie to ANY kind
  396. of file, and displays the offset of the 'movie resource' using the
  397. PutMovieIntoDataFork call. And another program that can play the movies
  398. at the specified offsets. This does seem to work correctly.
  399.  
  400. The only side-effect I have encountered so far is that the file which
  401. I added the movies to cannot be played by SimplePlayer. SimplePlayer
  402. can play the first movie if I don't save and restore the first 8 bytes
  403. of the file. But because I don't want to play the movies using a
  404. general movie player, but only from my own program, this should not
  405. be a problem.
  406.  
  407. The reason I have to restore the first 8 bytes of the file is that
  408. the quicktime movies are added to a specific database file (the database
  409. file is of proprietary format), and the database engine doesn't work
  410. if the first 8 bytes are overwritten.
  411.  
  412. The reason why I don't just create two seperate files (one with the
  413. database and one with all the quicktime movies) is that our customers
  414. (and our company) only wants ONE file, which contains all the data.
  415.  
  416. Does anybody know if saving and restoring the first 8 bytes that
  417. FlattenMovieData overwrites has any other side effects then not
  418. allowing programs such as SimplePlayer to play a movie?
  419.  
  420. Thanks!
  421.  
  422. Frank Manshande
  423. frankm@and.nl
  424.  
  425. +++++++++++++++++++++++++++
  426.  
  427. >From Peter Vanags <peterv@uclink.berkeley.edu>
  428. Date: 15 Jun 1994 20:43:47 GMT
  429. Organization: UCB
  430.  
  431. In article <CrDKDC.30H@and.nl> Frank Manshande, frankm@and.nl writes:
  432. >Does anybody know if saving and restoring the first 8 bytes that
  433. >FlattenMovieData overwrites has any other side effects then not
  434. >allowing programs such as SimplePlayer to play a movie?
  435.  
  436. Nope, not a problem. The only caveat is you MUST use
  437. NewMoveFromDataFork() with the offset to the 'mdat' or 'moov' atom to
  438. retrieve the movie, if the other data in the data fork is not stored in
  439. "atom" form. 
  440.  
  441. To be clean about using FlattenMovieData(), you should use the following
  442. procedure:
  443.  
  444. - store the first 8 bytes of the data fork
  445. - store the file's length
  446. - append a dummy 'mdat' atom to the end of the data fork
  447. - call FlattenMovieData()
  448. - check the offset to the end of the movie data, which is now 
  449.   in the first 4 bytes of the data fork, compare to the length
  450.   before FlattenMovieData() was called
  451.   and update your dummy atom
  452. - restore the first 8 bytes of the file's data fork
  453.  
  454. I talked with John Wang at MacDTS (author of the "Somewhere in QuickTime"
  455. column in develop) quite a bit about this issue right before he published
  456. the article.
  457.  
  458.  
  459. Peter Vanags
  460. peterv@uclink.berkeley.edu
  461.  
  462. +++++++++++++++++++++++++++
  463.  
  464. >From jywang@apple.com (John Wang)
  465. Date: 16 Jun 1994 00:27:12 GMT
  466. Organization: Apple Computer, Inc.
  467.  
  468. FYI.  The bug fix for the problem described in issue #17 of my article has
  469. been added to QuickTime 2.0.  If you use my BetterFlattenMovie or
  470. BetterFlattenMovieData routine, you will be all set since
  471. BetterFlattenMovie only patches FlattenMovie when QuickTime 1.6.X or
  472. earlier is used.
  473.  
  474. John
  475.  
  476. ---------------------------
  477.  
  478. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  479. Subject: Here's how to get OpenDoc
  480. Date: Wed, 15 Jun 1994 23:30:31 GMT
  481. Organization: Apple Computer
  482.  
  483. I just got off the phone with our evangelist, Mark "Rev. Billy-Bob" Thomas,
  484. to get the true facts about OpenDoc seeding. Here's the scoop.
  485.  
  486. * The current (a6) version of OpenDoc is _not_ going to be distributed more
  487. widely than to the WWDC attendees. They decided against a blanket mailing to
  488. all registered developers because, as Mark put it, "You only get one chance
  489. to make a good first impression". The a6 build is still a bit flaky, requires
  490. MPW, and doesn't come with much in the way of documentation. Their fear was
  491. that, if everybody got it, many would play with it a little, run into
  492. problems, and not look at it again later when things are more polished.
  493.  
  494. * The beta seed _is_ going to be distributed widely. It'll be on the
  495. developer CD. It'll be on the 'develop' bookmark CD, and we're hoping to get
  496. a number of OpenDoc articles in that issue of 'develop'. (Note that anyone
  497. can order single issues of 'develop' from APDA for $10.) This will probably
  498. be in September given the lead time involved in pressing CDs. By that time
  499. the code will be more stable, you'll be able to build with CodeWarrior (hope
  500. hope hope), and there will be at least draft versions of the official
  501. documentation for both OpenDoc and the framework.
  502.  
  503. * But! If you're interested in getting started with OpenDoc _now_ (and how
  504. can I blame you?) you can send mail to OpenDoc@applelink.apple.com and get a
  505. CD with version a6 in return for filling out a short form.
  506.  
  507. * Feel free to post OpenDoc questions here; I'll try to answer them. There is
  508. an OpenDoc mailing list; send mail to <majordomo@cil.org> with body
  509. "subscribe opendoc-interest" to subscribe. There is also a discussion board
  510. on AppleLink somewhere.
  511.  
  512. I hope this answers your questions. Sorry about any misinformation I've
  513. posted in the past ...
  514.  
  515. --Jens Alfke
  516.   jens_alfke@powertalk              Rebel girl, rebel girl,
  517.             .apple.com              Rebel girl you are the queen of my world
  518.  
  519. +++++++++++++++++++++++++++
  520.  
  521. >From chuck@molecule.Physics.Drexel.Edu (Chuck Browne)
  522. Date: Thu, 16 Jun 1994 16:35:00 GMT
  523. Organization: Drexel University
  524.  
  525. Jens Alfke (jens_alfke@powertalk.apple.com) wrote:
  526. : I just got off the phone with our evangelist, Mark "Rev. Billy-Bob" Thomas,
  527. : to get the true facts about OpenDoc seeding. Here's the scoop.
  528.  
  529. : * The beta seed _is_ going to be distributed widely. It'll be on the
  530. : developer CD. It'll be on the 'develop' bookmark CD, and we're hoping to get
  531.  
  532. Thanks, Jens
  533.  
  534. Is there any problem with lending it to Metrowerks for shipping on the
  535. DR4 CD, which roughly comes out at the same time? 
  536. (Not that I'm trying to save a couple of bucks or anything... :-) )
  537.  
  538. Chuck
  539.  
  540.  
  541.  
  542. +++++++++++++++++++++++++++
  543.  
  544. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  545. Date: Thu, 16 Jun 1994 22:55:44 GMT
  546. Organization: Apple Computer
  547.  
  548. Chuck Browne, chuck@molecule.Physics.Drexel.Edu writes:
  549. > Is there any problem with lending it to Metrowerks for shipping on the
  550. > DR4 CD, which roughly comes out at the same time? 
  551.  
  552. I think Mark wants people to go directly to Apple to obtain it. He wants to
  553. keep tabs on how many people have it and who they are (in case we need to
  554. send out any mass mailings, or sell your names and addresses to The Sharper
  555. Image :)
  556.  
  557. > (Not that I'm trying to save a couple of bucks or anything... :-) )
  558.  
  559. I don't think we're charging anything for the OpenDoc seed.
  560.  
  561. --Jens Alfke
  562.   jens_alfke@powertalk              Rebel girl, rebel girl,
  563.             .apple.com              Rebel girl you are the queen of my world
  564.  
  565. +++++++++++++++++++++++++++
  566.  
  567. >From chuck@molecule.Physics.Drexel.Edu (Chuck Browne)
  568. Date: Fri, 17 Jun 1994 00:58:43 GMT
  569. Organization: Drexel University
  570.  
  571. Jens Alfke (jens_alfke@powertalk.apple.com) wrote:
  572. : Chuck Browne, chuck@molecule.Physics.Drexel.Edu writes:
  573. : > Is there any problem with lending it to Metrowerks for shipping on the
  574. : > DR4 CD, which roughly comes out at the same time? 
  575.  
  576. : I think Mark wants people to go directly to Apple to obtain it. He wants to
  577. : keep tabs on how many people have it and who they are (in case we need to
  578. : send out any mass mailings, or sell your names and addresses to The Sharper
  579. : Image :)
  580.  
  581. : > (Not that I'm trying to save a couple of bucks or anything... :-) )
  582.  
  583. : I don't think we're charging anything for the OpenDoc seed.
  584.  
  585. I meant the $10 for develop, but what you say is good to hear. 
  586. (Not that I need OpenDoc or anything, I'm just curious about it and 
  587. what it will mean to software in the next couple of years...
  588. maybe I'll try it out, if I manage to get my PhD on schedule..)
  589.  
  590. Thanks,
  591. Chuck
  592.  
  593.  
  594. : --Jens Alfke
  595. :   jens_alfke@powertalk              Rebel girl, rebel girl,
  596. :             .apple.com              Rebel girl you are the queen of my world
  597.  
  598. ---------------------------
  599.  
  600. >From belanger@bach.ulaval.ca (Yves Belanger)
  601. Subject: How to know the cursor is into a polygon?
  602. Date: Tue, 14 Jun 1994 18:09:32 GMT
  603. Organization: Universite Laval, Ste-Foy (Quebec), Canada
  604.  
  605. Hello,
  606.  
  607. I am writing an application where districts are drawn on a geographic
  608. map. Districts are made with many points, like a polygon in MacDraw.
  609. Each point is given a longitude and a latitude. I have functions that
  610. translate back and forth these coordinates into screen coordinates.
  611.  
  612. My problem is how to determine that a user has clicked inside one of
  613. those polygon or the click was outside them all? If the solution could
  614. work with longitude and latitude, that would be greater, since less
  615. computing would be involved. Thank you.
  616.  
  617. S. Beaudry
  618.  
  619. +++++++++++++++++++++++++++
  620.  
  621. >From Mark Hanrek <hanrek@cts.com>
  622. Date: Tue, 14 Jun 1994 22:49:07 GMT
  623. Organization: The Information Workshop
  624.  
  625. In article <CrEFrx.LDq@athena.ulaval.ca> Yves Belanger,
  626. belanger@bach.ulaval.ca writes:
  627.  
  628. > I am writing an application where districts are drawn on a geographic
  629. > map. Districts are made with many points, like a polygon in MacDraw.
  630. > Each point is given a longitude and a latitude. I have functions that
  631. > translate back and forth these coordinates into screen coordinates.
  632.  
  633. The most common approach is to take advantage of the Macintosh's built-in
  634. region capabilities. They are incredibly powerful, and very easy to use.
  635.  
  636. You can easily take any polygon and create the equivalent region from it,
  637. which is kept in a RegionHandle.
  638.  
  639. Keep a list of these RegionHandles handy, one for each district, and when
  640. the user clicks, take the location of the click and then in a loop use
  641. the PtInRgn() toolbox call to test whether that point is within each of
  642. the regions.  When the result is true, bingo.
  643.  
  644. If there are overlapping regions, be sure they are set up and tested in
  645. front to back order.
  646.  
  647. That's all there is to it, unless I misunderstood your situation.
  648.  
  649. I forget the exact calls to make a region from a polygon, but the whole
  650. process is exceedingly simple.
  651.  
  652. This is the only approach I know of, really.
  653.  
  654. Mark Hanrek
  655.  
  656. +++++++++++++++++++++++++++
  657.  
  658. >From jwbaxter@olympus.net (John W. Baxter)
  659. Date: Tue, 14 Jun 1994 21:09:23 -0700
  660. Organization: Internet for the Olympic Peninsula
  661.  
  662. In article <CrEFrx.LDq@athena.ulaval.ca>, belanger@bach.ulaval.ca (Yves
  663. Belanger) wrote:
  664.  
  665. > Hello,
  666. > I am writing an application where districts are drawn on a geographic
  667. > map. Districts are made with many points, like a polygon in MacDraw.
  668. > Each point is given a longitude and a latitude. I have functions that
  669. > translate back and forth these coordinates into screen coordinates.
  670. > My problem is how to determine that a user has clicked inside one of
  671. > those polygon or the click was outside them all? If the solution could
  672. > work with longitude and latitude, that would be greater, since less
  673. > computing would be involved. Thank you.
  674.  
  675. My approach would be based on creating a QD region which covers the same
  676. "territory" as the polygon, and using the provided PtInRgn call against the
  677. region.  Only if that were not "fast enough" would I probe further.
  678.  
  679. Or...better...switch to QuickDraw GX, where you're likely to be working
  680. with a polygon shape, and you can easily hit-test that (or any other
  681. shape).  That may put things a little more into the future than you want,
  682. though.
  683. -- 
  684. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  685.    No hablo Intel.
  686.    jwbaxter@pt.olympus.net
  687.  
  688. +++++++++++++++++++++++++++
  689.  
  690. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  691. Date: Wed, 15 Jun 1994 22:21:34 GMT
  692. Organization: Apple Computer
  693.  
  694. In article <CrEFrx.LDq@athena.ulaval.ca> Yves Belanger,
  695. belanger@bach.ulaval.ca writes:
  696. > My problem is how to determine that a user has clicked inside one of
  697. > those polygon or the click was outside them all?
  698.  
  699. As has been said, the easiest solution is to create a region of the same
  700. shape as the polygon, then call PtInRegion. This does have the drawback that
  701. regions containing diagonal lines eat up lots of memory. (Think of the
  702. boundary of the region as a polygon, including little stairsteps at pixel
  703. edges on diagonal lines. The region then occupies about two to four bytes per
  704. vertex of that polygon.) Unfortunately, regions larger than 64kbytes will
  705. crash QuickDraw. This shouldn't be a problem unless your polygons are very
  706. large or complex.
  707.  
  708. To create a region from a polygon:
  709. * Call OpenRgn
  710. * MoveTo the first point in the polygon, LineTo each succeeding point. Make
  711. sure to end with a LineTo back to the first point.
  712. * Call CloseRgn.
  713.  
  714. Your other alternative is to use a real "point in polygon" test. You could
  715. either be the four millionth person this month to ask about this on
  716. comp.graphics.algorithms, or you could get a standard computer graphics
  717. textbook like "Computer Graphics: Principles and Practice" by Foley, Van Dam
  718. et al. There may also be source code available by ftp, but I have no idea
  719. where.
  720.  
  721. --Jens Alfke
  722.   jens_alfke@powertalk              Rebel girl, rebel girl,
  723.             .apple.com              Rebel girl you are the queen of my world
  724.  
  725. +++++++++++++++++++++++++++
  726.  
  727. >From mxmora@unix.sri.com (Matt Mora)
  728. Date: 16 Jun 1994 09:28:11 -0700
  729. Organization: SRI International, Menlo Park, CA
  730.  
  731. In article <1994Jun15.222134.21946@gallant.apple.com> Jens Alfke <jens_alfke@powertalk.apple.com> writes:
  732. >In article <CrEFrx.LDq@athena.ulaval.ca> Yves Belanger,
  733. >belanger@bach.ulaval.ca writes:
  734. >> My problem is how to determine that a user has clicked inside one of
  735. >> those polygon or the click was outside them all?
  736. >
  737. >As has been said, the easiest solution is to create a region of the same
  738. >shape as the polygon, then call PtInRegion. This does have the drawback that
  739. >regions containing diagonal lines eat up lots of memory. (Think of the
  740. >boundary of the region as a polygon, including little stairsteps at pixel
  741. >edges on diagonal lines. The region then occupies about two to four bytes per
  742. >vertex of that polygon.) Unfortunately, regions larger than 64kbytes will
  743. >crash QuickDraw. This shouldn't be a problem unless your polygons are very
  744. >large or complex.
  745. >
  746. >To create a region from a polygon:
  747. >* Call OpenRgn
  748. >* MoveTo the first point in the polygon, LineTo each succeeding point. Make
  749. >sure to end with a LineTo back to the first point.
  750. >* Call CloseRgn.
  751. >
  752. >Your other alternative is to use a real "point in polygon" test. You could
  753. >either be the four millionth person this month to ask about this on
  754. >comp.graphics.algorithms, or you could get a standard computer graphics
  755. >textbook like "Computer Graphics: Principles and Practice" by Foley, Van Dam
  756. >et al. There may also be source code available by ftp, but I have no idea
  757. >where.
  758.  
  759.  
  760.  
  761. >From the UMPG Vol II
  762.  
  763. Subject: Re: Point in Polygon routine needed
  764. From: fry@zariski.harvard.edu (David Fry)
  765.  
  766. In article <8fxkxAO00WB7M=nOFO@andrew.cmu.edu> Andrew Lewis Tepper <at15+@andrew.cmu.edu> writes:
  767. >I don't know if this routine is "standard", I just came up with it recently:
  768. >
  769. >For a polygon of points p1...pn, and a point P, make a table as follows:
  770. >
  771. >T(1)= angle from p1 to P to p2
  772. >T(2)= angle from p2 to P to p3
  773. >...
  774. >T(n)= angle from pn to P to p1
  775. >
  776. >express all angles as: -PI < angle < PI.
  777. >
  778. >Add all entries in the table. If the sum = 0, the point is outside. If
  779. >the sum is +/- PI, the point is inside. If the point is +/- xPI, you
  780. >have a strange polygon. If ANY angle was = +/-PI, the point is on the
  781. >border.
  782. >
  783. >Does anyone know if this is considered a good (known?) algorithm? It
  784. >took a long time to come up with!
  785.  
  786. You have the essence of the "good," standard algorithm, but if you're
  787. working with thousands of polygons, those floating point calculations
  788. will be too slow and will probably lead to round-off error at some
  789. point.  Round-off error is a huge pain in computational geometry
  790. problems.  The hard part is finding ways to avoid it.
  791.  
  792. The trick is that you don't need to know the angle between the lines,
  793. you just need to know its sign, called the *circulation*.   For every
  794. line AB in the polygon, form the triangle PAB and you want to know
  795. does it lie inside the polygon or not.  That is, if you were riding a
  796. bike counterclockwise around the boundary of the polygon, would P 
  797. lie on your left or your right when you crossed AB?  You can find this
  798. by calculating PA x PB = (A.x-P.x)*(B.y-P.y) - (A.y-P.y)*(B.x-P.x).
  799. The circulation (the sign of PA x PB) can be found without doing a
  800. multiplication in many cases, but this is good enough.  Remember,
  801. we've oriented the polygon so that you come to A before coming to B as
  802. your traverse its boundary.
  803.  
  804. Then the algorithm is:
  805.  
  806. In = 0
  807. foreach edge AB in the polygon
  808.     if A.y < P.y and B.y >= P.y and PA x PB > 0
  809.         In = In + 1
  810.     if A.y >= P.y and B.y < P.y and PA x PB < 0
  811.         In = In - 1
  812.  
  813. Then if In = 1, P is inside the polygon, and is outside if I = 0. 
  814. This doesn't handle the case where P lies on some edge AB of the
  815. polygon.
  816.  
  817.  
  818. David Fry                                  fry@math.harvard.edu
  819. Division of Applied Sciences               fry@huma1.bitnet
  820. Harvard University                      ...!harvard!huma1!fry
  821. Cambridge, MA  02138            
  822.  
  823.  
  824. - ----------
  825. end of artile
  826.  
  827.  
  828. Xavier
  829.  
  830. -- 
  831. ___________________________________________________________
  832. Matthew Xavier Mora                       Matt_Mora@sri.com
  833. SRI International                       mxmora@unix.sri.com
  834. 333 Ravenswood Ave                    Menlo Park, CA. 94025
  835.  
  836. +++++++++++++++++++++++++++
  837.  
  838. >From Rick Wong <rick@jessica.stanford.edu>
  839. Date: 16 Jun 1994 17:59:54 GMT
  840. Organization: Stanford University
  841.  
  842. In article <CrEFrx.LDq@athena.ulaval.ca> Yves Belanger,
  843. belanger@bach.ulaval.ca writes:
  844. > My problem is how to determine that a user has clicked inside one of
  845. > those polygon or the click was outside them all?
  846.  
  847. One approach is to create an offscreen bitmap with its origin set
  848. up so that the bitmap is centered around the click locaction.  The
  849. bitmap doesn't have to be very big at all, just enough for your hit
  850. tolerance.  For each polygon you want to test, clear the bitmap,
  851. then draw the polygon into it (if you want to see if the point is
  852. inside the polygon, you should draw it with a black fill pattern).
  853. You can then examine the individual bits around the click location
  854. to see if any are set.
  855.  
  856. Of course, such "cleverness" is unnecessary under QuickDraw GX....
  857.  
  858. --Rick Wong
  859.  
  860. ---------------------------
  861.  
  862. >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik)
  863. Subject: PowerPC load-store (was Re: Fast full screen scrolling: impossible?)
  864. Date: 15 Jun 1994 15:23:53 GMT
  865. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  866.  
  867. In article <1994Jun12.182803.1@west.cscwc.pima.edu> 103t_english@west.cscwc.pima.edu writes:
  868.  
  869. > And finally, what happened to the load/store multiple instructions that are
  870. > (I assume?) faster on the 601, but will probably be slower "in future
  871. > implementations?"
  872.  
  873. the load/store multiple instructions are not faster than a series of loads
  874. and stores (except perhaps if there are stalls from the instruction cache).
  875. they take 1 cycle per load or store.
  876.  
  877. these instructions are present to make saving and restoring registers
  878. (GPRs only) to the stack a little bit easier.  that's really the only benefit
  879. to them.
  880.  
  881. many of the PowerPC architects do not like these instructions because they
  882. do not fit the RISC model very well, thus they complicate the processor
  883. implementation.  don't expect IBM/Motorola to invest much time on these
  884. instructions.  witness the lack of equivalent instructions for floating-
  885. point registers or for 64-bit GPRs.
  886.  
  887. these instructions will become slower when they decide to eliminate them
  888. and handle them via trap-and-emulate. (hey, at least they're telling you
  889. all this up front)
  890.  
  891. -gary j kacmarcik
  892. platypus@cirrus.som.cwru.edu
  893.  
  894. +++++++++++++++++++++++++++
  895.  
  896. >From zstern@adobe.com (Zalman Stern)
  897. Date: Wed, 15 Jun 1994 20:34:44 GMT
  898. Organization: Adobe Systems Incorporated
  899.  
  900. Gary Kacmarcik writes
  901. > the load/store multiple instructions are not faster than a series of loads
  902. > and stores (except perhaps if there are stalls from the instruction  
  903. cache).
  904. > they take 1 cycle per load or store.
  905.  
  906. Which will happen relatively often on the 601. (For example anytime you save  
  907. 8 or more registers, its guaranteed to happen.)
  908.  
  909. > these instructions are present to make saving and restoring registers
  910. > (GPRs only) to the stack a little bit easier.  that's really the only  
  911. benefit
  912. > to them.
  913.  
  914. They improve code density somewhat. Given the size of native apps that's a  
  915. concern.
  916.  
  917. > many of the PowerPC architects do not like these instructions because they
  918. > do not fit the RISC model very well, thus they complicate the processor
  919. > implementation.  don't expect IBM/Motorola to invest much time on these
  920. > instructions.  witness the lack of equivalent instructions for floating-
  921. > point registers or for 64-bit GPRs.
  922.  
  923. Bottom line: the architecture would be better without load/store multiple.  
  924. However since the architects could not reach agreement to remove these  
  925. instructions, the implementors should support them. As it stands now, some  
  926. implementors will makes these instructions competitive and some won't.  
  927. Applications developers will be stuck with a choice which way to go. For  
  928. load/store multiple, this doesn't bother me that much. (One might take a  
  929. minor speed hit to win on code space most places anyway.) However the manual  
  930. says similar things about load/store update instructions vs. using a  
  931. load/store and an add instruction. This causes a much bigger performance  
  932. tradeoff right in the middle of your inner loops. A PowerPC implementation  
  933. where the two instruction sequence is faster than an update form instruction  
  934. would be braindead.
  935. --
  936. Zalman Stern           zalman@adobe.com            (415) 962 3824
  937. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  938. `Wait a second! This is just an octahedron suspended in blue liquid.' - JT
  939.  
  940. +++++++++++++++++++++++++++
  941.  
  942. >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik)
  943. Date: 16 Jun 1994 18:34:53 GMT
  944. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  945.  
  946. In article <1994Jun15.203444.3373@adobe.com> zstern@adobe.com (Zalman Stern) writes:
  947. >
  948. > Gary Kacmarcik writes
  949. > > these instructions are present to make saving and restoring registers
  950. > > (GPRs only) to the stack a little bit easier.  that's really the only  
  951. > > benefit to them.
  952. >
  953. > They improve code density somewhat. Given the size of native apps that's a  
  954. > concern.
  955.  
  956. but they don't affect code density all that much.  the recommended way
  957. doing the load/store sequence of instructions is to have a series of
  958. loads (or stores) somewhere in the app or OS like
  959.  
  960.    lwz    r13,0(r0)
  961.    lwz    r14,4(r0)
  962.    ...
  963.    lwz    r31,68(r0)
  964.    bcctr
  965.  
  966. (or something like that - i believe that the standard save/restore glue
  967. does a few other things, but i don't have the exact sequence handy).
  968.  
  969. then a function that wants to save a bunch of registers just calculates 
  970. the address of where the first register should be saved and branches to
  971. appropriate lwz instruction.  you have to do this anyway for floating-
  972. point and 64-bit reg's, so it's not a big deal.
  973.  
  974. the end result is that if it's done this way, it won't have a big impact
  975. on code density.  performance is basically to same too, since the branches
  976. (both of which are unconditional) are "free" and the glue code may
  977. already be in the i-cache (from previous functions).
  978.  
  979. -gary j kacmarcik
  980. platypus@cirrus.som.cwru.edu
  981.  
  982. +++++++++++++++++++++++++++
  983.  
  984. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  985. Date: Fri, 17 Jun 1994 04:23:38 +1200 (NZST)
  986. Organization: (none)
  987.  
  988. platypus@cirrus.som.cwru.edu (Gary Kacmarcik) writes:
  989. > many of the PowerPC architects do not like these instructions because they
  990. > do not fit the RISC model very well, thus they complicate the processor
  991. > implementation.  don't expect IBM/Motorola to invest much time on these
  992. > instructions.  witness the lack of equivalent instructions for floating-
  993. > point registers or for 64-bit GPRs.
  994. > these instructions will become slower when they decide to eliminate them
  995. > and handle them via trap-and-emulate. (hey, at least they're telling you
  996. > all this up front)
  997.  
  998. That won't be too bad -- everyone sees it coming, and coming (fairly) soon,
  999. and if you're saving a number of registers the speed hit won't be *that*
  1000. horrible (but horrible enough), and most people don't use it inside of
  1001. tight loops, and it's no faster than the alternative anyway.
  1002.  
  1003. The really, *really* horrible one will come when the "load with update"
  1004. and "store with update" instructions get the trap-and-emulate treatment.
  1005.  
  1006. For the non PPC-savvy folk, those instructions get used to implement
  1007. the C constructs *++p and *--p (and *p++ and *p-- with a smart optomising
  1008. compiler that can transform your code).
  1009.  
  1010. They're used a *lot*, they're a big speed win on the 601 (less on the
  1011. 603 and 604 if you don't mind tying up two units for a load and an addi
  1012. in parallel becasue you've got nothing better to do with them), and they
  1013. occur in speed-critical inner loops.
  1014.  
  1015. -- Bruce
  1016.  
  1017. ---------------------------
  1018.  
  1019. >From efisch@cs.tamu.edu (Eric A Fisch)
  1020. Subject: Q: Default button & Return key in Modeless Dialog
  1021. Date: 16 Jun 1994 18:56:00 GMT
  1022. Organization: Texas A&M Computer Science Department, College Station, TX
  1023.  
  1024. I am working with modeless dialogs and am quite pleased with the
  1025. results. I am having a problem defining a default button and making
  1026. the return (or enter) key activate it. Right now, when the return key
  1027. is pressed it is passed into the active editable text field. I do have
  1028. the OK button at item number 1, but I am clearly missing something. Any
  1029. thoughts?
  1030.  
  1031.  
  1032. Thanks,
  1033. Eric Fisch
  1034. efisch@cs.tamu.edu
  1035.  
  1036. +++++++++++++++++++++++++++
  1037.  
  1038. >From egurney@vcd.hp.com (Eddy J. Gurney)
  1039. Date: Thu, 16 Jun 1994 20:01:29 GMT
  1040. Organization: Hewlett-Packard VCD
  1041.  
  1042. Eric A Fisch (efisch@cs.tamu.edu) wrote:
  1043. >I am working with modeless dialogs and am quite pleased with the
  1044. >results. I am having a problem defining a default button and making
  1045. >the return (or enter) key activate it. Right now, when the return key
  1046. >is pressed it is passed into the active editable text field. I do have
  1047. >the OK button at item number 1, but I am clearly missing something. Any
  1048. >thoughts?
  1049.  
  1050. Yes. After calling IsDialogEvent() from your event loop and determining
  1051. that this is an event for an open modeless dialog, you need to
  1052. "pre-process" the event before passing it on to DialogSelect() and check
  1053. for a "keyDown" or "autoKey" event when theEvent.message & charCodeMask
  1054. is equal to the Enter or Return key and process it appropriately... being
  1055. sure to NOT pass the event on to DialogSelect() afterwards.
  1056.  
  1057. You need to do a similar thing anyway to catch Command-key equivalents,
  1058. which DialogSelect() also just "pushes" through to TEKey...
  1059.  
  1060. --
  1061. Eddy J. Gurney N8FPW   Hewlett-Packard Company, Vancouver (USA!) Division
  1062. egurney@vcd.hp.com                       #include <standard-disclaimer.h>
  1063. "Failures are divided into two classes-- those who thought and never did,
  1064.       and those who did and never thought."     John Charles Salak
  1065.  
  1066. +++++++++++++++++++++++++++
  1067.  
  1068. >From dubois@primate.wisc.edu (Paul DuBois)
  1069. Date: 16 Jun 1994 15:46:39 -0500
  1070. Organization: Castra Parvulorum
  1071.  
  1072. >From article <2tq780$3i8@news.tamu.edu>, by efisch@cs.tamu.edu (Eric A Fisch):
  1073. > I am working with modeless dialogs and am quite pleased with the
  1074. > results. I am having a problem defining a default button and making
  1075. > the return (or enter) key activate it. Right now, when the return key
  1076. > is pressed it is passed into the active editable text field. I do have
  1077. > the OK button at item number 1, but I am clearly missing something. Any
  1078. > thoughts?
  1079.  
  1080. You have to handle it yourself in a modeless dialog.
  1081. -- 
  1082. Paul DuBois
  1083. dubois@primate.wisc.edu
  1084.  
  1085. ---------------------------
  1086.  
  1087. >From apabla@hercules.cs.uregina.ca (jaime apablaza)
  1088. Subject: Questions about Tmon?
  1089. Date: Wed, 01 Jun 1994 03:19:37 GMT
  1090. Organization: University of Regina
  1091.  
  1092. How much does Tmon Pro cost and where can I order it from?  I read in the 
  1093. faq that Tmon has a rather steep learning curve so I was wondering is 
  1094. that because the manual is rather cryptic.  If so are there third party 
  1095. books on using Tmon?  Email preferred.
  1096.  
  1097.  
  1098. +++++++++++++++++++++++++++
  1099.  
  1100. >From hall_j@sat.mot.com (Joseph Hall)
  1101. Date: Wed, 1 Jun 1994 05:42:03 GMT
  1102. Organization: Motorola Inc., Satellite Communications
  1103.  
  1104. Seems it was apabla@hercules.cs.uregina.ca (jaime apablaza) who said:
  1105. >How much does Tmon Pro cost and where can I order it from?  I read in the 
  1106. >faq that Tmon has a rather steep learning curve so I was wondering is 
  1107. >that because the manual is rather cryptic.  If so are there third party 
  1108. >books on using Tmon?  Email preferred.
  1109.  
  1110. I'm not aware of any books on TMON (other than the fairly good documentation
  1111. that comes with it), but at least TMON seems to have a future now.  For a
  1112. while it looked as if it had been dropped on the floor and left for dead.
  1113.  
  1114. The current trend is STRONGLY toward Jasik's The Debugger, though.
  1115. Obviously there is no TMON for PowerPC at this time.
  1116.  
  1117. -- 
  1118. Joseph Nathan Hall | Joseph's Law of Interface Design: Never give your users
  1119. Software Architect | a choice between the easy way and the right way.
  1120. Gorca Systems Inc. |                 joseph@joebloe.maple-shade.nj.us (home)
  1121. (on assignment)    | (602) 732-2549 (work)  Joseph_Hall-SC052C@email.mot.com
  1122.  
  1123. +++++++++++++++++++++++++++
  1124.  
  1125. >From chewy@shell.portal.com (Paul F. Snively)
  1126. Date: 1 Jun 1994 14:26:07 GMT
  1127. Organization: tumbolia.com
  1128.  
  1129. In article <1994Jun01.031937.138522@sue.cc.uregina.ca>
  1130. apabla@hercules.cs.uregina.ca (jaime apablaza) writes:
  1131.  
  1132. > How much does Tmon Pro cost and where can I order it from?  I read in the 
  1133. > faq that Tmon has a rather steep learning curve so I was wondering is 
  1134. > that because the manual is rather cryptic.  If so are there third party 
  1135. > books on using Tmon?  Email preferred.
  1136.  
  1137. I would mail, but others might want to read this, too...
  1138.  
  1139. TMON Pro does have a significant learning curve, as does probably any
  1140. reasonably capable object-level debugger on the Mac.  The Mac is a
  1141. complex beast itself; to create a debugger that can interact with
  1142. heaps, resources, code, registers, etc. is difficult (says a guy who
  1143. used to work at ICOM Simulations, Inc.)
  1144.  
  1145. Having said that, here are my brief pointers for happiness in TMON Pro:
  1146.  
  1147. 1) Whenever you have a TMON Pro window open, note the little square box
  1148. in
  1149.    the upper right corner.  It looks like a zoom box, and in a sense,
  1150. it is:
  1151.    it will expand the window to show a variety of hidden (ugh) options
  1152. for
  1153.    use in that window.
  1154.  
  1155. 2) Learn--and I mean _really_ learn--TMON Pro's expression syntax. 
  1156. Easily
  1157.    90% of the cool things that you can do with TMON involve non-trivial
  1158. use
  1159.    of expressions.  For example, TMON Pro's "Stack Crawl" window is
  1160. just a
  1161.    Memory window with a moderately hairy expression used to crawl up
  1162. the
  1163.    stack.  There's an even hairier expression used to create a Memory
  1164. window
  1165.    that gives the names of all of the windows in the current world
  1166. (hairy to
  1167.    do because the titleHandle is at different offsets in b&w vs. color
  1168.    windows).  In particular, make sure that you fully understand
  1169. delayed vs.
  1170.    immediate evaluation.
  1171.  
  1172. 3) Remember that TMON Pro does, in fact, have a command line. 
  1173. Command-space
  1174.    will open it.  You may think, "but I hate command lines!"  So do I,
  1175. but
  1176.    it's the only way to do certain things in TMON Pro, e.g. type:
  1177.    "Step 4*LongPointer != F*LongPointer" (that is, step until the value
  1178. at
  1179.    LongPointer changes).
  1180.  
  1181. Like many old-hand TMON/TMON Pro users, I'm delighted to know that TMON
  1182. Pro for the PowerMac is forthcoming.
  1183.  
  1184. - ---------------------------------------------------------------------
  1185. Paul F. Snively          "Just because you're paranoid, it doesn't mean
  1186. chewy@shell.portal.com    that there's no one out to get you."
  1187.  
  1188. +++++++++++++++++++++++++++
  1189.  
  1190. >From dshayer@netcom.com (David Shayer)
  1191. Date: Wed, 1 Jun 1994 18:21:37 GMT
  1192. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  1193.  
  1194. : > How much does Tmon Pro cost and where can I order it from?  I read in the 
  1195. : > faq that Tmon has a rather steep learning curve so I was wondering is 
  1196. : > that because the manual is rather cryptic.  If so are there third party 
  1197. : > books on using Tmon?  Email preferred.
  1198.  
  1199. TMON is a great low level debugger, I don't think its any harder to use
  1200. than Macsbug, and it can certainly be easier to learn than Jasik.
  1201. It comes with 2 manuals, a reference manual and a tutorial.  I simply
  1202. read the tutorial all the way thru, and did all the examples.  It took
  1203. about a week of working every evening.  At the end, I was a TMON master.
  1204. (Well ok, I'm pretty competent with TMON :-)
  1205.  
  1206. There are no books I know of that explain how to use TMON.  However,
  1207. like all low level debuggers, if you don't know what's going on in
  1208. the Mac's guts, you won't know what you're looking at.  I highly
  1209. recommend Scott Knaster's book, How to Write Mac Software.  It actually
  1210. does have some examples in TMON, but in TMON 2.8, which is very old.
  1211.  
  1212. TMON 3.0 is available from APDA (800-282-2732) for $250.
  1213. It suppoessedly has a few quirks on the PowerPC.  Its been bought
  1214. by a new company, which is doing a PPC upgrade, so hopefully we'll
  1215. see a new version of TMON soon.
  1216.  
  1217. +------------------------------------------------------------------------+
  1218. |David Shayer                                  (415) 595-2523            |
  1219. |Sentient Software / Symantec                  shayer@applelink.apple.com|
  1220. |"They're not the best at what they do,        Applelink: SHAYER         |
  1221. | but they're the only ones who do what they do."                        |
  1222. +------------------------------------------------------------------------+
  1223.  
  1224.  
  1225. +++++++++++++++++++++++++++
  1226.  
  1227. >From roberts@insoftware.com (Robert Schwalbe)
  1228. Date: Sat, 11 Jun 1994 09:53:24 -0800
  1229. Organization: IN SOFTWARE
  1230.  
  1231. In article <dshayerCqqDo2.G1y@netcom.com>, dshayer@netcom.com (David
  1232. Shayer) wrote:
  1233.  
  1234. > TMON 3.0 is available from APDA (800-282-2732) for $250.
  1235. > It suppoessedly has a few quirks on the PowerPC.  Its been bought
  1236. > by a new company, which is doing a PPC upgrade, so hopefully we'll
  1237. > see a new version of TMON soon.
  1238.  
  1239. What is the name of this 'new' company, and how would we get in
  1240. contact with them?
  1241.  
  1242. ======================================================================
  1243. Robert Schwalbe                          INET:  roberts@insoftware.com
  1244. IN SOFTWARE                              Voice: 619.743.7502
  1245. 2403 Conway Drive                        Fax:   619.743.7503
  1246. Escondido, CA 92026    
  1247.  
  1248. +++++++++++++++++++++++++++
  1249.  
  1250. >From dshayer@netcom.com (David Shayer)
  1251. Date: Wed, 15 Jun 1994 05:03:14 GMT
  1252. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  1253.  
  1254. Robert Schwalbe (roberts@insoftware.com) wrote:
  1255. : In article <dshayerCqqDo2.G1y@netcom.com>, dshayer@netcom.com (David
  1256. : Shayer) wrote:
  1257.  
  1258. : > TMON 3.0 is available from APDA (800-282-2732) for $250.
  1259. : > It suppoessedly has a few quirks on the PowerPC.  Its been bought
  1260. : > by a new company, which is doing a PPC upgrade, so hopefully we'll
  1261. : > see a new version of TMON soon.
  1262.  
  1263. : What is the name of this 'new' company, and how would we get in
  1264. : contact with them?
  1265.  
  1266. The new "company" is really one guy, named Allan Foster.  You
  1267. can reach him at afcguru@aol.com.
  1268.  
  1269. David
  1270.  
  1271.  
  1272. ---------------------------
  1273.  
  1274. >From cconstan@epdiv1.env.gov.bc.ca (Carl B. Constantine)
  1275. Subject: Saving PICT files - Here's CODE!!
  1276. Date: Thu, 16 Jun 1994 07:10:55 -0700
  1277. Organization: Ministry of Environment, Lands & Parks
  1278.  
  1279. Here is some code that works for saving PICT files.  This code was
  1280. developed by a friend of mine, I'm not the author.
  1281.  
  1282. Here you go.
  1283.  
  1284. OK, I have working code for writing a PICT file from a mac Picture.
  1285. The trick is to write the fields of the Picture in the proper order.
  1286. Write 512 zeros, for conformity with old PICT files & MacDraw.
  1287. Then write the picture size, the picture rect, and finally the picture
  1288. opcodes.
  1289.  
  1290.  
  1291. PicHandle macPicture;
  1292. static Point SFPwhere = { 150, 150 };
  1293. static SFReply reply;
  1294.  
  1295. void MakePICTFile ()
  1296. {
  1297.     OSErr iErr;
  1298.     int iFileRef;
  1299.     CQDProcs myProcs;
  1300.     int longZero, i;
  1301.     long longCount = 1;
  1302.     Rect pFrame;
  1303.     PicHandle newPICTHand;
  1304.     short globalRef;
  1305.     Rect temp;
  1306.     int tempSize;
  1307.     
  1308.     SFPutFile ( SFPwhere, "\pSave PICT Plot as:","\pSaved PICT
  1309. Plot",NULL,&reply);
  1310.  
  1311.     if (reply.good)
  1312.     {
  1313.     
  1314.     
  1315.         PleaseWait ();                            /* change to watch cursor */
  1316.         ExerciseOffScreen ();                    /* draw pict in off-screen bitmap */
  1317.         
  1318.         iErr = Create ( reply.fName, reply.vRefNum, 'MKGW', 'PICT' );
  1319.                                                 /* create file */
  1320.         if (iErr != 0)
  1321.         {
  1322.             puts("Error - could not create file\n");
  1323.             return;
  1324.         }
  1325.         
  1326.         iErr = FSOpen ( reply.fName, reply.vRefNum, &globalRef );
  1327.                                                 /* open file */
  1328.  
  1329.         for ( i = 1; i<= 512; i++)                /* write 512 zeros for conformity to
  1330. standard */
  1331.             FSWrite (globalRef, &longCount, 0);
  1332.  
  1333.  
  1334.         longCount = 2;                            /* write picture size */
  1335.         tempSize = (*macPicture)->picSize;
  1336.         FSWrite (globalRef, &longCount, &tempSize);
  1337.         
  1338.         longCount = 8;                            /* write picture rect */
  1339.         temp = (*macPicture)->picFrame;
  1340.         FSWrite (globalRef, &longCount, &temp);
  1341.                                                 /* write picture */
  1342.         longCount = GetHandleSize ((Handle) macPicture);
  1343.         FSWrite (globalRef, &longCount, (Ptr) (*macPicture)+10);
  1344.                                                 /* picture starts 10 bytes from beginning address */
  1345.  
  1346.         FSClose (globalRef);
  1347.     }
  1348.  
  1349. }
  1350.  
  1351.  
  1352. Good luck!
  1353.  
  1354. -- 
  1355. =========================================================================
  1356. Carl B. Constantine                      B.C. Environment, Lands & Parks
  1357. End-User Support Analyst                 CCONSTAN@epdiv1.env.gov.bc.ca
  1358.    PGP Key available if you finger: CCONSTAN@EUSACBC.env.gov.bc.ca
  1359.  
  1360. ---------------------------
  1361.  
  1362. >From nhodulik@hypnos.norden1.com (Nick Hodulik)
  1363. Subject: Scroll Bars in DLOG?
  1364. Date: 6 Jun 1994 03:52:22 GMT
  1365. Organization: Norden 1 Communications
  1366.  
  1367. How does one make scroll bars work in a DLOG resource? I know it has something 
  1368. to do with the CNTL resource, but I can't figure it out. Please help me!
  1369.  
  1370. Nick
  1371.  
  1372. --
  1373. *-----------------------*------------------------------------*---------------*
  1374. |nhodulik@norden1.com   | "This train                        |   *------*    |
  1375. |Norden1 Communications |         is bound                   |    \ GO /     |
  1376. |Nick Hodulik           |              for glory..."         |    TITANS!    |
  1377. |Toledo, OH             |                    -Indigo Girls   |      \/       |      \/       |
  1378. *-----------------------*------------------------------------*---------------*
  1379.  
  1380. +++++++++++++++++++++++++++
  1381.  
  1382. >From Alex Kac <akac@delphi.com>
  1383. Date: Sat, 18 Jun 94 12:57:50 -0500
  1384. Organization: Delphi (info@delphi.com email, 800-695-4005 voice)
  1385.  
  1386. Nick Hodulik <nhodulik@hypnos.norden1.com> writes:
  1387.  
  1388. >How does one make scroll bars work in a DLOG resource? I know it has something 
  1389. >to do with the CNTL resource, but I can't figure it out. Please help me!
  1390. >
  1391. >Nick
  1392.  
  1393. Ok...here is some ol PASCAL source for you (easier to read)
  1394. FUNCTION NewDlogFilter (theDialog: DialogPtr;
  1395.        VAR theEvent: EventRecord;
  1396.        VAR itemhit: integer): boolean;
  1397.  
  1398. first, you need to use a ModalDialogFilter (if you're using a modaldialog)
  1399.  BEGIN
  1400.   setport(theDialog);
  1401.   IF (theEvent.what = update) AND (WindowPtr(theevent.message) <> theDialog) &
  1402. (WindowPeek(WindowPtr(theEvent.message))^.windowkind = dlog) THEN
  1403.    UpdtDialog(theDialog, (WindowPeek(WindowPtr(theEvent.message))^.updateRGN))
  1404.   ELSE IF (theEvent.what = activate) AND (DialogPtr(theEvent.message) <>
  1405. theDialog) THEN
  1406. {Deactivate any window behind....}
  1407.   ELSE
  1408.    CASE theEvent.what OF
  1409. ...do key stuff here....
  1410.     M_Down:
  1411.      BEGIN
  1412.       hitPt := theEVENT.where;
  1413.       GlobalToLocal(hitPt);
  1414.       Ahit := FindControl(hitPt, theDialog, hitControl);
  1415.       IF NOT (hitControl = NIL) THEN
  1416.        BEGIN
  1417.        dhit := FindDitem(theDialog, hitpt) + 1;
  1418.        GetDitem(theDialog, dhit, itemtype, itemhandle, itemrect);
  1419. {here I could have put a contrlAction in each of the 3 controls before I
  1420. started the Dialog, but thought this was the best way}
  1421.        CASE Ahit OF
  1422.        inButton:
  1423.        BEGIN
  1424.        CASE itemtype OF
  1425.        4..6:
  1426.        Ahit := TrackControl(hitControl, hitpt, NIL);
  1427.        7:
  1428.        Ahit := TrackControl(hitCOntrol, hitpt, Pointer(-1));    {since this is a
  1429. button, it can only be a PopUpMenu...}
  1430.        OTHERWISE
  1431.        ;
  1432.        END;
  1433.        CASE dhit OF
  1434. ...buttons and other stuff here....
  1435.        inUpButton:
  1436.        IF NOT (TrackControl(hitControl, hitpt, @UpButtonProc) = 0) THEN
  1437.        BEGIN
  1438.        NewDlogFilter := true;
  1439.        itemhit := dhit;
  1440.        END;
  1441.  
  1442.        inDownButton:
  1443.        IF NOT (TrackControl(hitControl, hitpt, @DownButtonProc) = 0) THEN
  1444.        BEGIN
  1445.        NewDlogFilter := true;
  1446.        itemhit := dhit;
  1447.        END;
  1448.  
  1449.        inThumb:
  1450.        IF NOT (TrackControl(hitControl, hitpt, NIL) = 0) THEN
  1451.        BEGIN
  1452.        ChangeBut(hitcontrol, theDialog);
  1453.        NewDlogFilter := true;
  1454.        itemhit := dhit;
  1455.        END;
  1456.  
  1457.        OTHERWISE
  1458.        ;
  1459.        END;
  1460.        END;
  1461.      END;        {end of MDown}
  1462.  
  1463.  
  1464.  
  1465. By!
  1466.  
  1467. ---------------------------
  1468.  
  1469. >From mburch@ksu.ksu.edu (Matt Burch)
  1470. Subject: Why should't you move baseAddrs?
  1471. Date: 15 Jun 1994 18:19:52 -0500
  1472. Organization: Kansas State University
  1473.  
  1474. Forgive me for sounding obtuse, but what excactly is wrong with
  1475. moving around baseAddrs? What's to prevent you from creating, say,
  1476. a GWorld or other offscreen pixmap with the same dimensions and
  1477. depth as the screen, and then setting the screen's baseAddr to
  1478. the baseAddr of the buffer when you want to draw a frame, instead
  1479. of blasting it into video memory? Am I missing something here?
  1480. Probably.
  1481.  
  1482. - Matt Burch
  1483.  
  1484.  
  1485. +++++++++++++++++++++++++++
  1486.  
  1487. >From kbell@cs.utexas.edu (Kevin Bell)
  1488. Date: Wed, 15 Jun 1994 23:30:38 -0600
  1489. Organization: The University of Texas at Austin, Austin, Texas
  1490.  
  1491. In article <2to2ao$o4k@matt.ksu.ksu.edu>, mburch@ksu.ksu.edu (Matt Burch)
  1492. wrote:
  1493.  
  1494. > Forgive me for sounding obtuse, but what excactly is wrong with
  1495. > moving around baseAddrs? What's to prevent you from creating, say,
  1496. > a GWorld or other offscreen pixmap with the same dimensions and
  1497. > depth as the screen, and then setting the screen's baseAddr to
  1498. > the baseAddr of the buffer when you want to draw a frame, instead
  1499. > of blasting it into video memory? Am I missing something here?
  1500. > Probably.
  1501. > - Matt Burch
  1502.  
  1503. The reason is that PixMaps are a QuickDraw software data structure, which
  1504. has little relation to the underlying video hardware. So if you change the
  1505. screen's baseAddr, QuickDraw commands will draw to the new port (if it
  1506. doesn't crash, I've never tried this), but the video hardware will continue
  1507. to fetch screen data from the old address.
  1508.  
  1509. -- 
  1510. Kevin Bell
  1511. kbell@cs.utexas.edu
  1512.  
  1513. ---------------------------
  1514.  
  1515. >From valentin+@pitt.edu (Shawn V. Hernan)
  1516. Subject: cntl-opt-esc
  1517. Date: 14 Jun 1994 00:19:12 GMT
  1518. Organization: The University of Pittsburgh
  1519.  
  1520. Greetings all, 
  1521.  
  1522.    Once again, I turn to the wisdom of the net...
  1523.  
  1524.    Is there any way to programatically intercept the cnt-alt-esc
  1525. keysequence? You know, the one that asks you if you really want to
  1526. force such and such to quit. I thought this was an AppleEvent, but
  1527. apparantly not....
  1528.  
  1529.  
  1530. Is this a FAQ? Do I have to resort to testing for that in my keyDown
  1531. events? 
  1532.  
  1533. Any help is deeply appreciated, 
  1534.  
  1535. Thanks, 
  1536. Shawn
  1537.  
  1538.  
  1539.  
  1540. Shawn Valentine Hernan       |Is the War on Drugs worth it?  
  1541. The University of Pittsburgh |Why does the government want your guns?  
  1542. valentin+@pitt.edu           |Does RICO ring a bell?   
  1543. 412-624-6425                 |Did you vote in the last election?
  1544.  
  1545. +++++++++++++++++++++++++++
  1546.  
  1547. >From Steve Maller <maller@genmagic.com>
  1548. Date: 14 Jun 1994 19:39:26 GMT
  1549. Organization: General Magic
  1550.  
  1551. In article <2tit20$59e@usenet.srv.cis.pitt.edu> Shawn V. Hernan,
  1552. valentin+@pitt.edu writes:
  1553. >   Is there any way to programatically intercept the cnt-alt-esc
  1554. >keysequence? You know, the one that asks you if you really want to
  1555. >force such and such to quit. I thought this was an AppleEvent, but
  1556. >apparantly not....
  1557. >
  1558. >Is this a FAQ? Do I have to resort to testing for that in my keyDown
  1559. >events? 
  1560.  
  1561. No dice. It's a pretty low level system patch (to PostEvent, I think)
  1562. so you'd have to patch PostEvent yourself and filter it out.
  1563. - ---------------------------------------------------------------
  1564. Steve Maller
  1565. Husband & Father
  1566. General Magic, Inc.
  1567.  
  1568. +++++++++++++++++++++++++++
  1569.  
  1570. >From mxmora@unix.sri.com (Matt Mora)
  1571. Date: 14 Jun 1994 15:33:11 -0700
  1572. Organization: SRI International, Menlo Park, CA
  1573.  
  1574. In article <2tl11e$lu0@gatekeep.genmagic.com> Steve Maller <maller@genmagic.com> writes:
  1575. >In article <2tit20$59e@usenet.srv.cis.pitt.edu> Shawn V. Hernan,
  1576. >valentin+@pitt.edu writes:
  1577. >>   Is there any way to programatically intercept the cnt-alt-esc
  1578. >>keysequence? You know, the one that asks you if you really want to
  1579. >>force such and such to quit. I thought this was an AppleEvent, but
  1580. >>apparantly not....
  1581. >>
  1582. >>Is this a FAQ? Do I have to resort to testing for that in my keyDown
  1583. >>events? 
  1584.  
  1585. Here you go from the up and coming UMPG volume II. 
  1586. (yes I'm actually working on it)
  1587.  
  1588.  
  1589.  
  1590.  
  1591. Subject: No Option Escape code
  1592. From: Manuel Veloso <veloso@husc9.harvard.edu>
  1593. Distribution: world
  1594.  
  1595. Someone a while back wanted code for killing off Force-Quit. Well, here's
  1596. one I found on CIS (I think) a few weeks ago. It works(!). It's in MPW
  1597. assembly, but 95% of it is the generic init install/patch. For anyone
  1598. doing
  1599. standalone systems (kiosks), well, you know...
  1600.  
  1601. ;    NoEscape.a
  1602.                 
  1603.                 include    'Traps.a'
  1604.  
  1605.                 machine    mc68000
  1606.                 case    obj
  1607.  
  1608. INITEntry        proc    export
  1609.                 
  1610.                 lea        EndPatch,a0
  1611.                 lea        StartPatch,a1
  1612.                 sub.l    a1,a0
  1613.                 move.l    a0,d0
  1614.                 move.l    a0,d3
  1615.                 _NewPtr sys
  1616.                 move.l    a0,d4
  1617.                 beq.s    NoPatch
  1618.                 
  1619.                 move.l    a0,a1
  1620.                 lea        StartPatch,a0
  1621.                 move.l    d3,d0
  1622.                 _BlockMove
  1623.  
  1624.                 move.w    #$a9c9,d0
  1625.                 _GetTrapAddress newTool
  1626.                 lea        RealSysError,a1
  1627.                 move.l    a0,(a1)
  1628.                 move.w    #$a9c9,d0
  1629.                 move.l    d4,a0
  1630.                 _SetTrapAddress newTool
  1631. NoPatch
  1632.                 rts
  1633.  
  1634. StartPatch        cmpi.w    #$4e22,d0
  1635.                 beq.s    NoThanks
  1636.                 move.l    RealSysError,-(sp)
  1637. NoThanks
  1638.                 rts
  1639.  
  1640. RealSysError    ds.l    1
  1641.  
  1642. EndPatch        equ        *
  1643.  
  1644.                 endp
  1645.  
  1646.                 end
  1647. -- 
  1648. ___________________________________________________________
  1649. Matthew Xavier Mora                       Matt_Mora@sri.com
  1650. SRI International                       mxmora@unix.sri.com
  1651. 333 Ravenswood Ave                    Menlo Park, CA. 94025
  1652.  
  1653. +++++++++++++++++++++++++++
  1654.  
  1655. >From Greg_Marriott@genmagic.com (Greg Marriott)
  1656. Date: Wed, 15 Jun 1994 06:21:07 -0800
  1657. Organization: General Magic, Inc.
  1658.  
  1659. Steve Maller <maller@genmagic.com> wrote:
  1660. > valentin+@pitt.edu writes:
  1661. > >   Is there any way to programatically intercept the cnt-alt-esc
  1662. > >keysequence?> 
  1663. > No dice. It's a pretty low level system patch (to PostEvent, I think)
  1664. > so you'd have to patch PostEvent yourself and filter it out.
  1665.  
  1666. Or you could patch SysError and intercept the dialog just before it comes
  1667. up, pretending the user hit cancel.
  1668.  
  1669. -- 
  1670. Greg Marriott
  1671. Just Some Guy
  1672. General Magic, Inc.
  1673.  
  1674. Disclaimer: My opinions are not necessarily the same as General Magic's.
  1675.             (can a company even HAVE an opinion?)
  1676.  
  1677. +++++++++++++++++++++++++++
  1678.  
  1679. >From Dave Falkenburg <falken@apple.com>
  1680. Date: Wed, 15 Jun 1994 16:14:42 GMT
  1681. Organization: Apple Computer, Inc.
  1682.  
  1683. In article <Greg_Marriott-150694062108@internet-macip-45.genmagic.com>
  1684. Greg Marriott, Greg_Marriott@genmagic.com writes:
  1685. >Steve Maller <maller@genmagic.com> wrote:
  1686. >> valentin+@pitt.edu writes:
  1687. >> >   Is there any way to programatically intercept the cnt-alt-esc
  1688. >> >keysequence?> 
  1689. >> No dice. It's a pretty low level system patch (to PostEvent, I think)
  1690. >> so you'd have to patch PostEvent yourself and filter it out.
  1691. >
  1692. >Or you could patch SysError and intercept the dialog just before it comes
  1693. >up, pretending the user hit cancel.
  1694.  
  1695. SysError(20002) is how force-quit happens.
  1696.  
  1697. As Greg said, just patch it to just RTS when the error code is 20002,
  1698. otherwise call through.
  1699.  
  1700. -Dave Falkenburg
  1701. -Apple Computer, Inc.
  1702.  
  1703. ---------------------------
  1704.  
  1705. >From fadushin@top.cis.syr.edu (Fred Dushin)
  1706. Subject: scroll bars in modal dialogs
  1707. Date: Thu, 16 Jun 1994 15:44:22 GMT
  1708. Organization: Syracuse University, CIS Dept.
  1709.  
  1710. >From what I gather from Inside Mac (old volume I and 
  1711. Toolbox Essentials), I need to handle mouseDown events
  1712. in scroll bars in modal dialogs with a filter proc.  I.e.,
  1713. ModalDialog does not return the part code for the control,
  1714. just the controlID.
  1715.  
  1716. Is that so?  If so, does someone have a sample filter procedure
  1717. that handles scroll bars I can scavange from?  Braaa.
  1718.  
  1719.  
  1720. Fred Dushin
  1721. Syracuse, NY
  1722.  
  1723. +++++++++++++++++++++++++++
  1724.  
  1725. >From Here@There (Someone)
  1726. Date: 17 Jun 1994 16:47:46 GMT
  1727. Organization: Large Fuzzy Room
  1728.  
  1729. In article <1994Jun16.154422.1710@newstand.syr.edu>,
  1730. fadushin@top.cis.syr.edu (Fred Dushin) wrote:
  1731. > Is that so?  If so, does someone have a sample filter procedure
  1732. > that handles scroll bars I can scavange from?  Braaa.
  1733. DialogBits 2.0.1 does this, it's on the DevCD and the ftp site.  Here's the
  1734. relevant code from the filter proc that tracks the scroll
  1735. control.............
  1736. // cut and paste into MPW to view right
  1737. // inside your filter proc
  1738. GetDItem(inputDialog, kScrollControlItem, &tempItem, &tempHandle,
  1739. &tempRect);
  1740.     if (PtInRect(mousePoint, &tempRect)) {
  1741.         /* We're in the scroll bar. */
  1742.         /* Now, what does that mean???? */
  1743.         /* Well, the Dialog Manager will automatically call FindControl and
  1744. TrackControl */
  1745.         /* and set the control value (in the case of scroll thumbs) */
  1746.         /* on controls added to your dialog, and in many cases that's all you're
  1747. going */
  1748.         /* to need. */
  1749.         /* But, ModalDialog does NOT pass back a part code, so if the userPerson
  1750. */
  1751.         /* clicked on the thumb or arrows of the scroll bar, you won't know,
  1752. you'll */
  1753.         /* just know that the  scroll bar was clicked in.*/
  1754.         /* That's not enough, so we'll to an initial check to see where the
  1755. control */
  1756.         /* was hit */
  1757.         thePart = FindControl(mousePoint, inputDialog, &returnedControl);
  1758.         /* if the hit was in an arrow or page area, we'll handle it ourselfs */
  1759.         if (thePart != inThumb) {
  1760.             TrackControl(returnedControl, mousePoint, (ProcPtr)DoScrollArrows);
  1761.             returnVal = true;
  1762.         }
  1763.         /* if it was in the thumb, we'll just fall through and let the Dialog
  1764. Manager */
  1765.         /* handle it for us */
  1766.     }
  1767.  
  1768.  
  1769.  
  1770.  
  1771. /* This little routine adjusts the scroll bar during TrackControl */
  1772. pascal void DoScrollArrows(ControlHandle theControl, short thePart)
  1773. {
  1774.     short currentVal = GetCtlValue(theControl);
  1775.     short offSet = 0;
  1776.     switch (thePart) {
  1777.         case inUpButton:
  1778.             offSet = -1;
  1779.             break;
  1780.         case inDownButton:
  1781.             offSet = 1;
  1782.             break;
  1783.         case inPageUp:
  1784.             offSet = -3;
  1785.             break;
  1786.         case inPageDown:
  1787.             offSet = 3;
  1788.             break;
  1789.             
  1790.     }
  1791.     /* set the control value to the new one, as long as it doesn't pass
  1792. limits */
  1793.     currentVal += offSet;
  1794.     if (currentVal < 1)
  1795.         currentVal = 1;
  1796.     if (currentVal > 10)
  1797.         currentVal = 10;
  1798.     SetCtlValue(theControl, currentVal);
  1799.     
  1800. } /* end DoScrollArrows */
  1801.  
  1802. <TR>
  1803. Somewhere, sometime
  1804.  
  1805. SPA FON
  1806.  
  1807. ---------------------------
  1808.  
  1809. End of C.S.M.P. Digest
  1810. **********************
  1811.  
  1812.  
  1813.