issue #5176, fix compile error on other platforms

This commit is contained in:
andyque 2014-05-26 15:35:43 +08:00
parent e866800044
commit 9118d7a98a
5 changed files with 20 additions and 6 deletions

View File

@ -29,7 +29,8 @@ CCProtectedNode.cpp \
UIHBox.cpp \
UIVBox.cpp \
UIRelativeBox.cpp \
UIVideoPlayerAndroid.cpp
UIVideoPlayerAndroid.cpp \
UIFocusManager.cpp
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../editor-support

View File

@ -22,5 +22,6 @@ set(COCOS_UI_SRC
ui/UITextField.cpp
ui/UIVBox.cpp
ui/UIWidget.cpp
ui/UIFocusManager.cpp
)

View File

@ -46,20 +46,24 @@ namespace ui {
void enableAndroidDpad(bool flag);
void setFirstFocsuedWidget(Widget* widget);
std::function<void(EventKeyboard::KeyCode, Event*)> onKeypadReleased = nullptr;
std::function<void(EventKeyboard::KeyCode, Event*)> onKeypadReleased;
protected:
void onKeypadKeyPressed(EventKeyboard::KeyCode, Event*);
private:
FocusManager(){}
FocusManager():_keyboardListener(nullptr),
_firstFocusedWidget(nullptr),
_enableAndroidDpad(false),
onKeypadReleased(nullptr)
{}
~FocusManager();
static FocusManager* _instance;
EventListenerKeyboard* _keyboardListener = nullptr;
Widget* _firstFocusedWidget = nullptr;
bool _enableAndroidDpad = false;
EventListenerKeyboard* _keyboardListener ;
Widget* _firstFocusedWidget ;
bool _enableAndroidDpad ;
};
}

View File

@ -15,6 +15,7 @@
<ClInclude Include="..\CocosGUI.h" />
<ClInclude Include="..\UIButton.h" />
<ClInclude Include="..\UICheckBox.h" />
<ClInclude Include="..\UIFocusManager.h" />
<ClInclude Include="..\UIHBox.h" />
<ClInclude Include="..\UIHelper.h" />
<ClInclude Include="..\UIImageView.h" />
@ -41,6 +42,7 @@
<ClCompile Include="..\CocosGUI.cpp" />
<ClCompile Include="..\UIButton.cpp" />
<ClCompile Include="..\UICheckBox.cpp" />
<ClCompile Include="..\UIFocusManager.cpp" />
<ClCompile Include="..\UIHBox.cpp" />
<ClCompile Include="..\UIHelper.cpp" />
<ClCompile Include="..\UIImageView.cpp" />

View File

@ -90,6 +90,9 @@
<ClInclude Include="..\UILayoutExecutant.h">
<Filter>Layouts</Filter>
</ClInclude>
<ClInclude Include="..\UIFocusManager.h">
<Filter>BaseClasses</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\UIScrollView.cpp">
@ -161,5 +164,8 @@
<ClCompile Include="..\UILayoutExecutant.cpp">
<Filter>Layouts</Filter>
</ClCompile>
<ClCompile Include="..\UIFocusManager.cpp">
<Filter>BaseClasses</Filter>
</ClCompile>
</ItemGroup>
</Project>