From 7493c7bf3e2a0104a1dba6a177d9f8edc9095ae2 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 3 Sep 2014 14:47:04 +0800 Subject: [PATCH] fxi compile warning --- .../GUI/CCControlExtension/CCControlButton.cpp | 18 +++++++++--------- .../GUI/CCControlExtension/CCControlButton.h | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/extensions/GUI/CCControlExtension/CCControlButton.cpp b/extensions/GUI/CCControlExtension/CCControlButton.cpp index 91599ae386..9a69de517e 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.cpp +++ b/extensions/GUI/CCControlExtension/CCControlButton.cpp @@ -63,10 +63,10 @@ ControlButton::~ControlButton() bool ControlButton::init() { - return this->initWithLabelAndBackgroundSprite(Label::createWithSystemFont("", "Helvetica", 12), Scale9Sprite::create()); + return this->initWithLabelAndBackgroundSprite(Label::createWithSystemFont("", "Helvetica", 12), cocos2d::ui::Scale9Sprite::create()); } -bool ControlButton::initWithLabelAndBackgroundSprite(Node* node, Scale9Sprite* backgroundSprite) +bool ControlButton::initWithLabelAndBackgroundSprite(Node* node, ui::Scale9Sprite* backgroundSprite) { if (Control::init()) { @@ -120,7 +120,7 @@ bool ControlButton::initWithLabelAndBackgroundSprite(Node* node, Scale9Sprite* b } } -ControlButton* ControlButton::create(Node* label, Scale9Sprite* backgroundSprite) +ControlButton* ControlButton::create(Node* label, cocos2d::ui::Scale9Sprite* backgroundSprite) { ControlButton *pRet = new (std::nothrow) ControlButton(); pRet->initWithLabelAndBackgroundSprite(label, backgroundSprite); @@ -130,7 +130,7 @@ ControlButton* ControlButton::create(Node* label, Scale9Sprite* backgroundSprite bool ControlButton::initWithTitleAndFontNameAndFontSize(const std::string& title, const std::string& fontName, float fontSize) { - return initWithLabelAndBackgroundSprite(Label::createWithSystemFont(title, fontName, fontSize), Scale9Sprite::create()); + return initWithLabelAndBackgroundSprite(Label::createWithSystemFont(title, fontName, fontSize), cocos2d::ui::Scale9Sprite::create()); } ControlButton* ControlButton::create(const std::string& title, const std::string& fontName, float fontSize) @@ -141,13 +141,13 @@ ControlButton* ControlButton::create(const std::string& title, const std::string return pRet; } -bool ControlButton::initWithBackgroundSprite(Scale9Sprite* sprite) +bool ControlButton::initWithBackgroundSprite(cocos2d::ui::Scale9Sprite* sprite) { Label *label = Label::createWithSystemFont("", "Arial", 30);// return initWithLabelAndBackgroundSprite(label, sprite); } -ControlButton* ControlButton::create(Scale9Sprite* sprite) +ControlButton* ControlButton::create(cocos2d::ui::Scale9Sprite* sprite) { ControlButton *pRet = new (std::nothrow) ControlButton(); pRet->initWithBackgroundSprite(sprite); @@ -422,7 +422,7 @@ const std::string& ControlButton::getTitleBMFontForState(State state) } -Scale9Sprite* ControlButton::getBackgroundSpriteForState(State state) +ui::Scale9Sprite* ControlButton::getBackgroundSpriteForState(State state) { auto backgroundSprite = _backgroundSpriteDispatchTable.at((int)state); if (backgroundSprite) @@ -433,7 +433,7 @@ Scale9Sprite* ControlButton::getBackgroundSpriteForState(State state) } -void ControlButton::setBackgroundSpriteForState(Scale9Sprite* sprite, State state) +void ControlButton::setBackgroundSpriteForState(ui::Scale9Sprite* sprite, State state) { Size oldPreferredSize = _preferredSize; @@ -469,7 +469,7 @@ void ControlButton::setBackgroundSpriteForState(Scale9Sprite* sprite, State stat void ControlButton::setBackgroundSpriteFrameForState(SpriteFrame * spriteFrame, State state) { - Scale9Sprite * sprite = Scale9Sprite::createWithSpriteFrame(spriteFrame); + ui::Scale9Sprite * sprite = ui::Scale9Sprite::createWithSpriteFrame(spriteFrame); this->setBackgroundSpriteForState(sprite, state); } diff --git a/extensions/GUI/CCControlExtension/CCControlButton.h b/extensions/GUI/CCControlExtension/CCControlButton.h index 758c61d363..2ead117306 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.h +++ b/extensions/GUI/CCControlExtension/CCControlButton.h @@ -32,8 +32,8 @@ #include "CCControl.h" #include "CCInvocation.h" -#include "extensions/ExtensionDeprecated.h" #include "base/CCMap.h" +#include "ui/UIScale9Sprite.h" NS_CC_EXT_BEGIN @@ -55,8 +55,8 @@ class CC_EX_DLL ControlButton : public Control { public: static ControlButton* create(); - static ControlButton* create(Scale9Sprite* sprite); - static ControlButton* create(Node* label, Scale9Sprite* backgroundSprite); + static ControlButton* create(cocos2d::ui::Scale9Sprite* sprite); + static ControlButton* create(Node* label, cocos2d::ui::Scale9Sprite* backgroundSprite); static ControlButton* create(const std::string& title, const std::string& fontName, float fontSize); virtual void needsLayout(void); @@ -148,7 +148,7 @@ public: * @param state The state that uses the background sprite. Possible values are * described in "CCControlState". */ - virtual Scale9Sprite* getBackgroundSpriteForState(State state); + virtual cocos2d::ui::Scale9Sprite* getBackgroundSpriteForState(State state); /** * Sets the background sprite to use for the specified button state. @@ -157,7 +157,7 @@ public: * @param state The state that uses the specified image. The values are described * in "CCControlState". */ - virtual void setBackgroundSpriteForState(Scale9Sprite* sprite, State state); + virtual void setBackgroundSpriteForState(cocos2d::ui::Scale9Sprite* sprite, State state); /** * Sets the background spriteFrame to use for the specified button state. @@ -202,8 +202,8 @@ CC_CONSTRUCTOR_ACCESS: virtual ~ControlButton(); virtual bool init() override; - virtual bool initWithLabelAndBackgroundSprite(Node* label, Scale9Sprite* backgroundSprite); - virtual bool initWithBackgroundSprite(Scale9Sprite* sprite); + virtual bool initWithLabelAndBackgroundSprite(Node* label, cocos2d::ui::Scale9Sprite* backgroundSprite); + virtual bool initWithBackgroundSprite(cocos2d::ui::Scale9Sprite* sprite); virtual bool initWithTitleAndFontNameAndFontSize(const std::string& title, const std::string& fontName, float fontSize); protected: @@ -221,7 +221,7 @@ protected: CC_SYNTHESIZE_RETAIN(Node*, _titleLabel, TitleLabel); /** The current background sprite. */ - CC_SYNTHESIZE_RETAIN(Scale9Sprite*, _backgroundSprite, BackgroundSprite); + CC_SYNTHESIZE_RETAIN(cocos2d::ui::Scale9Sprite*, _backgroundSprite, BackgroundSprite); /** The prefered size of the button, if label is larger it will be expanded. */ CC_PROPERTY_PASS_BY_REF(Size, _preferredSize, PreferredSize); @@ -237,7 +237,7 @@ protected: std::unordered_map _titleColorDispatchTable; Map _titleLabelDispatchTable; - Map _backgroundSpriteDispatchTable; + Map _backgroundSpriteDispatchTable; /* Define the button margin for Top/Bottom edge */ CC_SYNTHESIZE_READONLY(int, _marginV, VerticalMargin);