Get the particular EditField Details

Get the particular EditField Details

BY 06 Aug 2013 Native Application Development

Hi,

I am trying to develop an app where i have taken a number of EditFields using a 2D array of EditField objects. How am i supposed to get the index of the EditField on which the user has clicked?

This is how EditFields are created.

 

EditField* pField[ROWS][COLUMNS];

TTTPlayForm::OnInitializing(void)
{
    result r = E_SUCCESS;
    GridLayout gridPanelLayout;
    gridPanelLayout.Construct(ROWS, COLUMNS);
    Panel* pPanel = new Panel();
    pPanel->Construct(gridPanelLayout, Rectangle(85, 100, 500, 500));
    {
        for (int i = 0; i < ROWS; i++)
        {
            for(int j = 0; j < COLUMNS; j++)
            {
                pField[i][j] = new EditField();
                pField[i][j]->Construct(Rectangle(85, 100, 100, 100), EDIT_FIELD_STYLE_PHONE_NUMBER_SMALL, INPUT_STYLE_OVERLAY, EDIT_FIELD_TITLE_STYLE_NONE);
                pField[i][j]->SetTextAlignment(ALIGNMENT_LEFT);
                pPanel->AddControl(pField[i][j]);
            }
        }
    }
    AddControl(pPanel);
    return r;
}
 
Thanks in advance.
Written by