本文整理汇总了C++中tlistbox::get_selected_row方法的典型用法代码示例。如果您正苦于以下问题:C++ tlistbox::get_selected_row方法的具体用法?C++ tlistbox::get_selected_row怎么用?C++ tlistbox::get_selected_row使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tlistbox
的用法示例。
在下文中一共展示了tlistbox::get_selected_row方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: type_selected
void temploy::type_selected(twindow& window, tlistbox& list, const int type)
{
cursel_ = list.get_selected_row();
set_ok_active(window);
refresh_tooltip(window);
}
示例2: city_changed
void tside_report::city_changed(twindow& window, tlistbox& list, const int type)
{
if (candidate_cities_.empty()) {
return;
}
twidget* grid_ptr = list.get_row_panel(list.get_selected_row());
unsigned int selected_row = dynamic_cast<ttoggle_panel*>(grid_ptr)->get_data();
}
示例3: item_selected
void tinapp_purchase::item_selected(twindow& window, tlistbox& list, const int type)
{
twindow::tinvalidate_layout_blocker blocker(window);
int cursel = list.get_selected_row();
purchase_->set_active(!browse_ && operating_anim_ == twidget::npos);
refresh_tip(window, items_[cursel]);
}
示例4: campaign_selected
void tcampaign_selection::campaign_selected(twindow& window, tlistbox& list, const int type)
{
const int selected_row = list.get_selected_row();
tscrollbar_panel& multi_page = find_widget<tscrollbar_panel>(&window, "campaign_details", false);
tscroll_label& label = find_widget<tscroll_label>(&window, "description", false);
label.set_label(campaigns_[selected_row].description);
tcontrol& image = find_widget<tcontrol>(&window, "image", false);
image.set_label(campaigns_[selected_row].image);
window.invalidate_layout();
}
示例5: display_savegame
void tgame_load::display_savegame(twindow& window, tlistbox& list)
{
const int selected_row = list.get_selected_row();
twidget& preview_pane =
find_widget<twidget>(&window, "preview_pane", false);
if (selected_row == -1) {
preview_pane.set_visible(twidget::HIDDEN);
} else if (current_page_ == LOCAL_PAGE) {
preview_pane.set_visible(twidget::VISIBLE);
savegame::save_info& game = games_[selected_row];
filename_ = game.name;
config cfg_summary;
std::string dummy;
try {
savegame::manager::load_summary(game.name, cfg_summary, &dummy);
} catch(game::load_game_failed&) {
cfg_summary["corrupt"] = "yes";
}
find_widget<timage>(&window, "imgLeader", false).
set_label(cfg_summary["leader_image"]);
find_widget<tminimap>(&window, "minimap", false).
set_map_data(tminimap::TILE_MAP, cfg_summary["map_data"]);
find_widget<tscroll_label>(&window, "lblSummary", false).set_label(generate_summary(game.name, cfg_summary));
// window.invalidate_layout();
} else if (current_page_ == NETWORK_PAGE) {
preview_pane.set_visible(twidget::VISIBLE);
savegame::www_save_info& game = www_saves_[selected_row];
filename_ = game.name;
find_widget<tminimap>(&window, "minimap", false).set_map_data(tminimap::TILE_MAP, "");
find_widget<tscroll_label>(&window, "lblSummary", false).set_label(generate_summary(game.name, null_cfg));
}
}
示例6: item_selected
void tbrowse::item_selected(twindow& window, tlistbox& list, const int type)
{
int row = list.get_selected_row();
tristate dir = t_unset;
if (row >= 0) {
std::set<tfile>::const_iterator it;
if (row < (int)dirs_in_current_dir_.size()) {
dir = t_true;
it = dirs_in_current_dir_.begin();
} else {
dir = t_false;
it = files_in_current_dir_.begin();
row -= dirs_in_current_dir_.size();
}
std::advance(it, row);
selected_ = it->name;
} else {
selected_.empty();
}
set_ok_active(window, dir);
}
示例7: 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);
}
}
示例8: type_selected
void trpg_detail::type_selected(twindow& window, tlistbox& list, const int type)
{
troop_index_ = list.get_selected_row();
}
示例9: page_selected
void tpreferences::page_selected(twindow& window, tlistbox& list, const int type)
{
page_ = list.get_selected_row();
swap_page(window, page_, true);
}
示例10: type_selected
void tfinal_battle::type_selected(twindow& window, tlistbox& list, const int type)
{
type_index_ = list.get_selected_row();
}