本文整理匯總了C++中AddAnchor函數的典型用法代碼示例。如果您正苦於以下問題:C++ AddAnchor函數的具體用法?C++ AddAnchor怎麽用?C++ AddAnchor使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AddAnchor函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: InitWindowStyles
BOOL CED2kLinkDlg::OnInitDialog()
{
CResizablePage::OnInitDialog();
InitWindowStyles(this);
if (!m_bReducedDlg)
{
AddAnchor(IDC_LD_BASICGROUP,BOTTOM_LEFT,BOTTOM_RIGHT);
AddAnchor(IDC_LD_SOURCECHE,BOTTOM_LEFT,BOTTOM_LEFT);
AddAnchor(IDC_LD_ADVANCEDGROUP,BOTTOM_LEFT,BOTTOM_RIGHT);
AddAnchor(IDC_LD_HTMLCHE,BOTTOM_LEFT,BOTTOM_LEFT);
AddAnchor(IDC_LD_HASHSETCHE,BOTTOM_LEFT,BOTTOM_LEFT);
AddAnchor(IDC_LD_HOSTNAMECHE,BOTTOM_LEFT,BOTTOM_LEFT);
// enabled/disable checkbox depending on situation
if (theApp.IsConnected() && !theApp.IsFirewalled())
GetDlgItem(IDC_LD_SOURCECHE)->EnableWindow(TRUE);
else{
GetDlgItem(IDC_LD_SOURCECHE)->EnableWindow(FALSE);
((CButton*)GetDlgItem(IDC_LD_SOURCECHE))->SetCheck(BST_UNCHECKED);
}
if (theApp.IsConnected() && !theApp.IsFirewalled() && !thePrefs.GetYourHostname().IsEmpty() && thePrefs.GetYourHostname().Find(_T('.')) != -1)
GetDlgItem(IDC_LD_HOSTNAMECHE)->EnableWindow(TRUE);
else{
GetDlgItem(IDC_LD_HOSTNAMECHE)->EnableWindow(FALSE);
((CButton*)GetDlgItem(IDC_LD_HOSTNAMECHE))->SetCheck(BST_UNCHECKED);
}
}
else
{
CRect rcDefault, rcNew;
GetDlgItem(IDC_LD_LINKGROUP)->GetWindowRect(rcDefault);
GetDlgItem(IDC_LD_ADVANCEDGROUP)->GetWindowRect(rcNew);
int nDeltaY = rcNew.bottom - rcDefault.bottom;
GetDlgItem(IDC_LD_LINKGROUP)->SetWindowPos(NULL, 0, 0, rcDefault.Width(), rcDefault.Height() + nDeltaY, SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_NOACTIVATE);
GetDlgItem(IDC_LD_LINKEDI)->GetWindowRect(rcDefault);
GetDlgItem(IDC_LD_LINKEDI)->SetWindowPos(NULL, 0, 0, rcDefault.Width(), rcDefault.Height() + nDeltaY, SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_NOACTIVATE);
GetDlgItem(IDC_LD_CLIPBOARDBUT)->GetWindowRect(rcDefault);
ScreenToClient(rcDefault);
GetDlgItem(IDC_LD_CLIPBOARDBUT)->SetWindowPos(NULL, rcDefault.left, rcDefault.top + nDeltaY, 0, 0, SWP_NOSIZE | SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_NOACTIVATE);
GetDlgItem(IDC_LD_BASICGROUP)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_LD_SOURCECHE)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_LD_ADVANCEDGROUP)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_LD_HTMLCHE)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_LD_HASHSETCHE)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_LD_HOSTNAMECHE)->ShowWindow(SW_HIDE);
}
AddAnchor(IDC_LD_LINKGROUP,TOP_LEFT,BOTTOM_RIGHT);
AddAnchor(IDC_LD_LINKEDI,TOP_LEFT,BOTTOM_RIGHT);
AddAnchor(IDC_LD_CLIPBOARDBUT,BOTTOM_RIGHT);
Localize();
return TRUE;
}
示例2: ExtendFrameIntoClientArea
BOOL CInputDlg::OnInitDialog()
{
CResizableStandAloneDialog::OnInitDialog();
CAppUtils::MarkWindowAsUnpinnable(m_hWnd);
ExtendFrameIntoClientArea(IDC_INPUTTEXT, IDC_INPUTTEXT, IDC_INPUTTEXT, IDC_INPUTTEXT);
m_aeroControls.SubclassControl(this, IDC_CHECKBOX);
m_aeroControls.SubclassControl(this, IDC_HINTTEXT);
m_aeroControls.SubclassOkCancel(this);
m_cInput.Init();
m_cInput.SetFont(CAppUtils::GetLogFontName(), CAppUtils::GetLogFontSize());
if (!m_sInputText.IsEmpty())
{
m_cInput.SetText(m_sInputText);
}
if (!m_sHintText.IsEmpty())
{
SetDlgItemText(IDC_HINTTEXT, m_sHintText);
}
if (!m_sTitle.IsEmpty())
{
this->SetWindowText(m_sTitle);
}
if (!m_sCheckText.IsEmpty())
{
SetDlgItemText(IDC_CHECKBOX, m_sCheckText);
GetDlgItem(IDC_CHECKBOX)->ShowWindow(SW_SHOW);
}
else
{
GetDlgItem(IDC_CHECKBOX)->ShowWindow(SW_HIDE);
}
CAppUtils::SetAccProperty(m_cInput.GetSafeHwnd(), PROPID_ACC_ROLE, ROLE_SYSTEM_TEXT);
CAppUtils::SetAccProperty(m_cInput.GetSafeHwnd(), PROPID_ACC_HELP, CString(MAKEINTRESOURCE(IDS_INPUT_ENTERLOG)));
AddAnchor(IDC_HINTTEXT, TOP_LEFT, TOP_RIGHT);
AddAnchor(IDC_INPUTTEXT, TOP_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_CHECKBOX, BOTTOM_LEFT, BOTTOM_RIGHT);
AddAnchor(IDCANCEL, BOTTOM_RIGHT);
AddAnchor(IDOK, BOTTOM_RIGHT);
EnableSaveRestore(L"InputDlg");
if (GetExplorerHWND())
CenterWindow(CWnd::FromHandle(GetExplorerHWND()));
GetDlgItem(IDC_INPUTTEXT)->SetFocus();
// clear the selection
m_cInput.Call(SCI_SETSEL, (WPARAM)-1, (LPARAM)-1);
return FALSE;
}
示例3: AddAnchor
BOOL CInterior2::OnInitDialog()
{
CResizablePageEx::OnInitDialog();
AddAnchor(IDC_RADIO1, TOP_LEFT, TOP_RIGHT);
AddAnchor(IDC_STATIC1, TOP_LEFT, MIDDLE_RIGHT);
AddAnchor(IDC_RADIO2, MIDDLE_LEFT, MIDDLE_RIGHT);
AddAnchor(IDC_STATIC2, MIDDLE_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_STATIC3, TOP_LEFT);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例4: AddAnchor
BOOL CMyResizablePage1::OnInitDialog()
{
CExtResizablePropertyPage::OnInitDialog();
// TODO: Add extra initialization here
AddAnchor( IDC_COMBO1, __RDA_LT, __RDA_RT );
AddAnchor( IDC_EDIT1, __RDA_LT, __RDA_RT );
AddAnchor( IDC_BUTTON1, __RDA_RB );
AddAnchor( IDC_BUTTON2, __RDA_RB );
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例5: AddAnchor
BOOL CPlayerNavigationDialog::Create(CWnd* pParent)
{
if (!__super::Create(IDD, pParent)) {
return FALSE;
}
AddAnchor(IDC_LISTCHANNELS, TOP_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_NAVIGATION_INFO, BOTTOM_LEFT);
AddAnchor(IDC_NAVIGATION_SCAN, BOTTOM_RIGHT);
AddAnchor(IDC_NAVIGATION_FILTERSTATIONS, BOTTOM_LEFT, BOTTOM_RIGHT);
return TRUE;
}
示例6: AddAnchor
BOOL CFilePatchesDlg::OnInitDialog()
{
CResizableStandAloneDialog::OnInitDialog();
// hide the grip since it would overlap with the "path all" button
// m_wndGrip.ShowWindow(SW_HIDE); m_nShowCount = -100;
AddAnchor(IDC_FILELIST, TOP_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_PATCHSELECTEDBUTTON, BOTTOM_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_PATCHALLBUTTON, BOTTOM_LEFT, BOTTOM_RIGHT);
return TRUE;
}
示例7: AddAnchor
BOOL CRefLogDlg::OnInitDialog()
{
CResizableStandAloneDialog::OnInitDialog();
CAppUtils::MarkWindowAsUnpinnable(m_hWnd);
AddAnchor(IDOK,BOTTOM_RIGHT);
AddAnchor(IDCANCEL,BOTTOM_RIGHT);
AddAnchor(IDC_REFLOG_LIST,TOP_LEFT,BOTTOM_RIGHT);
AddAnchor(IDHELP, BOTTOM_RIGHT);
AddOthersToAnchor();
this->EnableSaveRestore(_T("RefLogDlg"));
CString sWindowTitle;
GetWindowText(sWindowTitle);
CAppUtils::SetWindowTitle(m_hWnd, g_Git.m_CurrentDir, sWindowTitle);
STRING_VECTOR list;
list.push_back(_T("HEAD"));
g_Git.GetRefList(list);
m_RefList.m_hasWC = !g_GitAdminDir.IsBareRepo(g_Git.m_CurrentDir);
m_ChooseRef.SetMaxHistoryItems(0x7FFFFFFF);
this->m_ChooseRef.AddString(list);
this->m_RefList.InsertRefLogColumn();
//m_RefList.m_logEntries.ParserFromRefLog(_T("master"));
if(this->m_CurrentBranch.IsEmpty())
{
m_CurrentBranch.Format(_T("refs/heads/%s"),g_Git.GetCurrentBranch());
m_ChooseRef.SetCurSel(0); /* Choose HEAD */
}
else
{
for(int i=0;i<list.size();i++)
{
if(list[i] == m_CurrentBranch)
{
m_ChooseRef.SetCurSel(i);
break;
}
}
}
OnCbnSelchangeRef();
return TRUE;
}
示例8: InitWindowStyles
BOOL CIPFilterDlg::OnInitDialog()
{
CResizableDialog::OnInitDialog();
InitWindowStyles(this);
AddAnchor(IDC_IPFILTER, TOP_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_TOTAL_IPFILTER_LABEL, BOTTOM_LEFT);
AddAnchor(IDC_TOTAL_IPFILTER, BOTTOM_LEFT);
AddAnchor(IDC_TOTAL_IPS_LABEL, BOTTOM_LEFT);
AddAnchor(IDC_TOTAL_IPS, BOTTOM_LEFT);
AddAnchor(IDC_REMOVE, BOTTOM_RIGHT);
AddAnchor(IDC_APPEND, BOTTOM_RIGHT);
AddAnchor(IDC_SAVE, BOTTOM_RIGHT);
AddAnchor(IDOK, BOTTOM_RIGHT);
EnableSaveRestore(PREF_INI_SECTION);
ASSERT( m_ipfilter.GetStyle() & LVS_OWNERDATA );
// Win98: Explicitly set to Unicode to receive Unicode notifications.
m_ipfilter.SendMessage(CCM_SETUNICODEFORMAT, TRUE);
m_ipfilter.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP | LVS_EX_GRIDLINES);
m_ipfilter.EnableHdrCtrlSortBitmaps();
m_ipfilter.ReadColumnStats(ARRSIZE(s_aColumns), s_aColumns);
m_ipfilter.CreateColumns(ARRSIZE(s_aColumns), s_aColumns);
m_ipfilter.InitColumnOrders(ARRSIZE(s_aColumns), s_aColumns);
m_ipfilter.UpdateSortColumn(ARRSIZE(s_aColumns), s_aColumns);
SetIcon(m_icoDlg = theApp.LoadIcon(_T("IPFilter")), FALSE);
InitIPFilters();
m_pMenuIPFilter = new CMenu();
if (m_pMenuIPFilter->CreatePopupMenu())
{
m_pMenuIPFilter->AppendMenu(MF_ENABLED | MF_STRING, MP_COPYSELECTED, GetResString(IDS_COPY));
m_pMenuIPFilter->AppendMenu(MF_ENABLED | MF_STRING, MP_REMOVE, GetResString(IDS_REMOVE));
m_pMenuIPFilter->AppendMenu(MF_SEPARATOR);
m_pMenuIPFilter->AppendMenu(MF_ENABLED | MF_STRING, MP_SELECTALL, GetResString(IDS_SELECTALL));
m_pMenuIPFilter->AppendMenu(MF_SEPARATOR);
m_pMenuIPFilter->AppendMenu(MF_ENABLED | MF_STRING, MP_FIND, GetResString(IDS_FIND));
}
m_ipfilter.m_pMenu = m_pMenuIPFilter;
m_ipfilter.m_pParent = this;
// localize
SetWindowText(GetResString(IDS_IPFILTER));
SetDlgItemText(IDC_STATICIPLABEL,GetResString(IDS_IP_RULES));
SetDlgItemText(IDC_TOTAL_IPFILTER_LABEL,GetResString(IDS_TOTAL_IPFILTER_LABEL));
SetDlgItemText(IDC_TOTAL_IPS_LABEL,GetResString(IDS_TOTAL_IPS_LABEL));
SetDlgItemText(IDC_REMOVE,GetResString(IDS_DELETESELECTED));
SetDlgItemText(IDC_APPEND,GetResString(IDS_APPEND));
SetDlgItemText(IDC_SAVE,GetResString(IDS_SAVE));
SetDlgItemText(IDOK,GetResString(IDS_FD_CLOSE));
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例9: _T
BOOL CBugtraqRegexTestDlg::OnInitDialog()
{
CResizableStandAloneDialog::OnInitDialog();
CAppUtils::MarkWindowAsUnpinnable(m_hWnd);
ProjectProperties projectprops;
projectprops.lProjectLanguage = -1;
projectprops.SetBugIDRe(m_sBugtraqRegex1);
projectprops.SetCheckRe(m_sBugtraqRegex2);
m_cLogMessage.Init(projectprops);
m_cLogMessage.SetFont((CString)CRegString(_T("Software\\TortoiseGit\\LogFontName"), _T("Courier New")), (DWORD)CRegDWORD(_T("Software\\TortoiseGit\\LogFontSize"), 8));
m_cLogMessage.SetText(CString(MAKEINTRESOURCE(IDS_SAMPLEBUGTRAQTESTMSG)));
m_cLogMessage.Call(SCI_SETCURRENTPOS, 0);
m_cLogMessage.Call(SCI_SETSEL, 0, 0);
AddAnchor(IDC_SAMPLELABEL, TOP_LEFT, TOP_RIGHT);
AddAnchor(IDC_LOGMESSAGE, TOP_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_REGEXIDLABEL, BOTTOM_LEFT);
AddAnchor(IDC_BUGTRAQLOGREGEX1, BOTTOM_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_REGEXMSGLABEL, BOTTOM_LEFT);
AddAnchor(IDC_BUGTRAQLOGREGEX2, BOTTOM_LEFT, BOTTOM_RIGHT);
AddAnchor(IDOK, BOTTOM_RIGHT);
AddAnchor(IDCANCEL, BOTTOM_RIGHT);
return TRUE;
}
示例10: GetWindowRect
void CResizableSheet::PresetLayout()
{
// set the initial size as the min track size
CRect rc;
GetWindowRect(&rc);
SetMinTrackSize(rc.Size());
if (GetStyle() & WS_CHILD)
{
GetClientRect(&rc);
GetTabControl()->MoveWindow(&rc);
}
if (IsWizard()) // wizard mode
{
// hide tab control
GetTabControl()->ShowWindow(SW_HIDE);
AddAnchor(ID_WIZLINE, BOTTOM_LEFT, BOTTOM_RIGHT);
}
else // tab mode
{
AddAnchor(AFX_IDC_TAB_CONTROL, TOP_LEFT, BOTTOM_RIGHT);
}
// add a callback for active page (which can change at run-time)
m_nCallbackID = AddAnchorCallback();
// use *total* parent size to have correct margins
CRect rectPage, rectSheet;
GetTotalClientRect(&rectSheet);
GetActivePage()->GetWindowRect(&rectPage);
::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&rectPage, 2);
// pre-calculate margins
m_sizePageTL = rectPage.TopLeft() - rectSheet.TopLeft();
m_sizePageBR = rectPage.BottomRight() - rectSheet.BottomRight();
// add all possible buttons, if they exist
for (int i = 0; i < _propButtonsCount; i++)
{
if (NULL != GetDlgItem(_propButtons[i]))
AddAnchor(_propButtons[i], BOTTOM_RIGHT);
}
// prevent flickering
GetTabControl()->ModifyStyle(0, WS_CLIPSIBLINGS);
}
示例11: AddAnchor
BOOL CMyPropertyPage1::OnInitDialog()
{
CResizablePage::OnInitDialog();
// preset layout
AddAnchor(IDC_EDIT1, TOP_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_BUTTON1, TOP_RIGHT, BOTTOM_RIGHT);
SetDlgItemText(IDC_EDIT1, _T("Pages have been designed for a property")
_T(" sheet dialog, so they have bad margins in wizard mode.\r\n\r\n")
_T("The active page can be saved together with dialog's size and")
_T(" position. Select another page and try to close and open again."));
return TRUE;
}
示例12: sizeof
BOOL CGitProgressDlg::OnInitDialog()
{
__super::OnInitDialog();
// Let the TaskbarButtonCreated message through the UIPI filter. If we don't
// do this, Explorer would be unable to send that message to our window if we
// were running elevated. It's OK to make the call all the time, since if we're
// not elevated, this is a no-op.
CHANGEFILTERSTRUCT cfs = { sizeof(CHANGEFILTERSTRUCT) };
typedef BOOL STDAPICALLTYPE ChangeWindowMessageFilterExDFN(HWND hWnd, UINT message, DWORD action, PCHANGEFILTERSTRUCT pChangeFilterStruct);
CAutoLibrary hUser = AtlLoadSystemLibraryUsingFullPath(_T("user32.dll"));
if (hUser)
{
ChangeWindowMessageFilterExDFN *pfnChangeWindowMessageFilterEx = (ChangeWindowMessageFilterExDFN*)GetProcAddress(hUser, "ChangeWindowMessageFilterEx");
if (pfnChangeWindowMessageFilterEx)
{
pfnChangeWindowMessageFilterEx(m_hWnd, WM_TASKBARBTNCREATED, MSGFLT_ALLOW, &cfs);
}
}
m_ProgList.m_pTaskbarList.Release();
if (FAILED(m_ProgList.m_pTaskbarList.CoCreateInstance(CLSID_TaskbarList)))
m_ProgList.m_pTaskbarList = nullptr;
UpdateData(FALSE);
AddAnchor(IDC_SVNPROGRESS, TOP_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_TITLE_ANIMATE, TOP_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_PROGRESSLABEL, BOTTOM_LEFT, BOTTOM_CENTER);
AddAnchor(IDC_PROGRESSBAR, BOTTOM_CENTER, BOTTOM_RIGHT);
AddAnchor(IDC_INFOTEXT, BOTTOM_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_NONINTERACTIVE, BOTTOM_LEFT, BOTTOM_RIGHT);
AddAnchor(IDCANCEL, BOTTOM_RIGHT);
AddAnchor(IDOK, BOTTOM_RIGHT);
AddAnchor(IDC_LOGBUTTON, BOTTOM_RIGHT);
//SetPromptParentWindow(this->m_hWnd);
m_Animate.Open(IDR_DOWNLOAD);
m_ProgList.m_pAnimate = &m_Animate;
m_ProgList.m_pProgControl = &m_ProgCtrl;
m_ProgList.m_pProgressLabelCtrl = &m_ProgLableCtrl;
m_ProgList.m_pInfoCtrl = &m_InfoCtrl;
m_ProgList.m_pPostWnd = this;
m_ProgList.m_bSetTitle = true;
if (hWndExplorer)
CenterWindow(CWnd::FromHandle(hWndExplorer));
EnableSaveRestore(_T("GITProgressDlg"));
m_background_brush.CreateSolidBrush(GetSysColor(COLOR_WINDOW));
m_ProgList.Init();
return TRUE;
}
示例13: ReleaseCapture
BOOL CFileExplore::EndVSplitterMove(BOOL Move, CPoint &point)
{
if(!IsVSplitterMove())
return FALSE;
m_bSplitterMove = FALSE;
ReleaseCapture();
CWindowDC dc(GetDesktopWindow());
dc.DrawDragRect(&m_rectLast,CSize(3,3),NULL,CSize(3,3));
if(Move)
{
CRect rectVSplitter,rectDirTree, rectFileList;
m_VSplitter.GetWindowRect(&rectVSplitter);
int _CX = m_rectLast.left - rectVSplitter.left;
ScreenToClient(&rectVSplitter);
rectVSplitter.OffsetRect(_CX,0);
m_DirTree.GetWindowRect(&rectDirTree);
ScreenToClient(&rectDirTree);
rectDirTree.right += _CX;
m_FileList.GetWindowRect(&rectFileList);
ScreenToClient(&rectFileList);
rectFileList.left += _CX;
m_VSplitter.MoveWindow(rectVSplitter);
m_DirTree.MoveWindow(rectDirTree);
m_FileList.MoveWindow(rectFileList);
Invalidate(TRUE);
UpdateWindow();
m_DirTree.Invalidate();
m_FileList.Invalidate();
m_VSplitter.Invalidate();
AddAnchor(&m_DirTree,CSize(0,0),CSize(0,100));
AddAnchor(&m_VSplitter,CSize(0,0),CSize(0,100));
AddAnchor(&m_FileList,CSize(0,0),CSize(100,100));
}
return TRUE;
}
示例14: AddAnchor
BOOL CPagePowerManagement::OnInitDialog()
{
AddAnchor(IDC_GRP_POWER, TOP_LEFT, TOP_RIGHT);
AddAnchor(IDC_CHK_DEVICE_IDLE_ENABLED, TOP_LEFT);
AddAnchor(IDC_CHK_DEFAULT_IDLE_STATE, TOP_LEFT);
AddAnchor(IDC_LBL_DEFAULT_IDLE_TIMEOUT, TOP_LEFT);
AddAnchor(IDC_CBO_DEFAULT_IDLE_TIMEOUT, TOP_LEFT);
AddAnchor(IDC_CHK_USER_SET_DEVICE_IDLE_ENABLED, TOP_LEFT);
AddAnchor(IDC_CHK_DEVICE_IDLE_IGNORE_WAKE_ENABLE, TOP_LEFT);
AddAnchor(IDC_CHK_SYSTEM_WAKE_ENABLED, BOTTOM_LEFT);
//////////////////////////////////////////////////////////////////
// Populate idle timeout CBO
//////////////////////////////////////////////////////////////////
if(!m_ToolTip.Create(this))
{
TRACE("Unable To create ToolTip\n");
return FALSE;
}
CInfWizardDisplay::AddCallbackTool(&m_ToolTip, this, IDC_CHK_DEVICE_IDLE_ENABLED, IDS_TIP_DEVICE_IDLE_ENABLED);
CInfWizardDisplay::AddCallbackTool(&m_ToolTip, this, IDC_CHK_DEFAULT_IDLE_STATE, IDS_TIP_DEFAULT_IDLE_STATE);
CInfWizardDisplay::AddCallbackTool(&m_ToolTip, this, IDC_CBO_DEFAULT_IDLE_TIMEOUT, IDS_TIP_DEFAULT_IDLE_TIMEOUT);
CInfWizardDisplay::AddCallbackTool(&m_ToolTip, this, IDC_LBL_DEFAULT_IDLE_TIMEOUT, IDS_TIP_DEFAULT_IDLE_TIMEOUT);
CInfWizardDisplay::AddCallbackTool(&m_ToolTip, this, IDC_CHK_USER_SET_DEVICE_IDLE_ENABLED, IDS_TIP_USER_SET_DEVICE_IDLE_ENABLED);
CInfWizardDisplay::AddCallbackTool(&m_ToolTip, this, IDC_CHK_DEVICE_IDLE_IGNORE_WAKE_ENABLE, IDS_TIP_DEVICE_IDLE_IGNORE_WAKE_ENABLE);
CInfWizardDisplay::AddCallbackTool(&m_ToolTip, this, IDC_CHK_SYSTEM_WAKE_ENABLED, IDS_TIP_SYSTEM_WAKE_ENABLED);
m_ToolTip.Activate(TRUE);
m_ToolTip.SetMaxTipWidth(400);
m_ToolTip.SetDelayTime(TTDT_AUTOPOP, 10000);
if (CResizablePageEx::OnInitDialog())
{
m_CboIdleTimeout.AddString(_T("100"));
m_CboIdleTimeout.AddString(_T("500"));
m_CboIdleTimeout.AddString(_T("1000"));
m_CboIdleTimeout.AddString(_T("2000"));
m_CboIdleTimeout.AddString(_T("5000"));
m_CboIdleTimeout.AddString(_T("10000"));
m_CboIdleTimeout.AddString(_T("20000"));
m_CboIdleTimeout.AddString(_T("30000"));
m_CboIdleTimeout.SelectString(-1, _T("5000"));
m_ChkDeviceIdleEnabled.SetCheck(BST_CHECKED);
return TRUE; // return TRUE unless you set the focus to a control
}
return FALSE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例15: SetIcon
BOOL CDemoDlg::OnInitDialog()
{
CResizableDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// preset layout
AddAnchor(IDOK, BOTTOM_RIGHT);
AddAnchor(IDCANCEL, BOTTOM_RIGHT);
AddAnchor(IDC_SPIN1, TOP_RIGHT);
AddAnchor(IDC_LABEL1, TOP_LEFT);
AddAnchor(IDC_EDIT1, TOP_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_GROUP1, BOTTOM_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_RADIO1, BOTTOM_LEFT);
AddAnchor(IDC_RADIO2, BOTTOM_LEFT);
// other initializations
// grip is visible by default
CheckRadioButton(IDC_RADIO1, IDC_RADIO2, IDC_RADIO2);
GetDlgItem(IDC_RADIO2)->SetFocus();
SetDlgItemText(IDC_EDIT1, _T("CResizableDialog\r\n\r\n")
_T("This dialog can be resized to full width and half the height of the screen.\r\n")
_T("The minimum size is by default the one in the dialog editor.\r\n")
_T("Size grip can be switched off.\r\n\r\n")
_T("Try to maximize and then to restore the dialog!\r\n")
_T("Isn't it cool?"));
// min/max size settings
// get desktop size
CRect rc;
GetDesktopWindow()->GetClientRect(&rc);
// set max tracking size to half a screen
SetMaxTrackSize(CSize(rc.Width(), rc.Height()/2));
// maximized position and size on top of the screen
rc.bottom = 100;
SetMaximizedRect(rc);
// save/restore
// (for dialog based app, default is a .INI file with
// the application's name in the Windows directory)
EnableSaveRestore(_T("DemoDlg"));
return FALSE; // return TRUE unless you set the focus to a control
}