124
Chapter 11: Creating the User Interface
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
Lines 42, 43 When another app is switched to in split screen mode or our
app is about to be closed a deactivate message is sent and
we restore the saved screen state.
Lines 45 . . . 50 The quit message signals our app is about to be closed. We
close our window if it was opened (all opened windows must
eventually be closed) and mark it as closed.
Lines 51 . . . 57 Echo printable characters to our window, let the system
respond to any other keys (if we did not the system would
not work).
Lines 58 . . . 61 We receive a paint message when the system wants us to
redraw our window. The WF_DUP_SCR in our call to
WinOpen
tells the system to make a backup of all of our
writes to our window (at the cost of extra memory and time)
and so all we have to do is redraw our border and call
WinBackupToScr
to copy the duplicate screen image to the
display.
Lines 62 . . . 64 ACM_WINSTR is a menu ID defined in app1.h (line 98) and
stored in our menu (line 110). Application menu IDs range
from 0x500 . . . 0x6FF and are used to return values to an
app. Since it is stored in our menu and the system is
handling our menu we get the command automatically when
the user selects it from our menu. In this case we just draw
a string to our window.
Lines 65 . . . 67 ACM_DIALOG (lines 99, 111), another of our menu IDs is
sent when it is selected from our menu to call our dialog
(defined on lines 118 . . . 134). We then setup the
parameters for our dialog. The edit field parameters were
set on lines 32 and 33 in response to our start-up message
and so their values will only change when the app is started.
The array
opts
contains the values passed to and returned
for the two dropdowns (lines 121, 122 and lines
126 . . . 134) in the dialog box.
Lines 68 . . . 70 If
¸
is pressed to close the dialog box (
N
is the other
valid key) we display the values selected using
DlgNotice
.
DlgNotice
creates a dynamic dialog box and places the
strings we pass along with
¸
and
N
buttons.
Lines 73 . . . 77 Here we create a dynamic pop-up using the values entered
in the dialog box and one additional static item. Instead of
using predefined menu IDs we pass 0 (the second
parameter to
DynMenuAdd
) so that they are assigned
sequentially (starting with 1).