> 
> Message: 2
>    Date: Mon, 22 Oct 2001 08:48:34 -0400
>    From: Chris Garvey <[EMAIL PROTECTED]>
> Subject: RE: palm-dev-forum digest: October 19, 2001
> 
> -----Original Message-----
> From:   Palm Developer Forum digest [SMTP:[EMAIL PROTECTED]]
> Sent:   Saturday, October 20, 2001 3:00 AM
> To:     palm-dev-forum digest recipients
> Subject:        palm-dev-forum digest: October 19, 2001
> 
> PALM-DEV-FORUM Digest for Friday, October 19, 2001.
> 
> 29. Popup trigger list values
> 30. Re: Popup trigger list values
> Subject: Popup trigger list values
> From: Chris Garvey <[EMAIL PROTECTED]>
> Date: Fri, 19 Oct 2001 15:44:28 -0400
> X-Message-Number: 29
> 
> Hello, I new to palm programming. My question is where does a Popup trigger
> 
> object in the resource editor get it's values. I inherited some code that
> uses one of these triggers to "popup" a list. I can not find where the list
> 
> values come from. This is probably a stupid question, but I have looked
> everywhere for these list values, which I need to change. I am using
> CodeWarrior 6. Thanks.
> 
> Chris
> 
Hello Chris,

I have a simple example of Popuup: I use Prc-tools + VFDIDE.

In this project, cmbTeste is the Popup Trigger, and the lstTeste is the
List linked with cmbTeste. 

In the exemple I show the contents of array MatCombo.

//ListPtr PtrCmbTeste;
char *MatCombo[50];
ListPtr PlstTeste;
ControlPtr PcmbTeste;

static int frmPrincHdlr(EventType *e)
{
// This function is set in Event Loop with FrmSetEventHandler function
FormPtr frm;
CharPtr strAux;

        switch(e->eType)
        {
        case frmOpenEvent:
                MatCombo[0] = "Combo 1";
                MatCombo[1] = "Combo 2";
                MatCombo[2] = "Combo 3";
                frm = FrmGetActiveForm();
                // Set pointers
                PlstPgm =FrmGetObjectPtr(frm, FrmGetObjectIndex(frm, lstPgm));
                PcmbTeste =FrmGetObjectPtr(frm, FrmGetObjectIndex(frm, cmbTeste));
                // Link array to popup
                LstSetListChoices(PlstPgm, MatCombo, 3);
                FrmDrawForm(frm);
                return 1; /* event handled */
                
        case ctlSelectEvent:
                switch (e->data.ctlEnter.controlID)
                {
                case lstTeste:
                        // The user clicked in Popup Trigger
                        LstPopupList(PlstTeste);
                        strAux = LstGetSelectionText(PlstTeste,0);
                        // Change the label
                        CtlSetLabel(PcmbTeste,strAux);
                        return 1;
                }
                
        case nilEvent: 
                return 0;
                
        default:
                
        }
        
        return 0; /* Event not handled */
}

If you have any doubts, email me.

[]s

Ricardo Brandao
Niteroi Brazil

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

Reply via email to