add "override"

This commit is contained in:
CaiWenzhi 2013-11-14 13:42:10 +08:00
parent 611ba9e9f5
commit 2432e6e40d
16 changed files with 207 additions and 202 deletions

View File

@ -120,7 +120,7 @@ public:
void setCapInsetsDisabledRenderer(const cocos2d::Rect &capInsets);
//override "setAnchorPoint" of widget.
virtual void setAnchorPoint(const cocos2d::Point &pt);
virtual void setAnchorPoint(const cocos2d::Point &pt) override;
/**
* Sets if button is using scale9 renderer.
@ -130,16 +130,16 @@ public:
virtual void setScale9Enabled(bool able);
//override "setFlipX" of widget.
virtual void setFlipX(bool flipX);
virtual void setFlipX(bool flipX) override;
//override "setFlipY" of widget.
virtual void setFlipY(bool flipY);
virtual void setFlipY(bool flipY) override;
//override "isFlipX" of widget.
virtual bool isFlipX();
virtual bool isFlipX() override;
//override "isFlipY" of widget.
virtual bool isFlipY();
virtual bool isFlipY() override;
/**
* Changes if button can be clicked zoom effect.
@ -149,13 +149,13 @@ public:
void setPressedActionEnabled(bool enabled);
//override "ignoreContentAdaptWithSize" method of widget.
virtual void ignoreContentAdaptWithSize(bool ignore);
virtual void ignoreContentAdaptWithSize(bool ignore) override;
//override "getContentSize" method of widget.
virtual const cocos2d::Size& getContentSize() const;
virtual const cocos2d::Size& getContentSize() const override;
//override "getVirtualRenderer" method of widget.
virtual cocos2d::Node* getVirtualRenderer();
virtual cocos2d::Node* getVirtualRenderer() override;
/**
* Sets color to widget
@ -164,12 +164,12 @@ public:
*
* @param color
*/
virtual void setColor(const cocos2d::Color3B &color);
virtual void setColor(const cocos2d::Color3B &color) override;
/**
* Returns the "class name" of widget.
*/
virtual const char* getDescription() const;
virtual const char* getDescription() const override;
void setTitleText(const std::string& text);
const std::string& getTitleText() const;
@ -181,18 +181,18 @@ public:
const char* getTitleFontName() const;
protected:
virtual bool init();
virtual void initRenderer();
virtual void onPressStateChangedToNormal();
virtual void onPressStateChangedToPressed();
virtual void onPressStateChangedToDisabled();
virtual void onSizeChanged();
virtual bool init() override;
virtual void initRenderer() override;
virtual void onPressStateChangedToNormal() override;
virtual void onPressStateChangedToPressed() override;
virtual void onPressStateChangedToDisabled() override;
virtual void onSizeChanged() override;
void normalTextureScaleChangedWithSize();
void pressedTextureScaleChangedWithSize();
void disabledTextureScaleChangedWithSize();
virtual UIWidget* createCloneInstance();
virtual void copySpecialProperties(UIWidget* model);
virtual UIWidget* createCloneInstance() override;
virtual void copySpecialProperties(UIWidget* model) override;
protected:
cocos2d::Node* _buttonNormalRenderer;
cocos2d::Node* _buttonClickedRenderer;

View File

@ -135,53 +135,53 @@ public:
bool getSelectedState();
//override "setAnchorPoint" method of widget.
virtual void setAnchorPoint(const cocos2d::Point &pt);
virtual void setAnchorPoint(const cocos2d::Point &pt) override;
//add a call back function would called when checkbox is selected or unselected.
void addEventListenerCheckBox(cocos2d::Object* target,SEL_SelectedStateEvent selector);
//override "setFlipX" method of widget.
virtual void setFlipX(bool flipX);
virtual void setFlipX(bool flipX) override;
//override "setFlipY" method of widget.
virtual void setFlipY(bool flipY);
virtual void setFlipY(bool flipY) override;
//override "isFlipX" method of widget.
virtual bool isFlipX();
virtual bool isFlipX() override;
//override "isFlipY" method of widget.
virtual bool isFlipY();
virtual bool isFlipY() override;
//override "onTouchEnded" method of widget.
virtual void onTouchEnded(const cocos2d::Point &touchPoint);
virtual void onTouchEnded(const cocos2d::Point &touchPoint) override;
//override "getContentSize" method of widget.
virtual const cocos2d::Size& getContentSize() const;
virtual const cocos2d::Size& getContentSize() const override;
//override "getVirtualRenderer" method of widget.
virtual cocos2d::Node* getVirtualRenderer();
virtual cocos2d::Node* getVirtualRenderer() override;
/**
* Returns the "class name" of widget.
*/
virtual const char* getDescription() const;
virtual const char* getDescription() const override;
protected:
virtual bool init();
virtual void initRenderer();
virtual void onPressStateChangedToNormal();
virtual void onPressStateChangedToPressed();
virtual void onPressStateChangedToDisabled();
virtual bool init() override;
virtual void initRenderer() override;
virtual void onPressStateChangedToNormal() override;
virtual void onPressStateChangedToPressed() override;
virtual void onPressStateChangedToDisabled() override;
void selectedEvent();
void unSelectedEvent();
virtual void onSizeChanged();
virtual void onSizeChanged() override;
void backGroundTextureScaleChangedWithSize();
void backGroundSelectedTextureScaleChangedWithSize();
void frontCrossTextureScaleChangedWithSize();
void backGroundDisabledTextureScaleChangedWithSize();
void frontCrossDisabledTextureScaleChangedWithSize();
virtual UIWidget* createCloneInstance();
virtual void copySpecialProperties(UIWidget* model);
virtual UIWidget* createCloneInstance() override;
virtual void copySpecialProperties(UIWidget* model) override;
protected:
cocos2d::Sprite* _backGroundBoxRenderer;
cocos2d::Sprite* _backGroundSelectedBoxRenderer;

View File

@ -81,45 +81,45 @@ public:
void setCapInsets(const cocos2d::Rect &capInsets);
//override "setFlipX" method of widget.
virtual void setFlipX(bool flipX);
virtual void setFlipX(bool flipX) override;
//override "setFlipY" method of widget.
virtual void setFlipY(bool flipY);
virtual void setFlipY(bool flipY) override;
//override "isFlipX" method of widget.
virtual bool isFlipX();
virtual bool isFlipX() override;
//override "isFlipY" method of widget.
virtual bool isFlipY();
virtual bool isFlipY() override;
//override "setAnchorPoint" method of widget.
virtual void setAnchorPoint(const cocos2d::Point &pt);
virtual void setAnchorPoint(const cocos2d::Point &pt) override;
//override "onTouchBegan" method of widget.
virtual bool onTouchBegan(const cocos2d::Point &touchPoint);
virtual bool onTouchBegan(const cocos2d::Point &touchPoint) override;
//override "onTouchEnded" method of widget.
virtual void onTouchEnded(const cocos2d::Point &touchPoint);
virtual void onTouchEnded(const cocos2d::Point &touchPoint) override;
//override "ignoreContentAdaptWithSize" method of widget.
virtual void ignoreContentAdaptWithSize(bool ignore);
virtual void ignoreContentAdaptWithSize(bool ignore) override;
/**
* Returns the "class name" of widget.
*/
virtual const char* getDescription() const;
virtual const char* getDescription() const override;
void setDoubleClickEnabled(bool able);
void doubleClickEvent();
void checkDoubleClick(float dt);
virtual const cocos2d::Size& getContentSize() const;
virtual cocos2d::Node* getVirtualRenderer();
virtual const cocos2d::Size& getContentSize() const override;
virtual cocos2d::Node* getVirtualRenderer() override;
protected:
virtual void initRenderer();
virtual void onSizeChanged();
virtual void initRenderer() override;
virtual void onSizeChanged() override;
void imageTextureScaleChangedWithSize();
virtual UIWidget* createCloneInstance();
virtual void copySpecialProperties(UIWidget* model);
virtual UIWidget* createCloneInstance() override;
virtual void copySpecialProperties(UIWidget* model) override;
protected:
int _clickCount;
float _clickTimeInterval;

View File

@ -108,7 +108,7 @@ public:
*
* @param scale The scale factor for both X and Y axis.
*/
virtual void setScale(float fScale);
virtual void setScale(float fScale) override;
/**
* Changes the scale factor on X axis of this widget
@ -117,7 +117,7 @@ public:
*
* @param fScaleX The scale factor on X axis.
*/
virtual void setScaleX(float fScaleX);
virtual void setScaleX(float fScaleX) override;
/**
* Changes the scale factor on Y axis of this widget
@ -126,49 +126,49 @@ public:
*
* @param fScaleY The scale factor on Y axis.
*/
virtual void setScaleY(float fScaleY);
virtual void setScaleY(float fScaleY) override;
//override "setFlipX" method of widget.
virtual void setFlipX(bool flipX);
virtual void setFlipX(bool flipX) override;
//override "setFlipY" method of widget.
virtual void setFlipY(bool flipY);
virtual void setFlipY(bool flipY) override;
//override "isFlipX" method of widget.
virtual bool isFlipX();
virtual bool isFlipX() override;
//override "isFlipY" method of widget.
virtual bool isFlipY();
virtual bool isFlipY() override;
//override "setAnchorPoint" method of widget.
virtual void setAnchorPoint(const cocos2d::Point &pt);
virtual void setAnchorPoint(const cocos2d::Point &pt) override;
//override "getContentSize" method of widget.
virtual const cocos2d::Size& getContentSize() const;
virtual const cocos2d::Size& getContentSize() const override;
//override "getVirtualRenderer" method of widget.
virtual cocos2d::Node* getVirtualRenderer();
virtual cocos2d::Node* getVirtualRenderer() override;
/**
* Returns the "class name" of widget.
*/
virtual const char* getDescription() const;
virtual const char* getDescription() const override;
void setTextAreaSize(const cocos2d::Size &size);
void setTextHorizontalAlignment(cocos2d::TextHAlignment alignment);
void setTextVerticalAlignment(cocos2d::TextVAlignment alignment);
protected:
virtual bool init();
virtual void initRenderer();
virtual void onPressStateChangedToNormal();
virtual void onPressStateChangedToPressed();
virtual void onPressStateChangedToDisabled();
virtual void onSizeChanged();
virtual bool init() override;
virtual void initRenderer() override;
virtual void onPressStateChangedToNormal() override;
virtual void onPressStateChangedToPressed() override;
virtual void onPressStateChangedToDisabled() override;
virtual void onSizeChanged() override;
void clickScale(float scaleX, float scaleY);
void labelScaleChangedWithSize();
virtual UIWidget* createCloneInstance();
virtual void copySpecialProperties(UIWidget* model);
virtual UIWidget* createCloneInstance() override;
virtual void copySpecialProperties(UIWidget* model) override;
protected:
bool _touchScaleChangeEnabled;
float _normalScaleValueX;

View File

@ -52,8 +52,8 @@ public:
static UICCLabelAtlas* create();
void setProperty(const std::string& string, const std::string& charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap);
void setProperty(const std::string& string, cocos2d::Texture2D *texture, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap);
virtual void updateDisplayedOpacity(GLubyte opacity);
virtual void draw(void);
virtual void updateDisplayedOpacity(GLubyte opacity) override;
virtual void draw(void) override;
};
/**
* @js NA
@ -87,25 +87,25 @@ public:
const std::string& getStringValue() const;
//override "setAnchorPoint" method of widget.
virtual void setAnchorPoint(const cocos2d::Point &pt);
virtual void setAnchorPoint(const cocos2d::Point &pt) override;
//override "getContentSize" method of widget.
virtual const cocos2d::Size& getContentSize() const;
virtual const cocos2d::Size& getContentSize() const override;
//override "getVirtualRenderer" method of widget.
virtual cocos2d::Node* getVirtualRenderer();
virtual cocos2d::Node* getVirtualRenderer() override;
/**
* Returns the "class name" of widget.
*/
virtual const char* getDescription() const;
virtual const char* getDescription() const override;
protected:
virtual void initRenderer();
virtual void onSizeChanged();
virtual void initRenderer() override;
virtual void onSizeChanged() override;
void labelAtlasScaleChangedWithSize();
virtual UIWidget* createCloneInstance();
virtual void copySpecialProperties(UIWidget* model);
virtual UIWidget* createCloneInstance() override;
virtual void copySpecialProperties(UIWidget* model) override;
protected:
UICCLabelAtlas* _laberAtlasRenderer;
std::string _stringValue;

View File

@ -59,19 +59,19 @@ public:
/** get string value for labelbmfont*/
const char* getStringValue();
virtual void setAnchorPoint(const cocos2d::Point &pt);
virtual const cocos2d::Size& getContentSize() const;
virtual cocos2d::Node* getVirtualRenderer();
virtual void setAnchorPoint(const cocos2d::Point &pt) override;
virtual const cocos2d::Size& getContentSize() const override;
virtual cocos2d::Node* getVirtualRenderer() override;
/**
* Returns the "class name" of widget.
*/
virtual const char* getDescription() const;
virtual const char* getDescription() const override;
protected:
virtual void initRenderer();
virtual void onSizeChanged();
virtual void initRenderer() override;
virtual void onSizeChanged() override;
void labelBMFontScaleChangedWithSize();
virtual UIWidget* createCloneInstance();
virtual void copySpecialProperties(UIWidget* model);
virtual UIWidget* createCloneInstance() override;
virtual void copySpecialProperties(UIWidget* model) override;
protected:
cocos2d::LabelBMFont* _labelBMFontRenderer;
bool _fntFileHasInit;

View File

@ -53,11 +53,11 @@ public:
static UILayer *create(void);
//initializes state of uilayer.
virtual bool init();
virtual bool init() override;
virtual void onEnter();
virtual void onExit();
virtual void onEnterTransitionDidFinish();
virtual void onEnter() override;
virtual void onExit() override;
virtual void onEnterTransitionDidFinish() override;
virtual bool onTouchBegan(cocos2d::Touch *pTouch, cocos2d::Event *pEvent);
virtual void onTouchMoved(cocos2d::Touch *pTouch, cocos2d::Event *pEvent);
@ -87,7 +87,7 @@ public:
*
* @param visible true if the UILayer is visible, false if the UILayer is hidden.
*/
virtual void setVisible(bool visible);
virtual void setVisible(bool visible) override;
/**
* Finds a widget whose tag is equal tag param from widget tree.

View File

@ -68,7 +68,7 @@ public:
static UILayout* create();
//override "hitTest" method of widget.
virtual bool hitTest(const cocos2d::Point &pt);
virtual bool hitTest(const cocos2d::Point &pt) override;
//background
/**
@ -133,10 +133,10 @@ public:
void setBackGroundColorVector(const cocos2d::Point &vector);
//override "setColor" method of widget.
virtual void setColor(const cocos2d::Color3B &color);
virtual void setColor(const cocos2d::Color3B &color) override;
//override "setOpacity" method of widget.
virtual void setOpacity(int opacity);
virtual void setOpacity(int opacity) override;
/**
* Remove the background image of layout.
@ -157,7 +157,7 @@ public:
*
* @param clipping enabled.
*/
virtual void setClippingEnabled(bool able);
virtual void setClippingEnabled(bool enabled);
/**
* Gets if layout is clipping enabled.
@ -171,12 +171,12 @@ public:
*
* Content size is widget's texture size.
*/
virtual const cocos2d::Size& getContentSize() const;
virtual const cocos2d::Size& getContentSize() const override;
/**
* Returns the "class name" of widget.
*/
virtual const char* getDescription() const;
virtual const char* getDescription() const override;
/**
* Sets LayoutType.
@ -203,25 +203,25 @@ public:
*
* @param child A child widget
*/
virtual bool addChild(UIWidget* child);
virtual bool addChild(UIWidget* child) override;
protected:
//override "init" method of widget.
virtual bool init();
virtual bool init() override;
//override "initRenderer" method of widget.
virtual void initRenderer();
virtual void initRenderer() override;
//override "onSizeChanged" method of widget.
virtual void onSizeChanged();
virtual void onSizeChanged() override;
//init background image renderer.
void addBackGroundImage();
void supplyTheLayoutParameterLackToChild(UIWidget* child);
virtual UIWidget* createCloneInstance();
virtual void copySpecialProperties(UIWidget* model);
virtual void copyClonedWidgetChildren(UIWidget* model);
virtual UIWidget* createCloneInstance() override;
virtual void copySpecialProperties(UIWidget* model) override;
virtual void copyClonedWidgetChildren(UIWidget* model) override;
protected:
bool _clippingEnabled;

View File

@ -393,7 +393,7 @@ void UIListView::selectedItemEvent()
{
if (_listViewEventListener && _listViewEventSelector)
{
(_listViewEventListener->*_listViewEventSelector)(this, LISTVIEW_ONSELECEDTITEM);
(_listViewEventListener->*_listViewEventSelector)(this, LISTVIEW_ONSELECTEDITEM);
}
}

View File

@ -43,7 +43,7 @@ typedef enum
typedef enum
{
LISTVIEW_ONSELECEDTITEM
LISTVIEW_ONSELECTEDITEM
}ListViewEventType;
typedef void (cocos2d::Object::*SEL_ListViewEvent)(cocos2d::Object*,ListViewEventType);
@ -164,20 +164,24 @@ public:
*
* @param SCROLLVIEW_DIR
*/
virtual void setDirection(SCROLLVIEW_DIR dir);
virtual void setDirection(SCROLLVIEW_DIR dir) override;
virtual const char* getDescription() const;
virtual const char* getDescription() const override;
protected:
virtual bool init();
virtual bool addChild(UIWidget* widget) override{return UIScrollView::addChild(widget);};
virtual bool removeChild(UIWidget* widget) override{return UIScrollView::removeChild(widget);};
virtual void removeAllChildren() override{UIScrollView::removeAllChildren();};
virtual cocos2d::Array* getChildren() override{return UIScrollView::getChildren();};
virtual bool init() override;
void updateInnerContainerSize();
void remedyLayoutParameter(UIWidget* item);
virtual void onSizeChanged();
virtual UIWidget* createCloneInstance();
virtual void copySpecialProperties(UIWidget* model);
virtual void copyClonedWidgetChildren(UIWidget* model);
virtual void onSizeChanged() override;
virtual UIWidget* createCloneInstance() override;
virtual void copySpecialProperties(UIWidget* model) override;
virtual void copyClonedWidgetChildren(UIWidget* model) override;
void selectedItemEvent();
virtual void interceptTouchEvent(int handleState,UIWidget* sender,const cocos2d::Point &touchPoint);
virtual void interceptTouchEvent(int handleState,UIWidget* sender,const cocos2d::Point &touchPoint) override;
protected:
UIWidget* _model;

View File

@ -112,25 +112,25 @@ public:
void setCapInsets(const cocos2d::Rect &capInsets);
//override "ignoreContentAdaptWithSize" method of widget.
virtual void ignoreContentAdaptWithSize(bool ignore);
virtual void ignoreContentAdaptWithSize(bool ignore) override;
//override "getContentSize" method of widget.
virtual const cocos2d::Size& getContentSize() const;
virtual const cocos2d::Size& getContentSize() const override;
//override "getVirtualRenderer" method of widget.
virtual cocos2d::Node* getVirtualRenderer();
virtual cocos2d::Node* getVirtualRenderer() override;
/**
* Returns the "class name" of widget.
*/
virtual const char* getDescription() const;
virtual const char* getDescription() const override;
protected:
virtual void initRenderer();
virtual void onSizeChanged();
virtual void initRenderer() override;
virtual void onSizeChanged() override;
void setScale9Scale();
void barRendererScaleChangedWithSize();
virtual UIWidget* createCloneInstance();
virtual void copySpecialProperties(UIWidget* model);
virtual UIWidget* createCloneInstance() override;
virtual void copySpecialProperties(UIWidget* model) override;
protected:
LoadingBarType _barType;
int _percent;

View File

@ -128,21 +128,21 @@ public:
//override "onTouchBegan" method of widget.
virtual bool onTouchBegan(const cocos2d::Point &touchPoint);
virtual bool onTouchBegan(const cocos2d::Point &touchPoint) override;
//override "onTouchMoved" method of widget.
virtual void onTouchMoved(const cocos2d::Point &touchPoint);
virtual void onTouchMoved(const cocos2d::Point &touchPoint) override;
//override "onTouchEnded" method of widget.
virtual void onTouchEnded(const cocos2d::Point &touchPoint);
virtual void onTouchEnded(const cocos2d::Point &touchPoint) override;
//override "onTouchCancelled" method of widget.
virtual void onTouchCancelled(const cocos2d::Point &touchPoint);
virtual void onTouchCancelled(const cocos2d::Point &touchPoint) override;
//override "update" method of widget.
virtual void update(float dt);
virtual void update(float dt) override;
virtual void doLayout(){};
virtual void doLayout() override{};
/**
* Sets LayoutType.
@ -151,7 +151,7 @@ public:
*
* @param LayoutType
*/
virtual void setLayoutType(LayoutType type){};
virtual void setLayoutType(LayoutType type) override{};
/**
* Gets LayoutType.
@ -160,36 +160,37 @@ public:
*
* @return LayoutType
*/
virtual LayoutType getLayoutType() const{return LAYOUT_ABSOLUTE;};
virtual LayoutType getLayoutType() const override{return LAYOUT_ABSOLUTE;};
/**
* Returns the "class name" of widget.
*/
virtual const char* getDescription() const;
virtual const char* getDescription() const override;
protected:
virtual bool addChild(UIWidget* widget);
virtual bool removeChild(UIWidget* widget);
virtual void removeAllChildren();
virtual bool init();
virtual bool addChild(UIWidget* widget) override;
virtual bool removeChild(UIWidget* widget) override;
virtual void removeAllChildren() override;
virtual cocos2d::Array* getChildren() override{return UIWidget::getChildren();};
virtual bool init() override;
UILayout* createPage();
float getPositionXByIndex(int idx);
void updateBoundaryPages();
virtual void handlePressLogic(const cocos2d::Point &touchPoint);
virtual void handleMoveLogic(const cocos2d::Point &touchPoint);
virtual void handleReleaseLogic(const cocos2d::Point &touchPoint);
virtual void interceptTouchEvent(int handleState, UIWidget* sender, const cocos2d::Point &touchPoint);
virtual void checkChildInfo(int handleState, UIWidget* sender, const cocos2d::Point &touchPoint);
virtual void handlePressLogic(const cocos2d::Point &touchPoint) override;
virtual void handleMoveLogic(const cocos2d::Point &touchPoint) override;
virtual void handleReleaseLogic(const cocos2d::Point &touchPoint) override;
virtual void interceptTouchEvent(int handleState, UIWidget* sender, const cocos2d::Point &touchPoint) override;
virtual void checkChildInfo(int handleState, UIWidget* sender, const cocos2d::Point &touchPoint) override;
virtual bool scrollPages(float touchOffset);
void movePages(float offset);
void pageTurningEvent();
void updateChildrenSize();
void updateChildrenPosition();
virtual void onSizeChanged();
virtual UIWidget* createCloneInstance();
virtual void copySpecialProperties(UIWidget* model);
virtual void copyClonedWidgetChildren(UIWidget* model);
virtual void setClippingEnabled(bool able){UILayout::setClippingEnabled(able);};
virtual void onSizeChanged() override;
virtual UIWidget* createCloneInstance() override;
virtual void copySpecialProperties(UIWidget* model) override;
virtual void copyClonedWidgetChildren(UIWidget* model) override;
virtual void setClippingEnabled(bool enabled) override {UILayout::setClippingEnabled(enabled);};
protected:
int _curPageIdx;
cocos2d::Array* _pages;

View File

@ -54,10 +54,10 @@ public:
/**
* Returns the "class name" of widget.
*/
virtual const char* getDescription() const;
virtual const char* getDescription() const override;
protected:
//initializes state of widget.
virtual bool init();
virtual bool init() override;
};
}

View File

@ -234,33 +234,33 @@ public:
void addEventListenerScrollView(cocos2d::Object* target, SEL_ScrollViewEvent selector);
//override "addChild" method of widget.
virtual bool addChild(UIWidget* widget);
virtual bool addChild(UIWidget* widget) override;
//override "removeAllChildrenAndCleanUp" method of widget.
virtual void removeAllChildren();
virtual void removeAllChildren() override;
//override "removeChild" method of widget.
virtual bool removeChild(UIWidget* child);
virtual bool removeChild(UIWidget* child) override;
//override "getChildren" method of widget.
virtual cocos2d::Array* getChildren();
virtual cocos2d::Array* getChildren() override;
//override "onTouchBegan" method of widget.
virtual bool onTouchBegan(const cocos2d::Point &touchPoint);
virtual bool onTouchBegan(const cocos2d::Point &touchPoint) override;
//override "onTouchMoved" method of widget.
virtual void onTouchMoved(const cocos2d::Point &touchPoint);
virtual void onTouchMoved(const cocos2d::Point &touchPoint) override;
//override "onTouchEnded" method of widget.
virtual void onTouchEnded(const cocos2d::Point &touchPoint);
virtual void onTouchEnded(const cocos2d::Point &touchPoint) override;
//override "onTouchCancelled" method of widget.
virtual void onTouchCancelled(const cocos2d::Point &touchPoint);
virtual void onTouchCancelled(const cocos2d::Point &touchPoint) override;
//override "onTouchLongClicked" method of widget.
virtual void onTouchLongClicked(const cocos2d::Point &touchPoint);
virtual void onTouchLongClicked(const cocos2d::Point &touchPoint) override;
virtual void update(float dt);
virtual void update(float dt) override;
void setBounceEnabled(bool enabled);
@ -277,7 +277,7 @@ public:
*
* @param LayoutType
*/
virtual void setLayoutType(LayoutType type);
virtual void setLayoutType(LayoutType type) override;
/**
* Gets LayoutType.
@ -286,17 +286,17 @@ public:
*
* @return LayoutType
*/
virtual LayoutType getLayoutType() const;
virtual LayoutType getLayoutType() const override;
virtual void doLayout();
virtual void doLayout() override;
/**
* Returns the "class name" of widget.
*/
virtual const char* getDescription() const;
virtual const char* getDescription() const override;
protected:
virtual bool init();
virtual void initRenderer();
virtual bool init() override;
virtual void initRenderer() override;
void moveChildren(float offsetX, float offsetY);
void autoScrollChildren(float dt);
void bounceChildren(float dt);
@ -313,11 +313,11 @@ protected:
bool bounceScrollChildren(float touchOffsetX, float touchOffsetY);
void startRecordSlidAction();
virtual void endRecordSlidAction();
virtual void handlePressLogic(const cocos2d::Point &touchPoint);
virtual void handleMoveLogic(const cocos2d::Point &touchPoint);
virtual void handleReleaseLogic(const cocos2d::Point &touchPoint);
virtual void interceptTouchEvent(int handleState,UIWidget* sender,const cocos2d::Point &touchPoint);
virtual void checkChildInfo(int handleState,UIWidget* sender,const cocos2d::Point &touchPoint);
virtual void handlePressLogic(const cocos2d::Point &touchPoint) override;
virtual void handleMoveLogic(const cocos2d::Point &touchPoint) override;
virtual void handleReleaseLogic(const cocos2d::Point &touchPoint) override;
virtual void interceptTouchEvent(int handleState,UIWidget* sender,const cocos2d::Point &touchPoint) override;
virtual void checkChildInfo(int handleState,UIWidget* sender,const cocos2d::Point &touchPoint) override;
void recordSlidTime(float dt);
void scrollToTopEvent();
void scrollToBottomEvent();
@ -328,11 +328,11 @@ protected:
void bounceBottomEvent();
void bounceLeftEvent();
void bounceRightEvent();
virtual void onSizeChanged();
virtual UIWidget* createCloneInstance();
virtual void copySpecialProperties(UIWidget* model);
virtual void copyClonedWidgetChildren(UIWidget* model);
virtual void setClippingEnabled(bool able){UILayout::setClippingEnabled(able);};
virtual void onSizeChanged() override;
virtual UIWidget* createCloneInstance() override;
virtual void copySpecialProperties(UIWidget* model) override;
virtual void copyClonedWidgetChildren(UIWidget* model) override;
virtual void setClippingEnabled(bool able) override{UILayout::setClippingEnabled(able);};
protected:
UILayout* _innerContainer;

View File

@ -165,43 +165,43 @@ public:
void addEventListenerSlider(cocos2d::Object* target,SEL_SlidPercentChangedEvent selector);
//override "onTouchBegan" method of widget.
virtual bool onTouchBegan(const cocos2d::Point &touchPoint);
virtual bool onTouchBegan(const cocos2d::Point &touchPoint) override;
//override "onTouchMoved" method of widget.
virtual void onTouchMoved(const cocos2d::Point &touchPoint);
virtual void onTouchMoved(const cocos2d::Point &touchPoint) override;
//override "onTouchEnded" method of widget.
virtual void onTouchEnded(const cocos2d::Point &touchPoint);
virtual void onTouchEnded(const cocos2d::Point &touchPoint) override;
//override "onTouchCancelled" method of widget.
virtual void onTouchCancelled(const cocos2d::Point &touchPoint);
virtual void onTouchCancelled(const cocos2d::Point &touchPoint) override;
//override "getContentSize" method of widget.
virtual const cocos2d::Size& getContentSize() const;
virtual const cocos2d::Size& getContentSize() const override;
//override "getVirtualRenderer" method of widget.
virtual cocos2d::Node* getVirtualRenderer();
virtual cocos2d::Node* getVirtualRenderer() override;
//override "ignoreContentAdaptWithSize" method of widget.
virtual void ignoreContentAdaptWithSize(bool ignore);
virtual void ignoreContentAdaptWithSize(bool ignore) override;
/**
* Returns the "class name" of widget.
*/
virtual const char* getDescription() const;
virtual const char* getDescription() const override;
protected:
virtual void initRenderer();
virtual void initRenderer() override;
float getPercentWithBallPos(float location);
void percentChangedEvent();
virtual void onPressStateChangedToNormal();
virtual void onPressStateChangedToPressed();
virtual void onPressStateChangedToDisabled();
virtual void onSizeChanged();
virtual void onPressStateChangedToNormal() override;
virtual void onPressStateChangedToPressed() override;
virtual void onPressStateChangedToDisabled() override;
virtual void onSizeChanged() override;
void barRendererScaleChangedWithSize();
void progressBarRendererScaleChangedWithSize();
virtual UIWidget* createCloneInstance();
virtual void copySpecialProperties(UIWidget* model);
virtual UIWidget* createCloneInstance() override;
virtual void copySpecialProperties(UIWidget* model) override;
protected:
cocos2d::Node* _barRenderer;
cocos2d::Node* _progressBarRenderer;

View File

@ -106,8 +106,8 @@ public:
UITextField();
virtual ~UITextField();
static UITextField* create();
virtual bool init();
virtual void initRenderer();
virtual bool init() override;
virtual void initRenderer() override;
void setTouchSize(const cocos2d::Size &size);
void setText(const std::string& text);
void setPlaceHolder(const std::string& value);
@ -115,7 +115,7 @@ public:
void setFontName(const std::string& name);
virtual void didNotSelectSelf();
const std::string& getStringValue();
virtual bool onTouchBegan(const cocos2d::Point &touchPoint);
virtual bool onTouchBegan(const cocos2d::Point &touchPoint) override;
void setMaxLengthEnabled(bool enable);
bool isMaxLengthEnabled();
void setMaxLength(int length);
@ -123,7 +123,7 @@ public:
void setPasswordEnabled(bool enable);
bool isPasswordEnabled();
void setPasswordStyleText(const char* styleText);
virtual void update(float dt);
virtual void update(float dt) override;
bool getAttachWithIME();
void setAttachWithIME(bool attach);
bool getDetachWithIME();
@ -134,17 +134,17 @@ public:
void setDeleteBackward(bool deleteBackward);
void addEventListenerTextField(cocos2d::Object* target, SEL_TextFieldEvent selecor);
virtual void setAnchorPoint(const cocos2d::Point &pt);
virtual void setColor(const cocos2d::Color3B &color);
virtual void setOpacity(int opacity);
virtual void setAnchorPoint(const cocos2d::Point &pt) override;
virtual void setColor(const cocos2d::Color3B &color) override;
virtual void setOpacity(int opacity) override;
/**
* Returns the "class name" of widget.
*/
virtual const char* getDescription() const;
virtual const char* getDescription() const override;
virtual const cocos2d::Size& getContentSize() const;
virtual cocos2d::Node* getVirtualRenderer();
virtual const cocos2d::Size& getContentSize() const override;
virtual cocos2d::Node* getVirtualRenderer() override;
void attachWithIME();
protected:
// event
@ -152,10 +152,10 @@ protected:
void detachWithIMEEvent();
void insertTextEvent();
void deleteBackwardEvent();
virtual void onSizeChanged();
virtual void onSizeChanged() override;
void textfieldRendererScaleChangedWithSize();
virtual UIWidget* createCloneInstance();
virtual void copySpecialProperties(UIWidget* model);
virtual UIWidget* createCloneInstance() override;
virtual void copySpecialProperties(UIWidget* model) override;
protected:
UICCTextField* _textFieldRenderer;