2 // Open Service Platform
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://www.tizenopensource.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.
17 #include "ButtonForm.h"
\r
19 using namespace Osp::Ui;
\r
20 using namespace Osp::Ui::Controls;
\r
21 using namespace Osp::Graphics;
\r
23 ButtonForm::ButtonForm(void):
\r
24 __pLabelButton(null)
\r
28 ButtonForm::~ButtonForm(void)
\r
33 ButtonForm::Initialize(void)
\r
35 Construct(L"IDF_FORM_BUTTON");
\r
41 ButtonForm::OnInitializing(void)
\r
43 BaseForm::OnInitializing();
\r
44 result r = E_SUCCESS;
\r
46 Header* pHeader = GetHeader();
\r
47 pHeader->SetTitleText(L"Button");
\r
49 __pLabelButton = static_cast<Label *>(GetControl(L"IDF_LABEL_BUTTON"));
\r
51 rc = GetClientAreaBounds();
\r
52 __pLabelButton->SetPosition(30, rc.height-60);
\r
53 Button* pButtonOn = static_cast<Button *>(GetControl(L"IDF_BUTTON_ON"));
\r
54 Button* pButtonOff = static_cast<Button *>(GetControl(L"IDF_BUTTON_OFF"));
\r
56 __pLabelButton->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
\r
57 __pLabelButton->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
\r
59 pButtonOn->SetActionId(ID_BUTTON_ON);
\r
60 pButtonOff->SetActionId(ID_BUTTON_OFF);
\r
61 pButtonOn->AddActionEventListener(*this);
\r
62 pButtonOff->AddActionEventListener(*this);
\r
68 ButtonForm::OnActionPerformed(const Control& source, int actionId)
\r
73 __pLabelButton->SetText(L"Button ON Clicked!");
\r
77 __pLabelButton->SetText(L"Button OFF Clicked!");
\r
83 __pLabelButton->Draw();
\r