Texas Instruments TI89 Developer Guide - Page 144
BITMAP, ICON, Windows - 89 graphic calculator
UPC - 033317198566
View all Texas Instruments TI89 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 144 highlights
102 Chapter 11: Creating the User Interface 11.1.2. 11.1.3. 11.2. SCR_RECTs are defined as a union since the four bytes that define the coordinates can also be represented by an unsigned long value. There is a global SCR_RECT called ScrRect that defines the entire writeable region of the screen. This includes the area normally reserved for an app's menu but does NOT include the status line. This area can be changed by interrupt routines in response to keystrokes, and is not available to write to under normal circumstances. BITMAP BITMAPs are used to store or retrieve rectangular regions on a window. They can also be used for cursors (text or graphic), to do animation, to highlight areas on the screen, and as images in menus (along with ICONs). A BITMAP is defined as follows: typedef struct { WORD NumRows; WORD NumCols; BYTE Data[1]; } BITMAP; A BITMAP must always have one or more rows and one or more columns so its size is always at least 5 bytes long. The macro BITMAP_HDR_SIZE defines the size of the BITMAP header (4 bytes). The CalcBitmapSize routine calculates the size given a pointer to a BITMAP structure. ICON An ICON can be thought of as a fixed 16x16 bitmap. Since ICONs do not have the BITMAP header, they cannot be used interchangeably with BITMAPs. They are stored as an array of 16 unsigned shorts (WORD). ICONs are normally only used in MENUs. Windows The Window routines provide a method to write to the screen of the calculator. Each active window must have an associated WINDOW structure. The Window routines use the WIN_RECT structure (defined in section 11.1.1. Screen/Window Regions and Coordinates) to define regions. Coordinates are all specified by the WIN_COORDS type. All screen IO must go through an opened window. Windows are opened with the WinOpen function. The windows in the system are linked together so that when a window is closed, the system can walk the list of windows to determine which windows are dirty and therefore need to be repainted. Hence, it is important for an app to close its window when done to remove it from the linked-list of TI-89 / TI-92 Plus Developer Guide Not for Distribution Beta Version January 26, 2001