当前位置:K88软件开发文章中心编程语言APP编程CrossApp → 文章内容

CAButton(按钮)

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-23 13:51:43

CCLog("callbackValueChanged()-->");}CAButton 属性说明AllowsSelected类型:bool解释:是否可以选择。is/set{}。Selected类型:bool解释:是否被选择。is{}。TouchClick类型:bool解释:是否被触摸点击。is{}。CAButton 方法说明static CAButton* create(const CAButtonType& buttonType);返回值:static CAButton*参数:类型参数名说明const CAButtonType&buttonType按钮类型解释:创建typedef enum{ CAButtonTypeCustom = 0, 默认看不见任何效果,需要自己定义效果 CAButtonTypeSquareRect, 矩形边框类型 CAButtonTypeRoundedRect, 圆角边框类型} CAButtonType;static CAButton* createWithFrame(const DRect& rect, const CAButtonType& buttonType);返回值:static CAButton*参数:类型参数名说明const DRect&rect区域大小 const CAButtonType&buttonType按钮类型解释:创建,并指定其Frametypedef enum{ CAButtonTypeCustom = 0, 默认看不见任何效果,需要自己定义效果 CAButtonTypeSquareRect, 矩形边框类型 CAButtonTypeRoundedRect, 圆角边框类型} CAButtonType;static CAButton* createWithCenter(const DRect& rect, const CAButtonType& buttonType);返回值:static CAButton*参数:类型参数名说明const DRect&rect中心点的位置及大小 const CAButtonType&buttonType按钮类型解释:创建,并指定其Centertypedef enum{ CAButtonTypeCustom = 0, 默认看不见任何效果,需要自己定义效果 CAButtonTypeSquareRect, 矩形边框类型 CAButtonTypeRoundedRect, 圆角边框类型} CAButtonType;virtual bool init();返回值:virtual bool参数:解释:初始化void setBackGroundViewForState(const CAControlState& controlState, CAView *var);返回值:void参数:类型参数名说明const CAControlState&controlStateButton的状态CAView*var图像解释:设置Button的状态的背景Viewtypedef enum{ CAControlStateNormal: 缺省状态 CAControlStateHighlighted: 高亮状态 CAControlStateDisabled: 禁用状态 CAControlStateSelected: 选中状态 CAControlStateAll: 全部状态}CAControlState;CAView* getBackGroundViewForState(const CAControlState& controlState);返回值:CAView*参数:类型参数名说明const CAControlState&controlStateButton的状态解释:获取Button的状态的背景Viewtypedef enum{ CAControlStateNormal: 缺省状态 CAControlStateHighlighted: 高亮状态 CAControlStateDisabled: 禁用状态 CAControlStateSelected: 选中状态 CAControlStateAll: 全部状态}CAControlState;void setImageForState(const CAControlState& controlState, CAImage* var);返回值:void参数:类型参数名说明const CAControlState&controlStateButton的状态CAImage*var图像解释:设置Button的状态和图像(不支持九宫格)typedef enum{ CAControlStateNormal: 缺省状态 CAControlStateHighlighted: 高亮状态 CAControlStateDisabled: 禁用状态 CAControlStateSelected: 选中状态 CAControlStateAll: 全部状态}CAControlState;CAImage* getImageForState(const CAControlState& controlState);返回值:CAImage*参数:类型参数名说明const CAControlState&controlStateButton的状态解释:获取Button的状态和图像(不支持九宫格)typedef enum{ CAControlStateNormal: 缺省状态 CAControlStateHighlighted: 高亮状态 CAControlStateDisabled: 禁用状态 CAControlStateSelected: 选中状态 CAControlStateAll: 全部状态}CAControlState;void setTitleForState(const CAControlState& controlState, const std::string& var);返回值:void参数:类型参数名说明const CAControlState&controlStateButton的状态const std::string&var文本解释:设置Button标题的显示文本typedef enum{ CAControlStateNormal: 缺省状态 CAControlStateHighlighted: 高亮状态 CAControlStateDisabled: 禁用状态 CAControlStateSelected: 选中状态 CAControlStateAll: 全部状态}CAControlState;const std::string& getTitleForState(const CAControlState& controlState);返回值:const std::string&参数:类型参数名说明const CAControlState&controlStateButton的状态解释:获取Button标题的显示文本typedef enum{ CAControlStateNormal: 缺省状态 CAControlStateHighlighted: 高亮状态 CAControlStateDisabled: 禁用状态 CAControlStateSelected: 选中状态 CAControlStateAll: 全部状态}CAControlState;void setImageColorForState(const CAControlState& controlState, const CAColor4B& var);返回值:void参数:类型参数名说明const CAControlState&controlStateButton的状态const CAColor4B&var颜色解释:设置Button的图像颜色和状态typedef enum{ CAControlStateNormal: 缺省状态 CAControlStateHighlighted: 高亮状态 CAControlStateDisabled: 禁用状态 CAControlStateSelected: 选中状态 CAControlStateAll: 全部状态}CAControlState;void setTitleColorForState(const CAControlState& controlState, const CAColor4B& var);返回值:void参数:类型参数名说明const CAControlState&controlStateButton的状态const CAColor4B&var颜色解释:设置Button的标题颜色和状态typedef enum{ CAControlStateNormal: 缺省状态 CAControlStateHighlighted: 高亮状态 CAControlStateDisabled: 禁用状态 CAControlStateSelected: 选中状态 CAControlStateAll: 全部状态}CAControlState;void setTitleFontName(const std::string& var);返回值:void参数:类型参数名说明const std::string&var文本解释:设置Button文本的字体void setImageOff

上一页  [1] [2] [3]  下一页


CAButton(按钮)