Dear members,

I am new to Palm OS and software development. I have been working on a 
small project and I am having some problems. I decided to ask you for your 
advice. My project needs to use dates, and I found a useful source code on 
the palm website at 
http://www.palmos.com/dev/support/docs/recipes/selector_triggers.html

I used the code accordingly, but whenever the date is chosen and set the 
program freezes if I choose to reselect the date or choose the popup list.

I am not sure what the problem can be and I will appreciate your help.

I am attaching the code that was added to the application created with the 
Codewarrior wizard:

===Code Snipplet START
static Boolean MainFormHandleEvent(EventType * eventP)
{
        Boolean handled = false;
        FormType * frmP;
        ControlType* ctl;
        ControlPtr ctlP;
        Char *label;
        
        switch (eventP->eType) 
        {
                case menuEvent:
                        return MainFormDoCommand(eventP->data.menu.itemID);

                case frmOpenEvent:
                        frmP = FrmGetActiveForm();
                        ctlP = (ControlType *) FrmGetObjectPtr(frmP,
                        FrmGetObjectIndex(frmP, SE_DateTrigger));
                        label = (char *) CtlGetLabel(ctlP);
                        StrCopy(label, "None");
                        CtlSetLabel(ctlP, label);
                        FrmDrawForm(frmP);                      
                        handled = true;
                        break;
            
        case ctlSelectEvent:
                {
                        if (eventP->data.ctlSelect.controlID == 
SE_DateTrigger)
                        {
                                
                                Int16 month, day, year;
                                DateTimeType now;
                                TimSecondsToDateTime(TimGetSeconds(), 
&now);
                                year = now.year;
                                month = now.month;
                                day = now.day;
                                if (SelectDay(selectDayByDay, &month, &day, 
&year, "Set Date")) 
                                {
                                        ctl = (ControlType *) 
GetObjectPtr(SE_DateTrigger);
                                        label = (Char *) CtlGetLabel(ctl);
                                        DateToDOWDMFormat (month, day, 
year, dfDMYWithSlashes, label);
                                        CtlSetLabel(ctl, label);
                                        
                                }
                }
                        break;
                }
        }
    
        return handled;
}
===Code Snipplet END

You can view the source codes at http://web.unbc.ca/~simonp/codewarrior/

The files are called testing.c, testing_Rsrc.rcp, testing.h, testing_Rsrc.h

Thank you all in advance.

Happy New Years!

-- 
Patryk Simon
[EMAIL PROTECTED]



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

Reply via email to