From: Seokpil Park Date: Sat, 13 Apr 2013 07:51:10 +0000 (+0900) Subject: [MultiProcUiApp] Apply constant for resource ID X-Git-Tag: 2.1b_release~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=52165de887439414a6b7d12d2dc9d1c48b910173;p=samples%2Fnative%2FMultiProcUiApp.git [MultiProcUiApp] Apply constant for resource ID Change-Id: I7a10b92759d7b6eeb4cafc304ea2f4a077ed6a6c Signed-off-by: Seokpil Park --- diff --git a/project/inc/AppResourceId.h b/project/inc/AppResourceId.h new file mode 100644 index 0000000..9389984 --- /dev/null +++ b/project/inc/AppResourceId.h @@ -0,0 +1,25 @@ +// +// Tizen C++ SDK +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#ifndef _APP_RESOURCE_ID_H_ +#define _APP_RESOURCE_ID_H_ + +extern const wchar_t* IDF_FORM; +extern const wchar_t* IDC_BUTTON_OK; +extern const wchar_t* IDC_LABEL1; + +#endif /* _APP_RESOURCE_ID_H_ */ diff --git a/project/src/AppResourceId.cpp b/project/src/AppResourceId.cpp new file mode 100644 index 0000000..e7fd131 --- /dev/null +++ b/project/src/AppResourceId.cpp @@ -0,0 +1,22 @@ +// +// Tizen C++ SDK +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include "AppResourceId.h" + +const wchar_t* IDF_FORM = L"IDF_FORM"; +const wchar_t* IDC_BUTTON_OK = L"IDC_BUTTON_OK"; +const wchar_t* IDC_LABEL1 = L"IDC_LABEL1"; diff --git a/project/src/SampleUiAppMainForm.cpp b/project/src/SampleUiAppMainForm.cpp index 2a6e003..d251819 100644 --- a/project/src/SampleUiAppMainForm.cpp +++ b/project/src/SampleUiAppMainForm.cpp @@ -17,6 +17,7 @@ #include +#include "AppResourceId.h" #include "SampleType.h" #include "SampleUiAppMainForm.h" @@ -40,7 +41,7 @@ SampleUiAppMainForm::~SampleUiAppMainForm(void) bool SampleUiAppMainForm::Initialize(void) { - Construct(L"IDF_FORM"); + Construct(IDF_FORM); return true; } @@ -54,7 +55,7 @@ SampleUiAppMainForm::OnInitializing(void) SetFormBackEventListener(this); // Get a button via resource ID - Button *pButtonOk = static_cast(GetControl(L"IDC_BUTTON_OK")); + Button *pButtonOk = static_cast(GetControl(IDC_BUTTON_OK)); if (pButtonOk != null) { pButtonOk->SetActionId(ID_BUTTON_OK); @@ -119,8 +120,8 @@ SampleUiAppMainForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs) AppLog("SampleUiApp : OnUserEventReceivedN is called. requestId is %d", requestId); - Label* pLabel = dynamic_cast(GetControl(L"IDC_LABEL1")); - Button* pButton = dynamic_cast(GetControl(L"IDC_BUTTON_OK")); + Label* pLabel = dynamic_cast(GetControl(IDC_LABEL1)); + Button* pButton = dynamic_cast(GetControl(IDC_BUTTON_OK)); switch (requestId) {