From 9d6d9dcd1964b9eed6fdcccd5c917dac855682d0 Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Tue, 17 Sep 2013 17:59:20 +0800 Subject: [PATCH] Add getDescription method --- .../GUI/BaseClasses/UIRootWidget.cpp | 5 ++ .../CocoStudio/GUI/BaseClasses/UIRootWidget.h | 5 ++ .../CocoStudio/GUI/BaseClasses/UIWidget.cpp | 5 ++ .../CocoStudio/GUI/BaseClasses/UIWidget.h | 5 ++ extensions/CocoStudio/GUI/Layouts/Layout.cpp | 5 ++ extensions/CocoStudio/GUI/Layouts/Layout.h | 4 ++ .../UIWidgets/ScrollWidget/UIDragPanel.cpp | 5 ++ .../GUI/UIWidgets/ScrollWidget/UIDragPanel.h | 5 ++ .../GUI/UIWidgets/ScrollWidget/UIListView.cpp | 6 +++ .../GUI/UIWidgets/ScrollWidget/UIListView.h | 4 ++ .../GUI/UIWidgets/ScrollWidget/UIPageView.cpp | 5 ++ .../GUI/UIWidgets/ScrollWidget/UIPageView.h | 4 ++ .../UIWidgets/ScrollWidget/UIScrollView.cpp | 5 ++ .../GUI/UIWidgets/ScrollWidget/UIScrollView.h | 5 ++ .../CocoStudio/GUI/UIWidgets/UIButton.cpp | 53 ++----------------- .../CocoStudio/GUI/UIWidgets/UIButton.h | 7 +-- .../CocoStudio/GUI/UIWidgets/UICheckBox.cpp | 5 ++ .../CocoStudio/GUI/UIWidgets/UICheckBox.h | 4 ++ .../CocoStudio/GUI/UIWidgets/UIImageView.cpp | 5 ++ .../CocoStudio/GUI/UIWidgets/UIImageView.h | 5 ++ .../CocoStudio/GUI/UIWidgets/UILabel.cpp | 6 ++- extensions/CocoStudio/GUI/UIWidgets/UILabel.h | 5 ++ .../CocoStudio/GUI/UIWidgets/UILabelAtlas.cpp | 5 ++ .../CocoStudio/GUI/UIWidgets/UILabelAtlas.h | 5 ++ .../GUI/UIWidgets/UILabelBMFont.cpp | 6 +++ .../CocoStudio/GUI/UIWidgets/UILabelBMFont.h | 5 ++ .../CocoStudio/GUI/UIWidgets/UILoadingBar.cpp | 5 ++ .../CocoStudio/GUI/UIWidgets/UILoadingBar.h | 4 ++ .../CocoStudio/GUI/UIWidgets/UISlider.cpp | 6 +++ .../CocoStudio/GUI/UIWidgets/UISlider.h | 5 ++ .../CocoStudio/GUI/UIWidgets/UITextField.cpp | 5 ++ .../CocoStudio/GUI/UIWidgets/UITextField.h | 7 ++- 32 files changed, 158 insertions(+), 53 deletions(-) diff --git a/extensions/CocoStudio/GUI/BaseClasses/UIRootWidget.cpp b/extensions/CocoStudio/GUI/BaseClasses/UIRootWidget.cpp index e2b7a69ceb..bc34480328 100644 --- a/extensions/CocoStudio/GUI/BaseClasses/UIRootWidget.cpp +++ b/extensions/CocoStudio/GUI/BaseClasses/UIRootWidget.cpp @@ -56,4 +56,9 @@ bool UIRootWidget::init() return false; } +const char* UIRootWidget::getDescription() const +{ + return "RootWidget"; +} + NS_CC_EXT_END \ No newline at end of file diff --git a/extensions/CocoStudio/GUI/BaseClasses/UIRootWidget.h b/extensions/CocoStudio/GUI/BaseClasses/UIRootWidget.h index 59ba41a498..c08a75f457 100644 --- a/extensions/CocoStudio/GUI/BaseClasses/UIRootWidget.h +++ b/extensions/CocoStudio/GUI/BaseClasses/UIRootWidget.h @@ -46,6 +46,11 @@ public: * Allocates and initializes a widget. */ static UIRootWidget* create(); + + /** + * Returns the "class name" of widget. + */ + virtual const char* getDescription() const; protected: //initializes state of widget. virtual bool init(); diff --git a/extensions/CocoStudio/GUI/BaseClasses/UIWidget.cpp b/extensions/CocoStudio/GUI/BaseClasses/UIWidget.cpp index 78584293a0..3a64c4667a 100644 --- a/extensions/CocoStudio/GUI/BaseClasses/UIWidget.cpp +++ b/extensions/CocoStudio/GUI/BaseClasses/UIWidget.cpp @@ -1158,6 +1158,11 @@ LayoutParameter* UIWidget::getLayoutParameter() return _layoutParameter; } +const char* UIWidget::getDescription() const +{ + return "Widget"; +} + /*temp action*/ void UIWidget::setActionTag(int tag) { diff --git a/extensions/CocoStudio/GUI/BaseClasses/UIWidget.h b/extensions/CocoStudio/GUI/BaseClasses/UIWidget.h index 4600eea4b7..ce3c9e59a8 100644 --- a/extensions/CocoStudio/GUI/BaseClasses/UIWidget.h +++ b/extensions/CocoStudio/GUI/BaseClasses/UIWidget.h @@ -875,6 +875,11 @@ public: virtual void onEnter(); virtual void onExit(); + /** + * Returns the "class name" of widget. + */ + virtual const char* getDescription() const; + /*temp action*/ void setActionTag(int tag); int getActionTag(); diff --git a/extensions/CocoStudio/GUI/Layouts/Layout.cpp b/extensions/CocoStudio/GUI/Layouts/Layout.cpp index 17e90a2108..a32aaf6cb6 100644 --- a/extensions/CocoStudio/GUI/Layouts/Layout.cpp +++ b/extensions/CocoStudio/GUI/Layouts/Layout.cpp @@ -425,6 +425,11 @@ const Size& Layout::getContentSize() const return _renderer->getContentSize(); } +const char* Layout::getDescription() const +{ + return "Layout"; +} + RectClippingNode::RectClippingNode(): m_pInnerStencil(NULL), _enabled(true), diff --git a/extensions/CocoStudio/GUI/Layouts/Layout.h b/extensions/CocoStudio/GUI/Layouts/Layout.h index 6b29af43a4..9afa9f539c 100644 --- a/extensions/CocoStudio/GUI/Layouts/Layout.h +++ b/extensions/CocoStudio/GUI/Layouts/Layout.h @@ -179,6 +179,10 @@ public: */ virtual const Size& getContentSize() const; + /** + * Returns the "class name" of widget. + */ + virtual const char* getDescription() const; protected: //override "init" method of widget. virtual bool init(); diff --git a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIDragPanel.cpp b/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIDragPanel.cpp index 01e6403700..29e7957094 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIDragPanel.cpp +++ b/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIDragPanel.cpp @@ -1383,4 +1383,9 @@ Layout* UIDragPanel::getInnerContainer() return m_pInnerContainer; } +const char* UIDragPanel::getDescription() const +{ + return "DragPanel"; +} + NS_CC_EXT_END \ No newline at end of file diff --git a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIDragPanel.h b/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIDragPanel.h index a1ba2a34ae..f5b8ae1598 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIDragPanel.h +++ b/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIDragPanel.h @@ -226,6 +226,11 @@ public: */ Layout* getInnerContainer(); + /** + * Returns the "class name" of widget. + */ + virtual const char* getDescription() const; + protected: virtual bool init(); virtual void initRenderer(); diff --git a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIListView.cpp b/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIListView.cpp index ba292aed22..9a28f435f0 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIListView.cpp +++ b/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIListView.cpp @@ -1457,4 +1457,10 @@ void UIListView::addUpdateChildEvent(Object *target, SEL_ListViewUpdateChildEven _updateChildSelector = selector; } +const char* UIListView::getDescription() const +{ + return "ListView"; +} + + NS_CC_EXT_END \ No newline at end of file diff --git a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIListView.h b/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIListView.h index 24a4a9edc8..3a8eb327d6 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIListView.h +++ b/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIListView.h @@ -139,6 +139,10 @@ public: /**/ virtual void update(float dt); + /** + * Returns the "class name" of widget. + */ + virtual const char* getDescription() const; protected: virtual bool init(); diff --git a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIPageView.cpp b/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIPageView.cpp index e6a215d5d3..b3abef206b 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIPageView.cpp +++ b/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIPageView.cpp @@ -565,4 +565,9 @@ int UIPageView::getCurPageIndex() const return _curPageIdx; } +const char* UIPageView::getDescription() const +{ + return "PageView"; +} + NS_CC_EXT_END \ No newline at end of file diff --git a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIPageView.h b/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIPageView.h index 6db0a85930..eb6fc8b52d 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIPageView.h +++ b/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIPageView.h @@ -134,6 +134,10 @@ public: //override "update" method of widget. virtual void update(float dt); + /** + * Returns the "class name" of widget. + */ + virtual const char* getDescription() const; protected: virtual bool addChild(UIWidget* widget); virtual bool init(); diff --git a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollView.cpp b/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollView.cpp index 8a8e341ad6..0881f5f98a 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollView.cpp +++ b/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollView.cpp @@ -698,4 +698,9 @@ LayoutExecutant* UIScrollView::getLayoutExecutant() const return _innerContainer->getLayoutExecutant(); } +const char* UIScrollView::getDescription() const +{ + return "ScrollView"; +} + NS_CC_EXT_END \ No newline at end of file diff --git a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollView.h b/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollView.h index 42feb83edf..67d1995c08 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollView.h +++ b/extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollView.h @@ -183,6 +183,11 @@ public: virtual void onTouchLongClicked(const Point &touchPoint); virtual void update(float dt); + + /** + * Returns the "class name" of widget. + */ + virtual const char* getDescription() const; protected: virtual bool init(); virtual void initRenderer(); diff --git a/extensions/CocoStudio/GUI/UIWidgets/UIButton.cpp b/extensions/CocoStudio/GUI/UIWidgets/UIButton.cpp index b456613e9e..7273378c0f 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/UIButton.cpp +++ b/extensions/CocoStudio/GUI/UIWidgets/UIButton.cpp @@ -431,54 +431,6 @@ void UIButton::setAnchorPoint(const Point &pt) _titleRenderer->setPosition(Point(_size.width*(0.5f-_anchorPoint.x), _size.height*(0.5f-_anchorPoint.y))); } -void UIButton::setNormalSpriteFrame(SpriteFrame *frame) -{ - if (!frame) - { - return; - } - if (_scale9Enabled) - { - dynamic_cast(_buttonNormalRenderer)->setSpriteFrame(frame); - } - else - { - dynamic_cast(_buttonNormalRenderer)->setDisplayFrame(frame); - } -} - -void UIButton::setPressedSpriteFrame(SpriteFrame *frame) -{ - if (!frame) - { - return; - } - if (_scale9Enabled) - { - dynamic_cast(_buttonClickedRenderer)->setSpriteFrame(frame); - } - else - { - dynamic_cast(_buttonClickedRenderer)->setDisplayFrame(frame); - } -} - -void UIButton::setDisabledSpriteFrame(SpriteFrame *frame) -{ - if (!frame) - { - return; - } - if (_scale9Enabled) - { - dynamic_cast(_buttonDisableRenderer)->setSpriteFrame(frame); - } - else - { - dynamic_cast(_buttonDisableRenderer)->setDisplayFrame(frame); - } -} - void UIButton::onSizeChanged() { normalTextureScaleChangedWithSize(); @@ -657,4 +609,9 @@ void UIButton::setColor(const Color3B &color) setTitleColor(_titleColor); } +const char* UIButton::getDescription() const +{ + return "Button"; +} + NS_CC_EXT_END \ No newline at end of file diff --git a/extensions/CocoStudio/GUI/UIWidgets/UIButton.h b/extensions/CocoStudio/GUI/UIWidgets/UIButton.h index ace2829c3a..f44e897a90 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/UIButton.h +++ b/extensions/CocoStudio/GUI/UIWidgets/UIButton.h @@ -171,9 +171,10 @@ public: void setTitleFontName(const char* fontName); const char* getTitleFontName() const; - virtual void setNormalSpriteFrame(SpriteFrame* frame); - virtual void setPressedSpriteFrame(SpriteFrame* frame); - virtual void setDisabledSpriteFrame(SpriteFrame* frame); + /** + * Returns the "class name" of widget. + */ + virtual const char* getDescription() const; protected: virtual bool init(); virtual void initRenderer(); diff --git a/extensions/CocoStudio/GUI/UIWidgets/UICheckBox.cpp b/extensions/CocoStudio/GUI/UIWidgets/UICheckBox.cpp index ea8671f02b..12bf8a3a72 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/UICheckBox.cpp +++ b/extensions/CocoStudio/GUI/UIWidgets/UICheckBox.cpp @@ -456,4 +456,9 @@ void UICheckBox::frontCrossDisabledTextureScaleChangedWithSize() } } +const char* UICheckBox::getDescription() const +{ + return "CheckBox"; +} + NS_CC_EXT_END \ No newline at end of file diff --git a/extensions/CocoStudio/GUI/UIWidgets/UICheckBox.h b/extensions/CocoStudio/GUI/UIWidgets/UICheckBox.h index 8b9658148d..b997f6f1e1 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/UICheckBox.h +++ b/extensions/CocoStudio/GUI/UIWidgets/UICheckBox.h @@ -157,6 +157,10 @@ public: //override "getVirtualRenderer" method of widget. virtual Node* getVirtualRenderer(); + /** + * Returns the "class name" of widget. + */ + virtual const char* getDescription() const; protected: virtual bool init(); virtual void initRenderer(); diff --git a/extensions/CocoStudio/GUI/UIWidgets/UIImageView.cpp b/extensions/CocoStudio/GUI/UIWidgets/UIImageView.cpp index a8175661f1..23db5afef3 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/UIImageView.cpp +++ b/extensions/CocoStudio/GUI/UIWidgets/UIImageView.cpp @@ -368,4 +368,9 @@ void UIImageView::imageTextureScaleChangedWithSize() } } +const char* UIImageView::getDescription() const +{ + return "ImageView"; +} + NS_CC_EXT_END \ No newline at end of file diff --git a/extensions/CocoStudio/GUI/UIWidgets/UIImageView.h b/extensions/CocoStudio/GUI/UIWidgets/UIImageView.h index 725e94f72f..89e73d3fc4 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/UIImageView.h +++ b/extensions/CocoStudio/GUI/UIWidgets/UIImageView.h @@ -107,6 +107,11 @@ public: void checkDoubleClick(float dt); virtual const Size& getContentSize() const; virtual Node* getVirtualRenderer(); + + /** + * Returns the "class name" of widget. + */ + virtual const char* getDescription() const; protected: virtual void initRenderer(); virtual void onSizeChanged(); diff --git a/extensions/CocoStudio/GUI/UIWidgets/UILabel.cpp b/extensions/CocoStudio/GUI/UIWidgets/UILabel.cpp index 9c1104f3a1..0bc0da834d 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/UILabel.cpp +++ b/extensions/CocoStudio/GUI/UIWidgets/UILabel.cpp @@ -221,7 +221,11 @@ void UILabel::labelScaleChangedWithSize() _labelRenderer->setScaleX(scaleX); _labelRenderer->setScaleY(scaleY); } - +} + +const char* UILabel::getDescription() const +{ + return "Label"; } NS_CC_EXT_END \ No newline at end of file diff --git a/extensions/CocoStudio/GUI/UIWidgets/UILabel.h b/extensions/CocoStudio/GUI/UIWidgets/UILabel.h index 4b6e4804c9..68b764595e 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/UILabel.h +++ b/extensions/CocoStudio/GUI/UIWidgets/UILabel.h @@ -117,6 +117,11 @@ public: //override "getVirtualRenderer" method of widget. virtual Node* getVirtualRenderer(); + /** + * Returns the "class name" of widget. + */ + virtual const char* getDescription() const; + void setTextAreaSize(const Size &size); void setTextHorizontalAlignment(TextHAlignment alignment); void setTextVerticalAlignment(TextVAlignment alignment); diff --git a/extensions/CocoStudio/GUI/UIWidgets/UILabelAtlas.cpp b/extensions/CocoStudio/GUI/UIWidgets/UILabelAtlas.cpp index 779a8bc9ec..c4ba1922a7 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/UILabelAtlas.cpp +++ b/extensions/CocoStudio/GUI/UIWidgets/UILabelAtlas.cpp @@ -167,4 +167,9 @@ void UILabelAtlas::labelAtlasScaleChangedWithSize() } } +const char* UILabelAtlas::getDescription() const +{ + return "LabelAtlase"; +} + NS_CC_EXT_END \ No newline at end of file diff --git a/extensions/CocoStudio/GUI/UIWidgets/UILabelAtlas.h b/extensions/CocoStudio/GUI/UIWidgets/UILabelAtlas.h index 7c1be4a670..6ff0b65a1e 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/UILabelAtlas.h +++ b/extensions/CocoStudio/GUI/UIWidgets/UILabelAtlas.h @@ -87,6 +87,11 @@ public: //override "getVirtualRenderer" method of widget. virtual Node* getVirtualRenderer(); + + /** + * Returns the "class name" of widget. + */ + virtual const char* getDescription() const; protected: virtual void initRenderer(); virtual void onSizeChanged(); diff --git a/extensions/CocoStudio/GUI/UIWidgets/UILabelBMFont.cpp b/extensions/CocoStudio/GUI/UIWidgets/UILabelBMFont.cpp index 0484fa2432..c5a687015c 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/UILabelBMFont.cpp +++ b/extensions/CocoStudio/GUI/UIWidgets/UILabelBMFont.cpp @@ -126,4 +126,10 @@ void UILabelBMFont::labelBMFontScaleChangedWithSize() } } +const char* UILabelBMFont::getDescription() const +{ + return "LabelBMFont"; +} + + NS_CC_EXT_END \ No newline at end of file diff --git a/extensions/CocoStudio/GUI/UIWidgets/UILabelBMFont.h b/extensions/CocoStudio/GUI/UIWidgets/UILabelBMFont.h index f85a3ee335..757a4c33b1 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/UILabelBMFont.h +++ b/extensions/CocoStudio/GUI/UIWidgets/UILabelBMFont.h @@ -58,6 +58,11 @@ public: virtual void setAnchorPoint(const Point &pt); virtual const Size& getContentSize() const; virtual Node* getVirtualRenderer(); + + /** + * Returns the "class name" of widget. + */ + virtual const char* getDescription() const; protected: virtual void initRenderer(); virtual void onSizeChanged(); diff --git a/extensions/CocoStudio/GUI/UIWidgets/UILoadingBar.cpp b/extensions/CocoStudio/GUI/UIWidgets/UILoadingBar.cpp index 8873e87403..6f71980dc5 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/UILoadingBar.cpp +++ b/extensions/CocoStudio/GUI/UIWidgets/UILoadingBar.cpp @@ -331,4 +331,9 @@ void UILoadingBar::setScale9Scale() dynamic_cast(_barRenderer)->setPreferredSize(Size(width, _barRendererTextureSize.height)); } +const char* UILoadingBar::getDescription() const +{ + return "LoadingBar"; +} + NS_CC_EXT_END \ No newline at end of file diff --git a/extensions/CocoStudio/GUI/UIWidgets/UILoadingBar.h b/extensions/CocoStudio/GUI/UIWidgets/UILoadingBar.h index f62dfba722..5f38f56eda 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/UILoadingBar.h +++ b/extensions/CocoStudio/GUI/UIWidgets/UILoadingBar.h @@ -117,6 +117,10 @@ public: //override "getVirtualRenderer" method of widget. virtual Node* getVirtualRenderer(); + /** + * Returns the "class name" of widget. + */ + virtual const char* getDescription() const; protected: virtual void initRenderer(); virtual void onSizeChanged(); diff --git a/extensions/CocoStudio/GUI/UIWidgets/UISlider.cpp b/extensions/CocoStudio/GUI/UIWidgets/UISlider.cpp index cc70352f13..48d27f5d14 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/UISlider.cpp +++ b/extensions/CocoStudio/GUI/UIWidgets/UISlider.cpp @@ -535,4 +535,10 @@ void UISlider::onPressStateChangedToDisabled() _slidBallPressedRenderer->setVisible(false); _slidBallDisabledRenderer->setVisible(true); } + +const char* UISlider::getDescription() const +{ + return "Slider"; +} + NS_CC_EXT_END \ No newline at end of file diff --git a/extensions/CocoStudio/GUI/UIWidgets/UISlider.h b/extensions/CocoStudio/GUI/UIWidgets/UISlider.h index db4749adf5..2ed5854280 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/UISlider.h +++ b/extensions/CocoStudio/GUI/UIWidgets/UISlider.h @@ -180,6 +180,11 @@ public: //override "ignoreContentAdaptWithSize" method of widget. virtual void ignoreContentAdaptWithSize(bool ignore); + + /** + * Returns the "class name" of widget. + */ + virtual const char* getDescription() const; protected: virtual void initRenderer(); float getPercentWithBallPos(float location); diff --git a/extensions/CocoStudio/GUI/UIWidgets/UITextField.cpp b/extensions/CocoStudio/GUI/UIWidgets/UITextField.cpp index 1afc92be9b..170bfe96ac 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/UITextField.cpp +++ b/extensions/CocoStudio/GUI/UIWidgets/UITextField.cpp @@ -584,4 +584,9 @@ Node* UITextField::getVirtualRenderer() return _textFieldRenderer; } +const char* UITextField::getDescription() const +{ + return "TextField"; +} + NS_CC_EXT_END \ No newline at end of file diff --git a/extensions/CocoStudio/GUI/UIWidgets/UITextField.h b/extensions/CocoStudio/GUI/UIWidgets/UITextField.h index 80ffa71e31..9820f05750 100644 --- a/extensions/CocoStudio/GUI/UIWidgets/UITextField.h +++ b/extensions/CocoStudio/GUI/UIWidgets/UITextField.h @@ -70,6 +70,8 @@ public: bool getInsertText(); void setDeleteBackward(bool deleteBackward); bool getDeleteBackward(); + + protected: bool m_bMaxLengthEnabled; int m_nMaxLength; @@ -131,7 +133,10 @@ public: virtual void setAnchorPoint(const Point &pt); virtual void setColor(const Color3B &color); virtual void setOpacity(int opacity); - + /** + * Returns the "class name" of widget. + */ + virtual const char* getDescription() const; /*compatibel*/ /** * These methods will be removed