======================================================================= Archived Messages: "Control Manager" America Online Apple II Developers Forum. Go Keyword ADV! (C) 1992. ===================================================================jrm= This topic is for the discussion of the Apple IIGS Control Manager (tool set #16). Type: Response From: ScottG25 Date: 88-04-19 18:30:46 EST 88-04-19 18:30:46 EST CC: SYSOP jim Re: ntrol Manager Hi! Does anyone out there know how to define a custom control? I'd like to be able to define some custom ones that will fit in with the Human Interface Guidelines, for use in a program that I'm writing! Thanks much! Type: Response From: MDavis Date: 88-04-19 23:02:29 EST 88-04-19 23:02:29 EST CC: SYSOP jim Re: Re: Control Manager It certainly can be done. What are you having trouble with? Type: Response From: ScottG25 Date: 88-04-22 20:29:19 EST 88-04-22 20:29:19 EST CC: SYSOP jim Re: Re: Control Manager I need to know if using the control manager is: 1. Better that using the UserCtlItem in the Dialog Manager? 2. If it is better (ie more flexible, easier to implement), does the drawCtl message return to my definition procedure for the actual drawing-(I've tried to draw using Quickdraw calls, and nothing seems to happen--also tried bit-maps, to no avail)..I have the docs for the Toolbox, but they're kind of sketchy, and have found no source (either through APDA, books, BBS's, and other online services....Help!!! Type: Response From: MDavis Date: 88-04-22 22:40:22 EST 88-04-22 22:40:22 EST CC: SYSOP jim Re: Re: Control Manager One of the first problems you encounter in drawing with QDraw is getting used to the fact you're drawing in a port. If the port isn't set where you want it (use SetPort), you could be drawing out into space. Also, drawing into a window won't make it part of the window definition unless you turn on the tape recorder (BeginUpdate), and then turn it off when done (EndUpdate). FYI, you probably already know that anyway. Type: Response From: ScottG25 Date: 88-04-23 12:38:37 EST 88-04-23 12:38:37 EST CC: SYSOP jim Re: Re: Control Manager Yes, I did know that..:) The calls to QdII that I'm using do work when going to "standard Modal Dialog", so the port setup is not really the problem. I think perhaps I need a simple example to get the ball rolling (of Custom Control implementation). If you could help, I would heap praise on you till you: 1. Tell me to stop... 2. Die. Thanks for your help! Type: Response From: ScottG25 Date: 88-04-23 12:44:51 EST 88-04-23 12:44:51 EST CC: SYSOP jim Re: nager Oh, yeah...So I am on the right track in using QDII calls(I did use the BeginUpdate and stuff)? Type: Response From: ScottG25 Date: 88-04-23 12:54:42 EST 88-04-23 12:54:42 EST CC: SYSOP jim Re: Re: Control Manager BTW..I've got your book..It is really GREAT!! It's helped me do things that the final and beta Toolbox refs have been sketchy on..Keep up the good work!! Type: Response From: ScottG25 Date: 88-04-28 18:52:29 EST 88-04-28 18:52:29 EST CC: SYSOP jim Re: Re: Control Manager Jeez..I hope I didn't make anyone angry!!! I'm really confused here...HELP, Someone!!! Type: Response From: MDavis Date: 88-04-28 22:36:00 EST 88-04-28 22:36:00 EST CC: SYSOP jim Re: Re: Control Manager Sorry, Scott. I've somehow missed your messages as of recent. Chalk it up to this weird software we have to use here where you're responsible for hunting down new messages (based on the dates and your good memory). To recap, you need an example of a custom control right? Type: Response From: JSchober Date: 88-04-29 18:23:26 EST 88-04-29 18:23:26 EST CC: SYSOP jim Re: Re: Control Manager BTW, Morgan... ditto Scott's comment on your book -- great reading!! The VERY complete summary of the Toolbox calls given at the end has helped a lot... nice job!! Type: Response From: ScottG25 Date: 88-04-29 21:22:33 EST 88-04-29 21:22:33 EST CC: SYSOP jim Re: Re: Control Manager Yes, sir!! Thank you very, very much for finding this string again...Scott Gentry Type: Response From: MDavis Date: 88-04-30 11:23:04 EST 88-04-30 11:23:04 EST CC: SYSOP jim Re: FIELD OVERLOW Scott, just what kind of custom control are you trying to create? A dial, a button? Can you give a description of what you're after? Type: Response From: ScottG25 Date: 88-04-30 22:00:57 EST 88-04-30 22:00:57 EST CC: SYSOP jim Re: Re: Control Manager Basically, a custom slider, something similar to what appears in the Apda Demo programs, only larger and with better control. The slider should conform to the Human Interface Guidelines in appearance (i.e. color, etc..) and ease of use. I was thinking along the lines of a thermometer. Is that enough info? If you need more, please let me know. BTW-If I don't respond to posts for a couple of days, I'm out of town on business..I should be back by Thursday, at the latest....Thanks again...Scott. Type: Response From: MDavis Date: 88-05-01 18:35:39 EST 88-05-01 18:35:39 EST CC: SYSOP jim Re: Re: Control Manager The two examples I can think of that sound like they might be what you're after are the sliding volume and speed controls in the Sound Studio demo program (here on this system), and the color controls in WordPerfect. A thermometer is usual an "output only" gauge to show some kind of range. But the volume control on the Macintosh's control panel is kind of a variation. Type: Response From: ScottG25 Date: 88-05-01 21:20:35 EST 88-05-01 21:20:35 EST CC: SYSOP jim Re: Re: Control Manager Thanks again, Morgan--I can call you Morgan, can't I? I'm not so much interested in the actual controls shape as I am in the procedure to define the control...As I said in earlier posts, I've tried using QdII calls in the "definition procedure" and have no luck--the program hangs at the specific section where the definition procedure is drawing to the active window. So, if I could get hold of some source that would define ANY custom controls implementation, I could take it from there...BTW-I have every piece of source from APDA (the Demo programs) and the nearest thing I can find to custom controls implementation is the Paint program. Alas there, if memory serves, the guy wrote his own "Control Manager"...I'll look at it again, tho I think I'm correct. Thanks Again, Morgan.. Scott Gentry Type: Response From: Brendan Hr Date: 88-05-03 18:04:44 EST 88-05-03 18:04:44 EST CC: SYSOP jim Re: Re: Control Manager Hows the progress on your program going, Scott (Gentry)? Type: Response From: MDavis Date: 88-05-03 20:26:36 EST 88-05-03 20:26:36 EST CC: SYSOP jim Re: Re: Control Manager Scott, you may call me Morgan if I may call you Scott. (Dontcha love protocol?) BTW, what language are you using? Perhaps I can try to piece something together real quick. I've been using standard controls for most of my programs (haven't needed to do a custom one yet). Type: Response From: ScottG25 Date: 88-05-04 17:45:12 EST 88-05-04 17:45:12 EST CC: SYSOP jim Re: Re: Control Manager Brendan...The programs coming along just fine, though with my travel schedule, I'm having problems finding time to add more than a simple function at a time. The travel should smooth out now that Philadelphia is fixed (I hate patching stuff). Morgan, I'm using assembler (APW flavor), and I would really appreciate anything you could piece together for me as this Control Manager thing is starting to hold up progress on my program! Thanks in advance!! Scott :) Type: Response From: Brendan Hr Date: 88-05-09 19:18:54 EST 88-05-09 19:18:54 EST CC: SYSOP jim Re: Re: Control Manager Still curious about the Control Manager problem...find out any more, Scott? Anyway...did we lose any topics from this area? Seems to me we had an extra screen before... Type: Response From: AFL Jim Date: 88-05-09 22:09:01 EST Re: Re: Control Manager Brendan, I'm doing a little cleanup this week to get rid of the "dead" topics throughout this forum. Before we started beta testing, we (the forum leaders) seeded our forums with lots of topics to give everyone an idea of where to start. Now that things are moving, we're cleaning up after ourselves. Jim Type: Response From: ScottG25 Date: 88-05-09 23:22:58 EST 88-05-09 23:22:58 EST CC: SYSOP jim Re: Re: Control Manager No, still progress is at a standstill. I tried the code you put up on TAP for me, still no go...Thanks!! I really appreciate it!!!:)... Seems to me, the FL moved out topics that hadn't had too much response. Thanks again, Brendan!! Type: Response From: Brendan Hr Date: 88-05-10 18:31:07 EST 88-05-10 18:31:07 EST CC: SYSOP jim Re: Re: Control Manager Well, I tried...have you sent the question to Apple CR, yet? Type: Response From: ScottG25 Date: 88-05-10 19:46:44 EST 88-05-10 19:46:44 EST CC: SYSOP jim Re: Re: Control Manager Yepper!! I don't know what to do now. They are going to try to answer the question, though Apple CR wasn't set up to answer questions this technical in nature. I really appreciate them trying. This might be one of those things that has to be fudged a bit. Thanks again, Brendan :) Type: Response From: Mensch72 Date: 88-05-17 01:02:00 EST 88-05-17 01:02:00 EST CC: SYSOP jim Re: l Manager If this is still about defining custom controls, Apple will be releasing a tech note on how to do it shortly ( I sit next to the guy who wrote it ). I will ask him if I can post an early version of it here. Jim Type: Response From: ScottG25 Date: 88-05-17 17:51:01 EST 88-05-17 17:51:01 EST CC: SYSOP jim Re: Re: Control Manager Jim, Thanks! I'd appreciate it! Type: Response From: Mensch72 Date: 88-06-04 23:49:59 EST 88-06-04 23:49:59 EST CC: SYSOP jim Re: Custom Control technote Well, Keith finished the custom control tech note. I will post it on monday ( also comes with a full custom control sample code ). By the way, minor documentation error in the toolbox manual regarding control color tables. In the 640 mode the manual says that only 2 bits of the value are used for control colors. This is not the case, if you want color 1 then you must set the nibble to 5 ( thats 0101 !) Jim. Type: Response From: DougDavies Date: 89-01-02 18:44:06 EST Re: Re: Sizing control What is the proper way to resize a control. I want to resize a scroll bar everytime the window changes size. A LONG time ago there use to be a tool call SizeControl (In Apple IIGS technical reference). It doesn't seem to exist anymore. Do I just go into the control record and change it there? Thanks, Doug Davies Type: Response From: Dave Lyons Date: 89-01-02 20:19:15 EST Re: resizing a scroll bar Doug, you could always dispose of the control and create another one just like it but with a different size. I don't know if there is a better way to do what you want or not. A _safe_ way, I mean. Type: Response From: AFL Jim Date: 89-01-02 23:46:33 EST Re: Updating the Scroll Bar Doug, Use the SetCtlParams and pass it the scroll bar's view and data size. The scroll bar will be redraw if needed. Jim Type: Response From: Dan Burton Date: 89-01-03 12:27:20 EST Re: Re: Resizing control Jim, I understand how to set the data and view sizes. What I need to do is change the BoundsRect for the control (the size of the control changes, not what it represents), you know like in task master when you make a window bigger the scroll bars become bigger to fit in the window appropriately. There use to be a call to do this. And I tried just changing the BoundsRect in the control record, but that didn't work, some other things need to be changed. It looks as if Dave is right, that you have to delete the control and then create a new one with the correct BoundsRect size. Doug Davies Type: Response From: AFL Jim Date: 89-01-05 01:40:08 EST Re: Re: Control Manager Doug: I realized we were talking about two different things at the meeting last night. Type: Response From: PGauthier Date: 89-01-18 23:21:00 EST Re: Re: TrackControl I'm having trouble using TrackControl in a Modal Dialog event loop. The code listed below is supposed to create a Modal Dlog box, draw some text and two buttons, then play music until the user presses (and releases) the mouse button inside one of the buttons. Then we close the Dialog box. What sometimes (not always) happens is: 1: User presses mouse button in the Ok button. 2: Button flashes on. 3: Button flashes off. 4: User release mouse button (still inside Ok button). 5: Nothing happens. TrackControl is sometimes acting as if the cursor was moved outside the Ok button between pressing and releasing the mouse button. Here's a summary of the (TML) code: SetRect(r,...); pDlog := NewModalDialog(r,true,0); SetPort(pDlog); SetRect(r,...); NewDItem(pDlog,1,r,buttonItem,@'Ok',0,0,nil); SetRect(r,...); NewDItem(pDlog,2,r,buttonItem,@'Cancel',0,0,nil); DrawDialog(pDlog); repeat { Play music until EventAvail($0402,event) is true } { $0402 = desk Acc. and mouse down events } itemHit := 0; if GetNextEvent($0402,event) then if event.what = mouseDown then begin itemHit := FindDItem(pDlog,event.where); if itemHit > 0 then begin theControl := GetControlDItem(pDlog,itemHit); thePart := TrackControl(event.where.h,event.where.v, nil,theControl); if thePart = 0 then itemHit := 0; end end until (itemHit = 1) or (itemHit = 2); CloseDialog(pDlog); Can anyone tell me what's wrong? BTW, I also have a regular window with a button and TrackControl works fine with that. Any help would be appreciated. Paul Gauthier Type: Response From: Dave Lyons Date: 89-01-19 04:05:58 EST Re: Let ModalDialog handle it! Paul, I can't explain specifically what's wrong with your code, but the usual way to handle a Modal Dailog is to let the ModalDialog call handle all the work for you! No need for DrawDialog or TrackControl or anyting: SetRect(r,...); pDlog := NewModalDialog(r,true,0); SetPort(pDlog); SetRect(r,...); NewDItem(pDlog,1,r,buttonItem,@'Ok',0,0,nil); SetRect(r,...); NewDItem(pDlog,2,r,buttonItem,@'Cancel',0,0,nil); itemHit := ModalDialog(nil); CloseDialog(pDlog); If you need to execute any code while waiting for a button to be hit, then you'll need to pass a pointer to a "filter proc" to ModalDialog (see discussion in the DialogManager folder). --Dave Type: Response From: PGauthier Date: 89-01-22 09:53:51 EST Re: Re: Let ModalDialog Handle It. Hmmmm... I thought the purpose of the filterProc was to handle special events (like hitting the arrow keys) or to make one event look like another (as in making <.> look like clicking in the cancel box). I must be missing something here. What I want to do is to play music UNTIL the user presses a button, not in response to pressing a button. If ModalDialog calls the FilterProc only when an event occurs, then how will my FilterProc routine get control to play its music before the user has done anything? If there's a way to use ModalDialog and still have control of the cpu for music, animation, etc. I'd like to learn about it since it's a pain to write a mini-TaskMaster inside all my dialogs. Thanks, Paul Type: Response From: Dave Lyons Date: 89-01-22 18:30:53 EST Re: when filterprocs are called Paul, I _think_ your filterproc gets called even when a "null event" happens (that is, even when nothing interesting like a keypress or a click happens). I could be wrong about that. Type: Response From: PGauthier Date: 89-02-10 21:56:47 EST Re: Re: Track Control Well, I figured out what was wrong with the event loop code back there. By changing the $0402 to $0406 (add mouse-up events) the event loop works as it should. Apparantly TrackControl was matching up a mouse-down event with a previous mouse-up in a different place and thought the mouse was moved outside the button Type: Response From: Coach101 Date: 89-03-29 21:16:53 EST Re: 32 Bit Scroll Bar Values In an item in the Window Manager folder Doug Davies posted a letter from Eric Soldan (Apple II Developer Tech Support) that dealt with using user generated scroll bar controls in a window to overcome the 0-$3fff limitation of TaskMaster/WindowManager window scroll bars. In the letter Eric stated "... scroll bar position can be a 4-byte value, thereby giving you an incredible range of actual values, ...". I have looked through the tool box reference and I do not see how to do this. It looks to me like the view and data sizes for a scroll bar are "word"s (as in 16 bits). How do I get the 32 bit values mentioned by Eric? Type: Response From: DaviesDoug Date: 89-03-30 20:37:46 EST Re: Re: Control Manager Hmmm.....didn't realize that. Guess Eric was wrong. Type: Response From: Coach101 Date: 89-04-01 13:53:00 EST Re: DrawControls & DrawOneCtl I have been implementing a vertical scroll bar to get past the $3FFF limitiation of TaskMaster's scroll bars. In my content draw routine (invoked by TaskMaster) I check the current bottom of the scroll bars bounds Rect and if it is appropriately set to fill the screen (vertically, that is), I HideControl, DisposeControl, and NewControl; all of this is avoided if the scroll bar is the correct vertical size. In any event, if the horizontal limits of the visRgn encompass any part of the scroll bar I call DrawOneCtl. The way I expected this to work was that if the scroll bar needed updating (i.e., the horizontal limits included the scroll bar) I would conditionally execute code to build a new control (when its size had changed) but in all cases call DrawOneCtl to get the obliterated parts of the control back in view. What happens is that whenever I change the size of the window, I get a nice scroll bar that is as correctly placed as I can get it (without playing with some of the WindowManager's stuff I can not seem to avoid some "double bounding lines" that TaskMaster does not have). However, if I just need to update the visual appearance of the scroll bar (i.e., get some parts that have been previously obscured by another window redrawn), I get what appears to be the enclosing rectangle re-drawn but NOT the interior parts (i.e., no thumb, no crosshatch, no arrows, no line between arrows {which are not there anyway_} and thumb area). However, sometimes (not frequently and I do not have a handle on the triggering conditions) the material is redrawn correctly. I have placed window and grafport dumping code in and everything seems correct. I have placed more code around the DrawOneCtl call and I know it is being called and passing the correct control handle. Anyone have any ideas? BTW Doug, In his letter to you Eric also mentioned windows with pixel heights of 1,000. Interesting? Type: Response From: Matt DTS Date: 89-04-01 23:24:44 EST Re: Re: Control Manager The gist of Eric's formerly-private message to Doug was that if you don't let TaskMaster do everything for you, you can handle it yourself however you want. Just because the value in the control or window record is two bytes doesn't mean you can't use your own four-byte value somewhere else as long as you're not expecting the system to keep it for you... --Matt Type: Response From: Coach101 Date: 89-04-02 00:07:04 EST Re: 16/32 Bit ScrollBar Values It took your message to shake reality back into me. Given that the screen has a resolution of 640 (best case) anything more than 10 bits would mean that the value is truncated/rounded before being visually displayed. Ergo, I could use a 64 bit value internally if I wanted. Just think of how long it could take a user to get from one end to the other a "count" at a time. Type: Response From: Coach101 Date: 89-04-02 00:14:06 EST Re: Missing ScrollBar Updates In my content draw routine, I first update the ScrollBar (via either DrawOneCtl or DrawControls, both exhibit the same behaviour) and then I shrink the grafport's portRect.h2 by the width of my vertical scroll bar. Now I do any updates that are needed to the data area and then, before leaving the content routine, I restore the grafport's portRect.h2 to the value it contained on entry to the content draw routine. The problem must have something to do with the portRect.h2 games; when I pull the code that deals with portRect.h2 the scroll bar is correctly updated; of course my content draw material makes mincemeat of the scroll bar also. I shall pursue the "h2" restoration code further. Type: Response From: Coach101 Date: 89-04-02 16:23:20 EST Re: Stumped...... When I pull the code that manipulates the portRect (as per Eric Soldan's suggestions) things go south. I inserted "printf"s before and after the DrawOneCtl call; the "printf"s look like: printf ("..... %d %d %d %d\n", GrafPort_->portRect.v1, GrafPort_->portRect.h1, GrafPort_->portRect.v2, GrafPort_->portRect.h2); GrafPort_ was previous set via "GrafPort_ = GetPort();". In all cases, the material from the "printf"s shows that the portRect is in its full state at the time of the DrawOneCtl call. It is almost as if, the actual drawing of the control is deferred until some other time (like maybe when I am doing other drawing and have the portRect shrunk). There is something basic thing about the control manager that I am not seeing. I had a similar problem with the dialog manager and reseting the "default" enhancements of a button item. For the time being, I have decided that sometimes missing control bar parts (as in when an obscuring window is closed/moved) are better than scroll bars obliterated by nearly every content update, so, thats the way I am leaving the program at present. Does anyone have any ideas as to what is happening to me? Is the "physical" drawing of the control's really delayed? Am I crazy? Did my parents forget to tell me my middle name was "Murphy"? Type: Response From: Coach101 Date: 89-04-05 20:17:37 EST Re: ScrollBar Update - More Info I have found what the trigger event is that causes the scroll bar to sometimes be redrawn correctly. First cause a window to obscure part of the scroll bar (either by opening a window whose original position impinges on the scroll bar, or by dragging an existing window to a position that impinges on the scroll bar). Now, if you drag the window off the scroll bar, then the scroll bar is not updated properly (i.e., its "enclosing rectangle" is drawn but the "parts" of the bar are not). However, if you close the window while it is still impinging on the scroll bar, the update goes perfectly (i.e., all obscured parts of the scroll bar are redrawn). I have stared at my code till I am blue in the face and cannot find the bug. Does anyone have any suggestions? Can anyone explain the difference, with respect to "updating" an obscured window, between moving and closing the "obscuring" window? Type: Response From: Dave Lyons Date: 89-04-06 23:42:31 EST Re: scroll bar updating I haven't had any insight yet, but I'll take a look at your code if you send-file-by-mail it to me. Type: Response From: AFL Dyfet Date: 89-05-28 11:48:18 EST Re: Re: Control Manager Subj: DragRect bugs? 89-05-27 18:47:12 EDT From: SkySinger Msgs: 1 (89-05-27) Anyone know of any bugs in the DragRect function of the Control Manager? It works fine for me if I use it to drag a rectangle, but if I set bit 2 in the dragFlag to indicate that it should do a rubber-band rectangle, it acts very eratic (seems to arbitrarily impose and remove constraints on the movement). --Thanks-- Type: Response From: Coach101 Date: 89-07-23 16:15:36 EST Re: CtlAction Procedures What calls can I legally make on the toolbox from within a control action procedure? In my case I have a scroll bar action procedure and need to know if its legal to call: ScrollRect, BeginUpdate, EndUpdate, GetPortRect, SetPortRect, assorted draw calls. Type: Response From: Dave Lyons Date: 89-07-25 22:55:20 EST Re: toolbox calls in action proc Coach, I think those calls are all fine. I don't know of any special restrictions, but you should probably put things back how they were, except for the things you changed on purpose. Type: Response From: LeonardB12 Date: 89-08-22 00:11:51 EST Re: Re: Custom Controls, Drawing I'm writing a program where I need some custom controls. I have two questions. First: Page 4-11 of the Toolbox Ref. gives the standard fonts that the control manager uses. It then innocently states, "If your would like to use different icons, you can replace the default font with the SetCtlIcons call..." So, what is the format required by an icon font and how does one create it. Second: What Quickdraw call are allowed when defining a custom control. The answer to these will probably decide the method I'll use. If it helps the program that I'm working on is for drawing flow charts. I'm creating some appropriate drawing tools that can be selected from a set of tools ala PaintWorks Gold, Deluxe Paint II, etc. Any help will be greatly apprecited. I've examined Apple's sample code for a sizer control put what I'm doing here is a little different. Thanks to whoever responses. Leonard. Type: Response From: JimMensch Date: 89-08-22 20:22:53 EST Re: Re: Control Manager len, make any quickdraw calls you want when you are a custom control, they are all allowed (except maybe startup and shutdown :) As to the previous question about what other calls you can make inside a control defproc. you definitely should NEVER call beginUpdate or EndUpdate, in most cases as far as drawing is concerned you will already be inside the update routine (you call draw controls in your update routine???) Also, you should remember that if you change the origin, you should reset it when you are done... Mensch Type: Response From: LeonardB12 Date: 89-09-01 16:59:15 EST Re: Re: Control Manager This is propably a simple question but I'm stumped. I have a simple button control in a window that has control bars. When the window scrolls the button scrolls with it. I want the button to stay at the same position on the screen while the content of the window scrolls under it. This has to be easier than my incorrect attempts to make it work. Anyone have any suggestions. Thanks, Leonard Type: Response From: Dave Lyons Date: 89-09-05 22:59:55 EST Re: keeping button from scrolling It shouldn't be too much trouble: mainly, you want to always have the window's origin set to (0,0) when dealing with your control(s). In particular, you want the origin to be (0,0) when you call DrawControls, FindControl, and TrackControl. This means you want to use SetPort rather than StartDrawing, since StartDrawing sets the origin of your window according to the window's scroll bars. (TaskMaster in System Software 5.0 has the ability to take care of FindControl and TrackControl automatically for you. You'll probably have to leave that feature turned off, since it's probably calling StartDrawing on your window first.) --Dave Type: Response From: LeonardB12 Date: 89-09-09 23:08:28 EST Re: Re: Non-scrolling buttons Dave, thanks for the help. I'm really snowed under at work right now but as soon as I get a chance to try out your suggestion I'll let you know how it worked. Seems simple enough. Thanks again. Type: Response From: Coach101 Date: 90-02-22 23:54:12 EST Re: Big Scroll Bars..... The following messages were moved from another folder.... ----------------------------------------------------------------- Subj: Help! Control Manager problems. 90-02-22 00:00:15 EST From: BrianG19 Msgs: 4 (90-02-22) Okay, I am trying to figure out how to do this: Im writing a word processor, and the vertical scroll tab needs to return values from say 1 to 30,000. I can't just open up a window and define it with a vertical scroll bar of a 30,000 depth because that would need about 10 megs of memory to hold. When I try adding a control scroll bar to the window, the program crashes every time I do a _DrawControls call or it doesn't do anything. Im following the ToolBox parms correctly, but it doesn't like it when I add a control item and try to draw it. It doesnt even crash with an error #, it just crashes into monitor. Any ideas? Is there another way to do it? -Brian ----------------------------------------------------------------- Subj: Lemme refine my question. 90-02-22 02:08:51 EST From: BrianG19 I can open up a window and do anything I like with it EXCEPT get Controls to appear. I go thru all of the init procedures for defining ANY kind of control, but I cannot get it to appear in the window (or anywhere else). If I call either the _DrawControls or _ShowControl tools from WITHIN the window's update routine, it crashes every time for unknown reasons. If I call those routines anywhere else in the program, they do absolutely nothing. What do I need to do in order to make the controls appear? -Brian ----------------------------------------------------------------- Subj: stuph 90-02-22 18:04:09 EST From: AFA Parik brian, what i said in email should hold thru. I can send you some source [in apw/orca] if you need thats a basic shell program. You may wanna pick up Toolbox Ref Vol #3 as it contains a toolset [TEXTEDIT] that makes word processing a BREEZE. in fact Chris Haun wrote a editor in NDA format called "WriteIt!" and he released the source code. I have it if ya want. A few hundred lines and you've got a full featured word processor! but again; the key is that taskmaster must be used and your updateevent mustn't use beginupdate/endupdate. make sure you pass the windowhandle, and make sure your taskmask [extended is best as it'll handle your controls for you] is #$1F_FFFF and your eventmask is $FFFF ----------------------------------------------------------------- Subj: Task Master 90-02-22 18:44:29 EST From: Joshua T6 TM might be a bit too limited for a word processor. I would suggest, Brian, using Task Master but intercepting events to the Text Edit control. That way you can have better control over it. TB ref III is a definite MUST HAVE. ----------------------------------------------------------------- Type: Response From: Coach101 Date: 90-04-08 00:17:34 EST Re: Square Buttons... The following messages were moved from another folder to here.. ----------------------------------------------------------------- Subj: Dialog question 90-03-18 17:55:19 EDT From: HaveGSPLUS Msgs: 6 (90-03-23) Are square,shadowed buttons a built in control? If it is a new built-in control, what is the number for it (and even other new controls)? David White ----------------------------------------------------------------- Subj: Square Buttons 90-03-18 18:40:31 EDT From: Markus Yes, Square Buttons have always been available. Use the simple button control template, and look at the Control Flag : ctlFlag |7|r|r|r|r|r|1|0| | reserved |_| / \ 1=invisible 11= Square, single outline, shadow 10= Square, single outline 01= Rounded, Bold outline 00= Rounded, single outline Hope this helps you out. Look up the Control Manager in the ToolBox Reference Manual for more detail. Mark ----------------------------------------------------------------- Subj: I don't have... 90-03-20 17:15:07 EDT From: HaveGSPLUS ...the official handbook, that's why I didn't know. Thanks, David White ----------------------------------------------------------------- Subj: Manuals 90-03-20 20:26:43 EDT From: Markus Yep, I'm hurtin because I don't have the GS/OS manuals.. it can be quite expensive to develop on a IIGS :( Well, at least its cheaper than a Mac. Mark ----------------------------------------------------------------- Subj: Controls.... 90-03-23 00:11:52 EDT From: JonahS Speaking of controls, is the thermometer that appears when you start the GS a standard control? My first thought would be no, but then I saw the came thing in SHR Convert and Fontasm and began to wonder. I haven't noticed it in any manuals, but that might just say something about my powers of observation. The only thing I could think of was that it was some kind of scroll bar that had had it's palette altered (?!?!) If anyone could help me out here I would really appreciate it! Thanks! Jonah ----------------------------------------------------------------- Subj: GS/OS 90-03-23 05:14:11 EDT From: Markus Lacking the appropriate manual, all I can tell you is that the thermometer is a GS/OS call :( Mark ----------------------------------------------------------------- Type: Response From: Coach101 Date: 90-04-08 11:23:24 EST Re: Setting Action Procedures.. The following messages were moved from another folder... ----------------------------------------------------------------- Subj: Extended controls 89-11-26 13:23:39 EDT From: SkySinger Msgs: 3 (89-12-13) With the new controls and the extended control record you can let TaskMaster take care of handling everything for controls it seems. However, how do you specify an action procedure for a control (eg. a scroll bar) when defining it? Since TrackControl is automatically called (with an action proc pointing at $FFFFFFFF according to the manual), how do I get it to deal with controls as I would do if I called TrackControl myself specifying an action procedure (such as one that responds to a continuous mouse down in a scroll bar arrow)? ----------------------------------------------------------------- Subj: Found the answer... :) 89-11-26 17:32:58 EDT From: SkySinger After creating an extended control called gTheScroll, I placed a pointer to its action procedure in the ctlAction field of the control's record. gTheScroll^^.ctlAction:=@ScrollAction ----------------------------------------------------------------- Subj: a better answer 89-12-13 01:08:10 EDT From: Dave Lyons Actually, you're not supposed to ever stuff something directly into the Control Record: use SetCtlAction instead! --Dave ----------------------------------------------------------------- Type: Response From: Sir AWGS Date: 90-04-12 23:52:47 EST Re: Once again... Why is there not a call to resize a control? I noticed that the new volume three specs call for a defproc message to allow the boundsrect of a control to be changed.... But its not supported by Apple's controls! I want to resize a scroll bar. I'm a multi-module program. I know that I'm supposed to automatically resize scroll bars that have a certain ID - but I don't know anything else - ( ie disposing of them might cause problems if the module is keeping the old handle around). I've been tinkering for a few hours know with changing the bounds rect directly. (NOTE: their are no control manager calls for getting the bounds rect or setting it!) and have been failing consistently. Why does SizeControl not exist? It does on the Mac. -Tom Type: Response From: AFA Gary J Date: 90-09-05 00:56:27 EST Re: Dragging icon controls--how? (moved) Subj: Dragging icon controls--how? 89-10-27 18:39:24 EDT From: BradL9 Msgs: 3 (89-11-25) I have created an icon control and would like to be able to drag it around the window. Do I need to use DragControl? If so, where would it go? Could TrackContol be made to drag it? I have been able to drag custom controls but don't see how to do a defined control. BradSubj: draggin controls 89-11-16 21:55:05 EDT From: KevinSSSi The easiest way is to call DragControl. Better yet, call DragRect using a better dragpattern, and then call MoveControl. KSSubj: Need more info 89-11-25 08:44:08 EDT From: BradL9 Thanks for the reply Kevin. Where would you put the DragRect if the control is not a custom control? If the control is an icon button, task master is in control while the mouse button is down and you don't return until the button is released. With the custom control you can put the DragRect in the custom definition procedure which is entered when the mouse button is down. Brad 9/4/90 10:48:54 PM Recording to "America Online Log" resumed.Subj: List Controls 89-11-12 20:58:11 EDT From: RobertH134 Msgs: 3 (89-11-19) Could someone please help me with the following code segment? I have a list control in a normal window, which also contains 5 simple buttons to enable the user to add, delete, or change items in the list. The list consists of a maximum of thirty names. TaskMaster handles the scroll bar (up,down,thumb,page) perfectly, but when I click inside the list to select a member, one becomes hilited, and when the mouse is moved (button NOT held down) the hiliting moves from member to member. It seems TaskMaster won't let go until I click outside the list control. It then returns part code 136. My Event.wmTaskMask is $001FFFFF I'm not sure what all this handles as I only have Toolbox refs 1 and 2. Any help would be greatly appreciated! procedure DoControl; var part : integer; theControl : CtlRecHndl; begin part := FindControl(theControl,mainEvent.wmwhere.h, mainEvent.wmwhere.v, WindowPtr(mainEvent.wmTaskData)); if theControl <> nil then begin part := TrackControl(mainEvent.wmwhere.h,mainEvent.wmwhere.v, nil,theControl); case part of noPart : {Do Nothing}; simplebutton : if (theControl = myDoneButton) then DoClose else if (theControl = myCancelButton) then begin changes := FALSE; DoClose; end else if (theControl = myDeleteButton) then DoDelete else if (theControl = myChangeButton) then DoChange else if (theControl = myAddButton) then DoAdd; end; end; end; Type: Response From: AFA Gary J Date: 90-09-05 00:58:08 EST Re: List Controls (cont.) (moved) Subj: Lists 89-11-16 21:50:22 EDT From: KevinSSSi make sure you are not dispatching this routine on BOTH a mousedown AND on a mouseup! K SSubj: Lists 89-11-19 17:18:02 EDT From: RobertH134 Thanks for your response KS, but I found my problem. I was calling TrackControl after obtaining a part code 136 from FindControl. No need to call TrackControl, TaskMaster hilites and I handle the necessary processing. RWH Type: Response From: SkipS Date: 91-01-10 23:14:32 EST Re: Trouble with Control and... Key Equivalents. Using the NewControl2 call, I can't get these to work. Can someone confirm that they do work with this call? I can get them to work using Resource Editor with Controls in the Window (TMLII) but even then it requires a Apple-key sequence. What I want to do is create a normal window that acts like a Diaglog Window and responds to the Return key as you'd expect. If you've done this with Pascal (TML or ORCA) please show me how! Thanks, Skip Type: Response From: Surak TFF Date: 91-01-11 19:02:12 EST Re: Well... I did it with Pascal, but to do it I first had to create the control with a resource and then directly modify the control record - I had the key equivalent (RETURN, for the Convert button in TFF Base Converter) in the resource, but it simply would not work. I'll look and find out how I did it, and cut out the piece of code and post it up here :) Dan Type: Response From: Damien9 Date: 91-01-11 19:07:02 EST Re: Return key Equiv. I had it work in Orca/C, using Genesys to generate Rez source code for my resource fork. I did not need to modify the control record at all, I just used NewControl2. One thing I did find, however, is that you must make _sure_ the correct bits in the Taskmask are set, otherwise they won't work. If you want an example in C, let me know... Jeff Type: Response From: SkipS Date: 91-01-12 00:11:15 EST Re: TaskMask? Could you post what you used for the TaskMask? I've tried nearly every combo I can think of and it had no effect. Also, in creating a template for the newControl2 call, what did you use to define the type for the key equivalents? I've tried using CHAR, BYTE and INTEGER with the same result... zilch! I think BYTE is proper but, when something doesn't work, everything is suspect. Thanks, Skip Type: Response From: Matt DTS Date: 91-01-18 22:57:27 EST Re: A sample I'm pasting below Rez source directly from Fidgeter. It has real tabs in it, but AOL should filter them out: ------------------------------------------------------------------ resource rControlTemplate (0x6) { 6, /* Control ID 6 */ {45,150,NIL,NIL}, /* Control rect */ RadioControl {{ /* Radio button control proc */ 1, /* Visible, family 1 (flags) */ fCtlWantsEvents+fCtlProcNotPtr+RefIsResource, /* more flags */ NIL, /* refcon */ 0x1006, /* Title reference */ NIL, /* Initially not selected */ NIL, /* No color table */ {"6","^",0x2000,0x3000} }} /* Key equivalents "6" and "^" but only if the keypad bit is down! */ }; Key 1 is the "6" key, and key 2 is the "^" (shift-6) key. The modifiers are set to $2000 for keyModifiers and $3000 for keyCarebits. This means that the keypad bit must be set for this test to pass. Try playing around with it some to see. (Toolbox Reference Volume 3, page E-12.) As for the TaskMask, if you want control key equivalents to work you *must* set bit 17 to 1. If this bit (tmControlKey) is not set, TaskMaster does not pass key-down events to controls (by calling SendEventToControls) and the controls then can't possibly respond. --Matt