summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChoongeun Hong <cheun.hong@samsung.com>2013-04-03 23:46:25 +0900
committerChoongeun Hong <cheun.hong@samsung.com>2013-04-04 15:35:24 +0900
commitc0b09e29dd2a9b30c211e9b2a0b8e0f158cde0ae (patch)
treeace0a0a11e55e5f401fcf3ed231ce2f4d1f35a88
parent7afaa928f8f239aaf04d7450c704b7fef1758243 (diff)
downloadUiControls-c0b09e29dd2a9b30c211e9b2a0b8e0f158cde0ae.tar.gz
UiControls-c0b09e29dd2a9b30c211e9b2a0b8e0f158cde0ae.tar.bz2
UiControls-c0b09e29dd2a9b30c211e9b2a0b8e0f158cde0ae.zip
Fixed N_SE-31169
Change-Id: I1f9fee720eda68d65d868120351b54a575800fb3 Signed-off-by: Choongeun Hong <cheun.hong@samsung.com>
-rw-r--r--project/inc/ExpandableEditAreaForm.h1
-rw-r--r--project/src/ExpandableEditAreaForm.cpp45
2 files changed, 34 insertions, 12 deletions
diff --git a/project/inc/ExpandableEditAreaForm.h b/project/inc/ExpandableEditAreaForm.h
index d173474..6e751fd 100644
--- a/project/inc/ExpandableEditAreaForm.h
+++ b/project/inc/ExpandableEditAreaForm.h
@@ -66,6 +66,7 @@ private:
Tizen::Ui::Controls::Button* __pButton;
Tizen::Ui::Controls::ScrollPanel* __pScrollPanel;
Tizen::Graphics::FloatRectangle __prevBounds;
+ Tizen::Graphics::FloatRectangle __prevBoundsToken;
Tizen::Graphics::FloatRectangle __SaveBounds;
}; // ExpandableEditAreaForm
diff --git a/project/src/ExpandableEditAreaForm.cpp b/project/src/ExpandableEditAreaForm.cpp
index 5fd0bc0..adfb575 100644
--- a/project/src/ExpandableEditAreaForm.cpp
+++ b/project/src/ExpandableEditAreaForm.cpp
@@ -102,6 +102,7 @@ ExpandableEditAreaForm::OnActionPerformed(const Control& source, int actionId)
__pExpandableEdit->SetSize(clientArea.width - EXPANDABLEEDITAREA_RIGHT_MARGIN, EXPANDABLEEDITAREA_HEIGHT);
__pExpandableEditToken->SetSize(clientArea.width - EXPANDABLEEDITAREA_RIGHT_MARGIN, EXPANDABLEEDITAREA_HEIGHT);
__prevBounds = FloatRectangle(15.0f, 15.0f, clientArea.width - EXPANDABLEEDITAREA_RIGHT_MARGIN, EXPANDABLEEDITAREA_HEIGHT);
+ __prevBoundsToken = FloatRectangle(15.0f, 15.0f, clientArea.width - EXPANDABLEEDITAREA_RIGHT_MARGIN, EXPANDABLEEDITAREA_HEIGHT);
__pLabel->SetSize(clientArea.width - LEFT_MARGIN - RIGHT_MARGIN, clientArea.height - PANEL_HEIGHT - TOP_MARGIN - BOTTOM_MARGIN);
__pScrollPanel->SetBounds(0.0f, 0.0f, clientArea.width, clientArea.height - __pPanel->GetSizeF().height);
}
@@ -113,11 +114,12 @@ ExpandableEditAreaForm::OnActionPerformed(const Control& source, int actionId)
__pExpandableEdit->SetShowState(true);
__pExpandableEditToken->SetShowState(false);
__pExpandableEdit->SetFocus();
+ __pButton->SetEnabled(true);
FloatRectangle newBounds = __pExpandableEdit->GetBoundsF();
FloatRectangle prePanelBounds = __pPanel->GetBoundsF();
- __pPanel->SetBounds(FloatRectangle(prePanelBounds.x, prePanelBounds.y - (newBounds.height - __prevBounds.height), prePanelBounds.width,
- prePanelBounds.height + (newBounds.height - __prevBounds.height)));
+ __pPanel->SetBounds(FloatRectangle(prePanelBounds.x, prePanelBounds.y - (newBounds.height - __prevBoundsToken.height), prePanelBounds.width,
+ prePanelBounds.height + (newBounds.height - __prevBoundsToken.height)));
__prevBounds = __pExpandableEdit->GetBoundsF();
FloatRectangle labelArea = GetClientAreaBoundsF();
@@ -132,12 +134,13 @@ ExpandableEditAreaForm::OnActionPerformed(const Control& source, int actionId)
__pExpandableEdit->SetShowState(false);
__pExpandableEditToken->SetShowState(true);
__pExpandableEditToken->SetFocus();
+ __pButton->SetEnabled(false);
FloatRectangle newBounds = __pExpandableEditToken->GetBoundsF();
FloatRectangle prePanelBounds = __pPanel->GetBoundsF();
__pPanel->SetBounds(FloatRectangle(prePanelBounds.x, prePanelBounds.y - (newBounds.height - __prevBounds.height), prePanelBounds.width,
prePanelBounds.height + (newBounds.height - __prevBounds.height)));
- __prevBounds = __pExpandableEditToken->GetBoundsF();
+ __prevBoundsToken = __pExpandableEditToken->GetBoundsF();
FloatRectangle labelArea = GetClientAreaBoundsF();
prePanelBounds = __pPanel->GetBoundsF();
@@ -216,8 +219,9 @@ ExpandableEditAreaForm::LayoutContent(void)
__pExpandableEdit->SetFocus();
__pExpandableEdit->ShowKeypad();
+ __prevBoundsToken = FloatRectangle(15.0f, 15.0f, clientArea.width - EXPANDABLEEDITAREA_RIGHT_MARGIN, EXPANDABLEEDITAREA_HEIGHT);
__pExpandableEditToken = new (std::nothrow) ExpandableEditArea();
- __pExpandableEditToken->Construct(__prevBounds, EXPANDABLE_EDIT_AREA_STYLE_TOKEN, EXPANDABLE_EDIT_AREA_TITLE_STYLE_NONE, EXPANDABLE_LINE_MAX);
+ __pExpandableEditToken->Construct(__prevBoundsToken, EXPANDABLE_EDIT_AREA_STYLE_TOKEN, EXPANDABLE_EDIT_AREA_TITLE_STYLE_NONE, EXPANDABLE_LINE_MAX);
__pExpandableEditToken->SetMargin(EDIT_MARGIN_TYPE_VERTICAL, 5.0f);
__pExpandableEditToken->AddKeypadEventListener(*this);
__pExpandableEditToken->AddExpandableEditAreaEventListener(*this);
@@ -274,10 +278,18 @@ ExpandableEditAreaForm::OnExpandableEditAreaLineAdded(ExpandableEditArea& source
{
FloatRectangle newBounds = source.GetBoundsF();
FloatRectangle prePanelBounds = __pPanel->GetBoundsF();
- __pPanel->SetBounds(FloatRectangle(prePanelBounds.x, prePanelBounds.y - (newBounds.height - __prevBounds.height), prePanelBounds.width,
- prePanelBounds.height + (newBounds.height - __prevBounds.height)));
- __prevBounds = source.GetBoundsF();
-
+ if(source.IsTokenEditModeEnabled())
+ {
+ __pPanel->SetBounds(FloatRectangle(prePanelBounds.x, prePanelBounds.y - (newBounds.height - __prevBoundsToken.height), prePanelBounds.width,
+ prePanelBounds.height + (newBounds.height - __prevBoundsToken.height)));
+ __prevBoundsToken = source.GetBoundsF();
+ }
+ else
+ {
+ __pPanel->SetBounds(FloatRectangle(prePanelBounds.x, prePanelBounds.y - (newBounds.height - __prevBounds.height), prePanelBounds.width,
+ prePanelBounds.height + (newBounds.height - __prevBounds.height)));
+ __prevBounds = source.GetBoundsF();
+ }
FloatRectangle labelArea = GetClientAreaBoundsF();
__pScrollPanel->SetBounds(0.0f, 0.0f, labelArea.width, labelArea.height - __pPanel->GetSizeF().height);
prePanelBounds = __pPanel->GetBoundsF();
@@ -290,9 +302,18 @@ ExpandableEditAreaForm::OnExpandableEditAreaLineRemoved(ExpandableEditArea& sour
{
FloatRectangle newBounds = source.GetBoundsF();
FloatRectangle prePanelBounds = __pPanel->GetBoundsF();
- __pPanel->SetBounds(FloatRectangle(prePanelBounds.x, prePanelBounds.y + (__prevBounds.height - newBounds.height), prePanelBounds.width,
- prePanelBounds.height - (__prevBounds.height - newBounds.height)));
- __prevBounds = source.GetBoundsF();
+ if(source.IsTokenEditModeEnabled())
+ {
+ __pPanel->SetBounds(FloatRectangle(prePanelBounds.x, prePanelBounds.y + (__prevBoundsToken.height - newBounds.height), prePanelBounds.width,
+ prePanelBounds.height - (__prevBoundsToken.height - newBounds.height)));
+ __prevBoundsToken = source.GetBoundsF();
+ }
+ else
+ {
+ __pPanel->SetBounds(FloatRectangle(prePanelBounds.x, prePanelBounds.y + (__prevBounds.height - newBounds.height), prePanelBounds.width,
+ prePanelBounds.height - (__prevBounds.height - newBounds.height)));
+ __prevBounds = source.GetBoundsF();
+ }
FloatRectangle labelArea = GetClientAreaBoundsF();
__pScrollPanel->SetBounds(0.0f, 0.0f, labelArea.width, labelArea.height - __pPanel->GetSizeF().height);
@@ -309,7 +330,7 @@ ExpandableEditAreaForm::OnOrientationChanged(const Control& source, OrientationS
__pPanel->SetSize(clientArea.width, __pPanel->GetBoundsF().height);
__pPanel->SetPosition(0.0f, clientArea.height - __pPanel->GetBoundsF().height);
__pExpandableEdit->SetSize(clientArea.width - EXPANDABLEEDITAREA_RIGHT_MARGIN, __prevBounds.height);
- __pExpandableEditToken->SetSize(clientArea.width - EXPANDABLEEDITAREA_RIGHT_MARGIN, EXPANDABLEEDITAREA_HEIGHT);
+ __pExpandableEditToken->SetSize(clientArea.width - EXPANDABLEEDITAREA_RIGHT_MARGIN, __prevBoundsToken.height);
__pLabel->SetSize(clientArea.width - LEFT_MARGIN - RIGHT_MARGIN, clientArea.height - PANEL_HEIGHT - TOP_MARGIN - BOTTOM_MARGIN);
__pButton->SetBounds(FloatRectangle(clientArea.width - 147.0f, 15.0f, 129.0f, 90.0f));
Invalidate(true);