Beispiel #1
0
void
MapItemListWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  CreateList(parent, dialog_look, rc,
             renderer.CalculateLayout(dialog_look));

  GetList().SetLength(list.size());
  UpdateButtons();

  for (unsigned i = 0; i < list.size(); ++i) {
    const MapItem &item = *list[i];
    if (HasDetails(item) || CanGotoItem(item)) {
      GetList().SetCursorIndex(i);
      break;
    }
  }
}
void
MapItemListWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  UPixelScalar item_height = dialog_look.list.font_bold->GetHeight()
    + Layout::Scale(6) + dialog_look.small_font->GetHeight();
  assert(item_height > 0);

  CreateList(parent, dialog_look, rc, item_height);

  GetList().SetLength(list.size());
  UpdateButtons();

  for (unsigned i = 0; i < list.size(); ++i) {
    const MapItem &item = *list[i];
    if (HasDetails(item) || CanGotoItem(item)) {
      GetList().SetCursorIndex(i);
      break;
    }
  }
}
Beispiel #3
0
 virtual bool CanActivateItem(unsigned index) const override {
   return HasDetails(*list[index]);
 }
Beispiel #4
0
 void UpdateButtons() {
   const unsigned current = GetCursorIndex();
   details_button->SetEnabled(HasDetails(*list[current]));
   goto_button->SetEnabled(CanGotoItem(current));
   ack_button->SetEnabled(CanAckItem(current));
 }
 void UpdateButtons() {
   const unsigned current = GetCursorIndex();
   details_button->SetEnabled(HasDetails(*list[current]));
 }
Beispiel #6
0
static void
OnListIndexChange(unsigned i)
{
  details_button->set_enabled(HasDetails(*(*list)[i]));
}