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 "ColorPickerForm.h"
\r
19 using namespace Osp::Ui;
\r
20 using namespace Osp::Ui::Controls;
\r
21 using namespace Osp::Graphics;
\r
23 ColorPickerForm::ColorPickerForm():
\r
29 ColorPickerForm::~ColorPickerForm()
\r
34 ColorPickerForm::Initialize(void)
\r
36 Construct(FORM_STYLE_NORMAL| FORM_STYLE_INDICATOR| FORM_STYLE_HEADER| FORM_STYLE_FOOTER);
\r
43 ColorPickerForm::OnInitializing(void)
\r
45 BaseForm::OnInitializing();
\r
46 result r = E_SUCCESS;
\r
47 Header* pHeader = GetHeader();
\r
48 pHeader->SetTitleText(L"ColorPicker");
\r
50 ColorPicker* pColorPicker = new ColorPicker();
\r
51 pColorPicker->Construct(Point(10,60));
\r
52 pColorPicker->AddColorChangeEventListener(*this);
\r
54 AddControl(*pColorPicker);
\r
57 rc = GetClientAreaBounds();
\r
59 __pLabelLog = new Label();
\r
60 __pLabelLog->Construct(Rectangle(45, rc.height-120, 630, 90), L"");
\r
61 __pLabelLog->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
\r
62 AddControl(*__pLabelLog);
\r
64 __pLabelText = new Label();
\r
65 __pLabelText->Construct(Rectangle(45, rc.height-225, 630, 90), L"Selected Color is");
\r
66 __pLabelText->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
\r
67 AddControl(*__pLabelText);
\r
73 ColorPickerForm::OnColorChanged(const Osp::Ui::Control& source, const Osp::Graphics::Color& color)
\r
75 __pLabelLog->SetBackgroundColor(color);
\r
76 __pLabelLog->Draw();
\r