FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

SYSTEM

Work with the Appearance Manager


Does anyone know if FB^3 is Appearance Manager savvy?

I've been trying to convert some Appearance Manager code to FBII and have run into trouble. For instance, tabbed windows are a nice Appearance Manager feature. But they use a new "tab#" ResEdit resource. Since TAB is a reserved word in FBII, it's difficult to call the "tab#" resource. (I noticed at Staz lounge that FB^3 uses tabbed windows, but I'm not sure if they are custom made or called from Appearance Manager.)

I threw together this little demo to show Appearance Manager's potential. Before I get flamed, I confess that the button use below is neither FB or Apple compliant. I realize you don't call the new Appearance Manager group box with a BUTTON statement. Also, the button 47 use is not proper radio button protocol. In fact, the whole thing busts if you don't built the window invisibly as in this code. This is just to give you an idea of the neat new 3-D Toolbox effects.

If you want the nice Apple compliant, refreshable mid-gray window background, you need to convert the small BinHexed "wctb" resource I tacked onto the end of this message. Otherwise, REM out the resource call in the code below. It works but ain't as pretty. (The BinHexed resource is small enough that I hope no one minds the extra bandwidth.)

You need be running Appearance Manager for this to work (System 8.0 or above).

I recommend you download Apple's Appearance Manager software development kit. It's a 3.8 meg file, but includes a wonderful 500k demo of many of Appearance Manager's new features that will leave you drooling. (Be sure to check out the various menu functions!) If you would just like to look at the official Apple demo without downloading the entire file, e-mail me offline. The file also includes the latest edition of Appearance Manager, v. 1.0.4, which fixes some major bugs. You can download it at:

ftp://ftp.apple.com//devworld/Development_Kits/Appearance_SDK_1.0.4.sit.hqx

The Apple download includes a Resourcer file with the new Appearance Manager templates. If you only have ResEdit, you can modify it to include the same templates with this file:

http://hyperarchive.lcs.mit.edu/HyperArchive/Archive/dev/resedit-appearance-tmpl.hqx

Again for the record: I don't know anything about Appearance Manager, but sure would like to. Any and all suggestions are appreciated.

Stand alone demo follows:
'------------------ Resources ----------------
RESOURCES "appearance.rsrc"

'------------------ Globals ------------------
DIM gProgramEnds
END GLOBALS

'------------------ Functions ----------------
CLEAR LOCAL
DIM rect.8
LOCAL FN mainBuild
   WINDOW # -1,"",( 5, 42)-( 450, 400),_docNoGrow
   wPtr&=WINDOW(_wndPointer)
   cTabHand&=FN GETRESOURCE(_"wctb",128)
   LONG IF cTabHand&
     err%=FN HLOCK(cTabHand&)
     CALL SETWINCOLOR(wPtr&,cTabHand&)
     err%=FN HUNLOCK(cTabHand&)
   END IF

   APPLE MENU "(Appearance Tester Demo"

   MENU 1,0,_enable,"File"
   MENU 1,1,_enable,"Quit/Q"

   EDIT MENU 2

   COLOR = _zRed
   TEXT _times,30
   EDIT FIELD -1,"Appearance Demo",( 0, 19)-( 440, 49),_statNoFramed,
_centerJust

   COLOR = _zBlack
   TEXT _geneva, 9, 0
   BUTTON 1, 1,"Button 1",( 20, 159)-( 190, 179),47
   BUTTON 2, 1,"Button 2",( 20, 179)-( 190, 199),47
   BUTTON 3, 1,"Button 3",( 20, 199)-( 190, 219),47
   BUTTON 4, 1,"Button 4",( 20, 219)-( 190, 239),47
   BUTTON 5, 1,"Button 5",( 20, 239)-( 190, 259),47
   BUTTON 6, 1,"Button 6",( 20, 259)-( 190, 279),47
   BUTTON 7, 1,"Button 7",( 20, 279)-( 190, 299),47
   BUTTON 8, 1,"Button 8",( 20, 299)-( 190, 319),47

   BUTTON 9, 1,"Quit",( 350, 307)-( 410, 329),_shadow

   BUTTON 10, 1,"Test",( 220, 150)-( 410, 280),165'Appearance Manager
group box (this is definitely an improper call)

   EDIT = 3
   TEXT _geneva, 10 , _boldBit%
   EDIT FIELD 2,"Odd Button Test",( 40, 75)-( 170, 95),_statNoFramed,
_centerJust
   EDIT FIELD 3,"Even Button Test",( 250, 75)-( 375,
95),_statNoFramed, _centerJust

   TEXT _geneva, 10, 0
   BUTTON 11, 0, "Press buttons to test",( 20, 95)-( 190, 120),47
   BUTTON 12, 0, "Press buttons to test",( 230, 95)-( 395, 120),47

   WINDOW #1

END FN

LOCAL FN radioGroup (btnClicked, first, last)
   FOR btnNum = first TO last
     LONG IF BUTTON(btnNum) = _markedBtn
       BUTTON #btnNum, _activeBtn
     END IF
   NEXT btnNum
   BUTTON #btnClicked, _markedBtn
END FN

LOCAL FN blinkBtns

   FOR count = 1 TO 3
     BUTTON 11, 1,"Not me, press buttons below!"
     DELAY 550
     BUTTON 11, 0,""
     BUTTON 12, 1,"Not me, press buttons below!"
     DELAY 550
     BUTTON 12, 0,""
   NEXT count
   BUTTON 11, 0,"Ready for test"
   BUTTON 12, 0,"Ready for test"
END FN

LOCAL FN doDialog
   evnt = DIALOG(0)
   id = DIALOG(evnt)

   SELECT evnt
     CASE _wndClose
       SELECT id
         CASE (1)
           WINDOW CLOSE #1
           gProgramEnds = true
       END SELECT
     CASE _btnClick
       SELECT id
         CASE(1)
           FN radioGroup(1, 1, 8)
           BUTTON 10, 1,"Odd number Button 1"
           BUTTON 11, 1,"Odd number Button 1"
           BUTTON 12, 0,""
         CASE(2)
           FN radioGroup(2, 1, 8)
           BUTTON 10, 1,"Even number Button 2"
           BUTTON 11, 0,""
           BUTTON 12, 1,"Even number Button 2"
         CASE(3)
           FN radioGroup(3, 1, 8)
           BUTTON 10, 1,"Odd number Button 3"
           BUTTON 11, 1,"Odd number Button 3"
           BUTTON 12, 0,""
         CASE(4)
           FN radioGroup(4, 1, 8)
           BUTTON 10, 1,"Even number Button 4"
           BUTTON 11, 0,""
           BUTTON 12, 1,"Even number Button 4"
         CASE(5)
           FN radioGroup(5, 1, 8)
           BUTTON 10, 1,"Odd number Button 5"
           BUTTON 11, 1,"Odd number Button 5"
           BUTTON 12, 0,""
         CASE(6)
           FN radioGroup(6, 1, 8)
           BUTTON 10, 1,"Even number Button 6"
           BUTTON 11, 0,""
           BUTTON 12, 1,"Even number Button 6"
         CASE(7)
           FN radioGroup(7, 1, 8)
           BUTTON 10, 1,"Odd number Button 7"
           BUTTON 11, 1,"Odd number Button 7"
           BUTTON 12, 0,""
         CASE(8)
           FN radioGroup(8, 1, 8)
           BUTTON 10, 1,"Even number Button 8"
           BUTTON 11, 0,""
           BUTTON 12, 1,"Even number Button 8"
         CASE(9)
           gProgramEnds = true
         CASE (11)
           BUTTON 11, 1,"Not me, press buttons below!"
           FN blinkBtns
         CASE (12)
           BUTTON 12, 1,"Not me, press buttons below!"
           FN blinkBtns
       END SELECT
   END SELECT
END FN

LOCAL FN doMenu
   menuID% = MENU(_menuID)
   itemID% = MENU(_itemID)

   SELECT menuID%
     CASE(1)
       SELECT itemID%
         CASE(1)
           END
       END SELECT
   END SELECT

   MENU
END FN

'------------------ Main ----------------
WINDOW OFF
COORDINATE WINDOW

ON DIALOG FN doDialog
ON MENU FN doMenu

FN mainBuild

DO
   HANDLEEVENTS
UNTIL gProgramEnds

'------------------ End -----------------
Following is the "appearance.rsrc" -- a ResEdit resource-- for the above demo in BinHex format. The resource is simply a wctb (window color) which sets the demo's window to a refreshable mid-gray.

-------- Begin BinHex snip ------------
(This file must be converted with BinHex 4.0)
:$f&`F'9KFQ&ZBf8ZFR0bB`"bFh*M8P0&4!#3#!&Q14-!N!3"!*!$!63!N!-d!*!
$-KT)ad(X!5T$l!$d-l"k!(S!-!G54lC(EZK#,!%SB"K)$f&`F'9KFQ&ZBf8ZFR0
bBf0PFb$%G(-J4N*TEfjQ)%d!!(*cFQ058d9%!3#3"!%!N"+``r,Z!*!'!@C261i
BL2r36Pj1G3!!6PB!!%MR%"K`!#K!GJ%L$'BB,`0)H!&H6VN!!!(+@)mQ(bK!)!a
Q!RB!5J0R'Lm-6VN!!!@%+%!SZIrmkh3J1Irmkh4B6f!#F!!Q6(!!%#i!'bm!,bi
!&#mZ!"![,J!-,bi!##m,6VN!!!A-)!Y2l`!B61iB!*!$-!#3"`3!!0f3"J!"!*!
(!J#3"`-!N!F%rj!'!!!"!*!$!63!N!-d!*!$-J66P)3Ip!#3!a`!-J!!Gf0dBJ#
3!`S!J2rr!*!%"01652Vq:
---------- End of BinHex snip ----------
Ken Shmidheiser