2014-12-31 16:28:14 +08:00
|
|
|
if nil == ccui then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2014-08-04 15:22:07 +08:00
|
|
|
--tip
|
|
|
|
local function deprecatedTip(old_name,new_name)
|
|
|
|
print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********")
|
|
|
|
end
|
|
|
|
|
|
|
|
--functions of ccui.Text will be deprecated begin
|
|
|
|
local TextDeprecated = { }
|
|
|
|
function TextDeprecated.setText(self, str)
|
|
|
|
deprecatedTip("ccui.Text:setText","ccui.Text:setString")
|
|
|
|
return self:setString(str)
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.Text.setText = TextDeprecated.setText
|
2014-08-04 15:22:07 +08:00
|
|
|
|
|
|
|
function TextDeprecated.getStringValue(self)
|
|
|
|
deprecatedTip("ccui.Text:getStringValue","ccui.Text:getString")
|
|
|
|
return self:getString()
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.Text.getStringValue = TextDeprecated.getStringValue
|
2014-08-04 15:22:07 +08:00
|
|
|
|
|
|
|
--functions of ccui.Text will be deprecated begin
|
|
|
|
|
|
|
|
--functions of ccui.TextAtlas will be deprecated begin
|
|
|
|
local TextAtlasDeprecated = { }
|
|
|
|
function TextAtlasDeprecated.setStringValue(self, str)
|
|
|
|
deprecatedTip("ccui.TextAtlas:setStringValue","ccui.TextAtlas:setString")
|
|
|
|
return self:setString(str)
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.TextAtlas.setStringValue = TextAtlasDeprecated.setStringValue
|
2014-08-04 15:22:07 +08:00
|
|
|
|
|
|
|
function TextAtlasDeprecated.getStringValue(self)
|
|
|
|
deprecatedTip("ccui.TextAtlas:getStringValue","ccui.TextAtlas:getString")
|
|
|
|
return self:getString()
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.TextAtlas.getStringValue = TextAtlasDeprecated.getStringValue
|
2014-08-04 15:22:07 +08:00
|
|
|
--functions of ccui.TextAtlas will be deprecated begin
|
|
|
|
|
|
|
|
|
|
|
|
--functions of ccui.TextBMFont will be deprecated begin
|
|
|
|
local TextBMFontDeprecated = { }
|
|
|
|
function TextBMFontDeprecated.setText(self, str)
|
|
|
|
deprecatedTip("ccui.TextBMFont:setText","ccui.TextBMFont:setString")
|
|
|
|
return self:setString(str)
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.TextBMFont.setText = TextBMFontDeprecated.setText
|
2014-08-04 15:22:07 +08:00
|
|
|
|
|
|
|
function TextBMFontDeprecated.getStringValue(self)
|
|
|
|
deprecatedTip("ccui.Text:getStringValue","ccui.TextBMFont:getString")
|
|
|
|
return self:getString()
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.Text.getStringValue = TextBMFontDeprecated.getStringValue
|
2014-08-04 15:22:07 +08:00
|
|
|
--functions of ccui.TextBMFont will be deprecated begin
|
|
|
|
|
|
|
|
--functions of cc.ShaderCache will be deprecated begin
|
|
|
|
local ShaderCacheDeprecated = { }
|
|
|
|
function ShaderCacheDeprecated.getProgram(self,strShader)
|
|
|
|
deprecatedTip("cc.ShaderCache:getProgram","cc.ShaderCache:getGLProgram")
|
|
|
|
return self:getGLProgram(strShader)
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
cc.ShaderCache.getProgram = ShaderCacheDeprecated.getProgram
|
2014-08-04 15:22:07 +08:00
|
|
|
--functions of ccui.TextBMFont will be deprecated begin
|
|
|
|
|
|
|
|
--functions of ccui.Widget will be deprecated begin
|
|
|
|
local UIWidgetDeprecated = { }
|
|
|
|
function UIWidgetDeprecated.getLeftInParent(self)
|
|
|
|
deprecatedTip("ccui.Widget:getLeftInParent","ccui.Widget:getLeftBoundary")
|
|
|
|
return self:getLeftBoundary()
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.Widget.getLeftInParent = UIWidgetDeprecated.getLeftInParent
|
2014-08-04 15:22:07 +08:00
|
|
|
|
|
|
|
function UIWidgetDeprecated.getBottomInParent(self)
|
|
|
|
deprecatedTip("ccui.Widget:getBottomInParent","ccui.Widget:getBottomBoundary")
|
|
|
|
return self:getBottomBoundary()
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.Widget.getBottomInParent = UIWidgetDeprecated.getBottomInParent
|
2014-08-04 15:22:07 +08:00
|
|
|
|
|
|
|
function UIWidgetDeprecated.getRightInParent(self)
|
|
|
|
deprecatedTip("ccui.Widget:getRightInParent","ccui.Widget:getRightBoundary")
|
|
|
|
return self:getRightBoundary()
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.Widget.getRightInParent = UIWidgetDeprecated.getRightInParent
|
2014-08-04 15:22:07 +08:00
|
|
|
|
|
|
|
function UIWidgetDeprecated.getTopInParent(self)
|
|
|
|
deprecatedTip("ccui.Widget:getTopInParent","ccui.Widget:getTopBoundary")
|
|
|
|
return self:getTopBoundary()
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.Widget.getTopInParent = UIWidgetDeprecated.getTopInParent
|
2014-08-04 15:22:07 +08:00
|
|
|
|
|
|
|
function UIWidgetDeprecated.getSize(self)
|
|
|
|
deprecatedTip("ccui.Widget:getSize","ccui.Widget:getContentSize")
|
|
|
|
return self:getContentSize()
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.Widget.getSize = UIWidgetDeprecated.getSize
|
2014-08-04 15:22:07 +08:00
|
|
|
|
|
|
|
function UIWidgetDeprecated.setSize(self, ...)
|
|
|
|
deprecatedTip("ccui.Widget:setSize","ccui.Widget:setContentSize")
|
|
|
|
return self:setContentSize(...)
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.Widget.setSize = UIWidgetDeprecated.setSize
|
2014-08-04 15:22:07 +08:00
|
|
|
|
|
|
|
--functions of ccui.Widget will be deprecated end
|
|
|
|
|
|
|
|
--functions of ccui.CheckBox will be deprecated begin
|
|
|
|
local UICheckBoxDeprecated = { }
|
|
|
|
function UICheckBoxDeprecated.addEventListenerCheckBox(self,handler)
|
|
|
|
deprecatedTip("ccui.CheckBox:addEventListenerCheckBox","ccui.CheckBox:addEventListener")
|
|
|
|
return self:addEventListener(handler)
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.CheckBox.addEventListenerCheckBox = UICheckBoxDeprecated.addEventListenerCheckBox
|
2014-08-22 11:56:13 +08:00
|
|
|
|
|
|
|
function UICheckBoxDeprecated.setSelectedState(self,flag)
|
|
|
|
deprecatedTip("ccui.CheckBox:setSelectedState", "ccui.CheckBox:setSelected")
|
|
|
|
return self:setSelected(flag)
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.CheckBox.setSelectedState = UICheckBoxDeprecated.setSelectedState
|
2014-08-22 11:56:13 +08:00
|
|
|
|
|
|
|
function UICheckBoxDeprecated.getSelectedState(self)
|
|
|
|
deprecatedTip("ccui.CheckBox:getSelectedState", "ccui.CheckBox:getSelected")
|
|
|
|
return self:getSelected()
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.CheckBox.getSelectedState = UICheckBoxDeprecated.setSelectedState
|
2014-08-22 11:56:13 +08:00
|
|
|
|
2014-08-04 15:22:07 +08:00
|
|
|
--functions of ccui.CheckBox will be deprecated end
|
|
|
|
|
|
|
|
--functions of ccui.Slider will be deprecated begin
|
|
|
|
local UISliderDeprecated = { }
|
|
|
|
function UISliderDeprecated.addEventListenerSlider(self,handler)
|
|
|
|
deprecatedTip("ccui.Slider:addEventListenerSlider","ccui.Slider:addEventListener")
|
|
|
|
return self:addEventListener(handler)
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.Slider.addEventListenerSlider = UISliderDeprecated.addEventListenerSlider
|
2014-08-04 15:22:07 +08:00
|
|
|
--functions of ccui.Slider will be deprecated end
|
|
|
|
|
|
|
|
--functions of ccui.TextField will be deprecated begin
|
|
|
|
local UITextFieldDeprecated = { }
|
|
|
|
function UITextFieldDeprecated.addEventListenerTextField(self,handler)
|
|
|
|
deprecatedTip("ccui.TextField:addEventListenerTextField","ccui.TextField:addEventListener")
|
|
|
|
return self:addEventListener(handler)
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.TextField.addEventListenerTextField = UITextFieldDeprecated.addEventListenerTextField
|
2014-09-09 13:59:35 +08:00
|
|
|
|
|
|
|
function UITextFieldDeprecated.setText(self, str)
|
|
|
|
deprecatedTip("ccui.TextField:setText","ccui.TextField:setString")
|
|
|
|
return self:setString(str)
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.TextField.setText = UITextFieldDeprecated.setText
|
2014-09-09 13:59:35 +08:00
|
|
|
|
|
|
|
function UITextFieldDeprecated.getStringValue(self)
|
|
|
|
deprecatedTip("ccui.TextField:getStringValue","ccui.TextField:getString")
|
|
|
|
return self:getString()
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.TextField.getStringValue = UITextFieldDeprecated.getStringValue
|
2014-08-04 15:22:07 +08:00
|
|
|
--functions of ccui.TextField will be deprecated end
|
|
|
|
|
|
|
|
--functions of ccui.PageView will be deprecated begin
|
|
|
|
local UIPageViewDeprecated = { }
|
|
|
|
function UIPageViewDeprecated.addEventListenerPageView(self,handler)
|
|
|
|
deprecatedTip("ccui.PageView:addEventListenerPageView","ccui.PageView:addEventListener")
|
|
|
|
return self:addEventListener(handler)
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.PageView.addEventListenerPageView = UIPageViewDeprecated.addEventListenerPageView
|
2014-08-04 15:22:07 +08:00
|
|
|
--functions of ccui.PageView will be deprecated end
|
|
|
|
|
|
|
|
--functions of ccui.ScrollView will be deprecated begin
|
|
|
|
local UIScrollViewDeprecated = { }
|
|
|
|
function UIScrollViewDeprecated.addEventListenerScrollView(self,handler)
|
|
|
|
deprecatedTip("ccui.ScrollView:addEventListenerScrollView","ccui.ScrollView:addEventListener")
|
|
|
|
return self:addEventListener(handler)
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.ScrollView.addEventListenerScrollView = UIScrollViewDeprecated.addEventListenerScrollView
|
2014-08-04 15:22:07 +08:00
|
|
|
--functions of ccui.ScrollView will be deprecated end
|
|
|
|
|
|
|
|
--functions of ccui.ListView will be deprecated begin
|
|
|
|
local UIListViewDeprecated = { }
|
|
|
|
function UIListViewDeprecated.addEventListenerListView(self,handler)
|
|
|
|
deprecatedTip("ccui.ListView:addEventListenerListView","ccui.ListView:addEventListener")
|
|
|
|
return self:addEventListener(handler)
|
|
|
|
end
|
2014-10-17 14:15:30 +08:00
|
|
|
ccui.ListView.addEventListenerListView = UIListViewDeprecated.addEventListenerListView
|
2014-08-04 15:22:07 +08:00
|
|
|
--functions of ccui.ListView will be deprecated end
|