Home
THE ANIMATED CURSOR EDITOR
Contents
1. THE ANIMATED CURSOR EDITOR INTRODUCTION This chapter explains the operation of Resorcerer s Animated Cursor Editor which lets you create and edit acur resources These resources do not themselves contain actual cursors they are only lists of references to CURS or crsr resources The Animated Cursor Editor lets you try out animated cursors and the Cursor Editor has a feature to let you see adjacent frames of an animation sequence while you are editing one frame For more on this see the Cursor Editor chapter You should also be familiar with general resource editing as explained in the Editing Resources chapter earlier in the manual Topics COVERED Creating a new animated cursor Opening an animated cursor Using the editor Cutting and pasting cursor frames Decompiling the frame list Programming considerations Closing the animated cursor 81 RESORCERER USER MANUAL 82 CREATING A NEw ANIMATED CURSOR If you are viewing resources in Resorcerer s File Window click on the New button or choose New Resource from the File menu If the Types List is the Active List Resorcerer will ask you to specify the resource ID prior to creating the resource otherwise it will use the next free resource ID available for acur resources The resource ID at which the search begins is specified in the Resource ID Preferences section of the Preferences dialog for more on this see the Preferen
2. t yet repositioned the frame resource ID in your new ordering If you close the resource while some frames have invalid indices the Editor saves the patterns in display order Should you want to stop reordering prior to clicking on all the cursor IDs with invalid indices choose Reorder again All cursor IDs with invalid indices are reassigned indices corresponding to their current list position DECOMPILING THE FRAME LIST The AnimatedCursor Editor will decompile the list of frame resource IDs into a Rez language declaration The text is placed directly in the clipboard so that you can switch to your development system s text editor and paste the declaration into your Rez file To do this first ensure that no cursor is currently selected in the list Then choose Copy from the Edit menu to decompile the entire list to the clipboard 85 RESORCERER USER MANUAL 86 PROGRAMMING CONSIDERATIONS Animated cursors are an important user interface technique They give the user a simple and unobtrusive visual cue that your application is still working during lengthy calculations that would otherwise involve no user interface activity Without an animated cursor your user cannot tell whether their computer is doing real work or whether it is hung indefinitely User interface testing has shown that without any visual feedback or other response from the computer many users will assume something is wrong after very short periods of time
3. need to get at some of the hidden placeholder fields in the resource open it with the Data button to get at them with a template and the Data Editor THE ANIMATED CURSOR EDITOR USING THE EDITOR An acur resource is essentially E just a list of resource IDs The Editor shows the resource ID and the cursor with that ID all in a D horizontal list If there is no cursor then the list draws a gray Cursor ID ary out J 10 Cancer square in its place acur 128 from Demo Resources Each cursor is labeled with its index or frame number from 1 up to the number of frames in the list Animated cursors can be either black amp white or color depending on how the code in the owning application is interpreting the acur resource However there is no place in the acur data to specify whether the resource IDs are for color crsr or black amp white CURS cursor resources When the Editor opens the animated cursor for each resource ID in the list it scans the file the acur is in looking for either a crsr or CURS with that ID When it finds a match it assumes that all the rest of the frame resource IDs refer to resources of the same type as the match You can use the Show Color Cursors command in the finimatedCursor AnimatedCursor menu to tell the Editor to look for New Cursor Reorder selection and display crsr
4. such as 10 seconds and proceed to do nasty things like rebooting the computer In spite of their importance there is no toolbox support for animated cursors You usually have to write your own code to process the acur resource and to do the actual animation The following is an overview of what you need to do in case you are unfamiliar First take a look at the actual structure of cur 128 from Demo Resources the acur resource by opening one with a OCNT Cursor frames E template which you do by using the Data wUSTO one Garstr trams At button in the File Window instead of the RD File Onn eP F Open button You will notice that for each RS icus resource 2002 frame there is an extra two byte placeholder cereals at field next to each resource ID field as well FWRD Filler O Cursor frame s 4 as an empty field labeled Used a frame RSID CURS resource ID 2004 is FWRD Filler O number just after the frame count ec To initialize the acur resource read it into memory and ensure that its handle isn t purgeable Scan the list for each resource ID and use it to retrieve the handle to the appropriate cursor use Get Cursor for black amp white CURO resources or Get CCursor for color crsr resources Then replace the resource ID field along with its adjacent placeholder field with the 4 byte handle to your cursor and continue
5. to the end of the list You need to write a routine that gets called regularly during any lengthy calculation Each time it is called it should increment the current frame index wrapping it back to the beginning if it gets larger than the frame count and use the index to retrieve the handle in the acur list of cursor handles You may want to include a governer that doesn t allow the current frame to change until a minimum amount of time has passed which helps keep the animation looking the same regardless of the machine s processor speed The following is a sample routine that illustrates how to do this THE ANIMATED CURSOR EDITOR Call this with FALSE to put up a simple non animated watch or with TRUE to either start or continue the animated cursor as specified by acur 128 This code continues to work if the acur resource is missing or empty in which case it defaults to displaying the static system watch cursor typedef struct short cursID short filler CursorEntry 4 bytes typedef struct CursHandle cursorHndl CursorEntryHandle 4 bytes void PleaseWait int animate static CursHandle watchHandle static Handle acur static Boolean once TRUE static long then static short nCursors cursIndex short i word CursorEntry idTable CursorEntryHandle handleTable One time initialization swap cursor IDs for CursHandles in list if once acur GetlResource acur 12
6. 8 if acur NIL amp amp ResError noErr LoadResource acur HNoPurge acur word short acur Scan the resource header nCursors word cursIndex wordt Usually 0 if cursIndex lt 0 cursIndex 0 idTable CursorEntry word handleTable CursorEntryHandle idTable for i 0 i lt nCursors i Use temporary so we don t have to lock acur handleTable down CursHandle tmp GetCursor idTable i cursID Moves memory handleTable i cursorHndl tmp HNoPurge Handle tmp else nCursors 0 Nothing to animate watchHandle GetCursor watchCursor From system resources then TickCount once FALSE 87 RESORCERER USER MANUAL 88 if animate amp amp nCursors gt 0 long now TickCount if now then gt 3 Been a while so install next frame in cycle CursHandle cursH handleTable CursorEntryHandle acur 2 sizeof short if cursIndex gt nCursors cursIndex 0 cursH handleTable cursIndex cursorHndl if cursH NIL amp amp cursH NIL SetCursor cursH then now else SetCursor watchHandle This type of subroutine works for both black amp white cursors and color cursors For color cursors you have to use color analogues of Get Cursor and SetCursor GetCCursor and SetCCursor Note Make sure you test for the presence of Color QuickDraw before using any of the co
7. ces chapter later in this manual Usually the starting ID is 128 If you are already viewing an open acur resource you can choose New Resource from the Resource menu The next free ID is assigned automatically Once the new empty list of cursor references has been created the Editor opens it for editing so that you can add frames to it OPENING AN ANIMATED CURSOR The File Window tries to a display all the cursors Types 1 acur Animated Cursors Resource whose resource IDs are ze G SGGGRSS kept in the acur If the set first resource ID belongs to bmap BNDL a color cursor crsr caps Resorcerer assumes that edew f all the rest of the cursors cid are color ones and tries to Select All Reverse en Bete display them in sequence None New If there is no color cursor with the first frame ID it looks for black amp white CURS resources to display them The Cursor Editor lets you explicitly say which cursor resource type you want it to resolve and display Any cursor resources that are not in the same file get drawn as a gray square emo Resources Changed To open the animated cursor select the acur resource you want to open in the Resources List of your File Window and click on the Open button Or double click on the resource entry directly If you
8. lor cursor routines Also the technique of using a VBL task to install an animated cursor is not recommended for color cursors because Set CCursor moves memory which is disallowed during VBL interrupts For more on VBL animated cursors see Apple s sample code CLOSING THE ANIMATED CURSOR When you have finished editing an animated cursor frame list click in the editing dialog s GoAway box to close it and save the changes you have made to the resource If you have made any changes and if your Confirm resource saves preference is set for more on this see the Preferences chapter later in the manual Resorcerer will ask you to confirm saving the changes The changes you save when closing the resource will be saved to disk when you save or close the open file later on
9. p and bottom of the list are two triangular handles These indicate the position of the list insertion caret If no cursor IDs are selected the caret will also display a blinking vertical line To move the caret click on either handle and drag it to the position you want If you drag it to the right or left of the list edges the list entries scroll automatically To select a single cursor in the animation click once on it Its cursor resource ID is installed in the text box for you to edit Sorcery d6N is the keyboard equivalent of New Cursor Double clicking on a list insertion caret handle is also equivalent to clicking on the New Cursor command 3A is the keyboard equivalent of Select All in the Edit menu s Select sub menu Shift clicking extends the current selection of cursors 6 clicking on a cursor ID toggles its selection status The Right or Left Arrow cursor key collapses the current selection and selects the first frame to the right or left of the former selection respectively To add a new frame to the animated cursor place the list insertion caret at the position in the list where you want the new resource ID inserted and choose New Cursor from the AnimatedCursor menu The resource ID the Editor assigns to the new frame is the first free ID in the list This does not create the referenced cursor resource so the list will either display a gray box or show you any cursor that already exists with that ID To edit a refe
10. renced cursor with the Cursor Editor or to create a referenced cursor if the list is showing it as a gray box double click on the list entry The state of the Show Color Cursors command determines whether any new cursor will be a CURO or ersr resource THE ANIMATED CURSOR EDITOR CUTTING AND PASTING CURSOR FRAMES When the frame list is the active editing item you can Cut Copy Clear and Paste any selection of cursor frames When copying or cutting all selected cursor IDs they are assembled into the same format as an acur resource and placed in the clipboard as a piece of scrap with type acur When pasting cursor frames the Editor always places them at the position of the list insertion caret Note If you are transferring frames between two acur resources in two different open files remember that you are only transferring resource ID references not the cursors themselves To delete a set of cursor IDs select them and tap the Delete key To quickly reorder a contiguous selection of frame resource IDs in the animated cursor use Reorder in the AnimatedCursor menu This performs Resorcerer s standard list reordering algorithm which invalidates each selected frame s index by marking it with and then waits for you to click on the list items in the order in which you want them The Editor does all the cutting and pasting for you Note An invalid index is only a reminder to you that you haven
11. resources instead of CURS resources This should only be necessary if your file contains both color and black amp white animated cursors and you are using the same resource ID range for the cursors in both animations The Try Out button is the same as the menu s Try Out command It builds an animated cursor either color or black amp white depending on the Show Color Cursors setting using the frames in the list with resource IDs that refer to actual cursors It then attaches the series of cursors to the mouse and animates them cyclically The small up and down arrow click control next to the Try Out button lets you change the wait time between frame changes The number to the control s right is the number of ticks 60th s of a second to wait Lower numbers mean faster animation Note There may be a slight jerkiness to the animation due to the Editor periodically letting the System have some time 83 RESORCERER USER MANUAL 84 OPERATING THE FRAME LIST You can grow the list and the dialog that holds it to any size when you click and drag the list s grow box in the lower right corner of the list The Zoom Box grows the list to the widest it can be on its current screen In the Editor window either the cursor ID list or the Cursor ID text box is the active item When the list is the active item it is framed with a bold border The active item is the one to which the Editor directs all editing commands On the to
Download Pdf Manuals
Related Search
Related Contents
Phaser 6200 Color Laser Printer Sagiblue - Active Audio Registrador de datos de humedad y temperatura Manuales de Instalación y Operación NOJA Power - Home page Toshiba Satellite L775D-S7330 Operator`s Guide Installation Manual [PDF 3.1 MB] Wiring fault detection, diagnosis and reporting for process control rescue_rams_manual_mail_174010085_de Copyright © All rights reserved.
Failed to retrieve file