Hello Todd,
I am new to Palm as well actually, and I have not yet used lists as Popup
Lists.
Whatsoever, here are two possible approaches I might try for the List
object:
1 Building the list
1.1 Approach one (see PalmOS doc for details)
1.1.1 Load your DB-Records into an array of text strings, which represents
your List
=> LstSetListChoices
1.1.2 Put choices "New" and "Edit" on the top of your array
1.1.2 Draw the List
=> LstDrawList
You can use 1, if your number of datasets is small: Note, that you are
allocating extra memory for your records here, and also for more records,
than can be shown at the same time within your list. I think the next is
better..
1.2 Approach two
1.2.1 Call LstSetListChoices with NULL instead of the array pointer
1.2.2 Tell this function to reserve two additional lines for "New" and
"Edit"
1.2.3 Call LstSetDrawFunction to define a callback function which is called
for
each line of your list when the list is drawn - system calls
this function also,
when the list's scope changes due to navigation
1.2.4 Let the callback function write "New" resp "Edit", when the first two
lines
are to be drawn..
1.2.5 Let the callback function write the according DB-record, when the
other lines
are drawn.
In 1.2.4 and 1.2.5 note, that a list might show e.g. 10 lines at one time,
still item 21 will cause the callback function to be called with line number
21.
2 Navigate within the list
2.1 Set the initial line number, when you do 1.2.1, 1.2.2 and before you do
1.2.3
- the list is kind and will position it's scope to make the
selection visible
2.2 when a list's line is tapped, System will send an lstSelectEvent - catch
it in the form's event
handler and take the row from the event's data section - memorize it
2.3 when a user taps "New", your event handler can note this, and open a
modal edit form
for ListDB: This might be an AddRecordDB( ).
2.4 when you close the form, get the input line and store it into ListDB
2.5 position list of MainDB according to the memorized value..
Hm.. do you really want to put "New" and "Edit" into the list? Could make
things rather
tricky.
There is a nice tutorial shipped together with the PalmOS SDK, which covers
also the list topic.
Hope that helps. By the way, which book is called the "Bible"?
Todd Cary schrieb:
> Werner -
>
> I am very new to the Palm, and as such, I am trying to learn the "flow"
> of coding for certain aspects of Palm apps.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/