For custom controls, the standard approach would have been to write your own CDEF (control definition function resource). See the Control Manager chapter of Inside Macintosh Volume I. This is a nontrivial exercise though.
For progress bars, one would probably just use QuickDraw to draw and update the thing on the screen, or implement a custom draw procedure for a dialog box userItem. See the section on ”user items” in the Dialog Manager chapter of Inside Macintosh Volume I (the upshot is, you use SetDItem and replace the handle argument to that trap with a pointer to a procedure you want to draw the item whenever appropriate).
Some of these types of widgets may have been supported by either MacApp or the THINK Class Library, the two primary development frameworks that emerged by the early ‘90s, but I didn’t use either much myself and don’t think that’s the direction you want to go anyway.
Nice thread exactly on point in what I find myself needing today.
I'm working on an app called FireJam that lets you use these inputs:
* Typing keyboard
* MIDI in (possible thanks to a great quality help I got from here in 2024)
* Mouse click and hold
Leading to these outputs:
* MIDI out
* All 3 variants of the Sound Driver
* Hopefully a real time mix of the freeform buffer with polyphony
My current wish is to reverse highlight the note graphics as they are interacted with and i thought I'd make a Code Resource of a note shape in a rectangle. I read and tried to dig in these materials:
* Original Inside Macintosh vol 1
* Later inside macintosh : control manager
* Think C primer vol 1 and 2
* Ultimate Mac Programming
None carry you all the way with all the steps needed in both ResEdit and Symantec C++ 6.0 which I'm using.
I know I have to:
* Set the project type to code resource
* Set the signature type to either CODE or CDEF
* Set the main function as pascal long main
* Deal with a switch with a short variable to deal with all cases associated with controls
* Add the built resource to my main project's resource fork either as a CDEF directly or a CODE
* Use a ControlHandle with a procID of 16*CDEF_id + variantNb
After all is said and done, I should have 7 rectangles representing my crude octave (white notes only for now) but all I get is a large rounded rectangle surrounding the area I wanted my first test in, as if it reverted to a single normal button.
Questions:
1) must I build a CODE and then resedit-make a CDEV with 0000 0080 (to link it to is 128) or do I build a CDEV directly?
2) should I have used empty text labels with programmed click behavior and bypassed all this mess instead to get my rectangular shapes? And call a FrameRect on their updating?