Languages

Menu
Sites
Language
Get the particular EditField Details

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.
Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

4 Replies
konduri sai swathi
Hi, Try adding AddTextBlockEventListener() to the edit field and handle the listener using OnTextBlockSelected() of Tizen::Ui::ITextBlockEventListener Interface by creating a separate class for it. I'm not sure whether it works this way, but try once doing like this.
do u want to know which editfield to be able to process the text? give every edit field a name and then inside virtual void OnTextValueChanged(const Tizen::Ui::Control& source); get the source name GetName and compare it to the Editfield name.. you will find out which EditField is active and the keypad is changing contents
Bikramjit Das
I did it in a different way..what i did is just passed the 'i'th and the 'j'th value of the EditField to the required function. These two values can be obtained by means of nested for loop..Wonder what would be the complexity of the getting the EditField by means of what has been suggested in the above two responses. Any kind of help is highly appreciable.
wil smith
FocusManager APIs could be useful.