3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
21 #include "ButtonPanel.h"
23 using namespace Tizen::Base;
24 using namespace Tizen::Ui::Controls;
25 using namespace Tizen::Graphics;
27 ButtonPanel::ButtonPanel(void)
32 ButtonPanel::~ButtonPanel(void)
37 ButtonPanel::Initialize(const Tizen::Graphics::Rectangle& rect)
39 return Panel::Construct(rect);
43 ButtonPanel::OnInitializing(void)
46 __pLabel = new (std::nothrow) Label();
47 __pLabel->Construct(Rectangle(45, 190, 600, 80), L"Button");
48 __pLabel->SetName(L"Label1");
49 __pLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
50 __pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
51 result r = AddControl(__pLabel);
54 Button *pButton = new (std::nothrow) Button();
55 pButton->Construct(Rectangle(20, 290, 680, 160));
56 pButton->SetText(L"Change Text");
57 pButton->SetActionId(ID_BUTTON);
58 pButton->AddActionEventListener(*this);
59 r = AddControl(pButton);
65 ButtonPanel::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
71 __pLabel->SetText(L"Button is clicked!");
72 AppLog("Button is pressed! \n");