[MultiProcUiApp] Apply constant for resource ID
authorSeokpil Park <seokpil.park@samsung.com>
Sat, 13 Apr 2013 07:51:10 +0000 (16:51 +0900)
committerSeokpil Park <seokpil.park@samsung.com>
Sat, 13 Apr 2013 07:51:13 +0000 (16:51 +0900)
Change-Id: I7a10b92759d7b6eeb4cafc304ea2f4a077ed6a6c
Signed-off-by: Seokpil Park <seokpil.park@samsung.com>
project/inc/AppResourceId.h [new file with mode: 0644]
project/src/AppResourceId.cpp [new file with mode: 0644]
project/src/SampleUiAppMainForm.cpp

diff --git a/project/inc/AppResourceId.h b/project/inc/AppResourceId.h
new file mode 100644 (file)
index 0000000..9389984
--- /dev/null
@@ -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 (file)
index 0000000..e7fd131
--- /dev/null
@@ -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";
index 2a6e003..d251819 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <FApp.h>
 
+#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<Button*>(GetControl(L"IDC_BUTTON_OK"));
+       Button *pButtonOk = static_cast<Button*>(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<Label*>(GetControl(L"IDC_LABEL1"));
-       Button* pButton = dynamic_cast<Button*>(GetControl(L"IDC_BUTTON_OK"));
+       Label* pLabel = dynamic_cast<Label*>(GetControl(IDC_LABEL1));
+       Button* pButton = dynamic_cast<Button*>(GetControl(IDC_BUTTON_OK));
 
        switch (requestId)
        {