本文整理汇总了C++中ListIter::GetEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ ListIter::GetEnabled方法的具体用法?C++ ListIter::GetEnabled怎么用?C++ ListIter::GetEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListIter
的用法示例。
在下文中一共展示了ListIter::GetEnabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: menu_rect
//.........这里部分代码省略.........
item_rect.x += 4;
item_rect.y += 3;
item_rect.w -= 8;
item_rect.h = 12;
item.reset();
while (++item) {
int line_height = 0;
if (item->GetText().length()) {
Rect fill_rect = item_rect;
fill_rect.Inflate(2,-1);
fill_rect.y -= 1;
int mx = Mouse::X() - offset.x;
int my = Mouse::Y() - offset.y;
// is this item picked?
if (menu_rect.Contains(mx, my)) {
if (my >= fill_rect.y && my <= fill_rect.y+fill_rect.h) {
if (Mouse::LButton()) {
menu_item = item.value();
item->SetSelected(2);
if (locked_item && locked_item->GetMenu() == m)
locked_item->SetSelected(0);
locked_item = menu_item;
}
else if (!locked_item || locked_item->GetMenu() != m) {
item->SetSelected(true);
menu_item = item.value();
}
if (menu_item && menu_item != selected) {
selected = menu_item;
Button::PlaySound(Button::SND_MENU_HILITE);
}
}
else if (item.value() != locked_item) {
item->SetSelected(false);
}
}
if (item->GetSelected()) {
window->FillRect(fill_rect, back_color * 0.35);
window->DrawRect(fill_rect, back_color * 0.75);
if (item->GetSubmenu()) {
submenu = item->GetSubmenu();
subx = menu_rect.x + max_width + extra_width;
suby = fill_rect.y - 3;
}
}
if (item->GetEnabled())
font->SetColor(text_color);
else
font->SetColor(text_color * 0.33);
window->SetFont(font);
window->DrawText(item->GetText(), 0, item_rect, DT_LEFT|DT_SINGLELINE);
line_height = 11;
}
else {
window->DrawLine(item_rect.x,
item_rect.y + 2,
item_rect.x + max_width + extra_width - 8,
item_rect.y + 2,
back_color);
line_height = 4;
}
if (item->GetSubmenu()) {
int left = item_rect.x + max_width + 10;
int top = item_rect.y + 1;
// draw the arrow:
POINT arrow[3];
arrow[0].x = left;
arrow[0].y = top;
arrow[1].x = left + 8;
arrow[1].y = top + 4;
arrow[2].x = left;
arrow[2].y = top + 8;
window->FillPoly(3, arrow, back_color);
}
item_rect.y += line_height;
}
if (submenu) {
if (subx + 60 > width)
subx = menu_rect.x - 60;
DrawMenu(subx, suby, submenu);
}
}
}