From daebc0902e29496e6f7957a8e5958e0d0dd7f949 Mon Sep 17 00:00:00 2001 From: Sinyoung Hwang Date: Thu, 11 Apr 2013 14:57:56 +0900 Subject: [PATCH] Modified, Sample resource issue Change-Id: Id17f9f48215c68b72315dc914cc6bc7b346178de Signed-off-by: Sinyoung Hwang --- project/inc/AppResourceId.h | 32 ++++++++++++++++++++++++++++++++ project/src/AppResourceId.cpp | 29 +++++++++++++++++++++++++++++ project/src/ChatFrm.cpp | 9 +++++---- project/src/MainFrm.cpp | 13 +++++++------ project/src/SocketChatEntry.cpp | 1 + 5 files changed, 74 insertions(+), 10 deletions(-) create mode 100644 project/inc/AppResourceId.h create mode 100644 project/src/AppResourceId.cpp diff --git a/project/inc/AppResourceId.h b/project/inc/AppResourceId.h new file mode 100644 index 0000000..bec5b50 --- /dev/null +++ b/project/inc/AppResourceId.h @@ -0,0 +1,32 @@ +// +// Tizen Native SDK +// Copyright (c) 2012-2013 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_MAINFRM; +extern const wchar_t* IDC_CHECKTCP; +extern const wchar_t* IDC_CHECKUDP; +extern const wchar_t* IDC_CHECKServer; +extern const wchar_t* IDC_EDITIPaddress; +extern const wchar_t* IDC_EDITPort; +extern const wchar_t* IDF_CHATFRM; +extern const wchar_t* IDC_TEXT; +extern const wchar_t* IDC_DATA; +extern const wchar_t* IDC_Wait; + +#endif // _APP_RESOURCE_ID_H_ diff --git a/project/src/AppResourceId.cpp b/project/src/AppResourceId.cpp new file mode 100644 index 0000000..53b3d72 --- /dev/null +++ b/project/src/AppResourceId.cpp @@ -0,0 +1,29 @@ +// +// Tizen Native SDK +// Copyright (c) 2012-2013 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_MAINFRM = L"IDF_MAINFRM"; +const wchar_t* IDC_CHECKTCP = L"IDC_CHECKTCP"; +const wchar_t* IDC_CHECKUDP = L"IDC_CHECKUDP"; +const wchar_t* IDC_CHECKServer = L"IDC_CHECKServer"; +const wchar_t* IDC_EDITIPaddress = L"IDC_EDITIPaddress"; +const wchar_t* IDC_EDITPort = L"IDC_EDITPort"; +const wchar_t* IDF_CHATFRM = L"IDF_CHATFRM"; +const wchar_t* IDC_TEXT = L"IDC_TEXT"; +const wchar_t* IDC_DATA = L"IDC_DATA"; +const wchar_t* IDC_Wait = L"IDC_Wait"; diff --git a/project/src/ChatFrm.cpp b/project/src/ChatFrm.cpp index 7b58467..3756332 100644 --- a/project/src/ChatFrm.cpp +++ b/project/src/ChatFrm.cpp @@ -15,6 +15,7 @@ // limitations under the License. // +#include "AppResourceId.h" #include "SocketChat.h" #include "FormFactory.h" #include "ChatFrm.h" @@ -96,7 +97,7 @@ bool ChatFrm::Initialize(void) { // Construct an XML form - Construct(L"IDF_CHATFRM"); + Construct(IDF_CHATFRM); return true; } @@ -134,21 +135,21 @@ ChatFrm::OnInitializing(void) __pFooter->AddActionEventListener(*this); } - __pLabelWait = static_cast< Label* >(GetControl(L"IDC_Wait")); + __pLabelWait = static_cast< Label* >(GetControl(IDC_Wait)); if (__pLabelWait == null) { AppLog("Can't get label Handle"); r = E_FAILURE; } - __pEditAreaData = static_cast< EditArea* >(GetControl(L"IDC_DATA")); + __pEditAreaData = static_cast< EditArea* >(GetControl(IDC_DATA)); if (__pEditAreaData == null) { AppLog("Can't get edit area Handle"); r = E_FAILURE; } - __pEditFieldtext = static_cast< EditField* >(GetControl(L"IDC_TEXT")); + __pEditFieldtext = static_cast< EditField* >(GetControl(IDC_TEXT)); if (__pEditFieldtext == null) { AppLog("Can't get edit field Handle"); diff --git a/project/src/MainFrm.cpp b/project/src/MainFrm.cpp index 7454d75..7840c84 100644 --- a/project/src/MainFrm.cpp +++ b/project/src/MainFrm.cpp @@ -15,6 +15,7 @@ // limitations under the License. // +#include "AppResourceId.h" #include "SocketChat.h" #include "FormFactory.h" #include "MainFrm.h" @@ -57,7 +58,7 @@ bool MainFrm::Initialize(void) { // Construct an XML form - Construct(L"IDF_MAINFRM"); + Construct(IDF_MAINFRM); return true; } @@ -68,7 +69,7 @@ MainFrm::OnInitializing(void) result r = E_SUCCESS; // Get a button via resource ID - __pButtonServer = static_cast< CheckButton* >(GetControl(L"IDC_CHECKServer")); + __pButtonServer = static_cast< CheckButton* >(GetControl(IDC_CHECKServer)); if (__pButtonServer != null) { @@ -76,16 +77,16 @@ MainFrm::OnInitializing(void) __pButtonServer->AddActionEventListener(*this); } - __pButtonTcp = static_cast< CheckButton* >(GetControl(L"IDC_CHECKTCP")); - __pButtonUdp = static_cast< CheckButton* >(GetControl(L"IDC_CHECKUDP")); + __pButtonTcp = static_cast< CheckButton* >(GetControl(IDC_CHECKTCP)); + __pButtonUdp = static_cast< CheckButton* >(GetControl(IDC_CHECKUDP)); - __pEditIPAddress = static_cast< EditField* >(GetControl(L"IDC_EDITIPaddress")); + __pEditIPAddress = static_cast< EditField* >(GetControl(IDC_EDITIPaddress)); if (__pEditIPAddress == null) { r = E_FAILURE; } - __pEditPort = static_cast< EditField* >(GetControl(L"IDC_EDITPort")); + __pEditPort = static_cast< EditField* >(GetControl(IDC_EDITPort)); Footer* pFooter = GetFooter(); if (pFooter != null) diff --git a/project/src/SocketChatEntry.cpp b/project/src/SocketChatEntry.cpp index fe3bdaf..14c555a 100644 --- a/project/src/SocketChatEntry.cpp +++ b/project/src/SocketChatEntry.cpp @@ -18,6 +18,7 @@ /** * This file contains the Tizen application entry point. */ + #include #include "SocketChat.h" -- 2.7.4