本文整理汇总了C++中CButton::SetWindowText方法的典型用法代码示例。如果您正苦于以下问题:C++ CButton::SetWindowText方法的具体用法?C++ CButton::SetWindowText怎么用?C++ CButton::SetWindowText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButton
的用法示例。
在下文中一共展示了CButton::SetWindowText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnBnClickedBnTimehide
void CShowPageDlg::OnBnClickedBnTimehide()
{
// TODO: 在此添加控件通知处理程序代码
// SetTimer(TIMEHIDESHOW,1000,NULL);
if(!m_bIsHide)
{
CRect windowRect;
GetWindowRect(windowRect);
m_rOldWindowRect = windowRect;//保存原来的rect
CRect listBoxRect;
m_OwnerListBox.GetWindowRect(listBoxRect);
ScreenToClient(listBoxRect);
windowRect.left-=listBoxRect.right;
windowRect.right-=listBoxRect.right;
MoveWindow(windowRect);
CButton* pButton = (CButton*)GetDlgItem(IDC_BN_TIMEHIDE);
pButton->SetWindowText(_T(">"));
m_bIsHide=!m_bIsHide;
}
else
{
MoveWindow(m_rOldWindowRect);
CButton* pButton = (CButton*)GetDlgItem(IDC_BN_TIMEHIDE);
pButton->SetWindowText(_T("<"));
m_bIsHide=!m_bIsHide;
}
}
示例2: MessageBox
void CoptimizerDlg::OnBnClickedButton1()
{
CButton *OptimizeButton = (CButton*)GetDlgItem(IDC_BUTTON1);
CButton *CancelButton = (CButton*)GetDlgItem(IDCANCEL);
CProgressCtrl *ProgressBar = (CProgressCtrl*)GetDlgItem(IDC_PROGRESS);
int RetVal;
OptimizeButton->SetWindowText(TEXT("Please wait..."));
OptimizeButton->EnableWindow(FALSE);
CancelButton->EnableWindow(FALSE);
ProgressBar->SetPos(0);
OptimizeBoot(OptimizeButton);
#ifndef LDRONLY
ProgressBar->SetPos(25);
OptimizeRegistry(OptimizeButton);
ProgressBar->SetPos(50);
OptimizeLibraries(OptimizeButton);
ProgressBar->SetPos(75);
OptimizeSystem(OptimizeButton);
#endif
ProgressBar->SetPos(100);
OptimizeButton->SetWindowText(TEXT("Optimize!"));
OptimizeButton->EnableWindow(TRUE);
CancelButton->EnableWindow(TRUE);
RetVal = MessageBox(TEXT("You need to reboot the system for the changes to take effect. Reboot now?"),
TEXT("Done."), MB_OKCANCEL);
if(RetVal == IDOK)
Reboot();
else
InflictLoad();
}
示例3: OnBnClickedBtnStart
// 按下“启动”/“停止”按钮,发消息到父窗体
void NetCfg::OnBnClickedBtnStart()
{
// TODO: 在此添加控件通知处理程序代码
CButton *hButton;
CString strout;
CString str_start = "启动";
HWND hparent;
hparent = this->GetParent()->GetSafeHwnd();
hButton = (CButton *)GetDlgItem(IDC_BTN_START);
hButton->GetWindowText(strout);
if (strout == str_start) {
hButton->SetWindowText("停止");
GetDlgItem(IDC_IP_TARGET)->EnableWindow(FALSE);
GetDlgItem(IDC_COMBO_THREAD)->EnableWindow(FALSE);
GetDlgItem(IDC_BTN_TRANSFER)->EnableWindow(TRUE);
::SendNotifyMessage(hparent,UM_DO_RUN_THREAD,NULL,NULL);
}
else {
TurnRun();
hButton->SetWindowText("启动");
GetDlgItem(IDC_IP_TARGET)->EnableWindow(TRUE);
GetDlgItem(IDC_COMBO_THREAD)->EnableWindow(TRUE);
GetDlgItem(IDC_BTN_TRANSFER)->EnableWindow(FALSE);
// GetDlgItem(IDC_EDIT_BROWSE)->EnableWindow(TRUE);
// GetDlgItem(IDC_BTN_BROWSE)->EnableWindow(TRUE);
// GetDlgItem(IDC_EDIT_TICK)->EnableWindow(TRUE);
::SendNotifyMessage(hparent,UM_DO_STOP_THREAD,NULL,NULL);
}
}
示例4: OnToggleHapticsButton
void Cdynamic_odeDlg::OnToggleHapticsButton() {
g_main_app->toggle_haptics();
CButton* button = (CButton*)(GetDlgItem(IDC_TOGGLEHAPTICS_BUTTON));
button->SetWindowText(g_main_app->haptics_enabled?"Disable haptics":"Enable haptics");
if (!g_main_app->haptics_enabled) {
CButton* button = (CButton*)(GetDlgItem(IDC_SECOND_DEVICE_BUTTON));
button->SetWindowText("Enable second device");
}
}
示例5: RefreshDialog
void CTisDialog::RefreshDialog()
{
CButton *cb = (CButton *) GetDlgItem(IDC_OPEN);
if(the_mos.m_drawclosed) cb->SetWindowText("Closed doors");
else cb->SetWindowText("Open doors");
cb->SetCheck(!the_mos.m_drawclosed);
if(m_preview.m_bm)
{
DeleteObject(m_preview.m_bm);
m_preview.m_bm=0;
}
if(editflg&LARGEWINDOW)
{
m_preview.m_maxextentx=m_preview.m_maxextenty=8;//maximum number of tiles fitting on screen
}
else
{
m_preview.m_maxextentx=m_preview.m_maxextenty=10;
}
CPoint point = m_preview.GetPoint(GP_TILE);
if ((DWORD) point.x!=m_minx && (m_maxx-m_minx>(DWORD) m_preview.m_maxextentx))
{
m_preview.m_clipx=point.x;
}
else
{
m_preview.m_clipx=m_minx;
}
m_preview.m_minclipx=m_minx;
if ((DWORD) point.x!=m_minx && (m_maxx-m_minx>(DWORD) m_preview.m_maxextentx))
{
m_preview.m_clipy=point.y;
}
else
{
m_preview.m_clipy=m_miny;
}
m_preview.m_minclipy=m_miny;
m_preview.m_maxclipx=m_maxx+1;
m_preview.m_maxclipy=m_maxy+1;
if(m_graphics)
{
m_preview.RedrawContent();
}
m_preview.ShowWindow(m_graphics);
UpdateData(UD_DISPLAY);
}
示例6: TurnRun
void NetCfg::TurnRun()
{
CButton *hButton;
CString strout;
CString str_start = "传输";
HWND hparent;
hparent = this->GetParent()->GetSafeHwnd();
hButton = (CButton *)GetDlgItem(IDC_BTN_TRANSFER);
hButton->GetWindowText(strout);
// todo 检查文件是否存在
// 文件不存在,退出
if (0) {
return ;
}
hButton->SetWindowText("传输");
GetDlgItem(IDC_EDIT_BROWSE)->EnableWindow(TRUE);
GetDlgItem(IDC_BTN_BROWSE)->EnableWindow(TRUE);
GetDlgItem(IDC_EDIT_TICK)->EnableWindow(TRUE);
GetDlgItem(IDC_COMBO_TICK)->EnableWindow(TRUE);
::SendNotifyMessage(hparent,UM_DO_PAUSE_TRANSFER,NULL,NULL);
}
示例7: OnYes
void CCellphoneDlg::OnYes()
{
// TODO: Add extra validation here
m_pCellphoneSocket = new CellphoneSocket();
if( !m_pCellphoneSocket->Create(CELLPHONE_PORT) ) {
MessageBox("Failed to create the chatting socket");
delete m_pCellphoneSocket;
m_pCellphoneSocket = NULL;
}
if( !m_pCellphoneSocket->Listen() ) {
MessageBox("Failed to listen to a connection for chat");
delete m_pCellphoneSocket;
m_pCellphoneSocket = NULL;
}
CEdit* status = (CEdit*)GetDlgItem(IDC_STATUS);
CButton* ok = (CButton*)GetDlgItem(ID_YES);
CButton* cancel = (CButton*)GetDlgItem(ID_NO);
status->SetWindowText("Listening to a cellphone...");
ok->ShowWindow(FALSE);
cancel->SetWindowText("Cancel");
cancel->ShowWindow(TRUE);
m_bIsListening = true;
m_bIsConnected = false;
}
示例8: OnSecondDeviceButton
void Cdynamic_odeDlg::OnSecondDeviceButton()
{
g_main_app->toggle_second_device();
CButton* button = (CButton*)(GetDlgItem(IDC_SECOND_DEVICE_BUTTON));
button->SetWindowText(g_main_app->second_device_enabled?"Disable second device":"Enable second device");
}
示例9: initChecks
/////////////////////////////////////////////////////////////////////////////
// set up stuff, turn things on and off
/////////////////////////////////////////////////////////////////////////////
void CNetworkAIDialog::initChecks()
{
int i, j;
CButton *pCheck;
CString str;
//traverse controls
for(i = 0; i < AI_DATABASE->numAI(); i++)
{
//set variables
pCheck = &m_AI1Check + i;
//set checkbox text
str.Format("Use %s", AI_DATABASE->getAIName(i));
pCheck->SetWindowText(str);
//see if it's already being used
for(j = 0; j < (int) GAME->m_players.size(); j++)
{
//find it
if(GAME->m_players[j].m_player.getID() == AI_DATABASE->getAIID(i))
{
pCheck->SetCheck(TRUE);
}
else
{
pCheck->SetCheck(FALSE);
}
}
}
}
示例10: RefreshDialog
void CScriptEdit::RefreshDialog()
{
CString tmpstr;
CButton *cb;
int topline;
int i;
if(m_firsterror>=0)
{
topline=m_text_control.GetFirstVisibleLine();
for(i=0;i<LINES;i++)
{
cb=(CButton *) GetDlgItem(IDC_U1+i);
if(topline+i>=m_count)
{
cb->ShowWindow(false);
}
else
{
cb->ShowWindow(true);
tmpstr.Format("%d",topline+i+1);
cb->SetWindowText(tmpstr);
if(m_errors[topline+i]&0xffff) cb->SetCheck(false);
else cb->SetCheck(true);
}
}
}
else
{
topline=m_text_control.GetFirstVisibleLine();
for(i=0;i<LINES;i++)
{
cb=(CButton *) GetDlgItem(IDC_U1+i);
if(topline+i>=m_count)
{
cb->ShowWindow(false);
}
else
{
cb->ShowWindow(true);
tmpstr.Format("%d",topline+i+1);
cb->SetWindowText(tmpstr);
cb->SetCheck(true);
}
}
}
}
示例11: RefreshPolygon
void CPolygon::RefreshPolygon(bool repos)
{
CString tmpstr;
CButton *cb;
int i;
if(!m_vertexpicker) return;
m_vertexpicker.ResetContent();
for(i=0;i<*countvertex;i++)
{
tmpstr.Format("%d [%d.%d]",i+1, m_polygon[i].x,m_polygon[i].y);
m_vertexpicker.AddString(tmpstr);
}
if(m_vertexnum<0) m_vertexnum=0;
m_vertexnum=m_vertexpicker.SetCurSel(m_vertexnum);
i=0;
while(vertexboxids[i])
{
GetDlgItem(vertexboxids[i])->EnableWindow(m_vertexnum>=0);
i++;
}
cb = (CButton *) GetDlgItem(IDC_OPEN);
if(m_open) cb->SetWindowText("Draw open");
else cb->SetWindowText("Draw closed");
the_mos.m_drawclosed=!m_open;
if(m_preview.m_bm)
{
DeleteObject(m_preview.m_bm);
m_preview.m_bm=0;
}
if(repos && m_vertexnum>=0)
{
m_preview.m_clipx=m_polygon[m_vertexnum].x/the_mos.mosheader.dwBlockSize-m_preview.m_maxextentx/2;
m_preview.m_clipy=m_polygon[m_vertexnum].y/the_mos.mosheader.dwBlockSize-m_preview.m_maxextenty/2;
}
if(m_graphics)
{
m_preview.m_polygon=m_polygon;
m_preview.m_vertexcount=*countvertex;
m_preview.m_actvertex=m_vertexnum;
m_preview.RedrawContent();
}
m_preview.ShowWindow(m_graphics);
}
示例12: OnBtviewrecdata
void CMyCommView::OnBtviewrecdata()
{
// TODO: Add your control notification handler code here
m_IsViewReceiveData = !m_IsViewReceiveData;
if (m_IsViewReceiveData)
{
CButton * myb = (CButton *) GetDlgItem(IDC_BTVIEWRECDATA);
myb->SetWindowText(_T("停止显示"));
m_EditLogger.AddText(_T("\r\n继续显示\r\n"));
}
else
{
CButton * myb = (CButton *) GetDlgItem(IDC_BTVIEWRECDATA);
myb->SetWindowText(_T("继续显示"));
m_EditLogger.AddText(_T("\r\n停止显示"));
}
}
示例13: OnSelchangeRoute
void CCustomerComment::OnSelchangeRoute()
{
int nI = pComboBoxROUTE->GetCurSel();
if(nI == CB_ERR)
{
pStaticDIRECTION_TEXT->EnableWindow(FALSE);
pButtonNADIRECTION->SetCheck(FALSE);
pButtonNADIRECTION->EnableWindow(FALSE);
pButtonOUTBOUND->SetCheck(FALSE);
pButtonOUTBOUND->EnableWindow(FALSE);
pButtonINBOUND->SetCheck(FALSE);
pButtonINBOUND->EnableWindow(FALSE);
}
else
{
pStaticDIRECTION_TEXT->EnableWindow(TRUE);
pButtonNADIRECTION->EnableWindow(TRUE);
pButtonNADIRECTION->SetCheck(TRUE);
pButtonOUTBOUND->SetCheck(FALSE);
pButtonINBOUND->SetCheck(FALSE);
ROUTESKey0.recordID = pComboBoxROUTE->GetItemData(nI);
if(btrieve(B_GETEQUAL, TMS_ROUTES, &ROUTES, &ROUTESKey0, 0) == 0)
{
CButton* pButton;
for(int nJ = 0; nJ < 2; nJ++)
{
pButton = (nJ == 0 ? pButtonOUTBOUND : pButtonINBOUND);
if(ROUTES.DIRECTIONSrecordID[nJ] == NO_RECORD)
{
pButton->SetWindowText("");
pButton->EnableWindow(FALSE);
}
else
{
DIRECTIONSKey0.recordID = ROUTES.DIRECTIONSrecordID[nJ];
btrieve(B_GETEQUAL, TMS_DIRECTIONS, &DIRECTIONS, &DIRECTIONSKey0, 0);
strncpy(tempString, DIRECTIONS.longName, DIRECTIONS_LONGNAME_LENGTH);
trim(tempString, DIRECTIONS_LONGNAME_LENGTH);
pButton->SetWindowText(tempString);
pButton->EnableWindow(TRUE);
}
}
}
}
}
示例14: OnToggleHapticsButton
void Cforce_shadingDlg::OnToggleHapticsButton() {
g_main_app->toggle_haptics();
CButton* button = (CButton*)(GetDlgItem(IDC_TOGGLEHAPTICS_BUTTON));
button->SetWindowText(g_main_app->haptics_enabled?"Disable haptics":"Enable haptics");
}
示例15: OnReadDone
LRESULT CSequenceEditor::OnReadDone(WPARAM wParam, LPARAM lParam) {
delete[] readobject.texttoread;
reading = false;
CButton* button = (CButton*) GetDlgItem( IDC_READBACK );
button->SetWindowText("Read Sequence");
return 0;
}