本文整理汇总了C++中twindow::alternate_bh方法的典型用法代码示例。如果您正苦于以下问题:C++ twindow::alternate_bh方法的具体用法?C++ twindow::alternate_bh怎么用?C++ twindow::alternate_bh使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twindow
的用法示例。
在下文中一共展示了twindow::alternate_bh方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: catalog_page
//.........这里部分代码省略.........
str.str("");
str << "<format>";
if (h->official_ == hero_official_mayor) {
str << "color=blue ";
} else if (h->official_ != HEROS_NO_OFFICIAL) {
str << "color=red ";
}
str << "text='" << h->name() << "'</format>";
table_item["label"] = str.str();
table_item_item.insert(std::make_pair("name", table_item));
if (h->parent_[0].hero_ != HEROS_INVALID_NUMBER) {
table_item["label"] = heros_[h->parent_[0].hero_].name();
} else {
table_item["label"] = "";
}
table_item_item.insert(std::make_pair("father", table_item));
if (h->parent_[1].hero_ != HEROS_INVALID_NUMBER) {
table_item["label"] = heros_[h->parent_[1].hero_].name();
} else {
table_item["label"] = "";
}
table_item_item.insert(std::make_pair("mother", table_item));
str.str("");
for (uint32_t i = 0; i < HEROS_MAX_OATH; i ++) {
if (h->oath_[i].hero_ != HEROS_INVALID_NUMBER) {
if (i == 0) {
str << heros_[h->oath_[i].hero_].name();
} else {
str << " " << heros_[h->oath_[i].hero_].name();
}
}
}
table_item["label"] = str.str();
table_item_item.insert(std::make_pair("oath", table_item));
str.str("");
for (uint32_t i = 0; i < HEROS_MAX_CONSORT; i ++) {
if (h->consort_[i].hero_ != HEROS_INVALID_NUMBER) {
if (i == 0) {
str << heros_[h->consort_[i].hero_].name();
} else {
str << " " << heros_[h->consort_[i].hero_].name();
}
}
}
table_item["label"] = str.str();
table_item_item.insert(std::make_pair("consort", table_item));
str.str("");
for (uint32_t i = 0; i < HEROS_MAX_INTIMATE; i ++) {
if (h->intimate_[i].hero_ != HEROS_INVALID_NUMBER) {
if (i == 0) {
str << heros_[h->intimate_[i].hero_].name();
} else {
str << " " << heros_[h->intimate_[i].hero_].name();
}
}
}
table_item["label"] = str.str();
table_item_item.insert(std::make_pair("intimate", table_item));
str.str("");
for (uint32_t i = 0; i < HEROS_MAX_HATE; i ++) {
if (h->hate_[i].hero_ != HEROS_INVALID_NUMBER) {
if (i == 0) {
str << heros_[h->hate_[i].hero_].name();
} else {
str << " " << heros_[h->hate_[i].hero_].name();
}
}
}
table_item["label"] = str.str();
table_item_item.insert(std::make_pair("hate", table_item));
}
hero_table_->add_row(table_item_item);
tgrid* grid_ptr = hero_table_->get_row_grid(hero_index);
ttoggle_button* toggle = dynamic_cast<ttoggle_button*>(grid_ptr->find("prefix", true));
toggle->set_callback_state_change(boost::bind(&tinterior::hero_toggled, this, _1));
toggle->set_data(hero_index);
if (checked_hero_ == hero_index) {
toggle->set_value(true);
}
if (browse_) {
toggle->set_active(false);
} else if (h->official_ != HEROS_NO_OFFICIAL && h->official_ != hero_official_mayor) {
toggle->set_active(false);
} else if (h->loyalty(*current_team_.leader()) < game_config::wander_loyalty_threshold) {
toggle->set_active(false);
}
}
if (swap) {
window.alternate_bh(hero_table_, index);
hero_table_->select_row(selected_row);
}
}