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


C++ WndOwnerDrawFrame类代码示例

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


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

示例1: Show

    void Show() {
        TCHAR filename[MAX_PATH];
        const TCHAR *resName = NULL;
        if (!ScreenLandscape) {
            LocalPathS(filename, TEXT("dlgBluetooth_L.xml"));
            resName = TEXT("IDR_XML_BLUETOOTH_L");
        } else {
            LocalPathS(filename, TEXT("dlgBluetooth.xml"));
            resName = TEXT("IDR_XML_BLUETOOTH");
        }
        wfBth = dlgLoadFromXML(CallBackTable, filename, resName);
        if (wfBth) {

            WndListFrame* BthList = (WndListFrame*) wfBth->FindByName(TEXT("frmBthList"));
            if (BthList) {
                BthList->SetBorderKind(BORDERLEFT | BORDERTOP | BORDERRIGHT | BORDERBOTTOM);
                BthList->SetWidth(wfBth->GetWidth() - BthList->GetLeft() - IBLSCALE(4));

                // Bug : we need ClientHeight, but Cleint Rect is Calculated by OnPaint
                // BthList->SetHeight(wfBth->GetHeight() - BthList->GetTop() - 2);
                if (BthList->ScrollbarWidth == -1) {
                    BthList->ScrollbarWidth = (int) (SCROLLBARWIDTH_INITIAL * ScreenDScale);
                }

                WndOwnerDrawFrame* BthListEntry = (WndOwnerDrawFrame*) wfBth->FindByName(TEXT("frmBthListEntry"));
                if (BthListEntry) {
                    BthListEntry->SetCanFocus(true);
                    BthListEntry->SetWidth(BthList->GetWidth() - BthList->ScrollbarWidth - 5);
                }

                BthList->ResetList();
                BthList->Redraw();
            }

            if (wfBth->ShowModal()) {
                CBtHandler * pBtHandler = CBtHandler::Get();
                if (pBtHandler) {
                    pBtHandler->ClearDevices();
                    pBtHandler->FillDevices();
                }
                RefreshComPortList();
            }

            delete wfBth;
            wfBth = NULL;
        }
    }
开发者ID:acasadoalonso,项目名称:LK8000,代码行数:47,代码来源:dlgBluetooth.cpp

示例2: dlgIgcFileShowModal

void dlgIgcFileShowModal() {
    TCHAR filename[MAX_PATH];
    const TCHAR *resName = NULL;
    if (!ScreenLandscape) {
        LocalPathS(filename, TEXT("dlgIgcFile.xml"));
        resName = TEXT("IDR_XML_IGCFILE");
    } else {
        LocalPathS(filename, TEXT("dlgIgcFile_L.xml"));
        resName = TEXT("IDR_XML_IGCFILE_L");
    }
    wfDlg = dlgLoadFromXML(DlgIgcFile::CallBackTable, filename, resName);
    if (wfDlg) {

        WndListFrame* wndFileList = (WndListFrame*) wfDlg->FindByName(TEXT("frmIgcFileList"));
        if (wndFileList) {
            wndFileList->SetBorderKind(BORDERLEFT | BORDERTOP | BORDERRIGHT | BORDERBOTTOM);
            wndFileList->SetWidth(wfDlg->GetWidth() - wndFileList->GetLeft() - IBLSCALE(4));

            // Bug : we need ClientHeight, but Cleint Rect is Calculated by OnPaint
            // wndFileList->SetHeight(wfDlg->GetHeight() - wndFileList->GetTop() - 2);
            if (wndFileList->ScrollbarWidth == -1) {
                wndFileList->ScrollbarWidth = (int) (SCROLLBARWIDTH_INITIAL * ScreenDScale);
            }

            WndOwnerDrawFrame* FileListEntry = (WndOwnerDrawFrame*) wfDlg->FindByName(TEXT("frmIgcFileListEntry"));
            if (FileListEntry) {
                FileListEntry->SetCanFocus(true);
                FileListEntry->SetWidth(wndFileList->GetWidth() - wndFileList->ScrollbarWidth - 5);
            }

            DlgIgcFile::ScanFile();

            wndFileList->ResetList();
            wndFileList->Redraw();
        }
    }

    if (wfDlg->ShowModal()) {

    }

    delete wfDlg;
    wfDlg = NULL;
}
开发者ID:acasadoalonso,项目名称:LK8000,代码行数:44,代码来源:dlgIgcFile.cpp

示例3: dlgHelpShowModal

void dlgHelpShowModal(const TCHAR* Caption, const TCHAR* HelpText) {
  if (!Caption || !HelpText) {
    return;
  }

  std::unique_ptr<WndForm> wf(dlgLoadFromXML(CallBackTable, ScreenLandscape ? IDR_XML_HELP_L : IDR_XML_HELP_P));
  if(!wf) {
    return;
  }
  WndListFrame* wHelp = static_cast<WndListFrame*>(wf->FindByName(TEXT("frmDetails")));
  if(!wHelp) {
    return;
  }
  wHelp->SetBorderKind(BORDERLEFT);

  WndOwnerDrawFrame* wHelpEntry = static_cast<WndOwnerDrawFrame*>(wf->FindByName(TEXT("frmDetailsEntry")));
  if (!wHelpEntry) {
    return;
  };
  wHelpEntry->SetCanFocus(true);

  DrawListIndex=0;

  TCHAR fullcaption[100];
  _stprintf(fullcaption,TEXT("%s: %s"), MsgToken(336), Caption); // Help
  wf->SetCaption(fullcaption);

  aTextLine.clear();

  {
    LKWindowSurface Surface(*wHelpEntry);

    const auto oldFont = Surface.SelectObject(wHelpEntry->GetFont());
    const int minHeight = Surface.GetTextHeight(_T("dp")) + 2 * DLGSCALE(2);
    const int wHeight = wHelpEntry->GetHeight();
    if(minHeight != wHeight) {
      wHelpEntry->SetHeight(minHeight);
    }

    aTextLine.update(Surface, wHelpEntry->GetWidth(), LKgethelptext(HelpText));

    Surface.SelectObject(oldFont);
  }

  wHelp->ResetList();
  wHelp->Redraw();
  wf->ShowModal();

  aTextLine.clear();
}
开发者ID:lshachar,项目名称:LK8000,代码行数:50,代码来源:dlgHelp.cpp

示例4: LoadDialog

void
dlgTaskManager::dlgTaskManagerShowModal(SingleWindow &parent)
{
  if (protected_task_manager == NULL)
    return;

  wf = LoadDialog(CallBackTable, parent,
                  Layout::landscape ?
                  _T("IDR_XML_TASKMANAGER_L") : _T("IDR_XML_TASKMANAGER"));

  assert(wf != NULL);

  active_task = protected_task_manager->task_clone();
  task_modified = false;

  // Load tabs
  wTabBar = (TabBarControl*)wf->FindByName(_T("TabBar"));
  assert(wTabBar != NULL);

  wTabBar->SetClientOverlapTabs(true);

  if (!Layout::landscape) {
    WndOwnerDrawFrame* wBlackRect =
        (WndOwnerDrawFrame*)wf->FindByName(_T("frmBlackRect"));
    assert(wBlackRect);
    const unsigned TabLineHeight = wTabBar->GetTabLineHeight();
    wBlackRect->move(0,
                     wTabBar->GetTabHeight() - TabLineHeight - Layout::Scale(1),
                     wf->get_width() - wTabBar->GetTabWidth() + Layout::Scale(3),
                     TabLineHeight + Layout::Scale(2));
    wBlackRect->show_on_top();
  }

  Window* wProps =
    pnlTaskProperties::Load(parent, wTabBar, wf, &active_task, &task_modified);
  assert(wProps);

  Window* wClose =
    pnlTaskManagerClose::Load(parent, wTabBar, wf, &active_task, &task_modified);
  assert(wClose);

  Window* wCalculator =
    pnlTaskCalculator::Load(parent, wTabBar, wf, &task_modified);
  assert(wCalculator);

  Window* wEdit =
    pnlTaskEdit::Load(parent, wTabBar, wf, &active_task, &task_modified);
  assert(wEdit);

  WndOwnerDrawFrame* wTaskView =
      (WndOwnerDrawFrame*)wf->FindByName(_T("frmTaskView"));
  assert(wTaskView);
  TaskViewRect = wTaskView->get_position();

  Window* wLst =
    pnlTaskList::Load(parent, wTabBar, wf, &active_task, &task_modified);
  assert(wLst);

  const DialogTabStyle_t IconsStyle = Appearance.DialogTabStyle;
  const Bitmap *CalcIcon = ((IconsStyle == dtIcon) ?
                             &Graphics::hBmpTabCalculator : NULL);
  const Bitmap *TurnPointIcon = ((IconsStyle == dtIcon) ?
                                  &Graphics::hBmpTabTask : NULL);
  const Bitmap *BrowseIcon = ((IconsStyle == dtIcon) ?
                               &Graphics::hBmpTabWrench : NULL);
  const Bitmap *PropertiesIcon = ((IconsStyle == dtIcon) ?
                                   &Graphics::hBmpTabSettings : NULL);

  if (Layout::landscape) {
    wTabBar->AddClient(wCalculator, _T("Calculator"), false, CalcIcon, NULL,
                       pnlTaskCalculator::OnTabPreShow, dlgTaskManager::SetTitle);

    wTabBar->AddClient(wEdit, _T("Turn Points"), false, TurnPointIcon, NULL,
                       pnlTaskEdit::OnTabPreShow, dlgTaskManager::SetTitle,
                       pnlTaskEdit::OnTabReClick);
    TurnpointTab = 1;

    wTabBar->AddClient(wLst, _T("Manage"), false, BrowseIcon, NULL,
                       pnlTaskList::OnTabPreShow, dlgTaskManager::SetTitle,
                       pnlTaskList::OnTabReClick);

    wTabBar->AddClient(wProps, _T("Rules"), false, PropertiesIcon,
                       pnlTaskProperties::OnTabPreHide,
                       pnlTaskProperties::OnTabPreShow, dlgTaskManager::SetTitle,
                       pnlTaskProperties::OnTabReClick);
    PropertiesTab = 3;

    wTabBar->AddClient(wClose, _T("Close"), false, NULL, NULL,
                       pnlTaskManagerClose::OnTabPreShow, dlgTaskManager::SetTitle,
                       pnlTaskManagerClose::OnTabReClick);

    wTabBar->SetCurrentPage(0);
  } else {
    wTabBar->AddClient(wCalculator, _T("Calculator"), false, CalcIcon, NULL,
                       pnlTaskCalculator::OnTabPreShow, dlgTaskManager::SetTitle);

    wTabBar->AddClient(wClose, _T("Close"), false, NULL, NULL,
                       pnlTaskManagerClose::OnTabPreShow, dlgTaskManager::SetTitle,
                       pnlTaskManagerClose::OnTabReClick);

//.........这里部分代码省略.........
开发者ID:Mrdini,项目名称:XCSoar,代码行数:101,代码来源:dlgTaskManager.cpp

示例5: Move

  void Move(const PixelRect &rc) override {
    const Layout layout(rc, waypoint);

    if (allow_navigation)
      goto_button.Move(layout.goto_button);

    if (!images.empty()) {
      magnify_button.Move(layout.magnify_button);
      shrink_button.Move(layout.shrink_button);
    }

    if (allow_navigation) {
      previous_button.Move(layout.previous_button);
      next_button.Move(layout.next_button);
    }

    close_button.Move(layout.close_button);

    info_dock.Move(layout.main);
    details_panel.Move(layout.main);
    details_text.Move(layout.details_text);
#ifdef HAVE_RUN_FILE
    if (!waypoint.files_external.empty())
      file_list.Move(layout.file_list);
#endif
    commands_dock.Move(layout.main);

    if (!images.empty())
      image_window.Move(layout.main);
  }
开发者ID:Andy-1954,项目名称:XCSoar,代码行数:30,代码来源:dlgWaypointDetails.cpp

示例6: Show

  void Show(const PixelRect &rc) override {
    const Layout layout(rc, *waypoint);

    if (task_manager != nullptr)
      goto_button.MoveAndShow(layout.goto_button);

    if (!images.empty()) {
      magnify_button.MoveAndShow(layout.magnify_button);
      shrink_button.MoveAndShow(layout.shrink_button);
    }

    previous_button.MoveAndShow(layout.previous_button);
    next_button.MoveAndShow(layout.next_button);

    close_button.MoveAndShow(layout.close_button);

    info_dock.Move(layout.main);
    details_panel.Move(layout.main);
    details_text.Move(layout.details_text);
#ifdef HAVE_RUN_FILE
    if (!waypoint->files_external.empty())
      file_list.Move(layout.file_list);
#endif

    commands_dock.Move(layout.main);

    if (!images.empty())
      image_window.Move(layout.main);

    UpdatePage();
  }
开发者ID:Advi42,项目名称:XCSoar,代码行数:31,代码来源:dlgWaypointDetails.cpp

示例7: UpdateZoomControls

void
WaypointDetailsWidget::OnMagnifyClicked()
{
  if (zoom >= 5)
    return;
  zoom++;

  UpdateZoomControls();
  image_window.Invalidate();
}
开发者ID:Andy-1954,项目名称:XCSoar,代码行数:10,代码来源:dlgWaypointDetails.cpp

示例8: MoveChildren

  void MoveChildren(const Layout &layout) {
    waypoint_name.Move(layout.waypoint_name);
    waypoint_details.Move(layout.waypoint_details);
    waypoint_remove.Move(layout.waypoint_remove);
    waypoint_relocate.Move(layout.waypoint_relocate);

    type_label.Move(layout.type_label);
    change_type.Move(layout.change_type);
    map.Move(layout.map);
    properties_dock.Move(layout.properties);
    optional_starts.Move(layout.optional_starts);
    score_exit.Move(layout.score_exit);
  }
开发者ID:kwtskran,项目名称:XCSoar,代码行数:13,代码来源:TaskPointDialog.cpp

示例9:

void
WaypointDetailsWidget::UpdatePage()
{
  info_dock.SetVisible(page == 0);
  details_panel.SetVisible(page == 1);
  commands_dock.SetVisible(page == 2);

  bool image_page = page >= 3;
  if (!images.empty()) {
    image_window.SetVisible(image_page);
    magnify_button.SetVisible(image_page);
    shrink_button.SetVisible(image_page);
  }
}
开发者ID:Andy-1954,项目名称:XCSoar,代码行数:14,代码来源:dlgWaypointDetails.cpp

示例10: Hide

  void Hide() override {
    if (task_manager != nullptr)
      goto_button.Hide();

    if (!images.empty()) {
      magnify_button.Hide();
      shrink_button.Hide();
    }

    previous_button.Hide();
    next_button.Hide();

    close_button.Hide();

    info_dock.Hide();
    details_panel.Hide();
    commands_dock.Hide();

    if (!images.empty())
      image_window.Hide();
  }
开发者ID:Advi42,项目名称:XCSoar,代码行数:21,代码来源:dlgWaypointDetails.cpp

示例11: Hide

  void Hide() override {
    if (allow_navigation)
      goto_button.Hide();

    if (!images.empty()) {
      magnify_button.Hide();
      shrink_button.Hide();
    }

    if (allow_navigation) {
      previous_button.Hide();
      next_button.Hide();
    }

    close_button.Hide();

    info_dock.Hide();
    details_panel.Hide();
    commands_dock.Hide();

    if (!images.empty())
      image_window.Hide();
  }
开发者ID:Andy-1954,项目名称:XCSoar,代码行数:23,代码来源:dlgWaypointDetails.cpp

示例12: ReadValues

void
TaskPointWidget::OnModified(ObservationZoneEditWidget &widget)
{
  ReadValues();
  map.Invalidate();
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:6,代码来源:TaskPointDialog.cpp

示例13: CreateObservationZoneEditWidget

void
TaskPointWidget::RefreshView()
{
  map.Invalidate();

  OrderedTaskPoint &tp = ordered_task.GetPoint(active_index);

  properties_dock.DeleteWidget();

  ObservationZonePoint &oz = tp.GetObservationZone();
  const bool is_fai_general =
    ordered_task.GetFactoryType() == TaskFactoryType::FAI_GENERAL;
  auto *properties_widget = CreateObservationZoneEditWidget(oz, is_fai_general);
  if (properties_widget != nullptr) {
    properties_widget->SetListener(this);
    properties_dock.SetWidget(properties_widget);
  } else
    properties_dock.SetWidget(new PanelWidget());

  type_label.SetCaption(OrderedTaskPointName(ordered_task.GetFactory().GetType(tp)));

  previous_button->SetEnabled(active_index > 0);
  next_button->SetEnabled(active_index < (ordered_task.TaskSize() - 1));

  optional_starts.SetVisible(active_index == 0);
  if (!ordered_task.HasOptionalStarts())
    optional_starts.SetCaption(_("Enable Alternate Starts"));
  else {
    StaticString<50> tmp;
    tmp.Format(_T("%s (%d)"), _("Edit Alternates"),
               ordered_task.GetOptionalStartPointCount());
    optional_starts.SetCaption(tmp);
  }

  if (tp.GetType() == TaskPointType::AST) {
    const ASTPoint &ast = (const ASTPoint &)tp;
    score_exit.Show();
    score_exit.SetState(ast.GetScoreExit());
  } else
    score_exit.Hide();

  StaticString<100> name_prefix_buffer, type_buffer;

  switch (tp.GetType()) {
  case TaskPointType::START:
    type_buffer = _("Start point");
    name_prefix_buffer = _T("Start: ");
    break;

  case TaskPointType::AST:
    type_buffer = _("Task point");
    name_prefix_buffer.Format(_T("%d: "), active_index);
    break;

  case TaskPointType::AAT:
    type_buffer = _("Assigned area point");
    name_prefix_buffer.Format(_T("%d: "), active_index);
    break;

  case TaskPointType::FINISH:
    type_buffer = _("Finish point");
    name_prefix_buffer = _T("Finish: ");
    break;

  default:
    gcc_unreachable();
  }

  dialog.SetCaption(type_buffer);

  {
    StaticString<100> buffer;
    buffer.Format(_T("%s %s"), name_prefix_buffer.c_str(),
                  tp.GetWaypoint().name.c_str());
    waypoint_name.SetCaption(buffer);
  }
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:77,代码来源:TaskPointDialog.cpp

示例14: layout

void
WaypointDetailsWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  for (const auto &i : waypoint.files_embed) {
    if (images.full())
      break;

    try {
      if (!images.append().LoadFile(LocalPath(i.c_str())))
        images.shrink(images.size() - 1);
    } catch (const std::exception &e) {
      LogFormat("Failed to load %s: %s",
                (const char *)NarrowPathName(Path(i.c_str())),
                e.what());
      images.shrink(images.size() - 1);
    }
  }

  const Layout layout(rc, waypoint);

  WindowStyle dock_style;
  dock_style.Hide();
  dock_style.ControlParent();

  WindowStyle button_style;
  button_style.Hide();
  button_style.TabStop();

  if (allow_navigation)
    goto_button.Create(parent, look.button, _("GoTo"), layout.goto_button,
                       button_style, *this, GOTO);

  if (!images.empty()) {
    magnify_button.Create(parent, layout.magnify_button, button_style,
                          new SymbolButtonRenderer(look.button, _T("+")),
                          *this, MAGNIFY);
    shrink_button.Create(parent, layout.shrink_button, button_style,
                         new SymbolButtonRenderer(look.button, _T("-")),
                         *this, SHRINK);
  }

  if (allow_navigation) {
    previous_button.Create(parent, layout.previous_button, button_style,
                           new SymbolButtonRenderer(look.button, _T("<")),
                           *this, PREVIOUS);
    next_button.Create(parent, layout.next_button, button_style,
                       new SymbolButtonRenderer(look.button, _T(">")),
                       *this, NEXT);
  }

  close_button.Create(parent, look.button, _("Close"), layout.close_button,
                      button_style, dialog, mrOK);

  info_dock.Create(parent, layout.main, dock_style);
  info_dock.SetWidget(&info_widget);

  details_panel.Create(parent, look, layout.main, dock_style);
  details_text.Create(details_panel, layout.details_text);
  details_text.SetFont(look.text_font);
  details_text.SetText(waypoint.details.c_str());

#ifdef HAVE_RUN_FILE
  const unsigned num_files = std::distance(waypoint.files_external.begin(),
                                           waypoint.files_external.end());
  if (num_files > 0) {
    file_list.Create(details_panel, layout.file_list,
                     WindowStyle(), layout.file_list_item_height);
    file_list.SetItemRenderer(&file_list_handler);
    file_list.SetCursorHandler(&file_list_handler);
    file_list.SetLength(num_files);
  }
#endif

  commands_dock.Create(parent, layout.main, dock_style);
  commands_dock.SetWidget(&commands_widget);

  if (!images.empty())
    image_window.Create(parent, layout.main, dock_style,
                        [this](Canvas &canvas, const PixelRect &rc){
                          OnImagePaint(canvas, rc);
                        });

  last_page = 2 + images.size();
}
开发者ID:Andy-1954,项目名称:XCSoar,代码行数:84,代码来源:dlgWaypointDetails.cpp


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