So I haven't been able to read through Palm OS Programming for Dummies, and I
thank John for writing it, but I hope that using the dynamic UI isn't
recommended or encouraged.
The issues is that it's just inefficient. It far cheaper to "add" and "remove"
UI via FrmShowObject than it is to create the UI. It's cheaper in both time and
in space.
It's also better for localization. Folks in foreign countries can't localize
strings in code segments. They can localize form resources.
The dynamic UI is really only intended for when you can't predict the UI. Form
software is an example. A web browser is a similar example.
The same thing goes for 3.5 dynamic menus.
-Roger
"Schettino, John" <[EMAIL PROTECTED]> on 03/16/2000 03:19:17 PM
Please respond to "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent by: "Schettino, John" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
cc: (Roger Flores/HQ/3Com)
Subject: RE: Dynamic Button Creation Crazyness...
Snippit from Palm OS Programming for Dummies example:
#define Main_Form 1000 // Identifier for dynamic Form and Form
elements
//
// Create the main form dynamically
//
static void MakeMainForm(void)
{
FormPtr newForm;
EventType openEvent;
newForm = FrmNewForm(Main_Form, "Tester", 0, 0, 160, 160, false,
0, 0, Main_MenuBar);
FrmSetActiveForm(newForm);
FrmSetEventHandler(newForm, MainFormHandleEvent);
// add dynamic interface elements
CtlNewControl ((VoidPtr) &newForm, Main_Form+1, buttonCtl,
"Next",
20, 145, 40, 14, stdFont, 0, true);
CtlNewControl ((VoidPtr) &newForm, Main_Form+2, buttonCtl,
"Previous",
100, 145, 40, 14, stdFont, 0, true);
// generate event
openEvent.eType = frmOpenEvent;
openEvent.data.frmOpen.formID = Main_Form;
EvtAddEventToQueue (&openEvent);
}
This example does more than you need, making a form and buttons, but you get
the idea... just be sure to give new buttons an Id.
In your form handler, you'll need to use:
case ctlSelectEvent:
switch(event->data.ctlSelect.controlID) {
case Main_Form+1:
break;
case Main_Form+2:
break;
}
John Schettino
Palm OS Programming for dummies: http://schettino.tripod.com
-----Original Message-----
From: Noah J. Ternullo
To: Palm Developer Forum
Sent: 3/16/00 2:33 PM
Subject: Dynamic Button Creation Crazyness...
Howdy all,
I can create dynamic buttons. I can even see them. I don't
seem
to be able to click on them though (meaning, they don't invert like the
buttons you build in Code Warrior's constructor do.).
Do I need to do something special to be able to use dynamically
created buttons?
Noah Ternullo
------------------------------------------------------------------------
--------
Noah J. Ternullo [EMAIL PROTECTED]
------------------------------------------------------------------------
--------
"As a matter of constitutional tradition, in the absence of evidence to
the
contrary, we presume that governmental regulation of the content of
speech
is more likely to interfere with the free exchange of ideas than to
encourage it." - Supreme Court Justice John Paul
Stevens
------------------------------------------------------------------------
--------
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palm.com/devzone/mailinglists.html
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html