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


C++ AddAnchor函数代码示例

本文整理汇总了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; 
} 
开发者ID:HackLinux,项目名称:eMule-Mirror,代码行数:57,代码来源:ED2kLinkDlg.cpp

示例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;
}
开发者ID:TortoiseGit,项目名称:tortoisesvn,代码行数:52,代码来源:InputDlg.cpp

示例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
}
开发者ID:Blonder,项目名称:resizablelib,代码行数:13,代码来源:Int2.cpp

示例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
}
开发者ID:ngphloc,项目名称:agmagic,代码行数:13,代码来源:MyResizablePage1.cpp

示例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;
}
开发者ID:KhR0N1K,项目名称:mpc-hc,代码行数:13,代码来源:PlayerNavigationDialog.cpp

示例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;
}
开发者ID:spritetong,项目名称:tortoisegit-utf8,代码行数:13,代码来源:FilePatchesDlg.cpp

示例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;
}
开发者ID:murank,项目名称:TortoiseGitMod,代码行数:51,代码来源:RefLogDlg.cpp

示例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
}
开发者ID:rusingineer,项目名称:eMule-mephisto-mod,代码行数:56,代码来源:IPFilterDlg.cpp

示例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;
}
开发者ID:545546460,项目名称:TortoiseGit,代码行数:28,代码来源:BugtraqRegexTestDlg.cpp

示例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);
}
开发者ID:KristinaTaylor,项目名称:TortoiseSI,代码行数:49,代码来源:ResizableSheet.cpp

示例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;
}
开发者ID:Blonder,项目名称:resizablelib,代码行数:15,代码来源:MyPropertyPages.cpp

示例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;
}
开发者ID:3F,项目名称:tortoisegit-mdc,代码行数:53,代码来源:GitProgressDlg.cpp

示例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;
}
开发者ID:alex765022,项目名称:IBN,代码行数:47,代码来源:FileExplore.cpp

示例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
}
开发者ID:Noah-p0werd0wn,项目名称:usb-travis,代码行数:56,代码来源:PagePowerManagement.cpp

示例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
}
开发者ID:Blonder,项目名称:resizablelib,代码行数:55,代码来源:DemoDlg.cpp


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