Commit Graph

141 Commits

Author SHA1 Message Date
zilongshanren a93bc88d31 add Mac Editbox multiline support.
1. It also refactor the original logic and optimize the iOS EditBox implementation.
2016-02-04 14:21:07 +08:00
Wenhai Lin 4992037c5c Avoid creating temporary string objects 2016-02-03 23:12:37 +08:00
zilongshanren 161be986af Merge pull request #14340 from fnz/easyjni
easy jni
2016-01-12 11:50:16 +08:00
mogemimi aac1558b75 Fix typos in documentation, comments and strings 2015-12-21 08:22:41 +09:00
Sergey 89f4a1208b fix font for EditBox in iOS & Mac 2015-12-17 12:02:39 +03:00
Wenhai Lin 4fa58602a8 Adds `std::nothrow` to the `new` statements 2015-12-16 14:02:55 +08:00
fnz 8c691430c1 conflicts resolved 2015-11-27 13:19:10 +03:00
fnz c4b995fe59 updates to JniHelper, refactoring of existing JNI calls 2015-11-27 12:00:33 +03:00
zilongshanren 8d1f1a9933 Merge pull request #14457 from zilongshanren/testEditBoxScaleSize
Fix edit box setPlaceholderFontName and scale font size issue
2015-11-24 11:33:52 +08:00
François Dupayrat 12df5ae1cc Fix wrong variable use for setPlaceholderFontName
1. fix editbox scale not affect native font size
2015-11-23 11:49:22 +08:00
zilongshanren 689c0f4af3 Merge pull request #14327 from wohaaitinciu/editbox-win32
Fix a fatal bug in EditBox implement for platform win32
2015-11-23 11:35:40 +08:00
Jeff Wang 9cbcd00798 some properties should be set 2015-11-18 22:47:26 +08:00
zilongshanren 02b59f020e Fix onEndEditing issue in script.
Issue: https://github.com/cocos2d/cocos2d-x/issues/14332
2015-11-18 15:05:13 +08:00
XiaoFeng e3c120eef4 Combine Studio change for compatible with 32 bit Mac System 2015-11-16 18:25:26 +08:00
Jeff Wang c1a64e9243 new implementation of EditBoxImpl-win32 2015-11-06 02:14:34 +08:00
mogemimi daa29752db Fix typo in UIEditBox 2015-10-12 13:57:50 +09:00
mogemimi 5993304e06 Fix typos 2015-10-09 17:59:11 +09:00
pandamicro 1e298a2c1a Merge pull request #14064 from MSOpenTech/v3-win10-fix
V3: fixed Windows 10 UWP app manifest by correcting image asset paths
2015-10-04 10:53:52 +08:00
Dale Stammen 32eeb560c3 clean up include files for WINRT platforms 2015-10-02 18:49:41 -07:00
mogemimi 9f768bc1ab Add missing override keyword 2015-10-02 18:18:23 +09:00
hanxi b1ed1a8a51 add UIEditBox support linux platform. 2015-09-18 17:11:58 +08:00
andyque 1be5402050 Merge branch 'v3' into addiOSMultiline-support
# Conflicts:
#	build/cocos2d_libs.xcodeproj/project.pbxproj
2015-09-16 21:49:55 +08:00
Mazyad Alabduljaleel 3090599f83 Oops, committed duplicate code by mistake 2015-09-16 10:12:07 +03:00
Mazyad Alabduljaleel 61980d1a8b [refactor] Break down the file into separate files, because it exceeded 1 kLOC 🙀
[refactor] Consolidate `UITextView` and `UITextField` APIs.
[refactor] rename classes that start with `UI` to `CCUI`, since that prefix is reserved by Apple.
[bugfix] setting the placeholder for `CCUISingleLineTextField` was missing in `createSingleLineTextField`
[bugfix] In `MultiLineTextView`, if `placeholder` changed, there doesn't seem to be a deterministic way of updating the `placeholderLabel`. We are relying on `drawRect:`. Instead, `placeholder` is now a computed property on top of `placeholderLabel.text`.
[bugfix] If the user wants multi-line secure input, we should set it, since it is possible, right?
[minor] `[viewWithTag:999]` was used instead of calling the property itself.
[minor] `drawRect:` was used to load properties, when it is normally in the getter.
[minor] fix ObjC code style
2015-09-15 23:36:26 +03:00
andyque 556175df1e add iOS EditBox multiline support
When the inputMode is ANY, then we use TextView to input.
otherwise we use normal UITextField.

Fixed issue https://github.com/cocos2d/cocos2d-x/issues/13436
2015-09-15 13:52:39 +08:00
pandamicro 4fb34ba190 Merge pull request #13703 from cocos2d/v3.8
Sync v3.8 to v3
2015-09-07 14:56:37 +08:00
andyque c0f40ad4a5 fix Android EditBox font size issue 2015-09-02 18:25:30 +08:00
子龙山人 2e9e660cbb Merge pull request #13220 from zilongshanren/testEditBoxWin32
Improved EditBox implement for platform win32
2015-09-01 10:40:11 +08:00
Jeff Wang b8105349c7 revert to the original state when user cancel input 2015-09-01 00:06:18 +08:00
andyque 367a105a48 refactor EditBox iOS&Android implementation
Fixed issue: https://github.com/cocos2d/cocos2d-x/issues/13616#issuecomment-135742727
2015-08-31 18:36:27 +08:00
Vladimir Perminov 24d06bb1c9 More use StringUtf8ToWideChar and PlatformStringFromString 2015-08-17 23:04:05 +03:00
andyque f9385d1604 fix iOS EditBox Chinese input maxLength issue.
https://github.com/cocos2d/cocos2d-x/issues/12519
2015-08-13 15:01:14 +08:00
andyque a35e89225e Re-implement Editbox on Android platform.
This PR also fixed issue:

https://github.com/cocos2d/cocos2d-x/issues/9572

For the new EditBox:

1. Added a ResizeLayout for updating layout when soft keyboard is shown.
This is because some Android devices won't refresh the view and when
the view is panned, the native EditText will turn black. This is really
a hack, but it works for many Android devices from 2.3 to 5.0.

When keyboard is beginning to show, the ResizeLayout's doLayout
method will be called 24 frames per second. Once the keyboard is closed,
or the user begins to input, the doLayout method will be disabled.

2. EditText is working in a different UI thread, so all the data
are passed to GL thread via callbacks in UI thead.

3. It also overrides onKeyDown method in Cocos2dxEditBox.
When the EditText got the focus, users could press back key to exit
the game. This behavior is not allowed. We give developer the choice to
handle back key event manually.
2015-08-07 17:27:15 +08:00
Jeff Wang bbf7e994e7 Improved EditBox implement for platform win32 2015-08-05 17:33:54 +08:00
pandamicro 9fea134de1 Use sendNodeEventToJSExtended instead of sendNodeEventToJS in sub classes 2015-07-28 18:24:03 +08:00
pandamicro 89c722ed4b Add script invocation for onEnter, onExit etc in other classes 2015-07-28 16:07:14 +08:00
子龙山人 b6aa3960d2 Merge pull request #12848 from Mazyod/v3
Improving iOS EditBox Implementation
2015-07-18 23:21:27 +08:00
Mazyad Alabduljaleel fa284bc2db headers and whitespace 2015-07-17 18:05:42 +03:00
Mazyad Alabduljaleel 2bb26e31d0 simplify CGRect math 2015-07-17 17:38:16 +03:00
Mazyad Alabduljaleel 54f52dac80 reduce header exposure
this is important, so we know that this class is only used in one place
2015-07-17 17:37:15 +03:00
Mazyad Alabduljaleel 32c5be84b8 weird, how did this slip 2015-07-17 17:15:41 +03:00
Mazyad Alabduljaleel d8b7b1d565 Mac EditBox cleanup:
+ Reduce header clutter
+ consistent property access and overall code style
+ cleanup extra code
2015-07-17 17:12:09 +03:00
Mazyad Alabduljaleel 7861bfd403 Final touch ups:
- group textfield delegate methods
- remove unused code
2015-07-17 16:25:45 +03:00
Mazyad Alabduljaleel 008a5ef89c replaced tabs with whitespace 2015-07-14 16:34:11 +03:00
Mazyad Alabduljaleel 6f8bc04934 First commit for improving iOS EditBox
+ Moved internal stuff to the implementation file
+ Added pragma and organized methods
+ cleanup synthesize, instance variables, and overall code style for ObjC
2015-07-14 16:18:03 +03:00
Dale Stammen 01135f892f fixed typo 2015-04-15 09:19:17 -07:00
Dale Stammen 911f8f6f8a removed WP8 UIEditBox project files 2015-04-15 07:16:39 -07:00
samuele3hu c3ad458a26 Update comment for Lua 2015-03-30 15:47:47 +08:00
andyque 248325d055 Add missing comments for UI modules
Squashed commit of the following:

commit eb23bf8972d1a580db537f3d341091eaeb99d626
Author: andyque <guanghui8827@126.com>
Date:   Wed Mar 25 17:08:07 2015 +0800

    finish all the documents

commit a64ec4196eb1b41771ac2f7b2ba48845d22b6211
Author: andyque <guanghui8827@126.com>
Date:   Wed Mar 25 09:49:33 2015 +0800

    finish scrollview

commit 4ff76623230f19dd25c4de29e2816754524570b2
Author: andyque <guanghui8827@126.com>
Date:   Tue Mar 24 21:40:26 2015 +0800

    add UIScale9Sprite comments

    Conflicts:
    	cocos/ui/UIScale9Sprite.h

commit e82a17b4e3cd07a03d4bfc906b0dc94d1fa08757
Author: andyque <guanghui8827@126.com>
Date:   Tue Mar 24 18:05:02 2015 +0800

    add comments for UIRichText

commit 7cbbcc6883ace0ef60a060f6c5808f4c296af4df
Author: andyque <guanghui8827@126.com>
Date:   Mon Mar 23 22:08:26 2015 +0800

    add comments for UIPageView and UIRelativeBox

commit 6fcf32a40d5407aefcba39e76aea5fb93a1a4e4a
Author: andyque <guanghui8827@126.com>
Date:   Mon Mar 23 21:12:27 2015 +0800

    finish loadingbar comments

commit 58e16b81dee833788018d913aef80e2ddd33d408
Author: andyque <guanghui8827@126.com>
Date:   Mon Mar 23 20:51:30 2015 +0800

    finished UiListView

commit 8278b3f1ee905c34dbd9c461975b1b4491eb7977
Author: andyque <guanghui8827@126.com>
Date:   Mon Mar 23 20:06:10 2015 +0800

    add comments for LayoutManager and LayoutParameter.

commit b2edfa06b83fbb0cdaf2f567c0d6f8d72e6f90c5
Author: andyque <guanghui8827@126.com>
Date:   Mon Mar 23 17:09:17 2015 +0800

    finish comments for UILayoutComponent

commit 730b5bc9c1a18139fbdef331b16c58b928cf999f
Author: andyque <guanghui8827@126.com>
Date:   Fri Mar 20 14:07:58 2015 +0800

    add missing comments

commit cecd97e830492e58dd07a2b1f5d0e87f19144856
Author: andyque <guanghui8827@126.com>
Date:   Fri Mar 20 09:31:51 2015 +0800

    add comments

commit ca0a6033bf61c7fc9caf70719ee5ea651953f580
Author: andyque <guanghui8827@126.com>
Date:   Thu Mar 19 21:02:36 2015 +0800

    add missing docs for UIButton, UILayout, UIIMageview and UIWidget

commit df98454583553e80d2ef4f72cc58de4b433f43c7
Author: andyque <guanghui8827@126.com>
Date:   Thu Mar 19 14:02:05 2015 +0800

    add missing comments for UIHbox and UIHelper

commit 4baf76dd92672b745d3d84e47e5fed8c680b01c7
Author: andyque <guanghui8827@126.com>
Date:   Thu Mar 19 11:28:32 2015 +0800

    add comments for UICheckbox

commit 77c4080b3c70268b6a07cfa12d1e9319c86a2f38
Author: andyque <guanghui8827@126.com>
Date:   Thu Mar 19 00:01:42 2015 +0800

    update coments

commit 4506327ace5b7786ee8b490aab1653462a834418
Author: andyque <guanghui8827@126.com>
Date:   Wed Mar 18 20:32:57 2015 +0800

    add comments for UIEditbox

commit 4937f30adb8912a02ab10353b6cc5fe2eed9d4bf
Author: andyque <guanghui8827@126.com>
Date:   Wed Mar 18 10:51:20 2015 +0800

    add missing comments for UIEditBox

commit 64a48c6b09f4eaf6b84cc8446ef59d382cf8767b
Author: andyque <guanghui8827@126.com>
Date:   Wed Mar 18 10:12:08 2015 +0800

    fix indentation problem

commit b38c921c114bb4a707be0f29dcdf8c46e43a445a
Author: andyque <guanghui8827@126.com>
Date:   Wed Mar 18 10:08:46 2015 +0800

    add missing comments for CCIMEDispatcher

commit 4412cf52429f22351a5c9fbb7c392bca64c2a2c6
Author: andyque <guanghui8827@126.com>
Date:   Wed Mar 18 09:57:52 2015 +0800

    add missing documents for CCIMedelegate

commit 53d3242f2cafde2bebedebe8353c6be625e5ce84
Author: andyque <guanghui8827@126.com>
Date:   Wed Mar 18 09:43:33 2015 +0800

    add missing documentation for CCTilemapatlas

commit 1f6183086b6e21557e5b05bf4cede43d472611a1
Author: andyque <guanghui8827@126.com>
Date:   Wed Mar 18 09:38:59 2015 +0800

    add missing comments for CCTextfieldttf

commit a7fe234153cebc4113cc97064d20dfd3515f9611
Author: andyque <guanghui8827@126.com>
Date:   Tue Mar 17 22:03:31 2015 +0800

    supplement comments for ProtectedNode

commit 3b02d22850b6a9e99e779ca09e5ce0b5bf24d602
Author: andyque <guanghui8827@126.com>
Date:   Tue Mar 17 21:55:03 2015 +0800

    add comments to CCMenuitem.h

commit 58e054c5cd28986e4420c2ae44af7e9a2beab4ce
Author: andyque <guanghui8827@126.com>
Date:   Tue Mar 17 21:36:14 2015 +0800

    add comments to Menu
2015-03-25 18:17:58 +08:00
minggo f7d5a16734 Merge pull request #10873 from konopka/fix_compiler_override_warnings
Fix compiler override warnings
2015-03-17 10:38:19 +08:00
Dale Stammen ef5e6fc473 fixed use of Color4B 2015-03-16 02:17:05 -07:00
minggo d0753674b2 Merge pull request #10514 from cpascal/uiEditBox_Win32
Fixed missing ui::EditBox functionalities on Win32
2015-03-16 14:56:49 +08:00
minggo 1916bc1f1f Merge pull request #10693 from Mazyod/editbox-text-alpha-support
Support Color4B for editbox text
2015-03-16 14:52:36 +08:00
Martin Konopka cd12d08a52 Get rid of compiler warnings: 'func' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] 2015-03-14 19:33:15 +01:00
Mazyad Alabduljaleel ce377c4a1e Fix compilation issues on Android and Win 2015-03-06 16:05:05 +04:00
cpascal db9985d7cd Added new line with the left curl bracket. 2015-03-03 20:39:25 +09:00
cpascal a6ee1451f4 changed one more indentation.
I made mistake, (now replacing the spaces to tab)
2015-03-03 13:44:43 +09:00
cpascal 4058e16f16 Added line break & removed function call in compare operator. 2015-03-03 13:40:40 +09:00
Mazyad Alabduljaleel 9d5fdcb973 Support Color4B for editbox text 2015-03-02 15:31:59 +04:00
Mazyad Alabduljaleel 4387844176 Fix editbox on Mac 2015-03-01 23:56:18 +04:00
cpascal 8d9da362e5 changed indentation. 2015-02-23 11:55:27 +09:00
cpascal e7a39287f1 Fixed missing ui::EditBox functionalities on Win32
1. There was 100-byte input limit at ui::EditBoxImplWin::openKeyboard()
2. Implemented MaxLength as LengthFilter, not ByteFilter. (same as
Android's InputFilter - LengthFilter)
3. Users can input unicode characters that is not supported by CP_ACP.
2015-02-16 18:21:26 +09:00
cpascal d857164768 Added override of ui::EditBox::getDescription() 2015-01-27 11:10:04 +09:00
Jialong Zhai b295c8e817 fix indentation 2015-01-23 14:13:36 +08:00
Jialong Zhai 7ef80e9dae Update UIEditBoxImpl-win32.cpp 2015-01-23 14:11:22 +08:00
andyque d53d71610b Merge branch 'v3' into fixEditBox_v3 2014-12-08 15:20:06 +08:00
Dhilan007 4e769d40b1 replace tab with four spaces 2014-11-24 11:26:34 +08:00
Dhilan007 ac0fb68989 fix compiling error caused by disable CC_ENABLE_SCRIPT_BINDING 2014-11-14 15:04:32 +08:00
Xavier Arias Botargues dd25ff7a39 Fixed retina/contentScale position errors for iPhone 6+ devices in EditBox.
Problem is that factor was 1.0 or 2.0 until iOS 8 introduced 3.0.
2014-11-07 12:08:31 +01:00
Vladimir Timofeev 2835b094da Cleanup order of fields initialization.
Make initialization order to match declarations.
This change twice reduces number of warnings when compiling on MacOS X with Xcode 6.1
Warnings was like "Field 'XXXX' will be initialized after field 'YYYY'"
2014-10-30 17:28:41 +03:00
Dale Stammen 6fcd0ebafd don't hide flyout when keyboard is hidden 2014-10-23 22:23:42 -07:00
Dale Stammen 5df4278e36 fixed reentrancy when closing flyout 2014-10-23 22:17:25 -07:00
Dale Stammen b77e7a5a97 fixed reentrancy when closing flyout 2014-10-23 22:01:35 -07:00
Dale Stammen afa052c5c7 added critical section 2014-10-23 20:49:10 -07:00
Dale Stammen 6e92d169cd changed implementation to use xaml flyout for editbox 2014-10-23 19:30:32 -07:00
Dale Stammen d2f852c3cb added editbox support for universal apps 2014-10-23 07:39:38 -07:00
Dale Stammen 9b2adef6b2 added CC_PLATFORM_WINRT 2014-10-23 07:15:58 -07:00
andyque 2013cdb4ef fix setMaxLength issue of EditBox-mac 2014-10-10 15:26:33 +08:00
Ricardo Quesada 342d934a0e scheduler and macro fixes
* kRepeatForever -> CC_REPEAT_FOREVER
* schedule_selector -> CC_SCHEDULE_SELECTOR
* [new] Node::schedule(const std::function<>& callback, const std::string &key)

Updates all smaples
2014-10-03 09:38:36 -07:00
andyque 3c434ec354 remove Win32InputBox.cpp/.h, move them to UIEditBoxImpl-win32.cpp 2014-09-24 17:47:38 +08:00
andyque 53d28168fe remove duplicated Win32InputBox.cpp/.h and add WebViewTest to win32 2014-09-24 16:39:32 +08:00
Sergey Perepelitsa 0a46a83794 fix missing includes 2014-09-23 23:19:25 +04:00
Ricardo Quesada d5a6289a9b compiles on wp8 2014-09-09 18:22:11 -07:00
Ricardo Quesada 6f3ca63f00 Moved base/CCPlatform* -> platform/CCPlatform* 2014-09-09 17:17:07 -07:00
Ricardo Quesada 9082ca18c3 Platform fixed 2014-09-09 16:50:02 -07:00
Ricardo Quesada 0ead7b6307 Squashed commit of the following:
commit b9181ae92541d11119bedd766773ddb01f0bb486
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Sep 9 09:34:40 2014 -0700

    Compiles luasocket on Mac

commit 91fc79aa2101867fedfbcd7d846e9508009894e6
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Sep 9 09:12:30 2014 -0700

    disables luasockets

commit 31f2ee462708ab7b604b9399eaabd275e2da9e02
Merge: 19099fd 0abe4cb
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Sep 9 08:10:48 2014 -0700

    Merge remote-tracking branch 'cocos2d/v3' into cmakefile_mac_osx

    Conflicts:
    	cocos/3d/cocos3d.h

commit 19099fd021b4ecf1f2eebd73ea14e84572d1ee33
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Mon Sep 8 23:21:03 2014 -0700

    compiles on Linux

commit eec7b92817ac9208123468bb882612aad89f94bf
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Mon Sep 8 23:16:46 2014 -0700

    all projecs compiles with CMake

commit 40fcc8325b409a580fdbf26d2ee27aa2d1db0109
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Mon Sep 8 21:47:27 2014 -0700

    CCUserDefualt.mm better includes

commit 30709ec8243562858498cb118240bb45bf9b33b0
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Mon Sep 8 21:26:36 2014 -0700

    cpp-tests compiles and works on Mac using CMake

commit 67f0fc8df887d08d3d7a27c5fdadd335d6841676
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Mon Sep 8 20:12:09 2014 -0700

    Adds missing files to CMakeLists.txt

commit 36f939ea7f157ca851aee138300c13d9888c0078
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Mon Sep 8 19:52:34 2014 -0700

    Adds more box2d missing files

commit 00f81e3b5ec97150974cc6022e86c394ff488ccb
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Mon Sep 8 19:39:54 2014 -0700

    Adds missing box2d files

commit 9673227b4d7d0e6d9eced49bdd69b98cb519968a
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Mon Sep 8 18:44:15 2014 -0700

    Initial CMake support for Mac
2014-09-09 12:18:31 -07:00
Sergey 14853d46f2 setPlaceholderFontSize fix 2014-09-03 23:38:44 +04:00
andyque 51e160beff fix EditBox lua compile error 2014-09-02 17:37:55 +08:00
andyque aef0f5e729 Merge branch 'v3' into mergeExtensionEditBox
Conflicts:
	build/cocos2d_libs.xcodeproj/project.pbxproj
	cocos/ui/Android.mk
	cocos/ui/CMakeLists.txt
	cocos/ui/proj.win32/libui.vcxproj
	cocos/ui/proj.win32/libui.vcxproj.filters
	tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp
	tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters
2014-09-01 15:26:25 +08:00
andyque 46f3ab9b57 add Scale9Sprite to create method of ui::EditBox 2014-08-20 16:08:28 +08:00
andyque 8d1c422ac5 merge extension EditBox to ui module 2014-08-19 10:28:24 +08:00