Skip to content
9miao edited this page Oct 8, 2014 · 2 revisions

CAAlertView

Class Description

Tooltip control, if button number is no more than three, then buttons are arranged in a horizontal array, if the number is more than three, than buttons are arranged in a vertical array.

Effect Picture


Base Class

CAView,CATableViewDataSource,CATableViewDelegate

Attribute

Access modifier

Attribute name

Description

public

MessageFontName

prompt message font

public

Title

tooltip title

public

AlertMessage

tooltips prompt message

public

TitleImage

title background

public

BackGroundImage

prompt message background

Method

Access modifier

Method name

Description

public

createWithText

create a alertView

 

public

show

set tooltip title, prompt message and button

public

setTarget

set buttons callback event

 

public

addButton

set prompt message font name

 

public

addButton

set title

 

public

setAllBtnBackGroundImage

set title background

 

public

setAllBtnTextColor

set prompt message

 

Attribute Description

MessageFontName
type:string
Descripition: tooltip font

Title
type:string
Descripition: tooltip title

AlertMessage
type:string
Descripition: prompt message

TitleImage
Type:CAImage*
Descripition: title background

BackGroundImage
Type:CAImage*
Descripition: prompt message background

Method Description

static CAAlertView createWithText(const char pszTitle, const char* pszAlertMsg, const char* pszBtnText, . . .)

Return value:static CAAlertView*
Parameter:

Type

Parameter name

Description

const char*

pszTitle

title

const char*

pszAlertMsg

prompt message

 const char**

pszBtnText

button title

Descripition: create an alertView and designate alertView‘s title and prompt message, here the third and subsequent parameters are button’s title which is variable parameter. Title number determines button number.

void show()
Return value:void
Descripition: enable alertView instantly display

void setTarget(CAObject target, SEL_CAAlertBtnEvent selector)*
Return value:void
Parameter:

Type

Parameter name

Description

CAObject*

target

current object

SEL_CAAlertBtnEvent

selector

function callback

Descripition: add callback event for alertView‘s button

void addButton(const std: : string& btnText, CAColor4B col = CAColor_white, CAImage pNormalImage = NULL, CAImage pHighlightedImage = NULL)**
Return value:void
Parameter:

Type

Parameter name

Description

const string&

btnText

button title

CAColor4B

col

button color

CAImage*

pNormalImage

image when button is in normal status

CAImage*

pHighlightedImage

image when button is in highlight status

Descripition: add button for alertView

void addButton(CAButton pBtn)*
Return value:void
Parameter:

Type

Parameter name

Description

CAButton*

pBtn

current object

Descripition: add already created button for alertView

void setAllBtnBackGroundImage(CAControlState controlState, CAImage image)*
Return value:void
Parameter:

Type

Parameter name

Description

CAControlState

controlState

button status

CAImage*

image

background image

Descripition: add unified background for alertView‘s all buttons

void setAllBtnTextColor(CAColor4B col = CAColor_white)
Return value:void
Parameter:

Type

Parameter name

Description

CAColor4B

col

button background color

Description: set unified background color for all buttons
Clone this wiki locally