[FR] [IT]
  [INFO] [ACQUIRE] [MAP] [RESOURCES]


NEW FEATURES OF RELEASE 6

This document outlines the new features in FB^3 release 6.

Carbon
Can you believe it? We now compile Carbon compatible code? What does that mean for the user? Quite simply that your applications will run under Mac OS 9, or as a full citizen under Mac OS X.

Runtime Appearance
The Appearance Runtime is now fully functional and way cool!


Press release:
Paris, 02/25/2002

[return to top]

Appearance Windows
  • Floating windows
    There's no need to spend hours trying to get everything to stay where it is supposed to stay. Our floating windows remain in their own layer. They are automatically hidden when your application goes to the background and automatically displayed when it comes forward. (You can change this in your program if you want.)

  • Sheet windows

    feuillet


    In OS X, a sheet window slides down from the title bar of its parent window. We'll show you how, and just wait till you see this.

  • Windows with toolbars

    barre d'outils


    This is cool! You can click the toolbar button in the title bar and have your set of tools open or close.

  • Appearance-compliant theme backgrounds

    fond


    You can set up the really sophisticated backgrounds available with OS X. When the same program is run in OS 9, the striped gray background automatically switches to time-tested gray. It's all handled with a simple new syntax: DEF SETWINDOWBACKGROUND.

  • Extended window parameters
    Who complained that 256 windows weren't enough? With the APPEARANCE WINDOW statement, that limit is now 2,147,483,647.

    The window category (formerly referred to as a window class) can now be a long integer - even an OSType. You can set the category with:
    DEF WINDOWCATEGORY(wNum&, category&)
    When you create an appearance window, you set up attribute and class parameters that determine things like what layer the window will be wedged into and what widgets will be contained in the title bar. You want a floating window with the title on the side? You want a document window with a toolbar button and a horizontal zoom box? You want it to collapse into the OS X dock? You decide.

  • Window positions
    We used to have two options: center a window or manually calculate its global coordinate position. But windows may now be created or repositioned using system constants with the help of two new commands:
    DEF WINDOWREPOSITION and DEF NEWWINDOWPOSITIONMETHOD

    Parameters include things like:
    _kWindowCenterOnMainScreen,
    _kWindowCascadeOnMainScreen,
    _kWindowAlertPositionOnMainScreen

    Want to calculate and position your windows in your own code? We can help there, too. The new function FBGETSCREENRECT will calculate the available area for you.

  • Shazoooom
    When your window opens, don't settle for the regular old wham bam presentation. Let it zoom from a specific area of the screen… why not from a button that the user just clicked. It's done using the new DEF TRANSITIONRECT call.

  • Buffered Graphics
    The single most important addition to Mac OS X is probably the neat way that windows are buffered. Everything is done off screen and brought into view smoothly. Martha Stewart would call this a good thing, but if you want to force the screen to see new info, you're going to have a problem. Enter, stage left: FLUSHWINDOWBUFFER. Draw whatever you want, then flush the buffer to send it to the screen.

  • New WINDOW functions
    With all of these new window features, you probably guessed that we would give you more tools for digging around under the hood. The extended WINDOW function now not only delivers information relating to the size of the window's content area, but also informs you of its structure area. You can extract window pointers or grafport addresses (which are now two different things in the Carbon API). Grab the class, the attributes, the category; it's all there.


  • [return to top]

    Glue code
    Many of the toolbox calls that we have come to depend on no longer work as expected. Fear not! FB is already armed with glue code to ease that burden. The two most important additions are FN INVALRECT and FN VALIDRECT (to replace CALL InvalRect) and CALL ValidRect (which Apple has removed from the new Carbon Toolbox). These replacements will work in anything from 68K to Carbon with no extra work on your part.


    [return to top]

    Menus
  • Contextual menus
    Menu ContextuelWe'll show you how to build contextual menus on the fly. (That's a menu that pops up when you control-click a hot area in a window.)

    We even provide a new DIALOG(_cntxtMenuClick) event so that you know when to build and display the menu.

  • OS X menu placement
    Things used to be easyÄ The Quit item was always at the bottom of the File menu and the Preferences item was always at the bottom of the Edit menu. This changed in X because these two items were moved to the application menu. This presented a coding nightmare. Programs that ran in OS 9 put the menus in one place and OS X in another. Well, that's a nightmare for folks with other languages. With FB, we just let the Runtime handle it. MENU PREFERENCES will move the preference item to the proper location and ensure that your menu routine receives the same values for menu ID and item ID whether you are running in Mac OS 9 or OS X. The Quit menu item is also handled automatically.


  • [return to top]

    Preferences
    There are only two reasons for not storing information in a preference file: your program is smaller than a flea's freckle, or it's just too much darn trouble. FB now provides all of the help you could ever need in building and maintaining preference files. You provide a file name and a preference record and we'll do the rest. The new calls are GET PREFERENCES (to load them into your program), PUT PREFERENCES (to store them on disk), and KILL PREFERENCES (to obliterate the file). FB takes care of all of the work involved in locating the proper preference folder in any version of the system software, even on foreign systems ('cos you know, those foreigners never call their files like us).


    [return to top]

    File Header
    If you send a file to someone else and their Compiler preferences are set to different values, the file will often fail to run. Our new File Header menu option places visible and understandable remarks at the top of your source code window. The remarks are picked up by the Editor when you run or build the program and are used to temporarily replace specific preferences. The result is that your program will run no matter what preferences were set on the other computer.


    [return to top]

    Error trapping

    We improve our error trapping with each release, and Release 6 is no exception, but there is one outstanding new feature: Toolbox validity checks.
    PrefsIn PPC coding it is possible to use a toolbox call (like some fancy new toolbox call for QuickTime 5) and everything will work just fine. But as soon as you run that program on another machine that has QuickTime 4, it crashes and you're left scratching your head and wondering what went awry.
    The new solution is to set a preference in the Editor that will force your program to check each and every toolbox call when your application starts up. If there are any missing toolbox entries, your program will safely report the error and give the user the option of a graceful exit.


    [return to top]

    Cursors
    A cursor is more than a plain spoken person. It's a pointy thing that you use instead of your finger. And we have a handful of new pointy things.

  • Animated cursors
    Animating cursors used to be an arduous task that involved setting up a VBL task or closely watching a tick counter and updating the pointer at appropriate times. Now we just set the cursor type to _themeCursorAnimate and let the system do the work.

  • More choices
    If you were tired of the old crosshair, I-Beam, arrow cursor choices, you'll love the new selections:

    The SYSTEM function is available for additional help here also. A new parameter (_lastCursType) lets you know if the cursor is animated (_themeCursorAnimate) or static (_themeCursorStatic).


  • [return to top]

    ON FINDERINFO
    Figuring out what files were dropped onto your application or were double-clicked has always been a problem. With our new FINDERINFO vector, you can have the Runtime notify you when files need to be opened.


    [return to top]

    Files
    Everything has changed. The Carbon API no longer accepts our time-tested volume reference numbers as file parameters. So just chuck out all your old file-handling code and rewrite everything from scratchÄ Just joking! The Standard BASIC Runtime keeps all of your old code operational by storing a list of appropriate values and transparently plugging them into modified functions so that old programs can run without modification.

  • File Spec Records
    When you get ready to switch your programs (and your thinking) over to the new File Spec Record, FB will be there with a boatload of new calls to help. The FILES$ function has been enhanced to include parameters such as _FSSpecOpen, _FSSpecOpenPreview, and _FSSpecSave.

  • New file utility routines
    There are lots of things that we wish we could do, but they just seem too complex. Our new file utilities will help. Routines are available to move files, copy files, check to see if a file exists, send a file to the trash, and more. There's even a routine that scans a folder looking for specific files.

  • Additional SYSTEM functions
    New parameters have been added to the SYSTEM function. One provides the volume reference number of the running process and the other gives the parent ID. You can use these to create a file spec record for the application's folder.

  • New OPEN parameter
    File spec records may be used with the OPEN statement in place of a file name by using the @ symbol as a designator.

    OPEN "O",#1,@myRecordFSSpec

  • [return to top] Edit Fields
    In the Appearance Runtime, there are two kinds of edit fields. The first is a button created like a button, using the APPEARANCE BUTTON statement. These are somewhat low powered fields that may not contain multiple style runs. They are appropriate for limited use in places such as dialogs to accept text entry.

    The second type of field is created with the EDIT FIELD statement. (Just like old times, huh?) What you don't see is that it is also a button - a very special kind of button. We use the same button mechanism, but substitute a real edit field in what is called a user pane. The advantages are enormous as you will see when you read about buttons.

  • New behaviors
    Now that we have stepped into the modern world, we need to adopt some modern practices. The first is the use of a focus ring. That's the highlight rectangle that appears around edit fields and other items to designate them as the target for any keyboard actions. This is, by default, handled automatically by the Appearance Runtime. But you may choose to modify the default settings by using new field attributes when the field is built. For instance, you can tell the Appearance Manager not to draw a focus ring on a particular field with _noDrawFocus. You can skip the fancy 3D frame and go with a plain border using _usePlainFrame. You can even set up the field to automatically turn gray (or not) when the window is disabled.

  • Roger. Copy that.
    A new type of field has been introduced with an attribute called _copyOnlyFramed (or _copyOnlyNoFramed). This lets your program display data that a user may select and copy, but not change.

  • Key filter procedure
    A single, powerful new parameter has been added to the EDIT FIELD statement: a procedure pointer. At the end of all other parameters, you may add @FN myKeyFilter and every key press will pass through your function before being allowed into the field. The older ON EDIT FN will still work, but once you have gotten used to the new method, you'll see that the old way was a sledge hammer and the new way is a sharp scalpel.

  • Disabling and more
    A field can be disabled by using the EDIT FIELD statement with a negative parameter (EDIT FIELD -1). Field numbers, like button and window numbers, are limited to around 2 billion. Here's a trick: OSTypes are really long integers, so an edit field reference number could actually be something like _"Name".


  • [return to top]

    Picture Fields
    The new picture fields boast all of the advantages of our updated edit fields along with a few tricks of their own. New attributes may be set to make a picture clickable and/or to invert when it is clicked. Another parameter makes the picture transparent so that white parts of the picture allow the background to show through.


    [return to top]

    Buttons
    This is a whole new world. Everything is a button. You can use the APPEARANCE BUTTON statement to draw pictures, icons, lines, placards, wells, pop-up menus, progress bars, date/time fields, sliders, and, oh yes, buttons.

  • The secret is embedding
    A new set of commands will allow one button to be embedded in another. The key here is that taking an action on the parent button automatically extends that action to involve all embedded buttons.
    ongletsLet's take tabbed panes as an example. A single pane is built to match each tab. (Yes, you guessed, a pane is a button too.) Then all of the items that will be visible in that pane are embedded. You can loop through this set up for every tab. The end result is that you can make a single pane button visible and all of the embedded buttons, fields, lines, etc. are also made visible. A tiny fragment of code inserted into your button routine will do amazing things.

    Does FB help with the embedding process? You betcha. Your program uses DEF EMBEDBUTTON to start the process. You can (if required) find out what a button's parent is and index through all buttons embedded in a parent. This makes it easy to track radio buttons, too.

  • New BUTTON parameters
    Previously, the BUTTON function accepted only one parameter ® the button reference number. The new BUTTON statement accepts two: the button reference number and a selector to determine which of many pieces of information your program requires. There are more than a dozen new parameters to extract information like the control's minimum and maximum values, the root control of the window, the control's date or time (for date/time buttons), the menu handle for a pop-up menu control and the TEHandle for an edit field control.

    listeOther utility items include a powerful statement called DEF GETBUTTONDATA and text related items like DEF GETBUTTONTEXTSELECTION. (Has anyone else noticed that these names are getting longer than the staying power of the Energizer Bunny?)

    SliderRelease 6 offers the full spectrum of Appearance Manager button possibilities. We accomplished this with the new APPEARANCE BUTTON statement. It gives your program direct access to all of the parameters used in the NewControl toolbox statement and we supply every constant from the latest Apple documents for your coding pleasure. We don't give you one or two types of sliders ® we give you every type.

    Case

    Even check boxes have gotten a little better by allowing a mixed mode check.

  • Wait
    attente Sooner or later, Mrs. Program User is going to need to wait while your program processes some huge piece of information. You've already seen the automated cursors that can be brought into play (counting fingers, rotating beach balls, animated wrist watches) but other indicators are available too. A small area might be set aside in your windows for chasing arrows or you may want to set up a progress bar in a dialog. (Yep, got that too.) Can it get any easier? Yes. These indicators animate themselves. Wow! I'm going to turn my spousal unit into a button!

  • Have you got the time?
    heure Date and time entries seem to creep into every application. And every programmer deals with them in a different way. That's why we added the date/time buttons and why we added all of the utility functions necessary to get at the contents of these controls. You can build controls that are display only and constantly update the time (like an on screen clock or calendar). You can look for only the month and year (as with credit card expiration dates). You can extract any piece of information from the control like the day of the week or the entire text of the user selected time.


  • [return to top]

    The tip of the 'berg
    Take everything you have read here and multiply it by a bazillion because that's how many options you really have. Take the tabbed panes. You looked at the graphic and read the text and thought, "Wow! That's cool!" But we didn't tell you that the tabs could be large or small and face north, south, east, or west.
    We didn't cover all of the new SYSTEM function parameters like the ones that give you the clock speed of your CPU. We skipped over lots of new utility functions like FN FBGETCONTROLRECT. We did not mention that new, easily accessible records are available to provide all of the info that you could ever imagine for buttons and windows. We skipped over the part about new dialog messages that tell if the cursor is over a picture field or an edit field. Oh, and PG:Pro support. Hundreds of new toolbox calls are in there too. Did I mention the new color parameters for the EDIT TEXT statement? AndÄ

    If you want to know what else we skipped, you'll have to take a good look at Release 6. Enjoy!

      © 2000 Pix&Mix  
      All Rights Reserved
    INFO  |  ACQUIRE  |  MAP  |  RESOURCES

      FutureBASIC is a registered trademark of Staz Software, Inc and is used with permission.