本文整理汇总了C++中tlistbox::invalidate_layout方法的典型用法代码示例。如果您正苦于以下问题:C++ tlistbox::invalidate_layout方法的具体用法?C++ tlistbox::invalidate_layout怎么用?C++ tlistbox::invalidate_layout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tlistbox
的用法示例。
在下文中一共展示了tlistbox::invalidate_layout方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: type_selected
void texpedite::type_selected(twindow& window, tlistbox& list, const int type)
{
tbutton* task = find_widget<tbutton>(&window, "task", false, true);
tbutton* ok = find_widget<tbutton>(&window, "ok", false, true);
// prevent visible/disable disband button from layouting window.
twindow::tinvalidate_layout_blocker invalidate_layout_blocker(window);
list.invalidate_layout(false);
troop_index_ = list.get_selected_row();
refresh_tooltip(window);
// There is maybe no troop after disband. so troop_index_ maybe equal -1.
if (troop_index_ >= 0) {
int size = city_.reside_troops().size();
const unit& u = *city_.reside_troops()[troop_index_];
for (int index = 0; index < size; index ++) {
twidget* grid_ptr = list.get_row_panel(index);
// tbutton& disband = find_widget<tbutton>(&window, "disband", false);
tbutton& disband = *dynamic_cast<tbutton*>(grid_ptr->find("disband", false));
if (index == troop_index_) {
disband.set_visible(twidget::VISIBLE);
disband.set_active(u.human());
} else {
disband.set_visible(twidget::INVISIBLE);
}
}
set_task_str(window, u);
ok->set_active(u.human() && can_move(u));
} else {
task->set_active(false);
ok->set_active(false);
}
}