本文整理汇总了C++中CButton::MoveWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ CButton::MoveWindow方法的具体用法?C++ CButton::MoveWindow怎么用?C++ CButton::MoveWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButton
的用法示例。
在下文中一共展示了CButton::MoveWindow方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnSize
void CUserListDlg::OnSize( UINT nType, int cx, int cy ) {
CDialog::OnSize( nType, cx, cy );
CListBox* userList = (CListBox*)GetDlgItem( IDC_USERLIST );
CButton* newButton = (CButton*)GetDlgItem( IDC_NEWUSERBUTTON );
CButton* deleteButton = (CButton*)GetDlgItem( IDC_DELETEUSERBUTTON );
if ( userList && newButton && deleteButton ) {
CRect client;
GetClientRect( client );
CRect button;
newButton->CButton::GetWindowRect( button );
userList->MoveWindow( 0, 0, client.Width(), client.Height()-button.Height() );
newButton->MoveWindow( 0, client.Height()-button.Height(), client.Width()/2, button.Height() );
deleteButton->MoveWindow( client.Width()/2, client.Height()-button.Height(), client.Width()/2, button.Height() );
}
}
示例2: AdjustRadio
void CMyGroupBox::AdjustRadio()
{
CRect rcTmp;
GetClientRect(rcTmp);
int nWith = rcTmp.Width();
for (int i = 0; i < GetRadioCount(); i++)
{
CButton* pBtn = m_RadioList.GetAt(i);
pBtn->MoveWindow(10, 20 + i * m_nRadioHeight, nWith - 10 * 2, m_nRadioHeight);
}
}
示例3: 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);
}
示例4: CalculateRects
void CXTPColorDialog::CalculateRects()
{
CRect rcBtnOK;
CRect rcBtnCancel;
CRect rcTabCtrl;
CRect rcItem;
// get the tab control size.
CTabCtrl* pTabCtrl = GetTabControl();
pTabCtrl->GetWindowRect(&rcTabCtrl);
ScreenToClient(&rcTabCtrl);
// get the size of the first tab item.
pTabCtrl->GetItemRect(0, &rcItem);
// get the OK button size.
CButton* pBtnOK = (CButton*)GetDlgItem(IDOK);
pBtnOK->GetWindowRect(&rcBtnOK);
ScreenToClient(&rcBtnOK);
// get the Cancel button size.
CButton* pBtnCancel = (CButton*)GetDlgItem(IDCANCEL);
pBtnCancel->GetWindowRect(&rcBtnCancel);
ScreenToClient(&rcBtnCancel);
rcBtnCancel.OffsetRect(-15, 0);
// resize the tab control
rcTabCtrl.right = rcBtnCancel.left - 5;
rcTabCtrl.bottom = rcBtnCancel.top - 15;
pTabCtrl->MoveWindow(&rcTabCtrl);
// reposition the OK button.
rcBtnOK = rcBtnCancel;
rcBtnOK.top = rcTabCtrl.top + rcItem.Height() + 1;
rcBtnOK.bottom = rcBtnOK.top + rcBtnCancel.Height();
pBtnOK->MoveWindow(&rcBtnOK);
// reposition the Cancel button.
rcBtnCancel = rcBtnOK;
rcBtnCancel.top = rcBtnOK.bottom + 5;
rcBtnCancel.bottom = rcBtnCancel.top + rcBtnOK.Height();
pBtnCancel->MoveWindow(&rcBtnCancel);
// reposition the hex display
if (::IsWindow(m_wndHexEdit.m_hWnd))
{
CRect rcWnd;
rcWnd = rcBtnCancel;
rcWnd.top = rcBtnCancel.bottom + 5;
rcWnd.bottom = rcWnd.top + 18;
m_wndHexEdit.MoveWindow(&rcWnd);
}
// reposition the eye dropper.
if (::IsWindow(m_wndEyeDropper.m_hWnd))
{
CRect rcWnd;
m_wndEyeDropper.GetWindowRect(&rcWnd);
CSize size = rcWnd.Size();
rcWnd.right = rcBtnOK.right;
rcWnd.left = rcBtnOK.right - size.cx;
rcWnd.bottom = rcTabCtrl.bottom;
rcWnd.top = rcTabCtrl.bottom - size.cy;
m_wndEyeDropper.MoveWindow(&rcWnd);
}
// resize the property sheet.
CXTPWindowRect rcWindow(this);
ClientToScreen(&rcTabCtrl);
rcWindow.bottom = rcTabCtrl.bottom + 10;
rcWindow.right -= 15;
MoveWindow(&rcWindow);
}
示例5: GetDlgItem
/*
This function update the window layout, the order of statement is significant.
//*/
void CDlg3RGSegment::UpdateLayout( int cx, int cy )
{
// Compute layout for the window and the image displaying region
CStatic* ctrlStatic = NULL;
CButton* ctrlButton = NULL;
CComboBox* ctrlCombobox = NULL;
CRect clientRect;
CRect contrlRect;
CRect infoRect;
GetClientRect(&clientRect);
//////////////////////////////////////////////////////////////////////////
// Compute the preprocessing group
contrlRect.left = clientRect.left + SV_3DRG_SPACING;
contrlRect.bottom = clientRect.bottom - SV_3DRG_SPACING;
contrlRect.top = clientRect.bottom - SV_3DRG_GRP_HEIGHT;
contrlRect.right = contrlRect.left + SV_3DRG_GRP_WIDTH;
ctrlStatic = (CStatic*)GetDlgItem(IDC_3DRG_GRAYGRP);
ctrlStatic->MoveWindow(&contrlRect, FALSE);
// Preprocessing check box
contrlRect.left += SV_3DRG_SPACING;
contrlRect.top += SV_3DRG_SPACING * 2;
contrlRect.right -= SV_3DRG_SPACING;
contrlRect.bottom = contrlRect.top + SV_3DRG_TEXTHEIGHT;
m_chkPreproc.MoveWindow(&contrlRect, FALSE);
// Brightness label
contrlRect.top = contrlRect.bottom + SV_3DRG_SPACING;
contrlRect.bottom = contrlRect.top + SV_3DRG_TEXTHEIGHT;
ctrlStatic = (CStatic*)GetDlgItem(IDC_LBL_BRIGHT);
ctrlStatic->MoveWindow(&contrlRect, FALSE);
//Brightness slider
contrlRect.top = contrlRect.bottom + SV_3DRG_SMALL_SPACING;
contrlRect.bottom = contrlRect.top + SV_3DRG_SMALLSLIDERHEIGHT;
contrlRect.right = contrlRect.left + SV_3DRG_CHARWIDTH;
ctrlStatic =(CStatic*)GetDlgItem(IDC_BR_100);
ctrlStatic->MoveWindow(&contrlRect, FALSE);
contrlRect.left = contrlRect.right + SV_3DRG_SMALL_SPACING;
contrlRect.right = contrlRect.left + SV_3DRG_SMALLSLIDERWIDTH;
m_sldBright.MoveWindow(&contrlRect, FALSE);
contrlRect.left = contrlRect.right + SV_3DRG_SMALL_SPACING;
contrlRect.right = contrlRect.left + SV_3DRG_CHARWIDTH;
ctrlStatic =(CStatic*)GetDlgItem(IDC_BR_M100);
ctrlStatic->MoveWindow(&contrlRect, FALSE);
// Contrast label
contrlRect.top = contrlRect.bottom + SV_3DRG_SPACING;
contrlRect.bottom = contrlRect.top + SV_3DRG_TEXTHEIGHT;
contrlRect.left = clientRect.left + SV_3DRG_SPACING *2;
contrlRect.right = clientRect.left + SV_3DRG_SMALLSLIDERWIDTH;
ctrlStatic = (CStatic*)GetDlgItem(IDC_LBL_CONTRAST);
ctrlStatic->MoveWindow(&contrlRect, FALSE);
// Contrast slider
contrlRect.top = contrlRect.bottom + SV_3DRG_SMALL_SPACING;
contrlRect.bottom = contrlRect.top + SV_3DRG_SMALLSLIDERHEIGHT;
contrlRect.right = contrlRect.left + SV_3DRG_CHARWIDTH;
ctrlStatic = (CStatic*)GetDlgItem(IDC_CS_100);
ctrlStatic->MoveWindow(&contrlRect, FALSE);
contrlRect.left = contrlRect.right + SV_3DRG_SMALL_SPACING;
contrlRect.right = contrlRect.left + SV_3DRG_SMALLSLIDERWIDTH;
m_sldContrast.MoveWindow(&contrlRect, FALSE);
contrlRect.left = contrlRect.right + SV_3DRG_SMALL_SPACING;
contrlRect.right = contrlRect.left + SV_3DRG_CHARWIDTH;
ctrlStatic =(CStatic*)GetDlgItem(IDC_CS_M100);
ctrlStatic->MoveWindow(&contrlRect, FALSE);
//////////////////////////////////////////////////////////////////////////
// Compute the region growing setting
contrlRect.left = clientRect.left + SV_3DRG_SPACING*1.5 + SV_3DRG_GRP_WIDTH;
contrlRect.bottom = clientRect.bottom - SV_3DRG_SPACING;
contrlRect.top = clientRect.bottom - SV_3DRG_GRP_HEIGHT;
contrlRect.right = contrlRect.left + SV_3DRG_GRP_WIDTH;
ctrlStatic = (CStatic*)GetDlgItem(IDC_3DRG_SETTINGGRP);
ctrlStatic->MoveWindow(&contrlRect, FALSE);
// Use default check box
contrlRect.left += SV_3DRG_SPACING;
contrlRect.top += SV_3DRG_SPACING * 2;
contrlRect.right -= SV_3DRG_SPACING;
contrlRect.bottom = contrlRect.top + SV_3DRG_TEXTHEIGHT;
m_chkDefaultThres.MoveWindow(&contrlRect, FALSE);
// Threshold slider label
contrlRect.top = contrlRect.bottom + SV_3DRG_SPACING;
contrlRect.bottom = contrlRect.top + SV_3DRG_TEXTHEIGHT;
ctrlStatic = (CStatic*)GetDlgItem(IDC_LBL_THRES);
ctrlStatic->MoveWindow(&contrlRect, FALSE);
// Threshold slider
//.........这里部分代码省略.........