Fixed N_SE-38439 tizen_2.1 accepted/tizen_2.1/20130520.093025 submit/tizen_2.1/20130516.041737
authorSeema <seema.nagraj@samsung.com>
Tue, 14 May 2013 10:51:58 +0000 (16:21 +0530)
committerSeema <seema.nagraj@samsung.com>
Tue, 14 May 2013 10:51:58 +0000 (16:21 +0530)
Change-Id: Iaca8bbf09df726a1a0dc1d07728a53fe7a42e186
Signed-off-by: Seema <seema.nagraj@samsung.com>
inc/MmDrawingObject.h
src/MmDrawingEditorForm.cpp
src/MmTextEditorForm.cpp

index 9471fb8..cf65800 100644 (file)
 
 #ifndef _MM_DRAWING_OBJECT_H_
 #define _MM_DRAWING_OBJECT_H_
+
+enum DrawingObjectType
+{
+       CURVELINE_OBJECT,
+       ERASER_OBJECT
+};
+
 class DrawingObject
 {
 public:
@@ -34,6 +41,8 @@ public:
        int GetBrushWidth(void) const;
        void SetBrushColor(const Tizen::Graphics::Color brushColor);
        void SetBrushWidth(const int width);
+       DrawingObjectType GetDrawingObjectType(void) const;
+       void SetDrawingObjectType(const DrawingObjectType objectType);
        bool operator ==(const DrawingObject& rhs) const;
        bool operator !=(const DrawingObject& rhs) const;
 
@@ -45,6 +54,7 @@ private:
        int __brushWidth;
        Tizen::Graphics::Color __color;
        bool __isSelected;
+       DrawingObjectType __objectType;
 };
 
 ///Curve line object
index 8f7d28c..f17fc5e 100644 (file)
@@ -466,6 +466,7 @@ DrawingObject::DrawingObject(Canvas* pCanvas)
        , __brushWidth(0)
        , __color(Color::GetColor(COLOR_ID_BLACK))
        , __isSelected(false)
+       , __objectType(CURVELINE_OBJECT)
 
 {
        return;
@@ -520,6 +521,18 @@ DrawingObject::SetBrushColor(const Color brushColor)
        __color = brushColor;
 }
 
+DrawingObjectType
+DrawingObject::GetDrawingObjectType(void) const
+{
+       return __objectType;
+}
+
+void
+DrawingObject::SetDrawingObjectType(const DrawingObjectType objectType)
+{
+       __objectType = objectType;
+}
+
 void
 DrawingObject::SetBrushWidth(const int width)
 {
@@ -774,12 +787,14 @@ MemoDrawingEditorForm::DrawOnTouchPress(void)
                __pCurveLine = new (std::nothrow) CurveLine(__pCanvas);
                __pCurveLine->SetBrushWidth(__sliderValue);
                __pCurveLine->SetBrushColor(__selectedColor);
+               __pCurveLine->SetDrawingObjectType(CURVELINE_OBJECT);
                __drawingObjects.Add((Object* )__pCurveLine);
        }
        else if (__drawingMode == DRAWING_MODE_ERASER)
        {
                __pEraser = new (std::nothrow) Eraser(__pCanvas);
                __pEraser->SetBrushWidth(__sliderValue);
+               __pEraser->SetDrawingObjectType(ERASER_OBJECT);
                __drawingObjects.Add((Object* )__pEraser);
        }
        if (__isEditMode == false)
@@ -1368,10 +1383,41 @@ MemoDrawingEditorForm::OnSceneActivatedN(const SceneId& previousSceneId, const S
                                {
                                        SetSaveEnabled(false);
                                }
+                               else
+                               {
+                                       int objectCount = __drawingObjects.GetCount();
+                                       bool enable = false;
+                                       for (int i=0; i < objectCount; i++)
+                                       {
+                                               DrawingObject* object = null;
+                                               object = (DrawingObject*)__drawingObjects.GetAt(i);
+                                               if(object != null && object->GetDrawingObjectType() == CURVELINE_OBJECT )
+                                               {
+                                                       CurveLine* pCurveLine = (CurveLine*)object;
+                                                       if(pCurveLine != null && pCurveLine->curvelinePointLists.GetCount() < 2)
+                                                       {
+                                                               enable = false;
+                                                       }
+                                                       else
+                                                       {
+                                                               enable = true;
+                                                               break;
+                                                       }
+                                               }
+                                       }
+                                       if(enable == true)
+                                       {
+                                               SetSaveEnabled(true);
+                                       }
+                                       else
+                                       {
+                                               SetSaveEnabled(false);
+                                       }
+
+                               }
                        }
-                       __pComment->SetCursorPosition(0);
                }
-
+               __pComment->SetCursorPosition(0);
                return;
        }
        UpdateEntireCanvas();
index 66e9606..c4c471d 100644 (file)
@@ -714,7 +714,7 @@ MemoTextEditorForm::ShowHideColorPicker(bool showState)
                __pMemoContentEditarea->HideKeypad();
                int height = 0, width = 0;
                __pMemoContentEditarea->GetSize(width , height);
-               if(height == H_EDITAREA_NOKEYPAD)
+               if(height == H_EDITAREA_NOKEYPAD || height == 887)
                {
                        __isSliderShow = true;
                }