Thanks! That worked perfectly. I did see the InformationAlertID, but wanted to get my solution working. It's supposed to be a general routine, and so I don't know how much text will show up there. Because the FldSetTextPtr takes a "char *" instead of a "const char *" I've got to copy the text into a local buffer first, so I'm now limiting the size to 200.

Anyways thanks again.

Chris Bruner
Compulife Software Inc.
==============================================
----- Original Message ----- From: "Russell Cagle" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[email protected]>
Sent: Monday, September 26, 2005 1:26 PM
Subject: Re: DisplayMessage


FldInsert() only works on editable fields. For your situation, call FldSetTextPtr() instead.

Also, I noticed your text field has scrollbars, so you're probably displaying lots of text, but if your text would fit on a single screen then you could use FrmCustomAlert():

ALERT ID InformationAlertID
DEFAULTBUTTON 0
WARNING
BEGIN
TITLE "Information"
MESSAGE "info: ^1"
BUTTONS "OK"
END


FrmCustomAlert(InformationAlertID, "This shows up where ^1 is in the MESSAGE line.", NULL, NULL);


cbruner wrote:
I'm trying to get a general purpose dialog to pop up showing text. It's defined below. It will pop the form up, but I can't figure out why the text I'm inserting isn't showing up. Can someone please look this over and tell me where I'm going wrong?

Thanks,

Chris Bruner

FORM ID InfoForm  AT ( 2 2 156 156 )
MODAL DEFAULTBTNID InfoDoneButton
BEGIN
       TITLE "Information"
BUTTON "Done" ID InfoDoneButton  AT (66 135 AUTO AUTO)
FIELD ID InfoTextField AT (7 19 144 111) MAXCHARS 255 HASSCROLLBAR NONEDITABLE MULTIPLELINES UNDERLINED
END



#define InfoTextField 1026
#define InfoDoneButton 1025
#define InfoForm 1024


void DisplayMessage(const char *Info)
{

 /* Display the InfoForm. */
FormType *   frmP = FrmInitForm (InfoForm);
FieldType *field;
UInt16 fieldIndex;

fieldIndex = FrmGetObjectIndex(frmP, InfoTextField);

field = (FieldType *)FrmGetObjectPtr(frmP, fieldIndex);

FldSetInsertionPoint(field,1);
FldInsert(field, Info, StrLen(Info));
FrmSetFocus(frmP, fieldIndex);
FrmDrawForm(frmP);
FrmDoDialog (frmP);
FrmDeleteForm (frmP);

}

Chris Bruner
Compulife Software Inc.
==============================================




--
For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/




--
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to