本文整理汇总了C++中CButton::ShowWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ CButton::ShowWindow方法的具体用法?C++ CButton::ShowWindow怎么用?C++ CButton::ShowWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButton
的用法示例。
在下文中一共展示了CButton::ShowWindow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: GetDlgItem
void
CMonProcDlg::OnCancelCheckTomcat( )
{
CButton *pCheckButton = (CButton *) GetDlgItem( IDC_CHECKTOMCAT );
CButton *pCancelButton = (CButton *) GetDlgItem( IDC_CANCELCHECKTOMCAT );
pCheckButton->EnableWindow( TRUE );
pCheckButton->ShowWindow( SW_SHOW );
pCancelButton->ShowWindow( SW_HIDE );
PumpMessages( );
CancelCheckTomcat( );
}
示例3: showCtl
void zstringEx::showCtl(int CtlID,BOOL isshow,HWND ParentWindowHwnd)
{
HWND oh;
if(ParentWindowHwnd==NULL)
{
CWnd *w=::AfxGetMainWnd();
oh=w->m_hWnd;
}
else oh=ParentWindowHwnd;
CButton b;
b.Attach(GetDlgItem(oh,CtlID));
if(isshow)b.ShowWindow(SW_SHOW);else b.ShowWindow(SW_HIDE);
b.Detach();
}
示例4: CreateButton
void CDBSchemaTableView::CreateButton(CButton& btn, UINT id, CWnd* pParent, LPCTSTR lpTitle, UINT width, UINT height, DWORD dwStyle, CFont* pFont)
{
static CFont* pDefaultFont = 0;
if(!pDefaultFont)
{
pDefaultFont = new CFont;
pDefaultFont->CreateFont(16, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
0, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
_T( "Arial ")); // lpszFac
}
RECT rect = {0, 0, width, height};
btn.Create(lpTitle, dwStyle, rect, pParent, id);
if(!pFont) pFont = pDefaultFont;
btn.SetFont(pFont);
btn.ShowWindow(SW_SHOW);
}
示例5: 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);
}
}
}
}
示例6: OnInitDialog
BOOL CFormatConverterWnd::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();
// TODO: Add your specialized code here
ModifyStyle(0, WS_MINIMIZEBOX);
CButton* omBtn;
WINDOWPLACEMENT omWndPlace;
omBtn = reinterpret_cast<CButton*>(GetDlgItem(ID_APPLY_NOW));
omBtn->ShowWindow(SW_HIDE);
omBtn->GetWindowPlacement(&omWndPlace);
omBtn = reinterpret_cast<CButton*>(GetDlgItem(IDOK));
omBtn->ShowWindow(SW_HIDE);
omBtn = reinterpret_cast<CButton*>(GetDlgItem(IDCANCEL));
omBtn->SetWindowText("Close");
omBtn->SetWindowPlacement(&omWndPlace);
return bResult;
}
示例7: updateState
void Display::updateState(BOOL pstate,BOOL nstate)
{
CEdit *eser,*eport,*euser;
CStatic *sser,*sport,*suser,*sgroup1,*sgroup2;
CButton *con;
//Destroy server related items
con=(CButton*)GetDlgItem(IDC_BUTTON1);
con->ShowWindow(pstate);
eser=(CEdit*)GetDlgItem(IDC_EDIT1);
eser->ShowWindow(pstate);
eport=(CEdit*)GetDlgItem(IDC_EDIT2);
eport->ShowWindow(pstate);
euser=(CEdit*)GetDlgItem(IDC_EDIT3);
euser->ShowWindow(pstate);
sser=(CStatic*)GetDlgItem(1098);
sser->ShowWindow(pstate);
suser=(CStatic*)GetDlgItem(1086);
suser->ShowWindow(pstate);
sport=(CStatic*)GetDlgItem(1099);
sport->ShowWindow(pstate);
sgroup1=(CStatic*)GetDlgItem(1097);
sgroup1->ShowWindow(pstate);
//Enable Send to items
sgroup2=(CStatic*)GetDlgItem(1075);
sgroup2->ShowWindow(nstate);
radio1=(CButton*)GetDlgItem(IDC_RADIO1);
radio2=(CButton*)GetDlgItem(IDC_RADIO2);
start=(CButton*)GetDlgItem(IDC_BUTTON5);
stop=(CButton*)GetDlgItem(IDC_BUTTON6);
radio1->ShowWindow(nstate);
radio2->ShowWindow(nstate);
radio1->SetCheck(1);
radio2->SetCheck(0);
start->ShowWindow(nstate);
cbox->ShowWindow(nstate);
if(doit==TRUE)
talk->ShowWindow(TRUE);
anicon->ShowWindow(FALSE);
}
示例8: OnShowWindow
void ProceedingDialog::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
if ( bShow ) {
CButton *bp = (CButton *)GetDlgItem( IDCANCEL );
bp->ShowWindow( SW_HIDE );
}
}
示例9: OnAccept
LRESULT CCellphoneDlg::OnAccept(WPARAM wParam, LPARAM lParam)
{
m_device->m_bOnInputDevice = true;
m_device->m_typeOnInputDevice = CELLPHONE_TOUCHPAD;
CEdit* status = (CEdit*)GetDlgItem(IDC_STATUS);
CButton* ok = (CButton*)GetDlgItem(ID_YES);
CButton* cancel = (CButton*)GetDlgItem(ID_NO);
status->SetWindowText("Cellphone is connected");
ok->ShowWindow(FALSE);
cancel->SetWindowText("Disconnect");
cancel->ShowWindow(TRUE);
m_bIsListening = false;
m_bIsConnected = true;
return 0;
}
示例10: UpdateHoldButton
void MessagesDlg::UpdateHoldButton(pjsua_call_info *call_info)
{
#ifndef _GLOBAL_NO_HOLD
MessagesContact* messagesContact = GetMessageContact();
if (messagesContact) {
CButton* button = (CButton*)GetDlgItem(IDC_HOLD);
CButton* buttonTransfer = (CButton*)GetDlgItem(IDC_TRANSFER);
CButton* buttonDialer = (CButton*)microsipDlg->pageDialer->GetDlgItem(IDC_HOLD);
CButton* buttonTransferDialer = (CButton*)microsipDlg->pageDialer->GetDlgItem(IDC_TRANSFER);
if (messagesContact->callId != -1) {
if (call_info && messagesContact->callId == call_info->id && call_info->media_cnt>0) {
buttonTransfer->ShowWindow(SW_SHOW);
buttonTransferDialer->EnableWindow(TRUE);
if (call_info->media_status == PJSUA_CALL_MEDIA_ACTIVE
|| call_info->media_status == PJSUA_CALL_MEDIA_REMOTE_HOLD
) {
button->ShowWindow(SW_SHOW);
button->SetCheck(BST_UNCHECKED);
buttonDialer->EnableWindow(TRUE);
buttonDialer->SetCheck(BST_UNCHECKED);
return;
} else if (call_info->media_status == PJSUA_CALL_MEDIA_LOCAL_HOLD
|| call_info->media_status == PJSUA_CALL_MEDIA_NONE) {
button->ShowWindow(SW_SHOW);
button->SetCheck(BST_CHECKED);
buttonDialer->EnableWindow(TRUE);
buttonDialer->SetCheck(BST_CHECKED);
return;
}
}
} else {
button->ShowWindow(SW_HIDE);
button->SetCheck(BST_UNCHECKED);
buttonDialer->EnableWindow(FALSE);
buttonDialer->SetCheck(BST_UNCHECKED);
buttonTransfer->ShowWindow(SW_HIDE);
buttonTransferDialer->EnableWindow(FALSE);
}
}
#endif
}
示例11: OnInitDialog
BOOL CWSPrintDialog::OnInitDialog()
{
bool bShowPrintRedlineOptions = Workshare::OptionApi::GetBool( L"ShowPrintRedlineOptions");
CButton *pButton;
pButton = (CButton*)GetDlgItem(IDC_CHECK_BW);
if( bShowPrintRedlineOptions)
{
pButton->SetCheck(m_bBlackAndWhite);
}
else
{
pButton->ShowWindow( SW_HIDE);
}
pButton = (CButton*)GetDlgItem(IDC_CHECK_CHANGES);
if( bShowPrintRedlineOptions)
{
pButton->SetCheck(m_bChangesOnly);
}
else
{
pButton->ShowWindow(SW_HIDE);
}
// resize the control to 3 times the width
CRect rcIcon;
GetDlgItem(1086)->GetWindowRect(rcIcon);
GetDlgItem(1086)->SetWindowPos(&wndTop, 0, 0, 2+rcIcon.Width()*3, 2+rcIcon.Height(), SWP_NOMOVE);
CEdit *pEdit = (CEdit *)GetDlgItem(1154);
pEdit->EnableWindow(TRUE);
CButton *pCheck = (CButton *)GetDlgItem( 1041 );
m_bCollate = pCheck->GetCheck();
CButton *pCheckPrintToFile = (CButton *)GetDlgItem( 1040 );
pCheckPrintToFile->SetCheck(FALSE);
return TRUE;
}
示例12: OnNo
void CCellphoneDlg::OnNo()
{
// TODO: Add extra cleanup here
CEdit* status = (CEdit*)GetDlgItem(IDC_STATUS);
CButton* ok = (CButton*)GetDlgItem(ID_YES);
CButton* cancel = (CButton*)GetDlgItem(ID_NO);
if(m_pCellphoneSocket) {
delete m_pCellphoneSocket;
m_pCellphoneSocket = NULL;
}
status->SetWindowText("Listen to a cellphone?");
ok->SetWindowText("Listen");
ok->ShowWindow(TRUE);
cancel->ShowWindow(FALSE);
m_bIsListening = false;
m_bIsConnected = false;
}
示例13: OnInitDialog
BOOL CCellphoneDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_device = &((CChatDlg*)m_pChatDlg)->m_pHugMe->m_device;
CEdit* status = (CEdit*)GetDlgItem(IDC_STATUS);
CButton* ok = (CButton*)GetDlgItem(ID_YES);
CButton* cancel = (CButton*)GetDlgItem(ID_NO);
status->SetWindowText("Listen to a cellphone?");
ok->SetWindowText("Listen");
ok->ShowWindow(TRUE);
cancel->ShowWindow(FALSE);
m_bIsListening = false;
m_bIsConnected = false;
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例14: OnPaint
void CWelcomeWnd::OnPaint()
{
CPaintDC dc(this); // device context for painting
// get our own DC instead, with no restrictions
CDC* pDC = GetDC();
// realize the palette
CPalette* pOldPalette = pDC->SelectPalette(m_bitmap.GetPalette(), FALSE);
pDC->RealizePalette();
// And draw the bitmap
BITMAP bmInfo;
if (m_bitmap.m_hObject == NULL)
return;
m_bitmap.GetObject(sizeof(BITMAP),&bmInfo);
CDC newDC;
newDC.CreateCompatibleDC(pDC);
CBitmap* pOldBitmap = newDC.SelectObject(&m_bitmap);
pDC->BitBlt(0,0,bmInfo.bmWidth,bmInfo.bmHeight,&newDC,0,0,SRCCOPY);
//
(void)newDC.SelectObject(pOldBitmap);
newDC.DeleteDC();
pDC->SelectPalette(pOldPalette, FALSE);
ReleaseDC(pDC);
// draw the 'OK' button
CRect winRect, rect;
GetClientRect(&winRect);
CButton* pBtn = (CButton*) GetDlgItem(IDOK);
pBtn->GetWindowRect(&rect);
ScreenToClient(&rect);
int nWidth = rect.Width();
int nHeight = rect.Height();
rect.bottom = winRect.bottom - 24;
rect.top = rect.bottom - nHeight;
rect.left = (winRect.right - nWidth) / 2;
rect.right = rect.left + nWidth;
pBtn->MoveWindow(&rect);
pBtn->ShowWindow(SW_SHOW);
}
示例15: callback
// enum camera callback
static void callback(void *pItem, char *pDeviceName)
{
TCHAR buffer[80] = L"";
size_t wlen;
int *idcCam = (int*)pItem;
if (*idcCam <= IDC_CAM4) {
CButton *item = (CButton*)pDlg->GetDlgItem(*idcCam);
item->EnableWindow();
item->SetCheck(BST_CHECKED);
item->ShowWindow(SW_SHOWNORMAL);
mbstowcs_s(&wlen, buffer, pDeviceName, 80);
// Buffaloのカメラの行末にCR,LFが入っているので、これを除去
for (wlen--; 0 < wlen; wlen--) {
if (buffer[wlen] == 13 || buffer[wlen] == 10)
buffer[wlen] = 0;
}
item->SetWindowText(buffer);
}
(*idcCam)++;
}