temp commit

This commit is contained in:
yangws 2011-05-06 16:38:09 +08:00
parent 0fe61642f6
commit ced029257f
6 changed files with 844 additions and 797 deletions

View File

@ -181,7 +181,7 @@
</References>
<Files>
<Filter
Name="source"
Name="Classes"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
@ -203,19 +203,7 @@
</File>
</Filter>
<Filter
Name="Makefiles"
>
<File
RelativePath=".\HelloWorld.TMK3"
>
</File>
<File
RelativePath=".\Makefile.ARM"
>
</File>
</Filter>
<Filter
Name="Framework"
Name="wophone"
>
<File
RelativePath=".\HelloWorldUnicodeScript.h"
@ -251,22 +239,18 @@
RelativePath=".\TG3AppDllEntry.h"
>
</File>
</Filter>
<Filter
Name="Resource"
>
<File
RelativePath="..\Resource\CloseNormal.png"
<Filter
Name="Makefiles"
>
</File>
<File
RelativePath="..\Resource\CloseSelected.png"
>
</File>
<File
RelativePath="..\Resource\HelloWorld.png"
>
</File>
<File
RelativePath=".\HelloWorld.TMK3"
>
</File>
<File
RelativePath=".\Makefile.ARM"
>
</File>
</Filter>
</Filter>
</Files>
<Globals>

View File

@ -206,6 +206,7 @@ CCEGLView::CCEGLView(TApplication * pApp)
, m_pTextField(NULL)
, m_nTextLen(0)
{
memset(&m_rcKeyboard, 0, sizeof(m_rcKeyboard));
}
CCEGLView::~CCEGLView()
@ -214,7 +215,7 @@ CCEGLView::~CCEGLView()
CC_SAFE_DELETE(m_pEGL);
}
Boolean CCEGLView::Create(int nWidthInPoints, int nHeightInPoints)
Boolean CCEGLView::Create(int nWidthInPoints, int nHeightInPoints, UInt32 eRotateMode)
{
// record the window size in points
m_tSizeInPoints.SetWidth(nWidthInPoints);
@ -236,6 +237,23 @@ Boolean CCEGLView::Create(int nWidthInPoints, int nHeightInPoints)
Boolean bRet = TWindow::Create(&TRectangle(0, 0, nWidth, nHeight));
Coord temp;
Int32 tmp;
if (WM_WINDOW_ROTATE_MODE_CW == eRotateMode
|| WM_WINDOW_ROTATE_MODE_CCW == eRotateMode)
{
temp = m_rcViewPort.X();
m_rcViewPort.SetX(m_rcViewPort.Y());
m_rcViewPort.SetY(temp);
temp = m_rcViewPort.Width();
m_rcViewPort.SetWidth(m_rcViewPort.Height());
m_rcViewPort.SetHeight(temp);
tmp = m_tSizeInPoints.Width();
m_tSizeInPoints.SetWidth(m_tSizeInPoints.Height());
m_tSizeInPoints.SetHeight(tmp);
}
this->RotateWindow(eRotateMode);
if (bRet)
{
s_pMainWindow = this;
@ -310,6 +328,46 @@ Boolean CCEGLView::EventHandler(TApplication * pApp, EventType * pEvent)
}
break;
case EVENT_WinImeStatusNotify:
{
EosImeNotifyEventType * pNotify = (EosImeNotifyEventType*)pEvent;
if (IME_NOTIFY_TYPE_KEYBOARD_SIZE == pNotify->notifyType)
{
m_rcKeyboard = pNotify->rtKeyboard;
//keyboard open
CCIMEKeyboardNotificationInfo info;
info.begin = CCRectMake((float)0
, (float)0 - m_rcKeyboard.extent.Y
, (float)m_rcKeyboard.extent.X
, (float)m_rcKeyboard.extent.Y);
info.end = CCRectMake((float)0
, (float)0
, (float)m_rcKeyboard.extent.X
, (float)m_rcKeyboard.extent.Y);
info.duration = 0;
CCIMEDispatcher::sharedDispatcher()->dispatchKeyboardWillShow(info);
CCIMEDispatcher::sharedDispatcher()->dispatchKeyboardDidShow(info);
}
else if (IME_NOTIFY_TYPE_IME_CLOSE == pNotify->notifyType)
{
CCIMEKeyboardNotificationInfo info;
info.begin = CCRectMake((float)0
, (float)0
, (float)m_rcKeyboard.extent.X
, (float)m_rcKeyboard.extent.Y);
info.end = CCRectMake((float)0
, (float)0 - m_rcKeyboard.extent.Y
, (float)m_rcKeyboard.extent.X
, (float)m_rcKeyboard.extent.Y);
info.duration = 0;
CCIMEDispatcher::sharedDispatcher()->dispatchKeyboardWillHide(info);
CCIMEDispatcher::sharedDispatcher()->dispatchKeyboardDidHide(info);
}
pEvent->sParam1 = pEvent->sParam1;
}
break;
case EVENT_FieldChanged:
do
{

View File

@ -47,7 +47,7 @@ public:
CCEGLView(TApplication * pApp);
virtual ~CCEGLView();
virtual Boolean Create(int nWidthInPoints, int nHeightInPoints);
virtual Boolean Create(int nWidthInPoints, int nHeightInPoints, UInt32 eRotateMode = WM_WINDOW_ROTATE_MODE_NORMAL);
virtual Boolean AfterCreate(void);
virtual Boolean EventHandler(TApplication * pApp, EventType * pEvent);
@ -84,6 +84,7 @@ private:
TRectangle m_rcViewPort;
TEdit * m_pTextField;
int m_nTextLen;
RectangleType m_rcKeyboard;
};
} // end of namespace cocos2d

View File

@ -46,7 +46,7 @@ bool AppDelegate::initInstance()
// Initialize OpenGLView instance, that release by CCDirector when application terminate.
// The tests is designed as HVGA.
CCEGLView* pMainWnd = new CCEGLView(this);
CC_BREAK_IF(! pMainWnd || ! pMainWnd->Create(320,480));
CC_BREAK_IF(! pMainWnd || ! pMainWnd->Create(320 ,480, WM_WINDOW_ROTATE_MODE_CW));
#ifndef _TRANZDA_VM_
// on wophone emulator, we copy resources files to Work7/NEWPLUS/TDA_DATA/Data folder instead of zip file

View File

@ -83,6 +83,7 @@ OBJECTS = \
$(OBJECTS_DIR)/KeypadTest.o \
$(OBJECTS_DIR)/LabelTest.o \
$(OBJECTS_DIR)/LayerTest.o \
$(OBJECTS_DIR)/TextInputTest.o \
$(OBJECTS_DIR)/MenuTest.o \
$(OBJECTS_DIR)/MotionStreakTest.o \
$(OBJECTS_DIR)/ParallaxTest.o \
@ -258,6 +259,9 @@ $(OBJECTS_DIR)/KeypadTest.o : ../tests/KeypadTest/KeypadTest.cpp
$(OBJECTS_DIR)/LabelTest.o : ../tests/LabelTest/LabelTest.cpp
$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/LabelTest.o ../tests/LabelTest/LabelTest.cpp
$(OBJECTS_DIR)/TextInputTest.o : ../tests/TextInputTest/TextInputTest.cpp
$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/TextInputTest.o ../tests/TextInputTest/TextInputTest.cpp
$(OBJECTS_DIR)/LayerTest.o : ../tests/LayerTest/LayerTest.cpp
$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/LayerTest.o ../tests/LayerTest/LayerTest.cpp

File diff suppressed because it is too large Load Diff