本文整理汇总了C++中CAButton::setTitleFontName方法的典型用法代码示例。如果您正苦于以下问题:C++ CAButton::setTitleFontName方法的具体用法?C++ CAButton::setTitleFontName怎么用?C++ CAButton::setTitleFontName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAButton
的用法示例。
在下文中一共展示了CAButton::setTitleFontName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insertSegmentWithTitle
bool CASegmentedControl::insertSegmentWithTitle(const char* title, int index, const CAControlState& controlState)
{
const int curItemCount = m_segments.size();
if (index < 0)
{
index = 0;
}
else if (index >= curItemCount)
{
index = curItemCount;
}
CAButton *newBtn = this->createDefaultSegment();
if (NULL == newBtn)
{
return false;
}
newBtn->setTitleForState(controlState, title);
newBtn->setTitleFontName(m_sTitleFontName);
m_segments.insert(m_segments.begin() + index, newBtn);
this->addSubview(newBtn);
this->layoutSubviews();
return true;
}
示例2: initMsgTableView
void SessionsViewController::initMsgTableView()
{
if (m_msg->empty())
{
showAlert();
return;
}
if (m_msgTableView == NULL)
{
m_listView = CAListView::createWithFrame(DRect(0,(120),m_winSize.width,(60)));
m_listView->setListViewDelegate(this);
m_listView->setListViewDataSource(this);
m_listView->setAllowsSelection(true);
m_listView->setAllowsMultipleSelection(false);
m_listView->setListViewOrientation(CAListViewOrientationHorizontal);
m_listView->setShowsScrollIndicators(false);
m_listView->setSeparatorColor(ccc4(0xf6, 0xf6, 0xf6, 0xff));
m_listView->setBackgroundImage(CAImage::create("common/gray_bg.png"));
m_listView->setTag(1);
//m_listView->setc
this->getView()->addSubview(m_listView);
m_msgTableView = CATableView::createWithFrame(DRect(0, (180), m_winSize.width, m_winSize.height - (180)));
m_msgTableView->setTableViewDataSource(this);
m_msgTableView->setTableViewDelegate(this);
m_msgTableView->setScrollViewDelegate(this);
m_msgTableView->setAllowsSelection(true);
m_msgTableView->setSeparatorColor(ccc4(200, 200, 200, 80));
//m_msgTableView->setSeparatorViewHeight((2));
this->getView()->addSubview(m_msgTableView);
CAPullToRefreshView *refreshDiscount = CAPullToRefreshView::create(CAPullToRefreshView::CAPullToRefreshTypeHeader);
refreshDiscount->setLabelColor(CAColor_black);
m_msgTableView->setHeaderRefreshView(refreshDiscount);
m_filterView = CAView::createWithFrame(DRect(0, (120), m_winSize.width, (60)));
CAScale9ImageView* imageView = CAScale9ImageView::createWithImage(CAImage::create("common/gray_bg.png"));
imageView->setFrame(DRect(0, 0, m_winSize.width, (60)));
m_filterView->addSubview(imageView);
this->getView()->addSubview(m_filterView);
m_filterViewVec.push_back(m_filterView);
for (int i = 0; i < 2; i++)
{
int cnt = 0;
if (i == 0) {
cnt = TrackNum;
} else if (i == 1) {
cnt = FormatNum;
}
m_filterBtn[i] = CAButton::createWithFrame(DRect(i * m_winSize.width / 2, 0, m_winSize.width / 2, (60)), CAButtonTypeCustom);
m_filterBtn[i]->setTitleForState(CAControlStateAll, filterItem[i]);
m_filterBtn[i]->setTitleFontName(SAP_FONT_ARIAL);
m_filterBtn[i]->setTitleFontSize((30));
m_filterBtn[i]->setTitleColorForState(CAControlStateAll, CAColor_gray);
m_filterBtn[i]->addTarget(this, CAControl_selector(SessionsViewController::buttonCallBack), CAControlEventTouchUpInSide);
m_filterBtn[i]->setTag(300 + i);
m_filterBtn[i]->setAllowsSelected(true);
m_filterView->addSubview(m_filterBtn[i]);
m_downView[i] = CAView::createWithFrame(DRect(i * m_winSize.width / 2, (180), m_winSize.width / 2, (50) * cnt + (20)));
CAScale9ImageView* imageView = CAScale9ImageView::createWithImage(CAImage::create("common/gray_bg.png"));
imageView->setFrame(DRect(0, 0, m_winSize.width / 2, (50) * cnt + (20)));
m_downView[i]->addSubview(imageView);
this->getView()->addSubview(m_downView[i]);
m_filterViewVec.push_back(m_downView[i]);
}
for (int i = 0; i < m_filterViewVec.size(); i++)
{
m_filterViewVec[i]->setVisible(false);
}
for (int i = 0; i < TrackNum; i++)
{
CAButton* button = CAButton::createWithFrame(DRect((20), (50) * i, m_winSize.width / 2 - (40), (50)), CAButtonTypeCustom);
button->setTitleForState(CAControlStateAll, trackFilterItem[i]);
button->setTitleFontName(SAP_FONT_ARIAL);
button->setTitleColorForState(CAControlStateAll, CAColor_gray);
button->setTitleColorForState(CAControlStateSelected, CAColor_white);
button->setTitleFontSize((27));
button->setAllowsSelected(true);
//CAImageView* imageView = CAImageView::createWithImage(CAImage::create("common/white_bg.png"));
//button->setBackgroundViewForState(CAControlStateAll, imageView);
CAImageView* imageView = CAImageView::createWithImage(CAImage::create("common/sky_bg.png"));
button->setBackgroundViewForState(CAControlStateSelected, imageView);
button->addTarget(this, CAControl_selector(SessionsViewController::buttonCallBack), CAControlEventTouchUpInSide);
button->setTag(400 + i);
m_downView[0]->addSubview(button);
m_trackButtonVec.push_back(button);
}
for (int i = 0; i < FormatNum; i++)
{
CAButton* button = CAButton::createWithFrame(DRect((20), (50) * i, m_winSize.width / 2 - (40), (50)), CAButtonTypeCustom);
button->setTitleForState(CAControlStateAll, formatFilterItem[i]);
button->setTitleFontName(SAP_FONT_ARIAL);
button->setTitleColorForState(CAControlStateAll, CAColor_gray);
button->setTitleColorForState(CAControlStateSelected, CAColor_white);
//.........这里部分代码省略.........