modify sample code
authorwoo <s-w.woo@samsung.com>
Thu, 9 May 2013 06:53:59 +0000 (15:53 +0900)
committerwoo <s-w.woo@samsung.com>
Thu, 9 May 2013 07:45:46 +0000 (16:45 +0900)
Change-Id: Ie3e0ad26c18930315c31d74b7bcce20154e1fea1
Signed-off-by: woo <s-w.woo@samsung.com>
inc/FUiClipboard.h
inc/FUiCtrlContextMenu.h
inc/FUiCtrlEditTime.h
inc/FUiCtrlIconList.h
inc/FUiCtrlPanel.h
inc/FUiCtrlProgress.h
inc/FUiCtrlProgressPopup.h
inc/FUiCtrlSectionTableView.h
inc/FUiDataBindingContext.h
inc/FUiGridLayout.h
inc/FUiVerticalBoxLayout.h

index f8bc28a..5ad4d93 100644 (file)
@@ -116,11 +116,11 @@ ClipboardSample::OnInitializing(void)
        pButton->Construct(Rectangle(50, 50, 200, 80), "COPY");
        pButton->SetActionId(ID_BUTTON_OK);
        pButton->AddActionEventListener(*this);
-       AddControl(*pButton);
+       AddControl(pButton);
 
        __pLabel = new Label();
        __pLabel->Construct(Rectangle(0, 200, GetClientAreaBounds().width, 80), L"..");
-       AddControl(*__pLabel);
+       AddControl(__pLabel);
 
        return r;
 }
index 9d5324c..2c4351c 100644 (file)
@@ -165,7 +165,7 @@ ContextMenuSample::OnInitializing(void)
        pButton->AddActionEventListener(*this);
 
        // Adds the button to the form
-       AddControl(*pButton);
+       AddControl(pButton);
 
        return r;
 }
index f67ee8b..b3e1457 100644 (file)
@@ -96,7 +96,7 @@ EditTimeSample::OnInitializing(void)
        __pEditTime->AddTimeChangeEventListener(*this);
 
        //Adds the edit time to the form
-       AddControl(*__pEditTime);
+       AddControl(__pEditTime);
 
        return r;
 }
index c92a74b..cc4ee9a 100644 (file)
@@ -146,7 +146,7 @@ IconListSample::OnInitializing(void)
        __pIconList->AddItem(&itemText2, pBitmapNormal2, pBitmapFocused2, ID_LIST_SECONDITEM);
 
        // Adds the icon list to the form
-       AddControl(*__pIconList);
+       AddControl(__pIconList);
 
        // Deallocates bitmaps
        delete pBitmapNormal1;
index c4e0543..b7a60ca 100644 (file)
@@ -101,7 +101,7 @@ PanelSample::OnInitializing(void)
        __pPanel->SetBackgroundColor(Color(0x50, 0xFF, 0x38));
 
        //Adds the panel to the form
-       AddControl(*__pPanel);
+       AddControl(__pPanel);
 
        return r;
 }
index f50bf31..e718834 100644 (file)
@@ -104,8 +104,8 @@ ProgressSample::OnInitializing(void)
        pButton->AddActionEventListener(*this);
 
        // Adds the __pProgress and the pButton to the form
-       AddControl(*__pProgress);
-       AddControl(*pButton);
+       AddControl(__pProgress);
+       AddControl(pButton);
 
        return r;
 }
index 46846cd..482823a 100644 (file)
@@ -60,6 +60,7 @@ namespace Tizen { namespace Ui { namespace Controls
 class ProgressPopupSample
        : public Tizen::Ui::Controls::Form
        , public Tizen::Ui::IProgressPopupEventListener
+       , public Tizen::Ui::IActionEventListener
 {
 public:
        ProgressPopupSample(void);
@@ -119,9 +120,10 @@ ProgressPopupSample::OnInitializing(void)
 
        // Creates an instance of Button to open the ProgressPopup.
        Button* pButtonProgressPopup = new Button();
-       pButtonProgressPopup->Construct(Rectangle(10, 10, 250, 60), L"Open ProgressPopup");
+       pButtonProgressPopup->Construct(Rectangle(50, 50, 350, 100), L"Open ProgressPopup");
        pButtonProgressPopup->SetActionId(ID_BUTTON_PROGRESSPOPUP);
        pButtonProgressPopup->AddActionEventListener(*this);
+       AddControl(pButtonProgressPopup);
 
        return r;
 }
index 6df6d15..0a9eab0 100644 (file)
@@ -62,8 +62,7 @@ class SectionTableViewSample
 {
 public:
        SectionTableViewSample(void)
-       : __pSectionTableView(null)
-       , __pContextItem(null){}
+       : __pSectionTableView(null){}
 
        bool Initialize(void);
        virtual result OnInitializing(void);
@@ -117,13 +116,13 @@ SectionTableViewSample::OnInitializing(void)
        result r = E_SUCCESS;
 
        // Creates an instance of TableView
-       __pSectionTableView = new TableView();
+       __pSectionTableView = new SectionTableView();
        __pSectionTableView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height), true, TABLE_VIEW_SCROLL_BAR_STYLE_FADE_OUT);
-       __pSectionTableView->SetItemProvider(*this);
+       __pSectionTableView->SetItemProvider(this);
        __pSectionTableView->AddSectionTableViewItemEventListener(*this);
 
        // Adds the Section TableView to the form
-       AddControl(*__pSectionTableView);
+       AddControl(__pSectionTableView);
        return r;
 }
 
@@ -162,13 +161,13 @@ SectionTableViewSample::GetItemCount(int sectionIndex)
 bool
 SectionTableViewSample::HasSectionHeader(int sectionIndex)
 {
-       true;
+       return true;
 }
 
 bool
 SectionTableViewSample::HasSectionFooter(int sectionIndex)
 {
-       true;
+       return true;
 }
 
 String
@@ -231,9 +230,9 @@ SectionTableViewSample::CreateItem(int sectionIndex, int itemIndex, int itemWidt
        text.Format(30, L"TableViewItem %d", itemIndex);
 
        Label* pLabel = new Label();
-       pLabel->Construct(Rectangle(0, 0, itemWidth, GetDefaultItemHeight(), text);
+       pLabel->Construct(Rectangle(0, 0, itemWidth, GetDefaultItemHeight()), text);
 
-       pItem->AddControl(*pLabel);
+       pItem->AddControl(pLabel);
 
        return pItem;
 
index 500852c..d16778c 100644 (file)
@@ -63,9 +63,6 @@ class DataBindingSample
        , public Tizen::Ui::IActionEventListener
 {
 public:
-       DataBindingSample(void);
-       virtual ~DataBindingSample(void);
-
        virtual bool Initialize(void);
        virtual result OnInitializing(void);
        virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
@@ -98,7 +95,6 @@ bool
 DataBindingSample::Initialize(void)
 {
        Construct(FORM_STYLE_NORMAL| FORM_STYLE_INDICATOR| FORM_STYLE_HEADER| FORM_STYLE_FOOTER);
-       SetFooter();
        return true;
 }
 
@@ -116,25 +112,25 @@ DataBindingSample::OnInitializing(void)
        __pUpdateBindingButton = new (std::nothrow) Button();
        __pUpdateBindingButton->Construct(Rectangle(10, rect.height / 6, rect.width - 20, rect.height / 6), L"BindingTarget");
        __pUpdateBindingButton->SetName("Target");
-       AddControl(*__pUpdateBindingButton);
+       AddControl(__pUpdateBindingButton);
 
        __pTargetButton = new (std::nothrow) Button();
        __pTargetButton->Construct(Rectangle(10, (rect.height / 3) + 10 , (rect.width - 20), rect.height / 6), L"Update Binding");
        __pTargetButton->SetActionId(ID_BUTTON_UPDATE_BINDING);
        __pTargetButton->AddActionEventListener(*this);
-       AddControl(*__pTargetButton);
+       AddControl(__pTargetButton);
 
        __pUnbindButton = new (std::nothrow) Button();
        __pUnbindButton->Construct(Rectangle(10, (rect.height * 2 / 3), (rect.width / 2) - 10, rect.height / 6), L"Unbind");
        __pUnbindButton->SetActionId(ID_BUTTON_UNBIND);
        __pUnbindButton->AddActionEventListener(*this);
-       AddControl(*__pUnbindButton);
+       AddControl(__pUnbindButton);
 
        __pBindButton = new (std::nothrow) Button();
        __pBindButton->Construct(Rectangle((rect.width / 2) + 10 , (rect.height * 2 / 3), (rect.width / 2) - 20 , rect.height / 6), L"Bind");
        __pBindButton->SetActionId(ID_BUTTON_BIND);
        __pBindButton->AddActionEventListener(*this);
-       AddControl(*__pBindButton);
+       AddControl(__pBindButton);
 
        DataBindingContext* pContext = GetDataBindingContextN();
        r = pContext->Bind(L"bindingcount", L"Target", L"text", __bindIntegerToButtonText, DATA_BINDING_DATA_TYPE_INTEGER, DATA_BINDING_FLOW_ONE_WAY, DATA_BINDING_TRIGGER_EXPLICIT, null, null, null);
index 712cbb6..bbeb97f 100644 (file)
@@ -88,26 +88,26 @@ GridLayoutSample::OnInitializing(void)
                Label* pLabel1 = new Label();
                pLabel1->Construct(Rectangle(0, 0, 100, 200), L"Label1\n(0, 0)");
                pLabel1->SetBackgroundColor(Color(0x00, 0x10, 0x80, 0xFF));
-               pPanel->AddControl(*pLabel1);
+               pPanel->AddControl(pLabel1);
 
                Label* pLabel2 = new Label();
                pLabel2->Construct(Rectangle(0, 0, 100, 200), L"Label2\n(0, 1)");
                pLabel2->SetBackgroundColor(Color(0x00, 0x20, 0xA0, 0xFF));
-               pPanel->AddControl(*pLabel2);
+               pPanel->AddControl(pLabel2);
 
                Label* pLabel3 = new Label();
                pLabel3->Construct(Rectangle(0, 0, 100, 200), L"Label3\n(0, 2)");
                pLabel3->SetBackgroundColor(Color(0x00, 0x30, 0xC0, 0xFF));
-               pPanel->AddControl(*pLabel3);
+               pPanel->AddControl(pLabel3);
 
                Label* pLabel4 = new Label();
                pLabel4->Construct(Rectangle(0, 0, 100, 200), L"Label4\n(1, 0)");
                pLabel4->SetBackgroundColor(Color(0x00, 0x40, 0xE0, 0xFF));
-               pPanel->AddControl(*pLabel4);
+               pPanel->AddControl(pLabel4);
 
                Button* pButton = new Button();
                pButton->Construct(Rectangle(0, 0, 100, 200), L"Button\n(1, 1)");
-               pPanel->AddControl(*pButton);
+               pPanel->AddControl(pButton);
 
                // Sets position to each label and button in grid layout
                gridPanelLayout.SetPosition(*pLabel1, 0, 0, 1, 1);
@@ -128,7 +128,7 @@ GridLayoutSample::OnInitializing(void)
        }
 
        // Adds the top panel to the form
-       AddControl(*pPanel);
+       AddControl(pPanel);
 
        return r;
 }
index 3518564..24e76d1 100644 (file)
@@ -93,21 +93,21 @@ VerticalBoxLayoutSample::OnInitializing(void)
                Label* pLabel1 = new Label();
                pLabel1->Construct(Rectangle(0,0,150,80), L"RIGHT");
                pLabel1->SetBackgroundColor(Color(0x00, 0x10, 0x80, 0xFF));
-               pTopPanel->AddControl(*pLabel1);
+               pTopPanel->AddControl(pLabel1);
 
                Label* pLabel2 = new Label();
                pLabel2->Construct(Rectangle(0,0,200,80), L"CENTER");
                pLabel2->SetBackgroundColor(Color(0x00, 0x20, 0xA0, 0xFF));
-               pTopPanel->AddControl(*pLabel2);
+               pTopPanel->AddControl(pLabel2);
 
                Label* pLabel3 = new Label();
                pLabel3->Construct(Rectangle(0,0,150,80), L"LEFT");
                pLabel3->SetBackgroundColor(Color(0x00, 0x30, 0xC0, 0xFF));
-               pTopPanel->AddControl(*pLabel3);
+               pTopPanel->AddControl(pLabel3);
 
                Button* pButton = new Button();
                pButton->Construct(Rectangle(0,0,150,80), "FIT TO PARENT");
-               pTopPanel->AddControl(*pButton);
+               pTopPanel->AddControl(pButton);
 
                // Sets relations each label and button
                topPanelLayout.SetHorizontalAlignment(*pLabel1, LAYOUT_HORIZONTAL_ALIGN_RIGHT);
@@ -118,7 +118,7 @@ VerticalBoxLayoutSample::OnInitializing(void)
        }
 
        // Adds the top panel to the form
-       AddControl(*pTopPanel);
+       AddControl(pTopPanel);
 
        // Creates an instance of VerticalBoxLayout for the bottom panel
        VerticalBoxLayout bottomPanelLayout;
@@ -132,17 +132,17 @@ VerticalBoxLayoutSample::OnInitializing(void)
                Label* pLabel1 = new Label();
                pLabel1->Construct(Rectangle(0,0,100,50), L"WEIGHT = 1.0f");
                pLabel1->SetBackgroundColor(Color(0x00, 0x10, 0x80, 0xFF));
-               pBottomPanel->AddControl(*pLabel1);
+               pBottomPanel->AddControl(pLabel1);
 
                Label* pLabel2 = new Label();
                pLabel2->Construct(Rectangle(0,0,100,50), L"WEIGHT = 2.0f");
                pLabel2->SetBackgroundColor(Color(0x00, 0x20, 0xA0, 0xFF));
-               pBottomPanel->AddControl(*pLabel2);
+               pBottomPanel->AddControl(pLabel2);
 
                Label* pLabel3 = new Label();
                pLabel3->Construct(Rectangle(0,0,100,50), L"WEIGHT = 3.0f");
                pLabel3->SetBackgroundColor(Color(0x00, 0x30, 0xC0, 0xFF));
-               pBottomPanel->AddControl(*pLabel3);
+               pBottomPanel->AddControl(pLabel3);
 
                // Sets relations each label
                bottomPanelLayout.SetHorizontalFitPolicy(*pLabel1, FIT_POLICY_PARENT);
@@ -154,7 +154,7 @@ VerticalBoxLayoutSample::OnInitializing(void)
        }
 
        // Adds the bottom panel to the form
-       AddControl(*pBottomPanel);
+       AddControl(pBottomPanel);
 
        //Gets the layout of the form
        VerticalBoxLayout* pFormLayout = dynamic_cast<VerticalBoxLayout*>(this->GetLayoutN());