• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetMetrics函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetMetrics函数的典型用法代码示例。如果您正苦于以下问题:C++ GetMetrics函数的具体用法?C++ GetMetrics怎么用?C++ GetMetrics使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetMetrics函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: rc

void CXTPSkinObjectTab::DrawTab(CDC* pDC, int iItem)
{
	CXTPClientRect rc(this);
	CTabCtrl* pTabCtrl = (CTabCtrl*)this;

	// Get the current tab selection.
	int iCurSel = pTabCtrl->GetCurSel();

	// Get the tab item size.
	CRect rcItem;
	pTabCtrl->GetItemRect(iItem, &rcItem);

	if (!CRect().IntersectRect(rcItem, rc))
		return;

	CRect rcItemFocus(rcItem);

	// Draw the tab item.
	BOOL bSelected = (iItem == iCurSel);
	FillTabFace(pDC, rcItem, iItem, pTabCtrl->GetItemCount(), bSelected);
	DrawTabIcon(pDC, rcItem, iItem);
	DrawTabText(pDC, rcItem, iItem, iItem, bSelected);

	// draw the focus rect
	if (bSelected && ::GetFocus() == m_hWnd && (SendMessage(WM_QUERYUISTATE) & UISF_HIDEFOCUS) == 0)
	{
		rcItemFocus.DeflateRect(GetMetrics()->m_cxEdge / 2, GetMetrics()->m_cyEdge / 2);
		pDC->DrawFocusRect(&rcItemFocus);
	}
}
开发者ID:killbug2004,项目名称:ghost2013,代码行数:30,代码来源:XTPSkinObjectTab.cpp


示例2: ROUND_TO_TWIPS

NS_IMETHODIMP
nsThebesFontMetrics::GetStrikeout(nscoord& aOffset, nscoord& aSize)
{
    aOffset = ROUND_TO_TWIPS(GetMetrics().strikeoutOffset);
    aSize = ROUND_TO_TWIPS(GetMetrics().strikeoutSize);
    return NS_OK;
}
开发者ID:PolyMtl,项目名称:crash-inducing,代码行数:7,代码来源:00148b3ae7d11b330a1f77f1e7520fcb2a396881.cpp


示例3: GetColor

BOOL CXTPSkinObjectFrame::OnHookDefWindowProc(UINT nMessage, WPARAM& wParam, LPARAM& lParam, LRESULT& lResult)
{
    if (nMessage == WM_CTLCOLORBTN || nMessage == WM_CTLCOLORDLG ||
            nMessage == WM_CTLCOLORSTATIC || nMessage == WM_CTLCOLOREDIT || nMessage == WM_CTLCOLORLISTBOX)
    {
        if (m_strClassName == _T("COMBOBOX"))
            return FALSE;

        if (nMessage == WM_CTLCOLOREDIT || nMessage == WM_CTLCOLORLISTBOX)
        {
            ::SetBkColor((HDC)wParam, GetColor(COLOR_WINDOW));
            ::SetTextColor((HDC)wParam, GetColor(COLOR_WINDOWTEXT));
            lResult = (LRESULT)GetMetrics()->m_brushWindow;
            return TRUE;
        }

        if (CWnd::GrayCtlColor((HDC)wParam, (HWND)lParam,
                               (UINT)(nMessage - WM_CTLCOLORMSGBOX),
                               GetMetrics()->m_brushDialog, 0))
        {
            lResult = (LRESULT)GetClientBrush((HDC)wParam, (HWND)lParam, (UINT)(nMessage - WM_CTLCOLORMSGBOX));
            return TRUE;
        }
    }

    return CXTPSkinObject::OnHookDefWindowProc(nMessage, wParam, lParam, lResult);
}
开发者ID:ylyking,项目名称:ThisIsASoftRenderer,代码行数:27,代码来源:XTPSkinObjectFrame.cpp


示例4: rcChild

BOOL CXTPSkinObjectFrame::IsSizeBox()
{
    HWND hWnd = m_hWnd;
    CXTPWindowRect rcChild(hWnd);

    int cxEdge = GetMetrics()->m_cxEdge;
    int cyEdge = GetMetrics()->m_cyEdge;

    while (hWnd)
    {
        if (GetWindowLong(hWnd, GWL_STYLE) & WS_SIZEBOX)
        {
            if ((GetWindowLong(hWnd, GWL_STYLE) & WS_MAXIMIZE))
                return FALSE;

            CPoint ptParent = CXTPClientRect(hWnd).BottomRight();
            ::ClientToScreen(hWnd, &ptParent);

            if ((rcChild.right + cxEdge < ptParent.x) ||
                    (rcChild.bottom + cyEdge < ptParent.y))
            {
                return FALSE;
            }

            return hWnd ? TRUE : FALSE;
        }

        if (((GetWindowLong(hWnd, GWL_STYLE) & WS_CHILD) == 0) || ((GetWindowLong(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION))
            break;

        hWnd = ::GetParent(hWnd);
    }

    return FALSE;
}
开发者ID:ylyking,项目名称:ThisIsASoftRenderer,代码行数:35,代码来源:XTPSkinObjectFrame.cpp


示例5: CEIL_TO_TWIPS

NS_IMETHODIMP
nsThebesFontMetrics::GetMaxHeight(nscoord &aHeight)
{
    aHeight = CEIL_TO_TWIPS(ComputeMaxAscent(GetMetrics())) +
        CEIL_TO_TWIPS(ComputeMaxDescent(GetMetrics(), mFontGroup));
    return NS_OK;
}
开发者ID:PolyMtl,项目名称:crash-inducing,代码行数:7,代码来源:00148b3ae7d11b330a1f77f1e7520fcb2a396881.cpp


示例6: GetMetrics

int CZipBitmap::GetWidth()
{
    if (!m_iWidth)
        GetMetrics();

    return m_iWidth;
}
开发者ID:cgestes,项目名称:multifxvst,代码行数:7,代码来源:ZipBitmap.cpp


示例7: GetMetrics

void LabelElement::Render() {
	auto m = GetMetrics();
	auto gui = GUI::Get();
	auto textProgram = ShaderRegistry::GetProgram("text");

	textProgram->Use();
	gui->camera->SetUniforms(textProgram.get());
	
	glUniform4f(textProgram->GetUniform("color"), 1,1,1, 1);

	auto size = m->topRight - m->bottomLeft;

	auto scalexy = size/textMesh->size;
	auto scale = std::min(scalexy.x, scalexy.y);
	auto tmbl = m->bottomLeft + vec2{0, textMesh->size.y * scalexy.y};

	Debug::PointUI(m->topRight);
	Debug::PointUI(m->bottomLeft);
	Debug::PointUI(m->bottomLeft + vec2{0, textMesh->size.y * scale}, vec3{1,1,0});

	Debug::PointUI(tmbl, vec3{1,0,0});
	Debug::PointUI(tmbl + textMesh->size * vec2{1,-1} * scale, vec3{0,1,0});
	Debug::PointUI(tmbl + textMesh->size * vec2{1,-1} * scale * .5f, vec3{0,0,1});

	textMesh->modelMatrix = 
		glm::translate(vec3{tmbl, 0}) *
		glm::scale(vec3{scale});

	textMesh->Render();
}
开发者ID:manpat,项目名称:vox,代码行数:30,代码来源:label.cpp


示例8: GetMetrics

HBRUSH CXTPSkinObjectFrame::FillBackground(CDC* pDC, LPCRECT lprc, int nMessage /*= WM_CTLCOLORSTATIC*/)
{
    HBRUSH hBrush = ::GetParent(m_hWnd) ? (HBRUSH)::SendMessage(::GetParent(m_hWnd), nMessage, (WPARAM)pDC->GetSafeHdc(), (LRESULT)m_hWnd) : NULL;
    if (hBrush)
    {
        if ((DWORD_PTR)hBrush < XTP_SKINMETRICS_COLORTABLESIZE)
        {
            hBrush = GetMetrics()->m_brTheme[(DWORD_PTR)hBrush - 1];
        }
        ::FillRect(pDC->GetSafeHdc(), lprc, hBrush);
        return hBrush;
    }

    pDC->FillSolidRect(lprc, GetColor(COLOR_3DFACE));
    return GetMetrics()->m_brTheme[COLOR_3DFACE];
}
开发者ID:ylyking,项目名称:ThisIsASoftRenderer,代码行数:16,代码来源:XTPSkinObjectFrame.cpp


示例9: GetClientRect

CRect CXTPSkinObjectTab::GetHeaderRect()
{
	CRect rcHeader;
	GetClientRect(&rcHeader);

	CTabCtrl* pTabCtrl = (CTabCtrl*)this;

	// get the selected tab item rect.
	CRect rcItem;
	pTabCtrl->GetItemRect(pTabCtrl->GetCurSel(), &rcItem);

	DWORD dwStyle = GetStyle();

	if (IsRight(dwStyle))
	{
		rcHeader.left = rcItem.left;
	}
	else if (IsLeft(dwStyle))
	{
		rcHeader.right = rcItem.right;
	}
	else if (IsBottom(dwStyle))
	{
		rcHeader.top = rcItem.top;
	}
	else
	{
		rcHeader.bottom = (rcHeader.top + rcItem.Height()) * pTabCtrl->GetRowCount() + GetMetrics()->m_cyEdge;
	}
	return rcHeader;
}
开发者ID:killbug2004,项目名称:ghost2013,代码行数:31,代码来源:XTPSkinObjectTab.cpp


示例10: GetMetrics

BOOL CXTPSkinObjectToolBar::OnEraseBkgnd(CDC* pDC)
{
	if (GetStyle() & (TBSTYLE_TRANSPARENT | TBSTYLE_CUSTOMERASE))
	{
		return CXTPSkinObjectFrame::OnEraseBkgnd(pDC);
	}

	HBRUSH hbr = (HBRUSH)(DWORD_PTR)GetClassLongPtr(m_hWnd, GCLP_HBRBACKGROUND);
	BOOL bChanged = FALSE;

	if (hbr > 0 && (ULONG_PTR)hbr < (ULONG_PTR)XTP_SKINMETRICS_COLORTABLESIZE)
	{
		HBRUSH hbrTheme = GetMetrics()->m_brTheme[(ULONG_PTR)hbr - 1];
		SetClassLongPtr(m_hWnd, GCLP_HBRBACKGROUND, (LONG_PTR)hbrTheme);
		bChanged = TRUE;
	}

	BOOL bResult =  (BOOL)::DefWindowProc(m_hWnd, WM_ERASEBKGND, (WPARAM)pDC->GetSafeHdc(), 0);

	if (bChanged)
	{
		SetClassLongPtr(m_hWnd, GCLP_HBRBACKGROUND, (LONG_PTR)hbr);
	}
	return bResult;
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:25,代码来源:XTPSkinObjectToolBar.cpp


示例11: GetMetrics

void ButtonElement::Update() {
	auto gui = GUI::Get();
	auto b = &gui->builder;
	auto m = GetMetrics();

	b->depth = m->depth;
	b->Add9Slice(m->bottomLeft, m->topRight, slice, buttonSize, 3.f);
}
开发者ID:manpat,项目名称:vox,代码行数:8,代码来源:button.cpp


示例12: GetMetrics

int32_t
nsFontMetrics::GetMaxStringLength()
{
    const gfxFont::Metrics& m = GetMetrics();
    const double x = 32767.0 / m.maxAdvance;
    int32_t len = (int32_t)floor(x);
    return std::max(1, len);
}
开发者ID:logicoftekk,项目名称:cyberfox,代码行数:8,代码来源:nsFontMetrics.cpp


示例13: NS_ASSERTION

// Get the glyphID of a space
PRUint32
gfxFT2FontBase::GetSpaceGlyph()
{
    NS_ASSERTION(GetStyle()->size != 0,
                 "forgot to short-circuit a text run with zero-sized font?");
    GetMetrics();
    return mSpaceGlyph;
}
开发者ID:typ4rk,项目名称:mozilla-history,代码行数:9,代码来源:gfxFT2FontBase.cpp


示例14: calcBaselineAscent

float RenderDevice::calcBaselineAscent(const std::wstring& key)
{
	auto pFont = this->getStockedFont(key);
	if (pFont == nullptr) return 0;

	DWRITE_FONT_METRICS metrics;
	pFont->GetMetrics(&metrics);
	return metrics.ascent;
}
开发者ID:Pctg-x8,项目名称:ChartForge,代码行数:9,代码来源:renderDevice.cpp


示例15: GetMetrics

void TelegrafSocket::SendMetrics()
{
	ServerInstance->Logs->Log("TELEGRAF", DEBUG, "Sending Telegraf Metrics..");
	TelegrafLine line = GetMetrics();
	creator->metrics.loopTimes.clear();
	creator->metrics.loopTimes.reserve(10);
	std::string out(line.format());
	WriteData(out);
	ServerInstance->Logs->Log("TELEGRAF", DEBUG, "Sent Telegraf metrics: %s", out.c_str());
}
开发者ID:snoonetIRC,项目名称:inspircd-modules,代码行数:10,代码来源:m_telegraf.cpp


示例16: GetSchema

void CXTPSkinObjectFrame::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp)
{
    if (IsFlatScrollBarInitialized())
    {
        m_spi[SB_VERT].fVisible = FALSE;
        m_spi[SB_HORZ].fVisible = FALSE;
        CXTPSkinObject::OnNcCalcSize(bCalcValidRects, lpncsp);
        return;
    }

    m_rcBorders = GetSchema()->CalcFrameBorders(this);

    lpncsp[0].rgrc->top += m_rcBorders.top;
    lpncsp[0].rgrc->left += m_rcBorders.left;
    lpncsp[0].rgrc->right -= m_rcBorders.right;
    lpncsp[0].rgrc->bottom -= m_rcBorders.bottom;

    DWORD dwStyle = GetStyle();

    m_spi[SB_VERT].fVisible = dwStyle & WS_VSCROLL;
    m_spi[SB_HORZ].fVisible = dwStyle & WS_HSCROLL;


    if (m_spi[SB_VERT].fVisible)
    {
        if (GetExStyle() & (WS_EX_LAYOUTRTL | WS_EX_LEFTSCROLLBAR))
            lpncsp[0].rgrc->left += GetMetrics()->m_cxVScroll;
        else
            lpncsp[0].rgrc->right -= GetMetrics()->m_cxVScroll;
    }

    if (m_spi[SB_HORZ].fVisible)
    {
        lpncsp[0].rgrc->bottom -= GetMetrics()->m_cyHScroll;
    }

    if (lpncsp[0].rgrc->bottom < lpncsp[0].rgrc->top)
        lpncsp[0].rgrc->bottom = lpncsp[0].rgrc->top;

    if (lpncsp[0].rgrc->right < lpncsp[0].rgrc->left)
        lpncsp[0].rgrc->right = lpncsp[0].rgrc->left;
}
开发者ID:ylyking,项目名称:ThisIsASoftRenderer,代码行数:42,代码来源:XTPSkinObjectFrame.cpp


示例17: CEIL_TO_TWIPS

nscoord
nsFontMetrics::SpaceWidth()
{
    // For vertical text with mixed or sideways orientation, we want the
    // width of a horizontal space (even if we're using vertical line-spacing
    // metrics, as with "writing-mode:vertical-*;text-orientation:mixed").
    return CEIL_TO_TWIPS(
        GetMetrics(mVertical &&
                   mTextOrientation == NS_STYLE_TEXT_ORIENTATION_UPRIGHT
                       ? gfxFont::eVertical
                       : gfxFont::eHorizontal).spaceWidth);
}
开发者ID:logicoftekk,项目名称:cyberfox,代码行数:12,代码来源:nsFontMetrics.cpp


示例18: GetMetrics

//----------------------------- FUNCTION -------------------------------------*
int
    CTransBmp::GetHeight()
/*>>>> 

Result
  height of bitmap
<<<<*/
{
    if ((m_iWidth == 0) || (m_iHeight == 0)){
        GetMetrics();
    }
    return m_iHeight;
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:14,代码来源:ToolBox.cpp


示例19: sizeof

void CXTPSkinObjectTab::DrawTabIcon(CDC* pDC, CRect& rcItem, int iItem)
{
	CTabCtrl* pTabCtrl = (CTabCtrl*)this;

	TC_ITEM tci;
	tci.mask = TCIF_IMAGE;

	BOOL bResult = pTabCtrl->GetItem(iItem, &tci);

#ifdef _UNICODE
	if (!bResult)
	{
		TC_ITEMA tcia;
		::ZeroMemory(&tcia, sizeof(TC_ITEMA));

		tcia.mask = TCIF_IMAGE;

		bResult = (BOOL)::SendMessage(pTabCtrl->m_hWnd, TCM_GETITEMA, iItem, (LPARAM)&tcia);
		tci.iImage = tcia.iImage;
	}
#endif
	if (!bResult)
		return;

	CImageList* pImageList = pTabCtrl->GetImageList();
	if (!pImageList || tci.iImage < 0)
		return;

	CPoint point = rcItem.TopLeft();

	DWORD dwStyle = GetStyle();

	if (IsHorz(dwStyle))
	{
		point.Offset(GetMetrics()->m_cxEdge * 2, IsTop(dwStyle) ? GetMetrics()->m_cyEdge : 1);
	}
	else
	{
		point.Offset(IsLeft(dwStyle) ? GetMetrics()->m_cxEdge : 1, GetMetrics()->m_cyEdge * 2);
	}

	// Draw any associated icons.
	pImageList->Draw(pDC, tci.iImage, point, ILD_TRANSPARENT);

	IMAGEINFO info;
	::ZeroMemory(&info, sizeof(info));

	pImageList->GetImageInfo(tci.iImage, &info);
	CRect rcImage(info.rcImage);

	if (IsHorz(dwStyle))
	{
		rcItem.left += rcImage.Width() + GetMetrics()->m_cxEdge;
	}
	else
	{
		rcItem.top += rcImage.Height() + GetMetrics()->m_cyEdge;
	}
}
开发者ID:killbug2004,项目名称:ghost2013,代码行数:59,代码来源:XTPSkinObjectTab.cpp


示例20: gtk_notebook_get_current_page

void
on_diagnostic_button_clicked           (GtkToolButton   *toolbutton,
                                        gpointer         user_data)
{
	GtkNotebook* notebook = (GtkNotebook*)lookup_widget(main_window, "notebook1");
	int n = gtk_notebook_get_current_page (notebook);
	if(n!=2)
		gtk_notebook_set_current_page(notebook, 2);
// this is because of the TODO a few lines above
//	else
//		gtk_notebook_set_current_page(notebook, my_mode-1);
	GetMetrics();
}
开发者ID:zipleen,项目名称:really-old-crap-from-cvs,代码行数:13,代码来源:callbacks.c



注:本文中的GetMetrics函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetMine函数代码示例发布时间:2022-05-30
下一篇:
C++ GetMethodID函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap