jnh@ecemwl.ncsu.edu (Joseph N. Hall) (08/30/89)
The following items reflect behavior in the THINK class library that I think is incorrect. I haven't explored all of the possible ramifications of "correcting" these, and it is entirely possible that Rich or Gregory might be able to explain them away to my satisfaction. 1. SetFontName() and SetFontSize() should be overriden in CEditText.c so that the font and size menus are updated whenever the font name or size is changed. Workaround: create and issue menu commands that simulate menu selections, since menu selections DO update font name and size menus. Alternatively, set the font and size of the owning window's macPort before creating the EditText object, since the font and size of the object are derived from the window's macPort. 2. When a panorama has been scrolled to its bottom (or very nearly), and the scroll pane enclosing the panorama is resized so that it is larger, the panorama is not scrolled up so that it extends to the new, lower bottom of the scroll pane. Instead, extra area is left at the bottom of the pane until the panorama is scrolled up far enough. I have seen this behavior in some applications before, but I don't think it is correct. 3. Furthermore, the panorama in the situation above will receive a request to redraw an area which is out of its bounds, i.e., the extra space at the bottom. Workaround: you must check area.bottom before you Draw() if this could be a problem. 4. Having the option of processing activating clicks is nice. However, it appears that controls within a window aren't activated until after the click that activates the window is processed, so they are immune from the effects of the activating click. Pretty obnoxious behavior. 5. When a new window is created atop a window that contains activated controls, those controls aren't deactivated. I don't consider the following items bugs in the library or in THINK C, but I offer them for comment: 1. I would like to be able to add form feeds to source documents (in the editor) and have them determine page breaks during printing. 2. It would be nice to have a scroll bar that implemented the equivalent of a TrackControl function for the thumb, so that the "live" thumb dragging available on the NeXT, etc., could be implemented. 3. It is not well documented that all views enclosing a view that wants to service clicks (for example, a control) must "want clicks," although this is certainly reasonable and correct behavior. v v sssss|| joseph hall || 4116 Brewster Drive v v s s || jnh@ecemwl.ncsu.edu (Internet) || Raleigh, NC 27606 v sss || SP Software/CAD Tool Developer, Mac Hacker and Keyboardist -----------|| Disclaimer: NCSU may not share my views, but is welcome to.
james@utastro.UUCP (James McCartney) (08/31/89)
In article <3812@ncsuvx.ncsu.edu>, jnh@ecemwl.ncsu.edu (Joseph N. Hall) writes: > > 2. It would be nice to have a scroll bar that implemented the equivalent > of a TrackControl function for the thumb, so that the "live" thumb > dragging available on the NeXT, etc., could be implemented. > I did this in my own object library : HThumbScroll(this, cntl, where) hFrame this; ControlHandle cntl; Point where; { int pix; int value; long valrng, pixrng, vdown; Point mdown, mse; Box limits; /* normal way to do a thumb : TrackControl(cntl, where, NIL); value = GetCtlValue(cntl); Send(this, mPutOrigin, value, This.origin.v, true); */ /* fancy a la NeXT way : */ valrng = GetCtlMax(cntl) - GetCtlMin(cntl); pixrng = (**cntl).contrlRect.right - (**cntl).contrlRect.left - 48; mdown = where; vdown = GetCtlValue(cntl); limits = This.fbox; while(StillDown()) { FocusParent(this); GetMouse(&mse); pix = mse.h - mdown.h; /* calc control value : */ value = vdown + pix * valrng / pixrng ; /* move origin of frame, scrollrect contents */ Send(this, mPutOrigin, value, This.origin.v, false); /* keep track of update region */ HLock(this); SectRect(&limits, &This.fbox, &limits); HUnlock(this); } Focus(this); UpdateHandLimits(this, &limits); } Some of the above is probably not intelligible without seeing the rest of the code. but you get the general idea. I spent about 10 minutes looking at how to do it in the THINK class library before moving on to other things. --- James McCartney