언어 설정

Menu
Sites
Language
About EditArea

<pre class="code">

result
testMainForm::OnInitializing(void)
{
    result r = E_SUCCESS;

    // TODO:
    // Add your initialization code here

    // Setup back event listener
    SetFormBackEventListener(this);

 

    __pButtonOK = static_cast<Button*>(GetControl(L"IDC_BUTTON_OK"));
    __pEditarea2 = new EditArea();
    __pEditarea2->Construct(Rectangle(50,100,400,150));
    __pEditarea2->AddTextEventListener(*this);

    AddControl(__pEditarea2);

    __pLabel = static_cast<Label*>(GetControl(L"IDC_LABEL1"));

    if (__pButtonOK != null)
        {
            __pButtonOK->SetActionId(ID_BUTTON_OK);
            __pButtonOK->AddActionEventListener(*this);
        }

    if(__pEditarea1)
        {
            __pEditarea1->AddActionEventListener(*this);
        }

 

 

    return r;
}

 

void
testMainForm::checkTest(void) {

     // when "__pButtonOK"  is clicked.

    String str;
    str = __pEditarea2->GetText(); // number

 

    __pLabel->SetText("test number :  " + str );

}

 

</pre>

 

When I click "__pButtonOK"(Okay Button) after writing number in  __pEditArea2  and than clicking "done" , I cannot see the number in label.

But, I can see the number written first in label when I click "done"(EditArea) again.

My log message prints some message like this.

 

------------------ log ------------------------

11-19 17:28:51.335 : INFO / driving5 ( 5707 : 5707 ) : virtual void driving5MainForm::OnActionPerformed(const Tizen::Ui::Control &, int)(197) > OK Button is clicked!
11-19 17:28:53.085 : ERROR / Tizen::Ui ( 5707 : 5707 ) : bool Tizen::Ui::_Control::IsVisible() const(2943) > [E_SYSTEM] This control should be attached to the main tree.

11-19 17:28:53.105 : ERROR / Tizen::Graphics ( 5707 : 5707 ) : result Tizen::Graphics::_Text::TextObject::SetBounds(const Tizen::Graphics::FloatRectangle&)(1132) > [E_OUT_OF_RANGE] The given rectangle(width:-24.000000,height:-8.000000) is out of range.
11-19 17:28:53.115 : ERROR / Tizen::Ui ( 5707 : 5707 ) : bool Tizen::Ui::_Control::IsVisible() const(2943) > [E_SYSTEM] This control should be attached to the main tree.
11-19 17:28:53.115 : ERROR / Tizen::Ui ( 5707 : 5707 ) : bool Tizen::Ui::_Control::IsVisible() const(2943) > [E_SYSTEM] This control should be attached to the main tree.
11-19 17:28:53.115 : ERROR / Tizen::Ui ( 5707 : 5707 ) : bool Tizen::Ui::_Control::IsVisible() const(2943) > [E_SYSTEM] This control should be attached to the main tree.
11-19 17:28:53.115 : ERROR / Tizen::Ui ( 5707 : 5707 ) : bool Tizen::Ui::_Control::IsVisible() const(2943) > [E_SYSTEM] This control should be attached to the main tree.
11-19 17:28:53.115 : ERROR / Tizen::Ui ( 5707 : 5707 ) : bool Tizen::Ui::_Control::IsVisible() const(2943) > [E_SYSTEM] This control should be attached to the main tree.
11-19 17:28:54.095 : ERROR / Tizen::Ui ( 5707 : 5707 ) : virtual bool Tizen::Ui::_KeyEventManagerImpl::PublicEventListener::OnKeyPressed(const Tizen::Ui::_Control&, const Tizen::Ui::_KeyInfo&)(66) > [E_SYSTEM] System error occurred. 
11-19 17:28:54.095 : ERROR / Tizen::Base::Collection ( 5707 : 5707 ) : virtual Tizen::Base::Object* Tizen::Base::Collection::LinkedList::GetAt(int)(256) > [E_OUT_OF_RANGE] The index(1) MUST be greater than or equal to 0, and less than the number of elements(1).
11-19 17:28:54.095 : ERROR / Tizen::Base::Collection ( 5707 : 5707 ) : virtual Tizen::Base::Object* Tizen::Base::Collection::LinkedList::GetAt(int)(256) > [E_OUT_OF_RANGE] The index(1) MUST be greater than or equal to 0, and less than the number of elements(1).
11-19 17:28:54.155 : ERROR / Tizen::Ui ( 5707 : 5707 ) : virtual bool Tizen::Ui::_KeyEventManagerImpl::PublicEventListener::OnKeyReleased(const Tizen::Ui::_Control&, const Tizen::Ui::_KeyInfo&)(99) > [E_SYSTEM] System error occurred. 
11-19 17:28:55.145 : ERROR / Tizen::Ui::Animations ( 5707 : 5707 ) : virtual Tizen::Ui::Animations::VisualElement::~VisualElement()(87) > [E_INVALID_STATE] should be called Destroy() for deallocating the VisualElement.
11-19 17:28:55.155 : ERROR / Tizen::Ui ( 5707 : 5707 ) : result Tizen::Ui::_UiEvent::ProcessEvent(const Tizen::Ui::_Control&, bool&)(132) > [E_SYSTEM] System error occurred.

 

I don't know the reason.

Please let me know,

 

Best regards,

Jenny

Edited by: Brock Boland on 17 3월, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

8 댓글
Alex Dem

Hi,
Try to add: __pLabel->Invalidate(false); after.

Alexey.

Jenny Blossoms

I tried it but I didn't get solution. :(

I get the same situation.

 

Jenny Blossoms

I uploaded my log again.

Please check it :)

Alex Dem

I have checked, It should works :

    String str;
    str = __pEditArea->GetText();
    __pLabel->SetText("test number :  " + str );
    __pLabel->Invalidate(false);

Without  __pLabel->Invalidate call it works like you described in topic.
p.s. please rebuild your project and reinstall packege on target again.
Alexey.

hgw7

The Label control has to redrawn to update. It should be Invalidate(true) not 'false'. Just try the following:

result
testEditAreaForm::OnInitializing(void)
{
    result r = E_SUCCESS;

    // Setup back event listener

    SetFormBackEventListener(this);

    // Get a button via resource ID
    Tizen::Ui::Controls::Button* pButtonOk = static_cast< Button* >(GetControl(IDC_BUTTON_OK));
    if (pButtonOk != null)
    {
        pButtonOk->SetActionId(IDA_BUTTON_OK);
        pButtonOk->AddActionEventListener(*this);
    }

    __pEditArea = new EditArea();
    __pEditArea->Construct(Rectangle(100, 100, 200, 100));
    AddControl(__pEditArea);

    __pLabel = new Label();
    __pLabel->Construct(Rectangle(100, 250, 100, 100), L"");
    __pLabel->SetBackgroundColor(Color::GetColor(COLOR_ID_BLUE));
    __pLabel->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
    AddControl(__pLabel);

    return r;
}

result
testEditAreaForm::OnTerminating(void)
{
    result r = E_SUCCESS;

    // TODO: Add your termination code here

    return r;
}

void
testEditAreaForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
{
    switch(actionId)
    {
    case IDA_BUTTON_OK:
    {
        AppLog("OK Button is clicked!\n");

        __pLabel->SetText(__pEditArea->GetText());
        __pLabel->Invalidate(true);
    }
    break;
    default:
        break;
    }
}

hgw7

From the logs posted, it seems that you have clicked the 'Ok' and then typed the numbers in the EditArea. The logs after 'OnKeyPressed()' occur when a character is typed in the keypad and then 'Done' is pressed.

I think you have called "checkTest(void)" method from OnActionPerformed() and hence your Label gets updated when you click on the 'Ok' button again.

If you want the label to update dynamically when keys are pressed then add the following code in the callback of ITextEventListener interface:

void
testEditAreaForm::OnTextValueChanged(const Tizen::Ui::Control& source)
{
        __pLabel->SetText(L"test number :  " + __pEditArea->GetText());
        __pLabel->Invalidate(true);

hgw7

From the logs posted, it seems that you have clicked the 'Ok' and then typed the numbers in the EditArea. The logs after 'OnKeyPressed()' occur when a character is typed in the keypad and then 'Done' is pressed.

I think you have called "checkTest(void)" method from OnActionPerformed() and hence your Label gets updated when you click on the 'Ok' button again.

If you want the label to update dynamically when keys are pressed then you should add the following code in the callback of ITextEventListener interface:

void
testEditAreaForm::OnTextValueChanged(const Tizen::Ui::Control& source)
{
        __pLabel->SetText(L"test number :  " + __pEditArea->GetText());
        __pLabel->Invalidate(true);

Jenny Blossoms

 

Thax to you !! Your comment helped me :)

I tried it and than solved !