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