Programación bada: controlador de eventos de botón

I'm new to bada programming. I have a question that is, is it possible to allow the button event handler in bada to bring up another form? If so, how do I go about doing that? Thank you so much in advance!

preguntado el 08 de noviembre de 11 a las 08:11

2 Respuestas

well yes,

Add ActionEventListener to your button,

pButton = new Button();
pButton->Construct(Rectangle(176, 593, 128, 46), L"");
pButton->SetActionId(IDC_ACTION);
pButton->AddActionEventListener(*this);
AddControl(*pButton);

and in OnActionEventListener()

create your form

void
Form1::OnActionPerformed(const Control& source, int actionId)
{
    case IDC_ACTION:
    {      
        Form2* pExeForm = new Form2();
        pExeForm->Initialize();
        r = pFrame->AddControl(*pExeForm);
        r = pFrame->SetCurrentForm(*pExeForm);
        r = pExeForm->Draw();
        r = pExeForm->Show();
    }
    break;
}

respondido 30 nov., 11:13

Hi, thanks for responding. What if now I am currently using a tabbar and the tabbar items are using panels? How do I call another form or panel from one of the tabs (panels)? - Winona

make one controller, which can act as a form manager, when you press button and call OnActionPerformed and do pFormMgr->SendUserEvent(FormMgr::FORM_ID_YOU_WANT_TO_CALL, null); this will call OnUserEventReceivedN in your form manager. Now, to call your form do,

NewForm* pNewForm = new NewForm();
pNewForm ->Construct();
pFrame->AddControl(*pNewForm );

pFrame->SetCurrentForm(*pNewForm );
pFrame->RequestRedraw();

respondido 23 nov., 11:10

Hi, thanks for responding. What if now I am currently using a tabbar and the tabbar items are using panels? How do I call another form or panel from one of the tabs? - Winona

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.