CCUIMultilineTextField.m 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /****************************************************************************
  2. Copyright (c) 2010-2012 cocos2d-x.org
  3. Copyright (c) 2013-2016 zilongshanren
  4. http://www.cocos2d-x.org
  5. Permission is hereby granted, free of charge, to any person obtaining a copy
  6. of this software and associated documentation files (the "Software"), to deal
  7. in the Software without restriction, including without limitation the rights
  8. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. copies of the Software, and to permit persons to whom the Software is
  10. furnished to do so, subject to the following conditions:
  11. The above copyright notice and this permission notice shall be included in
  12. all copies or substantial portions of the Software.
  13. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. THE SOFTWARE.
  20. ****************************************************************************/
  21. #import "ui/UIEditBox/Mac/CCUIMultilineTextField.h"
  22. @interface CCUIMultilineTextField()
  23. @property(nonatomic, copy)NSString* placeHolder;
  24. @end
  25. @implementation CCUIMultilineTextField
  26. {
  27. }
  28. @synthesize placeHolder = _placeHolder;
  29. -(void)dealloc
  30. {
  31. self.placeHolder = nil;
  32. [super dealloc];
  33. }
  34. -(void)ccui_setPlaceholderFont:(NSFont *)font
  35. {
  36. //TODO
  37. }
  38. -(NSFont*)ccui_placeholderFont
  39. {
  40. return NULL;
  41. }
  42. -(void)ccui_setPlaceholder:(NSString *)text
  43. {
  44. self.placeHolder = text;
  45. }
  46. -(NSString*)ccui_placeholder
  47. {
  48. return self.placeHolder;
  49. }
  50. -(void)ccui_setPlaceholderColor:(NSColor *)color
  51. {
  52. //TODO
  53. }
  54. -(NSColor*)ccui_placeholderColor
  55. {
  56. return NULL;
  57. }
  58. #pragma mark - CCUITextInput
  59. - (NSString *)ccui_text
  60. {
  61. return self.string;
  62. }
  63. - (void)ccui_setText:(NSString *)ccui_text
  64. {
  65. self.string = ccui_text;
  66. }
  67. - (NSColor *)ccui_textColor
  68. {
  69. return self.textColor;
  70. }
  71. - (void)ccui_setTextColor:(NSColor *)ccui_textColor
  72. {
  73. self.textColor = ccui_textColor;
  74. }
  75. - (NSFont *)ccui_font
  76. {
  77. return self.font;
  78. }
  79. - (void)ccui_setFont:(NSFont *)ccui_font
  80. {
  81. self.font = ccui_font;
  82. }
  83. - (NSTextAlignment)ccui_alignment
  84. {
  85. return self.alignment;
  86. }
  87. - (void)ccui_setTextHorizontalAlignment:(NSTextAlignment)ccui_alignment
  88. {
  89. self.alignment = ccui_alignment;
  90. }
  91. - (void)ccui_setDelegate:(id<NSTextFieldDelegate,NSTextViewDelegate>)delegate
  92. {
  93. self.delegate = delegate;
  94. }
  95. - (void)ccui_setMaxLength:(int)ccui_maxLength
  96. {
  97. //noop
  98. }
  99. -(int)ccui_maxLength
  100. {
  101. return 0;
  102. }
  103. @end