// 改变edit 组合框的内容 void TitleTemplateDlg::showTitle(void) { CWnd *pWnd; // 显示框文字变化 if ( m_changeTitle ) { pWnd = this->GetDlgItem ( IDC_STATIC_TITLENUMSHOW ); pWnd->SetWindowTextW ( _T("") ); CString titleNumShow; if ( m_titleNum ) titleNumShow.Format( _T("第%d级标题"), m_curTitle + 1 ); else titleNumShow.Format(_T("没有标题,请先插入")); pWnd->SetWindowTextW ( titleNumShow ); m_changeTitle = false; } pWnd = this->GetDlgItem ( IDC_TITLESET_TITLESHOW ); pWnd->SetWindowTextW ( _T("") ); CString toShow; changeTitleToShow ( m_curTitle, toShow ); pWnd->SetWindowTextW ( toShow ); }
void CGameDlg::OnBnClickedBtnMute() { if (mute) { mute = false; m_nSound.SetOn(); CWnd* pButton = GetDlgItem(IDC_BTN_MUTE); pButton->SetWindowTextW(TEXT("MUSIC ON")); } else { mute = true; m_nSound.SetMute(); CWnd* pButton = GetDlgItem(IDC_BTN_MUTE); pButton->SetWindowTextW(TEXT("Mute")); } }
/********************************************************* 函数名称:RefreshStatic(未完成) 功能描述:刷新静态标签的内容 作者: 余志荣 创建时间:2016-08-29 参数说明: 返 回 值: *********************************************************/ int CChatDlg::RefreshStatic(MSG_USERINFO * msg_info) { /* // 2016年9月1日16:31:01修改 MSG_USERINFO msg_info; memset(&msg_info, 0, sizeof(MSG_USERINFO)); strcpy_s(msg_info.nID, m_nID); //((CMFCChatDlg*)GetParent())->m_Friend.GetDetailInfo(&msg_info); CWnd* pWnd = GetDlgItem(IDC_STATIC_INFO); CString strTemp1, strTemp2; strTemp1 = "账号:"; strTemp2 = msg_info.nID; strTemp1 += strTemp2; strTemp1 += "\r\n姓名:"; strTemp2 = msg_info.Name; strTemp1 += strTemp2; strTemp1 += "\r\n邮箱:"; strTemp2 = msg_info.Email; strTemp1 += strTemp2; strTemp1 += "\r\n性别:"; strTemp2 = msg_info.Sex; strTemp1 += strTemp2; pWnd->SetWindowTextW(strTemp1); */ CWnd* pWnd = GetDlgItem(IDC_STATIC_INFO); CString strTemp1, strTemp2; strTemp1 = "账号:"; strTemp2 = msg_info->nID; strTemp1 += strTemp2; strTemp1 += "\r\n姓名:"; strTemp2.Format(L"%s", msg_info->Name); //strTemp2 = msg_info->Name; strTemp1 += strTemp2; strTemp1 += "\r\n邮箱:"; strTemp2 = msg_info->Email; strTemp1 += strTemp2; strTemp1 += "\r\n性别:"; if (msg_info->Sex == 'm') { strTemp2 = "男"; } else if (msg_info->Sex == 'f') { strTemp2 = "女"; } else { strTemp2 = "未知"; } strTemp1 += strTemp2; pWnd->SetWindowTextW(strTemp1); pWnd->Invalidate(); return 0; }
BOOL CInspectorProperty_Signal::OnInitDialog() { CInspectorProperty::OnInitDialog(); CWnd* pWnd = GetDlgItem(IDC_SIGNAL_BTN); if(pWnd && GetProperty()) { pWnd->SetWindowTextW(GetName()); } return TRUE; // return TRUE unless you set the focus to a control // Òì³£: OCX ÊôÐÔÒ³Ó¦·µ»Ø FALSE }
BOOL titleShowDlg::OnInitDialog() { CDialogEx::OnInitDialog(); // TODO: 在此添加额外的初始化 CWnd *pWnd = this->GetDlgItem( IDC_SHOWTITLE_STATICSHOW ); pWnd->SetWindowTextW ( _T("") ); CString showAllTitle, showTitle; TitleTemplateDlg *ttdlg = ( TitleTemplateDlg *)this->m_pParentWnd; for ( int i=0; i< ttdlg->getTitleSize(); i++ ) { ttdlg->changeTitleToShow( i ,showTitle ); for ( int j=i; j>0; j-- ) showAllTitle += _T(' '); showAllTitle += showTitle ; showAllTitle.AppendFormat( _T(" (第%d级标题)"), i+1 ); showAllTitle += _T("\r\n"); } pWnd->SetWindowTextW ( showAllTitle ); return TRUE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE }
BOOL CThetaGridAdjustmentSimpleOutputDlg::OnInitDialog() { int i; CString T; BOOL b; CWnd* pWnd; CDC* pDC; pWnd=this; pWnd->CenterWindow(); if (m_nType==1) pWnd->SetWindowTextW(L"Simple Output - Event's Arguments"); //if dealing with the event's arguments else if (m_nType==2) pWnd->SetWindowTextW(L"Simple Output - Complement Clause"); //if dealing with the event's complement clause CDialog::OnInitDialog(); m_bSubjectRaised=FALSE; m_strTargetFontName=m_pDoc->GetTargetLanguageFontName(); //used in ChangeFont if (HFONT(m_fontTarget)==NULL) //first time this modeless dialog activated { //create the fonts that will be used in the combo boxes pWnd=&m_datatblInput; pDC=pWnd->GetDC(); //get a pointer to the device context T=m_pDoc->GetSourceLanguageFontName(4); b=m_fontArial.CreatePointFont(90,L"Arial",pDC); if (b==FALSE) AfxMessageBox(L"Unable to create Arial font.",MB_OK); i=m_pDoc->GetTargetLanguageFontSize(); b=m_fontTarget.CreatePointFont(10*i,m_strTargetFontName,pDC); if (b==FALSE) AfxMessageBox(L"Unable to create Target font.",MB_OK); } SetupTable(); if (m_nType==2) //if specifying features for object complement clause { pWnd=GetDlgItem(IDC_BUTTONFEATURESET); pWnd->MoveWindow(12,68,75,22); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void CGameDlg::OnBnClickedBtnPause() { if(!mute) m_nSound.ButtonClick(); if (!m_bPlaying) return; if (m_bPause) { m_bPause = false; UpdateMap(); CWnd* pButton = GetDlgItem(IDC_BTN_PAUSE); pButton->SetWindowTextW(TEXT("Pause")); } else { m_bPause = true; m_dcMem.BitBlt(MAP_LEFT,MAP_TOP,m_ptGameEnd.x,m_ptGameEnd.y, &m_dcPauseMask, 0, 0 , SRCPAINT); m_dcMem.BitBlt(MAP_LEFT,MAP_TOP,m_ptGameEnd.x,m_ptGameEnd.y, &m_dcPause, 0,0, SRCAND); InvalidateRect(m_rtGameRect, FALSE); CWnd* pButton = GetDlgItem(IDC_BTN_PAUSE); pButton->SetWindowTextW(TEXT("Continue")); } }
BOOL CReferenceDlg::OnInitDialog() { CWnd* pWnd; CReferenceUtils ru; CDialog::OnInitDialog(); m_cboSourceText.ResetContent(); m_bGreekAndHebrewInstalled=FALSE; //m_bGreekAndHebrewInstalled=ru.GreekAndHebrewInstalled(m_pDoc); //check if Greek and Hebrew installed //if (m_bGreekAndHebrewInstalled) //if Hebrew and Greek installed //{ // m_cboSourceText.AddString(L"Hebrew OT"); // m_cboSourceText.AddString(L"Greek NT"); // m_cboSourceText.AddString(L"Greek Grammar Introduction"); //} m_bEnglishBibleInstalled=ru.EnglishBibleInstalled(m_pDoc); //check if English Bible and Missions Documents installed if (m_bEnglishBibleInstalled) { m_cboSourceText.AddString(L"Missions Documents"); m_cboSourceText.AddString(L"Bible"); } else { pWnd=GetDlgItem(IDC_STATICVERSE); pWnd->SetWindowTextW(L"Text:"); } m_cboSourceText.AddString(L"(this option not enabled)"); m_cboSourceText.AddString(L"Grammar Introduction"); m_cboSourceText.AddString(L"Community Development Texts"); m_nOriginalSourceText=m_nSourceText; //save so that when user hits OK, we'll check if it changed m_ncboSourceText=m_nSourceText; if (!m_bGreekAndHebrewInstalled) m_ncboSourceText-=3; //if Hebrew and Greek not installed, account for their dbs if (!m_bEnglishBibleInstalled) m_ncboSourceText-=2; //if English Bible and Missions Documents not installed, account for their dbs pWnd=&m_cboSourceText; if (m_bChangeSourceTextEnabled==FALSE) pWnd->EnableWindow(FALSE); LoadBooks(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }