Creating The User Interface; Common Screen Components; Screen/Window Regions And Coordinates; Table 11.1: Screen Vs. Window Coordinates - Texas Instruments TI-89 Developer's Manual

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

11.

Creating the User Interface

As explained in chapter 4. User Interface Overview , the user interface consists
of windows, menus, dialog boxes, fonts, and the status line. This chapter will
present more detail on windows, menus and dialog boxes along with common
structures shared by all three of these components. The resource compiler,
which converts resource files into object code, will also be discussed. Finally, a
detailed example of an application that uses windows, menus, and dialog boxes
will be presented.
11.1.

Common Screen Components

Windows, menus, and dialog boxes all use several common components. These
components include the screen region and coordinate typedefs — SCR_RECT,
SCR_COORDS; the bitmap structure — BITMAP; and the icon structure —
ICON.
11.1.1.

Screen/Window Regions and Coordinates

Although windows are based on window coordinates (signed short values —
WIN_COORDS), the screen is limited to only unsigned char coordinates —
SCR_COORDS. Because of this, there are two separate structures that define a
region on the screen: SCR_RECT and WIN_RECT. A region defines a
rectangular area. The x0, y0 coordinates of a region specify the upper left
coordinates; the x1, y1 coordinates specify the lower right coordinates. The
SCR_RECT structure is based on SCR_COORDS whereas the WIN_RECT
structure is based on WIN_COORDS. While the WINDOW structure uses
SCR_RECT regions internally, all calls to window routines use window region
and coordinates.
SCREEN
typedef unsigned char SCR_COORDS;
typedef union {
struct {
} xy;
unsigned long l;
} SCR_RECT;
TI-89 / TI-92 Plus Developer Guide
SCR_COORDS x0, y0;
SCR_COORDS x1, y1;

Table 11.1: Screen vs. Window Coordinates

Not for Distribution
WINDOW
typedef signed short WIN_COORDS;
typedef struct {
WIN_COORDS x0, y0;
WIN_COORDS x1, y1;
} WIN_RECT;
Beta Version January 26, 2001
101

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents