本文整理汇总了C++中CDialog类的典型用法代码示例。如果您正苦于以下问题:C++ CDialog类的具体用法?C++ CDialog怎么用?C++ CDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CDialog
LRESULT CFoldView::DoneFolding(WPARAM wParam, LPARAM lParam) {
CDialog* finished;
//CMainFrame* frame = (CMainFrame*) Parent;
if (m_save) delete foldobject.savefile;
if (!subfold) {
//offer to display the predicted structures if this is not subfolding
finished = new CDialog(IDD_FINISHED,this);
if(finished->DoModal()==IDOK) ((CRNAstructureApp*) GetFoldDocument()->pMainFrame)->Draw(m_ctname.GetBuffer(10));
delete finished;
}
progress->SendMessage (WM_CLOSE);
GetFoldDocument()->Frame->SendMessage(WM_CLOSE);
return 0;
}
示例2: ASSERT
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);
}
示例3: OnBnClickedButtonHtmlDialogTest
void CUITestDialog::OnBnClickedButtonHtmlDialogTest()
{
// TODO: 在此添加控件通知处理程序代码
// CWindowFactory::Instance()->ShowWindow( WndWebpage, this->GetWindowId() );
CDialog *pDlg = CWindowFactory::Instance()->NewDlg( WndWebpage );
pDlg->DoModal();
}
示例4: CreatePages
/*創建分頁-頁面增加*/
void CHM_MachineView::CreatePages()
{
CDialog* dlg;
dlg = new CMain;
m_DlgArray.Add(dlg);
dlg->Create(IDD_MAIN, m_TabCtrl);
m_TabCtrl->InsertItem(0, _T("主頁面"));
if (((CHM_MachineApp*)AfxGetApp())->Post == _T("工程師"))
{
dlg = new CCompiler;
m_DlgArray.Add(dlg);
dlg->Create(IDD_COMPILER, m_TabCtrl);
m_TabCtrl->InsertItem(1, _T("編輯頁面"));
dlg = new CParameter;
m_DlgArray.Add(dlg);
dlg->Create(IDD_PARAMETER, m_TabCtrl);
m_TabCtrl->InsertItem(2, _T("參數設定"));
dlg = new CIOState;
m_DlgArray.Add(dlg);
dlg->Create(IDD_IOSTATE, m_TabCtrl);
m_TabCtrl->InsertItem(3, _T("I/O狀態"));
}
OnTabSelChange(NULL, NULL);
Invalidate();
}
示例5: DialogProc
BOOL CALLBACK DialogProc(HWND hwnd,
UINT message,
WPARAM wParam,
LPARAM lParam)
{
CDialog *pDlg = NULL;
switch (message)
{
case WM_INITDIALOG:
pDlg = (CDialog*)lParam;
return pDlg->OnInit(hwnd);
case WM_COMMAND:
pDlg = (CDialog*)::GetWindowLong(hwnd, DWL_USER);
return pDlg->OnCommand(LOWORD (wParam), HIWORD (wParam));
case WM_DESTROY:
::PostQuitMessage(0);
return TRUE;
case WM_CLOSE:
pDlg = (CDialog*)::GetWindowLong(hwnd, DWL_USER);
return pDlg->OnClose();
}
return FALSE;
}
示例6: DefDialogProc
INT_PTR CALLBACK DefDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
CDialog* pThis = NULL;
CDialog* pThat = NULL;
switch(uMsg)
{
case WM_INITDIALOG:
pThis=(CDialog*)lParam; //获取对象指针
if( NULL != pThis)
{
pThis->Attach(hWnd); //设置HWND和对象之间的关系
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)pThis); //将对象指针保存到窗口hWnd用户数据空间
}
break;
default:
break;
}
pThat = (CDialog*)GetWindowLongPtr(hWnd, GWLP_USERDATA); //从窗口句柄hWnd得到对象指针,因为之前有SetWindowLongPtr()
if(NULL != pThat)
{
return ( pThat->HandleMessage(uMsg,wParam, lParam) );
}
return (INT_PTR)FALSE;
}
示例7: UpdateData
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
}
示例8: UpdateData
BOOL C3DGORangeWire::OnApply()
{
UpdateData();
CDialog* pDlg = STATIC_DOWNCAST(CDialog, AfxGetMainWnd());
pDlg->SendMessage(WM_3DOPTIONS_CHANGE, 0, 0);
return CPropertyPage::OnApply();
}
示例9: OnBnClickedButtonControlTest
void CUITestDialog::OnBnClickedButtonControlTest()
{
// TODO: 在此添加控件通知处理程序代码
// CControlTestDialog dlg;
// dlg.DoModal();
CDialog *pDlg = CWindowFactory::Instance()->NewDlg( WndUnittestCtrl );
pDlg->DoModal();
}
示例10: DlgProc
// static
INT_PTR CALLBACK CDialog::DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
CDialog *dlg = (CDialog*)FromHandle(hWnd);
if( dlg )
return dlg->MsgProc(msg, wParam, lParam);
return FALSE;
}
示例11:
CSubFormCollection::~CSubFormCollection()
{
// Free all sub forms on destruction
for (int i = 0; i <= m_Forms.GetUpperBound(); i++) {
CDialog* pDlg = m_Forms.GetAt(i);
pDlg->DestroyWindow();
delete pDlg;
}
}
示例12: 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 );
}
示例13: AddBoard
void CConfigWizard::AddBoard(LPRECT lpRect, LPCTSTR desc)
{
CDialog *pDlg = new T;
pDlg->Create(T::IDD, &m_bnBoardPlace);
pDlg->MoveWindow(lpRect);
pDlg->SetWindowText(desc);
m_wizards.push_back(pDlg);
m_lbStep.AddItem(0, desc);
}
示例14: WinMain
int APIENTRY WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
CDialog dlg;
dlg.DoDialogBox(hInstance, CDialog::IDD, GetDesktopWindow());
return 0;
}
示例15: test_4_Button
int test_4_Button() {
bool done = false;
int key = 0;
int i = 0;
int fn = C_FULL_FRAME;
CDialog Screen;
for(int k=2;k<console.getRows();k+=2){
for(int m=0;m<console.getCols()-10;m+=10){
Screen<<new CLabel((i=!i)?"Hello": "Hi",k, m, 9);
}
}
Screen<<new CLabel(">>>>>> Dialog and Button Tester <<<<<<<<", 0, (console.getCols()-40)/2);
Screen.draw();
CDialog D(&Screen, 5, 10, 50, 15, true, "+-+|+-+|");
CButton Inc("Increase",9,10);
CButton Dec("Decrease",9,30);
D.add(new CLabel("Testing Buttons (bordered)",1, 12,30));
D.add(new CLabel("Press F10 to toggle button borders visiblity",3,3));
D.add(new CLabel("Press F6 to move ",4,15));
int mesIndx = D.add(new CLabel(7, 24, 10));
int incNum = D.add(Inc) + 1;
int decNum = D.add(Dec) + 1;
D << new CLabel("Press Escape to exit", 12, 15);
D[mesIndx].set("100");
while(!done){
key = D.edit(fn);
switch(key){
case ESCAPE:
done = true;
break;
case F(10):
Inc.visible(!Inc.visible());
Dec.visible(!Dec.visible());
D[0].set(Inc.visible() ? "Testing Buttons (bordered)" : "Testing Buttons (no border)");
D.refresh();
break;
case F(6):
D.move();
break;
case C_BUTTON_HIT:
if(&D.curField() == &Inc){
i++;
fn = incNum;
}
else{
i--;
fn = decNum;
}
sprintf((char*)D[mesIndx].data(),"%d",i);
D[mesIndx].draw();
break;
}
}
D.hide();
console.pause();
return 0;
}