Commit Graph

23 Commits

Author SHA1 Message Date
Josh Bodily c3c6681b9e Add Horizontal Text Alignment to UIEditBox (#16772)
* Add Horizontal Text Alignment to UIEditBox

* Fix compile error

* Fix win32 compile
2016-11-09 10:38:00 +08:00
David DeSimone fb9c1f2de0 Fixed EditBox placeholder font not being set correctly for multiline text fields on iOS. (#16821) 2016-11-09 10:27:34 +08:00
zilongshanren a6b0ea76de improve editbox test and font creation 2016-06-23 15:57:41 +08:00
zilongshanren 6e3d69dded Merge pull request #15336 from cocos2d/v3.10
V3.10
2016-03-29 11:23:11 +08:00
Xpol Wan 32e408487f Fixes import path for m and mm files. 2016-03-21 20:12:58 +08:00
Xpol Wan 931d56bc10 Fixes includes in .m and .mm files. 2016-03-21 11:02:00 +08:00
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
Sergey 89f4a1208b fix font for EditBox in iOS & Mac 2015-12-17 12:02:39 +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
andyque c0f40ad4a5 fix Android EditBox font size issue 2015-09-02 18:25:30 +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
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
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 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
Mazyad Alabduljaleel 9d5fdcb973 Support Color4B for editbox text 2015-03-02 15:31:59 +04: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
Sergey Perepelitsa 0a46a83794 fix missing includes 2014-09-23 23:19:25 +04:00
Ricardo Quesada 9082ca18c3 Platform fixed 2014-09-09 16:50:02 -07:00