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


C++ WndOwnerDrawFrame::SetCanFocus方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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


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