d8f946af0978024e9e647621bfa974b578a03d39
[apps/native/sample/BasicApp.git] / project / src / BasicAppFrame.cpp
1 //
2 // Tizen C++ SDK
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.1 (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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17
18 #include <new>
19
20 #include "BasicAppFrame.h"
21 #include "MainForm.h"
22
23 using namespace Tizen::Base;
24 using namespace Tizen::Ui;
25 using namespace Tizen::Ui::Controls;
26
27 BasicAppFrame::BasicAppFrame(void)
28         : __panelId(0)
29 {
30 }
31
32 BasicAppFrame::~BasicAppFrame(void)
33 {
34 }
35
36 result
37 BasicAppFrame::Initialize(int panelId)
38 {
39         result r = Frame::Construct();
40         __panelId = panelId;
41
42         return r;
43 }
44
45 result
46 BasicAppFrame::OnInitializing(void)
47 {
48         // Create a form
49         MainForm* pMainForm = new (std::nothrow) MainForm();
50         result r = pMainForm->Initialize(__panelId);
51
52         // Add the form to the frame
53         AddControl(pMainForm);
54
55         // Set the current form
56         SetCurrentForm(*pMainForm);
57
58         // Draw the form
59         pMainForm->Invalidate(true);
60
61         return r;
62 }
63
64 result
65 BasicAppFrame::OnTerminating(void)
66 {
67         result r = E_SUCCESS;
68
69         return r;
70 }