当前位置: 首页>>代码示例>>C++>>正文


C++ TaskStore类代码示例

本文整理汇总了C++中TaskStore的典型用法代码示例。如果您正苦于以下问题:C++ TaskStore类的具体用法?C++ TaskStore怎么用?C++ TaskStore使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了TaskStore类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetList

void
TaskListPanel::DeleteTask()
{
  const unsigned cursor_index = GetList().GetCursorIndex();
  if (cursor_index >= task_store->Size())
    return;

  const TCHAR *path = task_store->GetPath(cursor_index);
  if (StringEndsWithIgnoreCase(path, _T(".cup"))) {
    ShowMessageBox(_("Can't delete .CUP files"), _("Error"),
                   MB_OK | MB_ICONEXCLAMATION);
    return;
  }

  const TCHAR *fname = task_store->GetName(cursor_index);

  StaticString<1024> text;
  text.Format(_T("%s\n(%s)"), _("Delete the selected task?"), fname);
  if (ShowMessageBox(text.c_str(), _("Task Browser"),
                  MB_YESNO | MB_ICONQUESTION) != IDYES)
    return;

  File::Delete(path);

  task_store->Scan(more);
  RefreshView();
}
开发者ID:henrik1g,项目名称:XCSoar,代码行数:27,代码来源:TaskListPanel.cpp

示例2: _T

const TCHAR *
TaskListPanel::get_cursor_name()
{
  const unsigned cursor_index = GetList().GetCursorIndex();
  if (cursor_index >= task_store->Size())
    return _T("");

  return task_store->GetName(cursor_index);
}
开发者ID:henrik1g,项目名称:XCSoar,代码行数:9,代码来源:TaskListPanel.cpp

示例3: assert

void
TaskListPanel::OnPaintItem(Canvas &canvas, const PixelRect rc,
                           unsigned DrawListIndex)
{
  assert(DrawListIndex <= task_store->Size());

  const TCHAR *name = task_store->GetName(DrawListIndex);

  canvas.DrawText(rc.left + Layout::FastScale(2),
                  rc.top + Layout::FastScale(2), name);
}
开发者ID:henrik1g,项目名称:XCSoar,代码行数:11,代码来源:TaskListPanel.cpp

示例4: assert

void
TaskListPanel::OnPaintItem(Canvas &canvas, const PixelRect rc,
                           unsigned DrawListIndex)
{
  assert(DrawListIndex <= task_store->Size());

  const unsigned padding = Layout::GetTextPadding();
  const TCHAR *name = task_store->GetName(DrawListIndex);

  canvas.DrawText(rc.left + padding, rc.top + padding, name);
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:11,代码来源:TaskListPanel.cpp

示例5: GetList

void
TaskListPanel::LoadTask()
{
  const OrderedTask* orig = get_cursor_task();
  if (orig == nullptr)
    return;

  StaticString<1024> text;
  text.Format(_T("%s\n(%s)"), _("Load the selected task?"),
              get_cursor_name());

  if (ShowMessageBox(text.c_str(), _("Task Browser"),
                  MB_YESNO | MB_ICONQUESTION) != IDYES)
    return;

  // create new task first to guarantee pointers are different
  OrderedTask* temptask = orig->Clone(CommonInterface::GetComputerSettings().task);
  delete *active_task;
  *active_task = temptask;

  const unsigned cursor_index = GetList().GetCursorIndex();
  (*active_task)->SetName(StaticString<64>(task_store->GetName(cursor_index)));

  RefreshView();
  *task_modified = true;

  dialog.SwitchToEditTab();
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:28,代码来源:TaskListPanel.cpp

示例6: RefreshView

void
TaskListPanel::OnMoreClicked()
{
  more = !more;

  more_button->SetCaption(more ? _("Less") : _("More"));

  task_store->Scan(more);
  RefreshView();
}
开发者ID:henrik1g,项目名称:XCSoar,代码行数:10,代码来源:TaskListPanel.cpp


注:本文中的TaskStore类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。