UIScrollView.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. /****************************************************************************
  2. Copyright (c) 2013-2017 Chukong Technologies Inc.
  3. http://www.cocos2d-x.org
  4. Permission is hereby granted, free of charge, to any person obtaining a copy
  5. of this software and associated documentation files (the "Software"), to deal
  6. in the Software without restriction, including without limitation the rights
  7. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. copies of the Software, and to permit persons to whom the Software is
  9. furnished to do so, subject to the following conditions:
  10. The above copyright notice and this permission notice shall be included in
  11. all copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18. THE SOFTWARE.
  19. ****************************************************************************/
  20. #ifndef __UISCROLLVIEW_H__
  21. #define __UISCROLLVIEW_H__
  22. #include "ui/UILayout.h"
  23. #include "ui/GUIExport.h"
  24. #include <list>
  25. NS_CC_BEGIN
  26. /**
  27. * @addtogroup ui
  28. * @{
  29. */
  30. class EventFocusListener;
  31. namespace ui {
  32. class ScrollViewBar;
  33. /**
  34. *Scrollview scroll event type.
  35. *@deprecated use @see `ScrollView::EventType` instead.
  36. */
  37. typedef enum
  38. {
  39. SCROLLVIEW_EVENT_SCROLL_TO_TOP,
  40. SCROLLVIEW_EVENT_SCROLL_TO_BOTTOM,
  41. SCROLLVIEW_EVENT_SCROLL_TO_LEFT,
  42. SCROLLVIEW_EVENT_SCROLL_TO_RIGHT,
  43. SCROLLVIEW_EVENT_SCROLLING,
  44. SCROLLVIEW_EVENT_BOUNCE_TOP,
  45. SCROLLVIEW_EVENT_BOUNCE_BOTTOM,
  46. SCROLLVIEW_EVENT_BOUNCE_LEFT,
  47. SCROLLVIEW_EVENT_BOUNCE_RIGHT,
  48. SCROLLVIEW_EVENT_AUTOSCROLL_ENDED
  49. }ScrollviewEventType;
  50. /**
  51. * A callback which would be called when a ScrollView is scrolling.
  52. *@deprecated Use @see `ccScrollViewCallback` instead.
  53. */
  54. typedef void (Ref::*SEL_ScrollViewEvent)(Ref*, ScrollviewEventType);
  55. #define scrollvieweventselector(_SELECTOR) (SEL_ScrollViewEvent)(&_SELECTOR)
  56. /**
  57. * Layout container for a view hierarchy that can be scrolled by the user, allowing it to be larger than the physical display.
  58. * It holds a inner `Layout` container for storing child items horizontally or vertically.
  59. */
  60. class CC_GUI_DLL ScrollView : public Layout
  61. {
  62. DECLARE_CLASS_GUI_INFO
  63. public:
  64. /**
  65. * ScrollView scroll direction type.
  66. */
  67. enum class Direction
  68. {
  69. NONE,
  70. VERTICAL,
  71. HORIZONTAL,
  72. BOTH
  73. };
  74. /**
  75. * Scrollview scroll event type.
  76. */
  77. enum class EventType
  78. {
  79. SCROLL_TO_TOP,
  80. SCROLL_TO_BOTTOM,
  81. SCROLL_TO_LEFT,
  82. SCROLL_TO_RIGHT,
  83. SCROLLING,
  84. BOUNCE_TOP,
  85. BOUNCE_BOTTOM,
  86. BOUNCE_LEFT,
  87. BOUNCE_RIGHT,
  88. CONTAINER_MOVED,
  89. AUTOSCROLL_ENDED
  90. };
  91. /**
  92. * A callback which would be called when a ScrollView is scrolling.
  93. */
  94. typedef std::function<void(Ref*, EventType)> ccScrollViewCallback;
  95. /**
  96. * Default constructor
  97. * @js ctor
  98. * @lua new
  99. */
  100. ScrollView();
  101. /**
  102. * Default destructor
  103. * @js NA
  104. * @lua NA
  105. */
  106. virtual ~ScrollView();
  107. /**
  108. * Create an empty ScrollView.
  109. * @return A ScrollView instance.
  110. */
  111. static ScrollView* create();
  112. /**
  113. * Changes scroll direction of scrollview.
  114. *
  115. * @see `Direction`
  116. * @param dir Scroll direction enum.
  117. */
  118. virtual void setDirection(Direction dir);
  119. /**
  120. * Query scroll direction of scrollview.
  121. *
  122. * @see `Direction` Direction::VERTICAL means vertical scroll, Direction::HORIZONTAL means horizontal scroll
  123. *
  124. * @return Scrollview scroll direction.
  125. */
  126. Direction getDirection()const;
  127. /**
  128. * Get inner container of scrollview.
  129. *
  130. * Inner container is a child of scrollview.
  131. *
  132. * @return Inner container pointer.
  133. */
  134. Layout* getInnerContainer()const;
  135. /**
  136. * Immediately stops inner container scroll initiated by any of the "scrollTo*" member functions
  137. */
  138. virtual void stopAutoScroll();
  139. /**
  140. * Scroll inner container to bottom boundary of scrollview.
  141. * @param timeInSec Time in seconds.
  142. * @param attenuated Whether scroll speed attenuate or not.
  143. */
  144. virtual void scrollToBottom(float timeInSec, bool attenuated);
  145. /**
  146. * Scroll inner container to top boundary of scrollview.
  147. * @param timeInSec Time in seconds.
  148. * @param attenuated Whether scroll speed attenuate or not.
  149. */
  150. virtual void scrollToTop(float timeInSec, bool attenuated);
  151. /**
  152. * Scroll inner container to left boundary of scrollview.
  153. * @param timeInSec Time in seconds.
  154. * @param attenuated Whether scroll speed attenuate or not.
  155. */
  156. virtual void scrollToLeft(float timeInSec, bool attenuated);
  157. /**
  158. * Scroll inner container to right boundary of scrollview.
  159. * @param timeInSec Time in seconds.
  160. * @param attenuated Whether scroll speed attenuate or not.
  161. */
  162. virtual void scrollToRight(float timeInSec, bool attenuated);
  163. /**
  164. * Scroll inner container to top and left boundary of scrollview.
  165. * @param timeInSec Time in seconds.
  166. * @param attenuated Whether scroll speed attenuate or not.
  167. */
  168. virtual void scrollToTopLeft(float timeInSec, bool attenuated);
  169. /**
  170. * Scroll inner container to top and right boundary of scrollview.
  171. * @param timeInSec Time in seconds.
  172. * @param attenuated Whether scroll speed attenuate or not.
  173. */
  174. virtual void scrollToTopRight(float timeInSec, bool attenuated);
  175. /**
  176. * Scroll inner container to bottom and left boundary of scrollview.
  177. * @param timeInSec Time in seconds.
  178. * @param attenuated Whether scroll speed attenuate or not.
  179. */
  180. virtual void scrollToBottomLeft(float timeInSec, bool attenuated);
  181. /**
  182. * Scroll inner container to bottom and right boundary of scrollview.
  183. * @param timeInSec Time in seconds
  184. * @param attenuated Whether scroll speed attenuate or not.
  185. */
  186. virtual void scrollToBottomRight(float timeInSec, bool attenuated);
  187. /**
  188. * Scroll inner container to vertical percent position of scrollview.
  189. * @param percent A value between 0 and 100.
  190. * @param timeInSec Time in seconds.
  191. * @param attenuated Whether scroll speed attenuate or not.
  192. */
  193. virtual void scrollToPercentVertical(float percent, float timeInSec, bool attenuated);
  194. /**
  195. * Scroll inner container to horizontal percent position of scrollview.
  196. * @param percent A value between 0 and 100.
  197. * @param timeInSec Time in seconds.
  198. * @param attenuated Whether scroll speed attenuate or not.
  199. */
  200. virtual void scrollToPercentHorizontal(float percent, float timeInSec, bool attenuated);
  201. /**
  202. * Scroll inner container to both direction percent position of scrollview.
  203. * @param percent A value between 0 and 100.
  204. * @param timeInSec Time in seconds.
  205. * @param attenuated Whether scroll speed attenuate or not.
  206. */
  207. virtual void scrollToPercentBothDirection(const Vec2& percent, float timeInSec, bool attenuated);
  208. /**
  209. * Move inner container to bottom boundary of scrollview.
  210. */
  211. virtual void jumpToBottom();
  212. /**
  213. * Move inner container to top boundary of scrollview.
  214. */
  215. virtual void jumpToTop();
  216. /**
  217. * Move inner container to left boundary of scrollview.
  218. */
  219. virtual void jumpToLeft();
  220. /**
  221. * Move inner container to right boundary of scrollview.
  222. */
  223. virtual void jumpToRight();
  224. /**
  225. * Move inner container to top and left boundary of scrollview.
  226. */
  227. virtual void jumpToTopLeft();
  228. /**
  229. * Move inner container to top and right boundary of scrollview.
  230. */
  231. virtual void jumpToTopRight();
  232. /**
  233. * Move inner container to bottom and left boundary of scrollview.
  234. */
  235. virtual void jumpToBottomLeft();
  236. /**
  237. * Move inner container to bottom and right boundary of scrollview.
  238. */
  239. virtual void jumpToBottomRight();
  240. /**
  241. * Move inner container to vertical percent position of scrollview.
  242. * @param percent A value between 0 and 100.
  243. */
  244. virtual void jumpToPercentVertical(float percent);
  245. /**
  246. * Move inner container to horizontal percent position of scrollview.
  247. * @param percent A value between 0 and 100.
  248. */
  249. virtual void jumpToPercentHorizontal(float percent);
  250. /**
  251. * Move inner container to both direction percent position of scrollview.
  252. * @param percent A value between 0 and 100.
  253. */
  254. virtual void jumpToPercentBothDirection(const Vec2& percent);
  255. /**
  256. * Change inner container size of scrollview.
  257. *
  258. * Inner container size must be larger than or equal scrollview's size.
  259. *
  260. * @param size Inner container size.
  261. */
  262. void setInnerContainerSize(const Size &size);
  263. /**
  264. * Get inner container size of scrollview.
  265. *
  266. * Inner container size must be larger than or equal scrollview's size.
  267. *
  268. * @return The inner container size.
  269. */
  270. const Size& getInnerContainerSize() const;
  271. /**
  272. * Set inner container position
  273. *
  274. * @param pos Inner container position.
  275. */
  276. void setInnerContainerPosition(const Vec2 &pos);
  277. /**
  278. * Get inner container position
  279. *
  280. * @return The inner container position.
  281. */
  282. const Vec2& getInnerContainerPosition() const;
  283. /**
  284. * Add callback function which will be called when scrollview event triggered.
  285. * @deprecated Use @see `addEventListener` instead.
  286. * @param target A pointer of `Ref*` type.
  287. * @param selector A member function pointer with type of `SEL_ScrollViewEvent`.
  288. */
  289. CC_DEPRECATED_ATTRIBUTE void addEventListenerScrollView(Ref* target, SEL_ScrollViewEvent selector);
  290. /**
  291. * Add callback function which will be called when scrollview event triggered.
  292. * @param callback A callback function with type of `ccScrollViewCallback`.
  293. */
  294. virtual void addEventListener(const ccScrollViewCallback& callback);
  295. //override functions
  296. virtual void addChild(Node* child)override;
  297. virtual void addChild(Node * child, int localZOrder)override;
  298. virtual void addChild(Node* child, int localZOrder, int tag) override;
  299. virtual void addChild(Node* child, int localZOrder, const std::string &name) override;
  300. virtual void removeAllChildren() override;
  301. virtual void removeAllChildrenWithCleanup(bool cleanup) override;
  302. virtual void removeChild(Node* child, bool cleanup = true) override;
  303. virtual Vector<Node*>& getChildren() override;
  304. virtual const Vector<Node*>& getChildren() const override;
  305. virtual ssize_t getChildrenCount() const override;
  306. virtual Node * getChildByTag(int tag) const override;
  307. virtual Node* getChildByName(const std::string& name)const override;
  308. //touch event callback
  309. virtual bool onTouchBegan(Touch *touch, Event *unusedEvent) override;
  310. virtual void onTouchMoved(Touch *touch, Event *unusedEvent) override;
  311. virtual void onTouchEnded(Touch *touch, Event *unusedEvent) override;
  312. virtual void onTouchCancelled(Touch *touch, Event *unusedEvent) override;
  313. virtual void update(float dt) override;
  314. /**
  315. * @brief Toggle bounce enabled when scroll to the edge.
  316. *
  317. * @param enabled True if enable bounce, false otherwise.
  318. */
  319. void setBounceEnabled(bool enabled);
  320. /**
  321. * @brief Query bounce state.
  322. *
  323. * @return True if bounce is enabled, false otherwise.
  324. */
  325. bool isBounceEnabled() const;
  326. /**
  327. * @brief Toggle whether enable scroll inertia while scrolling.
  328. *
  329. * @param enabled True if enable inertia, false otherwise.
  330. */
  331. void setInertiaScrollEnabled(bool enabled);
  332. /**
  333. * @brief Query inertia scroll state.
  334. *
  335. * @return True if inertia is enabled, false otherwise.
  336. */
  337. bool isInertiaScrollEnabled() const;
  338. /**
  339. * @brief Toggle scroll bar enabled.
  340. *
  341. * @param enabled True if enable scroll bar, false otherwise.
  342. */
  343. void setScrollBarEnabled(bool enabled);
  344. /**
  345. * @brief Query scroll bar state.
  346. *
  347. * @return True if scroll bar is enabled, false otherwise.
  348. */
  349. bool isScrollBarEnabled() const;
  350. /**
  351. * @brief Set the scroll bar positions from the left-bottom corner (horizontal) and right-top corner (vertical).
  352. *
  353. * @param positionFromCorner The position from the left-bottom corner (horizontal) and right-top corner (vertical).
  354. */
  355. void setScrollBarPositionFromCorner(const Vec2& positionFromCorner);
  356. /**
  357. * @brief Set the vertical scroll bar position from right-top corner.
  358. *
  359. * @param positionFromCorner The position from right-top corner
  360. */
  361. void setScrollBarPositionFromCornerForVertical(const Vec2& positionFromCorner);
  362. /**
  363. * @brief Get the vertical scroll bar's position from right-top corner.
  364. *
  365. * @return positionFromCorner
  366. */
  367. Vec2 getScrollBarPositionFromCornerForVertical() const;
  368. /**
  369. * @brief Set the horizontal scroll bar position from left-bottom corner.
  370. *
  371. * @param positionFromCorner The position from left-bottom corner
  372. */
  373. void setScrollBarPositionFromCornerForHorizontal(const Vec2& positionFromCorner);
  374. /**
  375. * @brief Get the horizontal scroll bar's position from right-top corner.
  376. *
  377. * @return positionFromCorner
  378. */
  379. Vec2 getScrollBarPositionFromCornerForHorizontal() const;
  380. /**
  381. * @brief Set the scroll bar's width
  382. *
  383. * @param width The scroll bar's width
  384. */
  385. void setScrollBarWidth(float width);
  386. /**
  387. * @brief Get the scroll bar's width
  388. *
  389. * @return the scroll bar's width
  390. */
  391. float getScrollBarWidth() const;
  392. /**
  393. * @brief Set the scroll bar's color
  394. *
  395. * @param the scroll bar's color
  396. */
  397. void setScrollBarColor(const Color3B& color);
  398. /**
  399. * @brief Get the scroll bar's color
  400. *
  401. * @return the scroll bar's color
  402. */
  403. const Color3B& getScrollBarColor() const;
  404. /**
  405. * @brief Set the scroll bar's opacity
  406. *
  407. * @param the scroll bar's opacity
  408. */
  409. void setScrollBarOpacity(GLubyte opacity);
  410. /**
  411. * @brief Get the scroll bar's opacity
  412. *
  413. * @return the scroll bar's opacity
  414. */
  415. GLubyte getScrollBarOpacity() const;
  416. /**
  417. * @brief Set scroll bar auto hide state
  418. *
  419. * @param scroll bar auto hide state
  420. */
  421. void setScrollBarAutoHideEnabled(bool autoHideEnabled);
  422. /**
  423. * @brief Query scroll bar auto hide state
  424. *
  425. * @return True if scroll bar auto hide is enabled, false otherwise.
  426. */
  427. bool isScrollBarAutoHideEnabled() const;
  428. /**
  429. * @brief Set scroll bar auto hide time
  430. *
  431. * @param scroll bar auto hide time
  432. */
  433. void setScrollBarAutoHideTime(float autoHideTime);
  434. /**
  435. * @brief Get the scroll bar's auto hide time
  436. *
  437. * @return the scroll bar's auto hide time
  438. */
  439. float getScrollBarAutoHideTime() const;
  440. /**
  441. * @brief Set the touch total time threshold
  442. *
  443. * @param the touch total time threshold
  444. */
  445. void setTouchTotalTimeThreshold(float touchTotalTimeThreshold);
  446. /**
  447. * @brief Get the touch total time threshold
  448. *
  449. * @return the touch total time threshold
  450. */
  451. float getTouchTotalTimeThreshold() const;
  452. /**
  453. * Set layout type for scrollview.
  454. *
  455. * @see `Layout::Type`
  456. * @param type Layout type enum.
  457. */
  458. virtual void setLayoutType(Type type) override;
  459. /**
  460. * Get the layout type for scrollview.
  461. *
  462. * @see `Layout::Type`
  463. * @return LayoutType
  464. */
  465. virtual Type getLayoutType() const override;
  466. /**
  467. * Return the "class name" of widget.
  468. */
  469. virtual std::string getDescription() const override;
  470. /**
  471. * @lua NA
  472. */
  473. virtual void onEnter() override;
  474. /**
  475. * When a widget is in a layout, you could call this method to get the next focused widget within a specified direction.
  476. * If the widget is not in a layout, it will return itself
  477. *@param direction the direction to look for the next focused widget in a layout
  478. *@param current the current focused widget
  479. *@return the next focused widget in a layout
  480. */
  481. virtual Widget* findNextFocusedWidget(FocusDirection direction, Widget* current) override;
  482. CC_CONSTRUCTOR_ACCESS:
  483. virtual bool init() override;
  484. protected:
  485. enum class MoveDirection
  486. {
  487. TOP,
  488. BOTTOM,
  489. LEFT,
  490. RIGHT,
  491. };
  492. virtual void initRenderer() override;
  493. virtual void onSizeChanged() override;
  494. virtual void doLayout() override;
  495. virtual Widget* createCloneInstance() override;
  496. virtual void copySpecialProperties(Widget* model) override;
  497. virtual void copyClonedWidgetChildren(Widget* model) override;
  498. virtual void initScrollBar();
  499. virtual void removeScrollBar();
  500. Vec2 flattenVectorByDirection(const Vec2& vector);
  501. virtual Vec2 getHowMuchOutOfBoundary(const Vec2& addition = Vec2::ZERO);
  502. bool isOutOfBoundary(MoveDirection dir);
  503. bool isOutOfBoundary();
  504. virtual void moveInnerContainer(const Vec2& deltaMove, bool canStartBounceBack);
  505. bool calculateCurrAndPrevTouchPoints(Touch* touch, Vec3* currPt, Vec3* prevPt);
  506. void gatherTouchMove(const Vec2& delta);
  507. Vec2 calculateTouchMoveVelocity() const;
  508. virtual void startAttenuatingAutoScroll(const Vec2& deltaMove, const Vec2& initialVelocity);
  509. void startAutoScroll(const Vec2& deltaMove, float timeInSec, bool attenuated);
  510. void startAutoScrollToDestination(const Vec2& des, float timeInSec, bool attenuated);
  511. bool isNecessaryAutoScrollBrake();
  512. void processAutoScrolling(float deltaTime);
  513. void startInertiaScroll(const Vec2& touchMoveVelocity);
  514. bool startBounceBackIfNeeded();
  515. void jumpToDestination(const Vec2& des);
  516. virtual void scrollChildren(const Vec2& deltaMove);
  517. virtual void handlePressLogic(Touch *touch);
  518. virtual void handleMoveLogic(Touch *touch);
  519. virtual void handleReleaseLogic(Touch *touch);
  520. virtual void interceptTouchEvent(Widget::TouchEventType event,Widget* sender,Touch *touch) override;
  521. void processScrollEvent(MoveDirection dir, bool bounce);
  522. void processScrollingEvent();
  523. void dispatchEvent(ScrollviewEventType scrollEventType, EventType eventType);
  524. void updateScrollBar(const Vec2& outOfBoundary);
  525. protected:
  526. virtual float getAutoScrollStopEpsilon() const;
  527. bool fltEqualZero(const Vec2& point) const;
  528. Layout* _innerContainer;
  529. Direction _direction;
  530. float _topBoundary;
  531. float _bottomBoundary;
  532. float _leftBoundary;
  533. float _rightBoundary;
  534. bool _bePressed;
  535. float _childFocusCancelOffsetInInch;
  536. // Touch move speed
  537. std::list<Vec2> _touchMoveDisplacements;
  538. std::list<float> _touchMoveTimeDeltas;
  539. long long _touchMovePreviousTimestamp;
  540. float _touchTotalTimeThreshold;
  541. bool _autoScrolling;
  542. bool _autoScrollAttenuate;
  543. Vec2 _autoScrollStartPosition;
  544. Vec2 _autoScrollTargetDelta;
  545. float _autoScrollTotalTime;
  546. float _autoScrollAccumulatedTime;
  547. bool _autoScrollCurrentlyOutOfBoundary;
  548. bool _autoScrollBraking;
  549. Vec2 _autoScrollBrakingStartPosition;
  550. bool _inertiaScrollEnabled;
  551. bool _bounceEnabled;
  552. Vec2 _outOfBoundaryAmount;
  553. bool _outOfBoundaryAmountDirty;
  554. bool _scrollBarEnabled;
  555. ScrollViewBar* _verticalScrollBar;
  556. ScrollViewBar* _horizontalScrollBar;
  557. Ref* _scrollViewEventListener;
  558. #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
  559. #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
  560. #elif _MSC_VER >= 1400 //vs 2005 or higher
  561. #pragma warning (push)
  562. #pragma warning (disable: 4996)
  563. #endif
  564. SEL_ScrollViewEvent _scrollViewEventSelector;
  565. #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
  566. #pragma GCC diagnostic warning "-Wdeprecated-declarations"
  567. #elif _MSC_VER >= 1400 //vs 2005 or higher
  568. #pragma warning (pop)
  569. #endif
  570. ccScrollViewCallback _eventCallback;
  571. };
  572. }
  573. // end of ui group
  574. /// @}
  575. NS_CC_END
  576. #endif /* defined(__CocoGUI__ScrollView__) */