{
}
-result
-ViewDescriptForm::Construct(String* pStr)
+bool
+ViewDescriptForm::Initialize(void)
{
- __strDescription = *pStr;
-
Form::Construct(FORM_STYLE_HEADER | FORM_STYLE_INDICATOR | FORM_STYLE_FOOTER);
- EditArea* pEaEditor = new (std::nothrow) EditArea;
- TryReturn(pEaEditor != null, E_OUT_OF_MEMORY, "new EditArea() is null");
+ TextBox* pTextBox = new (std::nothrow) TextBox();
+ TryReturn(pTextBox != null, false, "[E_OUT_OF_MEMORY] new TextBox() is null.");
Rectangle rect = Rectangle(10, 10, GetClientAreaBounds().width - 20, GetClientAreaBounds().height - 15);
- result r = pEaEditor->Construct(rect);
- TryReturn(r == E_SUCCESS, r, "FileViewForm - EditArea::Construct() is failed by %s", GetErrorMessage(r));
-
- pEaEditor->SetKeypadEnabled(false);
- pEaEditor->SetEnabled(false);
+ result r = pTextBox->Construct(rect, TEXT_BOX_BORDER_NONE);
+ TryReturn(r == E_SUCCESS, false, "[%s] TextBox::Construct() failed.", GetErrorMessage(r));
- r = AddControl(*pEaEditor);
- TryReturn(r == E_SUCCESS, r, "FileViewForm - AddControl() is failed by %s", GetErrorMessage(r));
-
- pEaEditor->SetText(__strDescription);
-
- return E_SUCCESS;
-}
-
-bool
-ViewDescriptForm::Initialize(void)
-{
- Form::Construct(FORM_STYLE_HEADER | FORM_STYLE_INDICATOR | FORM_STYLE_FOOTER);
+ r = AddControl(*pTextBox);
+ TryReturn(r == E_SUCCESS, false, "[%s] AddControl() failed.", GetErrorMessage(r));
return true;
}
SetFormBackEventListener(this);
- EditArea* pEaEditor = new (std::nothrow) EditArea;
-
- Rectangle rect = Rectangle(10, 10, GetClientAreaBounds().width - 20, GetClientAreaBounds().height - 15);
- pEaEditor->Construct(rect);
-
- pEaEditor->SetKeypadEnabled(false);
-
- AddControl(*pEaEditor);
-
- pEaEditor->SetText(__strDescription);
-
Header* pHeader = GetHeader();
pHeader->SetTitleText(L"DESCRIPTION");
{
if (pArgs != null)
{
- __strDescription = *((String*)pArgs->GetAt(0));
+ String description = *((String*)pArgs->GetAt(0));
- EditArea* pEaEditor = static_cast<EditArea*>(GetControl(0));
- pEaEditor->SetText(__strDescription);
+ TextBox* pTextBox = dynamic_cast< TextBox* >(GetControl(0));
+ if (pTextBox)
+ {
+ pTextBox->SetText(description);
+ }
pArgs->RemoveAll(true);
delete pArgs;