//this is my ConsultaFormHandle.c

#include "ConsultaFormHandle.h"
#include "DBRecordRsc.h"
#include "DBtesteMain.h"

#pragma mark
//-------------- Fun��o para manipular consulta Form

 Boolean ConsultaFormHandleEvent(EventType * eventP)
{
    Boolean handled = false;
    FormType * frmP;

    switch (eventP->eType)
        {
        case menuEvent:
            return MainFormDoCommand(eventP->data.menu.itemID);

        case frmOpenEvent:
             frmP = FrmGetActiveForm();
             //ConsultaTableFormInit(frmP);
             FrmDrawForm(frmP);
             handled = true;
             break;

        case ctlSelectEvent:
            switch (eventP->data.ctlSelect.controlID)
            {
                case ConsultaVoltarButton:
                     FrmGotoForm(MainForm);
                     handled = true;
                     break;

                case MainBotConsMainButton:
                     FrmGotoForm(ConsultaForm);
                     handled = true;
                     break;
             }

         /*  Falta manipular o search field */
            break;
       case frmUpdateEvent:
            // To do any custom drawing here, first call
            // FrmDrawForm(), then do your drawing, and
            // then set handled to true.
            break;

        default:
            break;
        }

    return handled;
}


and this my AppHandleEvent in DBtesteMain.c




static Boolean AppHandleEvent(EventType * eventP)
{
    UInt16 formId;
    FormType * frmP;


    if (eventP->eType == frmLoadEvent)
    {
        // Load the form resource.

        formId = eventP->data.frmLoad.formID;
        frmP = FrmInitForm(formId);
        FrmSetActiveForm(frmP);


        // Set the event handler for the form.  The handler of the
        // currently active form is called by FrmHandleEvent each
        // time is receives an event.

        switch (formId)
        {
        case MainForm:
            FrmSetEventHandler(frmP, MainFormHandleEvent);
            break;

        case CadastroForm:
         FrmSetEventHandler(frmP, CadastroFormHandleEvent);
         break;

        case ConsultaForm:
         FrmSetEventHandler(frmP, ConsultaFormHandleEvent);
         break;

        default:
            break;

        }
        return true;
    }

    return false;
}

and The HandleFunction for MainForm in MainFormHandle.c archive.

#include "MainFormHandle.h"
#include "DBtesteMain.h"
#include "DBRecordRsc.h"


Boolean MainFormHandleEvent(EventType * eventP)
{
    Boolean handled = false;
    FormType * frmP;

    switch (eventP->eType)
        {
        case menuEvent:
            return MainFormDoCommand(eventP->data.menu.itemID);

        case frmOpenEvent:
            frmP = FrmGetActiveForm();
            //MainFormInit(frmP);
            FrmDrawForm(frmP);
            handled = true;
            break;

        case ctlSelectEvent:
            switch (eventP->data.ctlSelect.controlID)
            {
                case MainBotCadMainButton:
                  FrmGotoForm(CadastroForm);
                    handled = true;
                    break;

                case MainBotConsMainButton:
                    FrmGotoForm(ConsultaForm);
                    handled = true;
                    break;
             }


        case frmUpdateEvent:
            // To do any custom drawing here, first call
            // FrmDrawForm(), then do your drawing, and
            // then set handled to true.
            break;

        default:
            break;
        }

    return handled;
}

and i dont know why this happen!!!

8-(

yours truly!!

Gl�ucio.




> At 09:00 AM 8/11/2004, you wrote:
> >I am with a problem in my application, when start the emulator with the
> >program the buttons of form 1000 for example appear together with the
> >buttons of form 1200, as if the old form was not been extinguished, what
it
> >can be this?
>
> This usually means that you've done something that causes a form object to
> be drawn (setting text, for example) before your initial call to
> FrmDrawForm.  This causes form items to be saved in the "save-behind"
> buffer used with modal forms.  Always call FrmDrawForm first before
> modifying form objects.
>
>
> -- Ben Combee, DTS technical lead, PalmSource, Inc.
>     "Combee on Palm OS" weblog: http://palmos.combee.net/
>     Palm OS Dev Fourm Archives: http://news.palmos.com/read/all_forums/
>
>
>


>



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

Reply via email to