本文整理汇总了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();
}
示例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;
}
}
示例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;
}