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


C++ CDialog::ShowWindow方法代码示例

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


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

示例1: ShowSubForm

bool CSubFormCollection::ShowSubForm(int ix)
{
    ASSERT(ix <= m_Forms.GetUpperBound());
    if (ix > m_Forms.GetUpperBound()) return(false); // does not exist

    CDialog* pDlg;
    if (ix != -1) {
        if (m_nActiveForm != -1) {
            pDlg = m_Forms.GetAt(m_nActiveForm);
            ASSERT(pDlg != NULL);
            ASSERT(pDlg->m_hWnd != NULL);
            if ((pDlg == NULL) 
            ||  (pDlg->m_hWnd == NULL)) return(false);
            pDlg->ShowWindow(SW_HIDE);
        }
        m_nActiveForm = ix; // this is the active one now;
    }
    else {
        if (m_nActiveForm == -1) {
            m_nActiveForm = 0;
        }
    }
    pDlg = m_Forms.GetAt(m_nActiveForm);
    ASSERT(pDlg != NULL);
    ASSERT(pDlg->m_hWnd != NULL);
    if ((pDlg == NULL) 
    ||  (pDlg->m_hWnd == NULL)) return(false);
    pDlg->ShowWindow(SW_SHOW);
    pDlg->Invalidate();
    pDlg->RedrawWindow();
    return(true);
}
开发者ID:kevintank,项目名称:e_wiz,代码行数:32,代码来源:SubFormCollection.cpp

示例2: OnInitDialog

BOOL DlgAnimationExporterMain::OnInitDialog()
{
	CDialog::OnInitDialog();
	UpdateData(FALSE);//
	// TODO:  在此添加额外的初始化

	char* szItemName[] = {" 骨骼框架", "动画序列", "纹理", "模型信息", "5"};
	
	for (int i = 0; i < MAX_PAGE; i++)
	{
		m_tabExporter.InsertItem(i, szItemName[i]);
	}

	RECT rc;
	m_tabExporter.GetClientRect(&rc);
	ClientToScreen(&rc);
	RECT rcDlg = {0,0,0,0};
	//GetClientRect(&rcDlg);
	//GetWindowRect(&rcDlg);
	//ClientToScreen(&rcDlg);
	RECT rcw = {rcDlg.left + rc.left, rcDlg.top + rc.top + 21, rcDlg.left + rc.right, rcDlg.top + rc.bottom};
	CDialog* pDlg = NULL;
	int iDlgNum = 0;
	CREATE_PAGE(IDD_DIALOG1, CDlgExporterPage1);
	pDlg->ShowWindow(SW_SHOW);
	CREATE_PAGE(IDD_DIALOG2, CDlgExporterPage2);
	CREATE_PAGE(IDD_DIALOG3, CDlgExportPage3);
	CREATE_PAGE(IDD_DIALOG4, CDlgExportPage4);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常: OCX 属性页应返回 FALSE
}
开发者ID:RobertPeng,项目名称:XGame,代码行数:32,代码来源:DlgAnimationExporterMain.cpp

示例3: ShowPage

//*****************************************************************************
//
// Function Name:  RColorDialog::ShowPage
//
// Description:    Helper function for creating/displaying the correct
//						 property sheet in the tab control.
//
// Returns:        VOID
//
// Exceptions:	    None
//
//*****************************************************************************
void RColorDialog::ShowPage( int nPage )
{
	CDialog* pPrevPage  = m_pCurrentPage;
	CDialog* pPages[]   = { &m_dlgColorPalette, &m_dlgColorTexture, &m_dlgColorPhoto };
	int		pPageIDs[] = { DIALOG_COLOR_DIALOG_GRADIENTS, m_dlgColorTexture.IDD, m_dlgColorPhoto.IDD };

	TpsAssert( nPage < NumElements( pPages ), "Invalid page number!" );

	if (m_pCurrentPage != pPages[nPage])
	{
		m_pCurrentPage = pPages[nPage] ;

		if (!IsWindow( m_pCurrentPage->m_hWnd ))
		{
			CRect   rectAdjust(0,0,0,0);
			CRect   rectWindow(0,0,0,0);

			m_ctlTabCtrl.AdjustRect( TRUE, &rectAdjust );
			m_ctlTabCtrl.GetWindowRect( &rectWindow );

			rectWindow.left -= rectAdjust.left;
			rectWindow.top  -= rectAdjust.top;
			ScreenToClient( &rectWindow );

			if (!m_pCurrentPage->Create( pPageIDs[nPage], this ))
			{
				if (!pPrevPage) return ;

				// Restore the current page pointer to the previous one.
				m_pCurrentPage = pPrevPage ;
				pPrevPage = NULL;

				// Find the index of the previous page. (For setting the tab)
				for (int i = 0; i < NumElements( pPages ); i++)
				{
					if (m_pCurrentPage == pPages[i])
					{
						m_ctlTabCtrl.SetCurSel( i ) ;
						break ;
					}
				}
			}

			m_pCurrentPage->SetWindowPos( &wndTop, rectWindow.left,
				rectWindow.top, 0, 0, SWP_NOSIZE ) ;

		} // if (IsWindow())
			
	} // if (new page)

	if (pPrevPage && IsWindow( pPrevPage->m_hWnd ))
		pPrevPage->ShowWindow( SW_HIDE ) ;

	m_pCurrentPage->ShowWindow( SW_SHOW ) ;

	GetDlgItem( IDC_COLOR_MORE )->EnableWindow( m_pCurrentPage == &m_dlgColorPalette );
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:69,代码来源:ColorDialog.cpp

示例4: scan

VSTPluginLib *CSelectPluginDlg::ScanPlugins(const mpt::PathString &path, CWnd *parent)
//------------------------------------------------------------------------------------
{
	CVstPluginManager *pManager = theApp.GetPluginManager();
	VSTPluginLib *plugLib = nullptr;
	bool update = false;

	CDialog pluginScanDlg;
	pluginScanDlg.Create(IDD_SCANPLUGINS, parent);
	pluginScanDlg.CenterWindow(parent);
	pluginScanDlg.ModifyStyle(0, WS_SYSMENU, WS_SYSMENU);
	pluginScanDlg.ShowWindow(SW_SHOW);

	FolderScanner scan(path, true);
	mpt::PathString fileName;
	int files = 0;
	while(scan.NextFile(fileName) && pluginScanDlg.IsWindowVisible())
	{
		if(!mpt::PathString::CompareNoCase(fileName.GetFileExt(), MPT_PATHSTRING(".dll")))
		{
			CWnd *text = pluginScanDlg.GetDlgItem(IDC_SCANTEXT);
			std::wstring scanStr = L"Scanning Plugin...\n" + fileName.ToWide();
			::SetWindowTextW(text->m_hWnd, scanStr.c_str());
			MSG msg;
			while(::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
			{
				::TranslateMessage(&msg);
				::DispatchMessage(&msg);
			}

			VSTPluginLib *lib = pManager->AddPlugin(fileName, mpt::ustring(), false);
			if(lib)
			{
				update = true;
				if(!VerifyPlug(lib, parent))
				{
					pManager->RemovePlugin(lib);
				} else
				{
					plugLib = lib;
					files++;
				}
			}
		}
	}

	if(update)
	{
		// Force selection to last added plug.
		Reporting::Information(mpt::String::Print("Found %1 plugin%2.", files, files == 1 ? "" : "s").c_str(), parent);
		return plugLib;
	} else
	{
		Reporting::Error("Could not find any valid VST plugins.");
		return nullptr;
	}
}
开发者ID:Sappharad,项目名称:modizer,代码行数:57,代码来源:SelectPluginDialog.cpp

示例5: OnTvnSelchanged

//------------------------------------------------------------------------------
void CTreeCtrlBase::OnTvnSelchanged(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);

	CString str = GetItemText(pNMTreeView->itemOld.hItem);

	if (TREE_WINDOW == m_Type)
	{
		CDialog *pOldDlg = (CDialog*)pNMTreeView->itemOld.lParam;
		if (pOldDlg)
			pOldDlg->ShowWindow(SW_HIDE);
	}

	*pResult = 0;
}
开发者ID:jjuiddong,项目名称:DebugMonitorUsingNetwork,代码行数:16,代码来源:TreeCtrlBase.cpp

示例6: UpdateForm

void CMarkersPropertyPage::UpdateForm()
{
	CDialog     *pConfigDlg;
 CFileMarker *pSelectedMarker;
 CFileMarker *pCurrentMarker;
 int Index;

	if (m_SelectionCheckList.GetCurSel() != LB_ERR  )
	{
	 pSelectedMarker = (CFileMarker *)m_SelectionCheckList.GetItemData(	m_SelectionCheckList.GetCurSel() );
		
		m_SelectionDescription.SetWindowText( pSelectedMarker->GetDescription() );

		for (Index = 0; Index < g_DupeFileFind.GetFileSelectionArray()->GetSize(); Index++)
		{
			pCurrentMarker = g_DupeFileFind.GetFileSelectionArray()->GetAt(Index);
			pConfigDlg = pCurrentMarker->GetForm();
	
			if (pConfigDlg)
			{
				pConfigDlg->ShowWindow( pCurrentMarker == pSelectedMarker ? SW_SHOW : SW_HIDE);
		 }
		}

		pConfigDlg = pSelectedMarker->GetForm();
		if (pConfigDlg)
		{
			m_NoConfigText.ModifyStyle(WS_VISIBLE,NULL);
		}
		else
		{
			m_NoConfigText.ModifyStyle(NULL,WS_VISIBLE);
		}
	}

}
开发者ID:GerHobbelt,项目名称:duff,代码行数:36,代码来源:PropertyPageSelections.cpp


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