本文整理汇总了C++中CDuiRect::GetHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ CDuiRect::GetHeight方法的具体用法?C++ CDuiRect::GetHeight怎么用?C++ CDuiRect::GetHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDuiRect
的用法示例。
在下文中一共展示了CDuiRect::GetHeight方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CalPos
RECT CEditWnd::CalPos()
{
CDuiRect rcPos = m_pOwner->GetPos();
RECT rcInset = m_pOwner->GetTextPadding();
rcPos.left += rcInset.left;
rcPos.top += rcInset.top;
rcPos.right -= rcInset.right;
rcPos.bottom -= rcInset.bottom;
LONG lEditHeight = m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->tm.tmHeight;
if( lEditHeight < rcPos.GetHeight() ) {
rcPos.top += (rcPos.GetHeight() - lEditHeight) / 2;
rcPos.bottom = rcPos.top + lEditHeight;
}
CControlUI* pParent = m_pOwner;
RECT rcParent;
while( pParent = pParent->GetParent() ) {
if( !pParent->IsVisible() ) {
rcPos.left = rcPos.top = rcPos.right = rcPos.bottom = 0;
break;
}
rcParent = pParent->GetClientPos();
if( !::IntersectRect(&rcPos, &rcPos, &rcParent) ) {
rcPos.left = rcPos.top = rcPos.right = rcPos.bottom = 0;
break;
}
}
return rcPos;
}
示例2: InitWindow
void MainDialog::InitWindow()
{
MONITORINFO oMonitor = {};
oMonitor.cbSize = sizeof(oMonitor);
::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTOPRIMARY), &oMonitor);
CDuiRect rcWork = oMonitor.rcWork;
CDuiRect rcWnd;
GetWindowRect(m_hWnd, &rcWnd);
int nWidth = rcWnd.GetWidth();
int nHeight = rcWnd.GetHeight();
SetWindowPos(m_hWnd, HWND_TOPMOST, rcWork.GetWidth() - nWidth - 100, 100, 280, rcWork.GetHeight()-200, SWP_SHOWWINDOW);
}
示例3: CalPos
RECT CEditWnd::CalPos()
{
CDuiRect rcPos = m_pOwner->GetPos();
RECT rcInset = m_pOwner->GetTextPadding();
rcPos.left += rcInset.left;
rcPos.top += rcInset.top;
rcPos.right -= rcInset.right;
rcPos.bottom -= rcInset.bottom;
LONG lEditHeight = m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->tm.tmHeight;
if( lEditHeight < rcPos.GetHeight() ) {
rcPos.top += (rcPos.GetHeight() - lEditHeight) / 2;
rcPos.bottom = rcPos.top + lEditHeight;
}
return rcPos;
}
示例4: ResizeMenu
void CMenuWnd::ResizeMenu()
{
CControlUI* pRoot = m_pm.GetRoot();
#if defined(WIN32) && !defined(UNDER_CE)
MONITORINFO oMonitor = {};
oMonitor.cbSize = sizeof(oMonitor);
::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTOPRIMARY), &oMonitor);
CDuiRect rcWork = oMonitor.rcWork;
#else
CDuiRect rcWork;
GetWindowRect(m_pOwner->GetManager()->GetPaintWindow(), &rcWork);
#endif
SIZE szAvailable = { rcWork.right - rcWork.left, rcWork.bottom - rcWork.top };
szAvailable = pRoot->EstimateSize(szAvailable);
m_pm.SetInitSize(szAvailable.cx, szAvailable.cy);
//必须是Menu标签作为xml的根节点
CMenuUI *pMenuRoot = static_cast<CMenuUI*>(pRoot);
ASSERT(pMenuRoot);
SIZE szInit = m_pm.GetInitSize();
CDuiRect rc;
CDuiPoint point = m_BasedPoint;
rc.left = point.x;
rc.top = point.y;
rc.right = rc.left + szInit.cx;
rc.bottom = rc.top + szInit.cy;
int nWidth = rc.GetWidth();
int nHeight = rc.GetHeight();
if (m_dwAlignment & eMenuAlignment_Right)
{
rc.right = point.x;
rc.left = rc.right - nWidth;
}
if (m_dwAlignment & eMenuAlignment_Bottom)
{
rc.bottom = point.y;
rc.top = rc.bottom - nHeight;
}
SetForegroundWindow(m_hWnd);
MoveWindow(m_hWnd, rc.left, rc.top, rc.GetWidth(), rc.GetHeight(), FALSE);
SetWindowPos(m_hWnd, HWND_TOPMOST, rc.left, rc.top, rc.GetWidth(), rc.GetHeight() + pMenuRoot->GetInset().bottom + pMenuRoot->GetInset().top, SWP_SHOWWINDOW);
}
示例5: OnNcCalcSize
LRESULT WindowImplBase::OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
LPRECT pRect=NULL;
if ( wParam == TRUE)
{
LPNCCALCSIZE_PARAMS pParam = (LPNCCALCSIZE_PARAMS)lParam;
pRect=&pParam->rgrc[0];
}
else
{
pRect=(LPRECT)lParam;
}
if ( ::IsZoomed(m_hWnd))
{ // 最大化时,计算当前显示器最适合宽高度
MONITORINFO oMonitor = {};
oMonitor.cbSize = sizeof(oMonitor);
::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTONEAREST), &oMonitor);
CDuiRect rcWork = oMonitor.rcWork;
CDuiRect rcMonitor = oMonitor.rcMonitor;
rcWork.Offset(-oMonitor.rcMonitor.left, -oMonitor.rcMonitor.top);
pRect->right = pRect->left + rcWork.GetWidth();
pRect->bottom = pRect->top + rcWork.GetHeight();
return WVR_REDRAW;
}
return 0;
}
示例6: OnGetMinMaxInfo
LRESULT WindowImplBase::OnGetMinMaxInfo(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
LPMINMAXINFO lpMMI = (LPMINMAXINFO) lParam;
MONITORINFO oMonitor = {};
oMonitor.cbSize = sizeof(oMonitor);
::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTONEAREST), &oMonitor);
CDuiRect rcWork = oMonitor.rcWork;
CDuiRect rcMonitor = oMonitor.rcMonitor;
rcWork.Offset(-oMonitor.rcMonitor.left, -oMonitor.rcMonitor.top);
// 计算最大化时,正确的原点坐标
lpMMI->ptMaxPosition.x = rcWork.left;
lpMMI->ptMaxPosition.y = rcWork.top;
lpMMI->ptMaxTrackSize.x = lpMMI->ptMaxSize.x = rcWork.GetWidth();
lpMMI->ptMaxTrackSize.y = lpMMI->ptMaxSize.y = rcWork.GetHeight();
if (m_PaintManager.GetMaxInfo().cx != 0) {
lpMMI->ptMaxTrackSize.x = lpMMI->ptMaxSize.x = m_PaintManager.GetMaxInfo().cx;
}
if (m_PaintManager.GetMaxInfo().cy != 0) {
lpMMI->ptMaxTrackSize.y = lpMMI->ptMaxSize.y = m_PaintManager.GetMaxInfo().cy;
}
lpMMI->ptMinTrackSize.x =m_PaintManager.GetMinInfo().cx;
lpMMI->ptMinTrackSize.y =m_PaintManager.GetMinInfo().cy;
bHandled = TRUE;
return 0;
}
示例7: CreateTransColorRgn
HRGN CreateTransColorRgn(HDC dc,HWND hwnd,COLORREF TransColor)
{
COLORREF cl;
CDuiRect cRect;
HRGN wndRgn;
::GetWindowRect(hwnd,&cRect);
wndRgn = ::CreateRectRgn(0,0,cRect.GetWidth(),cRect.GetHeight());
for(int x = 0,len = cRect.GetWidth(); x <= len; x++)
{
int y1,y2;
int height = cRect.GetHeight();
for(y1 = 0; y1 <=height; y1++)
{
cl = ::GetPixel(dc,x,y1);
if(cl == TransColor)
{
HRGN rgnTemp = ::CreateRectRgn(x, y1, x+1, y1+1);
::CombineRgn(wndRgn,wndRgn,rgnTemp,RGN_XOR);
::DeleteObject(rgnTemp);
}
else
{
break;
}
}
for(y2 = height-1; y2 >= y1; y2--)
{
cl = ::GetPixel(dc,x, y2);
if(cl == TransColor)
{
HRGN rgnTemp = ::CreateRectRgn(x, y2, x+1, y2+1);
::CombineRgn(wndRgn,wndRgn,rgnTemp, RGN_XOR);
::DeleteObject(rgnTemp);
}
else
{
break;
}
}
}
return wndRgn;
}
示例8: OnSize
LRESULT CWkeWebkitWnd::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
CDuiRect rcWnd;
::GetWindowRect(*this, &rcWnd);
m_pWebView->resize(rcWnd.GetWidth(), rcWnd.GetHeight());
m_pWebView->tick();
::InvalidateRect(m_hWnd, NULL, FALSE);
return 0;
}
示例9: AdjustPostion
void CMenuWnd::AdjustPostion()
{
CDuiRect rcWnd;
GetWindowRect(m_hWnd, &rcWnd);
int nWidth = rcWnd.GetWidth();
int nHeight = rcWnd.GetHeight();
rcWnd.left = m_ptPos.x;
rcWnd.top = m_ptPos.y;
rcWnd.right = rcWnd.left + nWidth;
rcWnd.bottom = rcWnd.top + nHeight;
MONITORINFO oMonitor = {};
oMonitor.cbSize = sizeof(oMonitor);
::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTOPRIMARY), &oMonitor);
CDuiRect rcWork = oMonitor.rcWork;
if( rcWnd.bottom > rcWork.bottom ) {
if( nHeight >= rcWork.GetHeight() ) {
rcWnd.top = 0;
rcWnd.bottom = nHeight;
}
else {
rcWnd.bottom = rcWork.bottom;
rcWnd.top = rcWnd.bottom - nHeight;
}
}
if( rcWnd.right > rcWork.right ) {
if( nWidth >= rcWork.GetWidth() ) {
rcWnd.left = 0;
rcWnd.right = nWidth;
}
else {
rcWnd.right = rcWork.right;
rcWnd.left = rcWnd.right - nWidth;
}
}
::SetWindowPos(m_hWnd, NULL, rcWnd.left, rcWnd.top, rcWnd.GetWidth(), rcWnd.GetHeight(), SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
}
示例10: FullScreen
void CWindowWnd::FullScreen()
{
::GetClientRect(m_hWnd,&m_RestoreRect);
CPoint point;
::ClientToScreen(m_hWnd,&point);
m_RestoreRect.left=point.x;
m_RestoreRect.top=point.y;
m_RestoreRect.right+=point.x;
m_RestoreRect.bottom+=point.y;
MONITORINFO oMonitor = {};
oMonitor.cbSize = sizeof(oMonitor);
::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTONEAREST), &oMonitor);
CDuiRect rcWork = oMonitor.rcWork;
::SetWindowPos( m_hWnd, NULL, rcWork.left, rcWork.top, rcWork.GetWidth(), rcWork.GetHeight(), SWP_SHOWWINDOW | SWP_NOZORDER );
}
示例11: OnGetMinMaxInfo
LRESULT WindowImplBase::OnGetMinMaxInfo(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
MONITORINFO oMonitor = {};
oMonitor.cbSize = sizeof(oMonitor);
::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTOPRIMARY), &oMonitor);
CDuiRect rcWork = oMonitor.rcWork;
rcWork.Offset(-oMonitor.rcMonitor.left, -oMonitor.rcMonitor.top);
LPMINMAXINFO lpMMI = (LPMINMAXINFO) lParam;
lpMMI->ptMaxPosition.x = rcWork.left;
lpMMI->ptMaxPosition.y = rcWork.top;
lpMMI->ptMaxSize.x = rcWork.GetWidth();
lpMMI->ptMaxSize.y = rcWork.GetHeight();
bHandled = FALSE;
return 0;
}
示例12: MoveWindowToPoint
BOOL CWin::MoveWindowToPoint(LPPOINT lpPoint)
{
assert(lpPoint);
assert(::IsWindow(m_hWnd));
RECT rcWnd;
GetWindowRect(&rcWnd);
const int nWidth = rcWnd.right - rcWnd.left;
const int nHeight = rcWnd.bottom - rcWnd.top;
rcWnd.left = lpPoint->x;
rcWnd.top = lpPoint->y;
rcWnd.right = rcWnd.left + nWidth;
rcWnd.bottom = rcWnd.top + nHeight;
MONITORINFO oMonitor = {0};
oMonitor.cbSize = sizeof(oMonitor);
::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTOPRIMARY), &oMonitor);
CDuiRect rcWork = oMonitor.rcWork;
if( rcWnd.bottom > rcWork.bottom ) {
if( nHeight >= rcWork.GetHeight() ) {
rcWnd.top = 0;
rcWnd.bottom = nHeight;
}
else {
rcWnd.bottom = lpPoint->y;//rcWork.bottom;
rcWnd.top = rcWnd.bottom - nHeight;
}
}
if( rcWnd.right > rcWork.right ) {
if( nWidth >= rcWork.GetWidth() ) {
rcWnd.left = 0;
rcWnd.right = nWidth;
}
else {
rcWnd.right = lpPoint->x;//rcWork.right;
rcWnd.left = rcWnd.right - nWidth;
}
}
return SetWindowPos(NULL,&rcWnd,SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
}
示例13: AdjustWindow
void CInfoWindow::AdjustWindow(HWND hparent,POINT pt)
{
if(hparent)
::ClientToScreen(hparent,&pt);
CDuiRect rtWnd;
GetWindowRect(&rtWnd);
const int nWidth = rtWnd.GetWidth();
const int nHeight = rtWnd.GetHeight();
rtWnd.left = pt.x;
rtWnd.right = rtWnd.left + nWidth;
rtWnd.bottom = pt.y;// - _ptOffsize.cy;
rtWnd.top = rtWnd.bottom - nHeight;
SetWindowPos(HWND_TOPMOST,&rtWnd,0);
// {
// CDuiRect rect;
// GetWindowRect(&rect);
// HDC dc = ::GetDC(m_hWnd);
// HDC memdc = ::CreateCompatibleDC(dc);
// COLORREF clr = RGB(255,0,255);
// COLORREF clrOld = ::SetBkColor(memdc, clr);
// ASSERT(clrOld != CLR_INVALID);
// if(clrOld != CLR_INVALID)
// {
// ::ExtTextOut(memdc, 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL);
// ::SetBkColor(memdc, clrOld);
// }
// VERIFY(CRenderEngine::DrawImageString(memdc,GetPaintMgr(),rect,rect,GetPaintMgr()->GetRoot()->GetBkImage()));
// HRGN hrgn = CreateTransColorRgn(memdc,m_hWnd,clr);
// ASSERT(hrgn);
// ::SetWindowRgn(m_hWnd,hrgn, true);
// ::DeleteObject(hrgn);
// ::DeleteDC(memdc);
// ::ReleaseDC(m_hWnd,dc);
// }
Invalidate(FALSE);
}
示例14: SetPos
void CControlUI::SetPos(const CDuiRect& rc)
{
m_rcItem = rc;
if(m_rcItem.right < m_rcItem.left) m_rcItem.right = m_rcItem.left;
if(m_rcItem.bottom< m_rcItem.top) m_rcItem.bottom = m_rcItem.top;
SIZE tmpsz = {m_rcItem.GetWidth(), m_rcItem.GetHeight()};
SetPostSize(tmpsz);
if(!IsWindow(m_hWnd) || m_rcItem.IsNull())
return;
CDuiRect rct = m_rcItem;
rct = m_rcItem;
rct.left += m_rcInset.left;
rct.top += m_rcInset.top;
rct.right -= m_rcInset.right;
rct.bottom -= m_rcInset.bottom;
::SetWindowPos(m_hWnd, 0, rct.left, rct.top, rct.GetWidth(), rct.GetHeight(), SWP_NOZORDER);
}
示例15: SetPos
void CSysComboUI::SetPos(RECT rc)
{
__super::SetPos(rc);
CDuiRect r = GetPos();
::SetWindowPos(*m_pWnd,0,r.left, r.top, r.GetWidth(), r.GetHeight(), SWP_NOZORDER | ::IsWindowVisible(*m_pWnd)?SWP_SHOWWINDOW:SWP_HIDEWINDOW);
}