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

C++ GetTotalSize函数代码示例

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

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



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

示例1: GetTotalSize

void CStartupView::CalculateBkgRects(Gdiplus::RectF &gdipRcLeft, 
      Gdiplus::RectF &gdipRcMiddle, 
      Gdiplus::RectF &gdipRcRight,
      Gdiplus::REAL &y, float fHeight)
{
   CSize siTotal = GetTotalSize();
   CRect rcClient(0, 0, siTotal.cx, siTotal.cy);

   int iLeft = 6;
   int iLeftOffset = 4;
   int iRight = 13;
   int iMiddle = rcClient.Width() - iLeft - iRight;
   
   gdipRcLeft.X = rcClient.left + iLeftOffset;
   gdipRcLeft.Y = rcClient.top + y;
   gdipRcLeft.Width = iLeft;
   gdipRcLeft.Height = fHeight;

   gdipRcMiddle.X = rcClient.left + iLeft + iLeftOffset;
   gdipRcMiddle.Y = rcClient.top + y;
   gdipRcMiddle.Width = iMiddle;
   gdipRcMiddle.Height = fHeight;

   gdipRcRight.X = rcClient.left + iLeft + iMiddle + iLeftOffset;
   gdipRcRight.Y = rcClient.top + y;
   gdipRcRight.Width = iRight;
   gdipRcRight.Height = fHeight;

   y += fHeight;
}
开发者ID:identity0815,项目名称:os45,代码行数:30,代码来源:StartupView.cpp


示例2: OnMouseWheel

BOOL CSpermView::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt) 
{
	// TODO: Add your message handler code here and/or call default

	CSize sz1=GetTotalSize();
	CRect rect;
	GetClientRect(rect);
	CSize sz2(rect.Width(),rect.Height());
	if(sz1.cy<sz2.cy)
		return CScrollView::OnMouseWheel(nFlags, zDelta, pt);;
	SCROLLINFO si;
	zDelta =  -zDelta;
	GetScrollInfo(SB_VERT,&si);
	si.nPos += zDelta/12;
	SetScrollInfo(SB_VERT,&si);


	CPoint sp=GetScrollPosition();
	CRect rc;
	GetClientRect(rc);
	CDC* pDC=GetDC();
	rc.bottom+=sp.y;
	rc.right+=sp.x;
	pDC->SetViewportOrg(-sp);
	DrawMemDCImage(pDC,rc);
	ReleaseDC(pDC);
	return CScrollView::OnMouseWheel(nFlags, zDelta, pt);
}
开发者ID:niepp,项目名称:sperm-x,代码行数:28,代码来源:SpermView.cpp


示例3: Compile

BOOL CResPacker::Compile(PVOID output, UINT buff_size, PUINT pcomp_size)
{
	std::list<_ResFrame>::iterator it = _res.begin();
	DWORD offset = 0;

	*pcomp_size = GetTotalSize();
	if (*pcomp_size > buff_size) {
		return false;
	}

	while (it != _res.end()) {
		*(UINT *)((UINT)output + offset) = it->id;
		offset += sizeof(UINT);

		*(UINT *)((UINT)output + offset) = it->size;
		offset += sizeof(UINT);

		memcpy((PVOID)((UINT)output + offset), it->pdata, it->size);
		offset += it->size;

		it++;
	}

	return true;
}
开发者ID:JKornev,项目名称:DLib-Attacher,代码行数:25,代码来源:ResPacker.cpp


示例4: GetParentFrame

void CPrime95View::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
	CFrameWnd *parent;
	CSize	sz;
	CPoint	pos;
	int	new_scroll_height, new_scroll_width;

	parent = GetParentFrame();

	if (parent != NULL) {

		if (charHeight == 0) getCharSize ();

		sz = GetTotalSize ();

		new_scroll_height = NumLines * charHeight;
		new_scroll_width = MaxLineSize * charWidth;

		pos = GetScrollPosition ();
		pos.y += (new_scroll_height - sz.cy);
		if (pos.y < 0) pos.y = 0;
		sz.cx = new_scroll_width;
		sz.cy = new_scroll_height;
		SetScrollSizes (MM_TEXT, sz);
		ScrollToPosition (pos);
		parent->RecalcLayout ();
	}

	CScrollView::OnUpdate (pSender, lHint, pHint);
}
开发者ID:irukasti,项目名称:mprime,代码行数:30,代码来源:Prime95View.cpp


示例5: ReqSplit_cmd

trap_retval ReqSplit_cmd( void )
{
    char                *cmd;
    char                *start;
    split_cmd_ret       *ret;
    unsigned            len;

    cmd = GetInPtr( sizeof( split_cmd_req ) );
    ret = GetOutPtr( 0 );
    ret->parm_start = 0;
    start = cmd;
    len = GetTotalSize() - sizeof( split_cmd_req );
    while( len != 0 ) {
        switch( *cmd ) {
        case '\0':
        case ' ':
        case '\t':
            ret->parm_start = 1;
            len = 0;
            continue;
        }
        ++cmd;
        --len;
    }
    ret->parm_start += cmd - start;
    ret->cmd_end = cmd - start;
    CONV_LE_16( ret->cmd_end );
    CONV_LE_16( ret->parm_start );
    return( sizeof( *ret ) );
}
开发者ID:pavanvunnava,项目名称:open-watcom-v2,代码行数:30,代码来源:coremisc.c


示例6: GetCompartmentCount

void
JPartition::PTBoundsChanged()
{
	const JSize compartmentCount = GetCompartmentCount();
	JCoordinate delta = GetTotalSize() - kDragRegionSize * (compartmentCount-1);
	for (JIndex i=1; i<=compartmentCount; i++)
		{
		delta -= GetCompartmentSize(i);
		}

	if (delta != 0)
		{
		JArray<JCoordinate> newSizes;
		if (delta > 0)
			{
			FillSpace(*itsSizes, itsElasticIndex, delta, &newSizes);
			}
		else if (delta < 0)
			{
			JCoordinate trueDelta;
			const JBoolean ok = CreateSpace(*itsSizes, *itsMinSizes, itsElasticIndex,
											-delta, -delta, &newSizes, &trueDelta);
			assert( ok );
			}
		*itsSizes = newSizes;
		SetCompartmentSizes();
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:28,代码来源:JPartition.cpp


示例7: Input

/******************************************************************************
  Function Name    :  OnUpdate

  Input(s)         :  CView* pSender, LPARAM lHint, CObject* pHint
  Output           :  -
  Functionality    :  Called by the frame work to update the view.
                      Scrolls to the position, for any changes in the
                      view.
  Member of        :  CFileView
  Friend of        :      -

  Author(s)        :  Amarnath Shastry
  Date Created     :  05.03.2002
******************************************************************************/
void CFileView::OnUpdate(CView* /*pSender*/, LPARAM /*lHint*/, CObject* /*pHint*/)
{
    CSize omDocSize;

    // Set SCROLL Sizes
    CFunctionEditorDoc* pomDoc = omGetDocument();

    // Get Character Height & Width
    CClientDC omDeviceContext(this);

    m_nCharHeight = GET_FILE_VIEW_CHAR_HEIGHT();
    m_nCharWidth  = GET_FILE_VIEW_CHAR_WIDTH();


    if(pomDoc != nullptr)
    {
        omDocSize.cx  =  ((pomDoc -> nGetMaxLineLength() + 1) * m_nCharWidth);
        omDocSize.cy  =  m_nCharHeight * ((pomDoc -> dwGetLineCount() + 1) +
                                          SPACE_BET_LINE_IN_FILE_VIEW);
        if( GetTotalSize() != omDocSize)
        {
            SetScrollSizes(MM_TEXT, omDocSize);
        }
    }

    // refresh the view
    Invalidate(TRUE);
}
开发者ID:BlackVodka,项目名称:busmaster,代码行数:42,代码来源:FileView.cpp


示例8: GetTotalSize

	void VScrollTemplate::OnHandleMouseUp(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiMouseEventArgs& arguments)
	{
		if (draggingHandle)
		{
			vint totalPixels = handle->GetParent()->GetBounds().Height();
			vint currentOffset = handle->GetBounds().Top();
			vint newOffset = currentOffset + (arguments.y - draggingStartLocation.y);
			vint totalSize = GetTotalSize();
			double ratio = (double)newOffset / totalPixels;
			vint newPosition = (vint)(ratio * totalSize);

			vint offset1 = (vint)(((double)newPosition / totalSize) * totalPixels);
			vint offset2 = vint(((double)(newPosition + 1) / totalSize) * totalPixels);
			vint delta1 = abs((int)(offset1 - newOffset));
			vint delta2 = abs((int)(offset2 - newOffset));

			if(delta1 < delta2)
			{
				GetCommands()->SetPosition(newPosition);
			}
			else
			{
				GetCommands()->SetPosition(newPosition + 1);
			}
		}
	}
开发者ID:GitHubLiQuanJi,项目名称:gac,代码行数:26,代码来源:VScrollTemplate.cpp


示例9: GetClientRect

void CResizableFormView::GetTotalClientRect(LPRECT lpRect)
{
	GetClientRect(lpRect);

	// get dialog template's size
	// (this is set in CFormView::Create)
	CSize size = GetTotalSize();

	// before initialization use dialog's size
	if (!m_bInitDone)
	{
		lpRect->right = lpRect->left + size.cx;
		lpRect->bottom = lpRect->top + size.cy;
		return;
	}

	// otherwise, give the correct size if scrollbars active

	if (m_nMapMode < 0)	// scrollbars disabled
		return;

	// enlarge reported client area when needed
	CRect rect(lpRect);
	if (rect.Width() < size.cx)
		rect.right = rect.left + size.cx;
	if (rect.Height() < size.cy)
		rect.bottom = rect.top + size.cy;

	rect.OffsetRect(-GetScrollPosition());
	*lpRect = rect;
}
开发者ID:LjApps,项目名称:eMule-VeryCD,代码行数:31,代码来源:ResizableFormView.cpp


示例10: GetClientRect

void ITxFormView::GetTotalClientRect(LPRECT lpRect)
{
    GetClientRect(lpRect);

    // get scrollable size
    CSize size = GetTotalSize();

    // before initialization, "size" is dialog template size
    if (!m_bInitDone)
    {
        lpRect->right = lpRect->left + size.cx;
        lpRect->bottom = lpRect->top + size.cy;
        return;
    }

    // otherwise, give correct size if scrollbars active

    if (m_nMapMode < 0) // scrollbars disabled
    {
        return;
    }

    // enlarge reported client area when needed
    CRect rect(lpRect);
    if (rect.Width() < size.cx)
    {
        lpRect->right = lpRect->left + size.cx;
    }
    if (rect.Height() < size.cy)
    {
        lpRect->bottom = lpRect->top + size.cy;
    }
}
开发者ID:IXXAT-wucherer,项目名称:busmaster,代码行数:33,代码来源:ITxFormView.cpp


示例11: ReqFile_run_cmd

trap_retval ReqFile_run_cmd( void )
{
    file_run_cmd_ret    *ret;
#if defined(__WINDOWS__)

    ret = GetOutPtr( 0 );
    ret->err = 0;
#else
    bool                chk;
    char                buff[64];
    file_run_cmd_req    *acc;
    unsigned            len;
    tiny_ret_t          rc;

    acc = GetInPtr( 0 );
    len = GetTotalSize() - sizeof( *acc );
    ret = GetOutPtr( 0 );

    chk = CheckPointMem( acc->chk_size, buff );
    rc = Fork( (char *)GetInPtr( sizeof(*acc) ), len );
    ret->err = TINY_ERROR( rc ) ? TINY_INFO( rc ) : 0;
    if( chk ) CheckPointRestore();
#endif
    return( sizeof( *ret ) );
}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:25,代码来源:dosfile.c


示例12: CheckScrollBars

void CStartupView::OnSize(UINT nType, int cx, int cy)
{
   BOOL bHBar, bVBar;
   CheckScrollBars(bHBar, bVBar);
   CScrollView::OnSize(nType, cx, cy);

   int iNewWidth = cx < VIEW_DEFAULT_WIDTH ? VIEW_DEFAULT_WIDTH : cx;
   int iNewHeight = cy < VIEW_DEFAULT_HEIGHT ? VIEW_DEFAULT_HEIGHT : cy;
   
   int nVOffset = 0;
   int nHOffset = 0;
   DWORD dwStyle = AfxGetApp()->GetMainWnd()->GetStyle();
   CRect rcMainWnd;
   AfxGetApp()->GetMainWnd()->GetWindowRect(&rcMainWnd);
   if((dwStyle & WS_MAXIMIZE) != 0 || m_bIsRetFromEditMode)
   {
      nVOffset =  bVBar? 17: 0;
      nHOffset =  bHBar? 17: 0;
   }
   CSize siTotal = GetTotalSize();
   CRect rcClient(0, 0, siTotal.cx, siTotal.cy);

   if (!m_bIsRetFromEditMode || ! m_rcLastMainWndRect.EqualRect(&rcMainWnd)) {
       SetScrollSizes(MM_TEXT, CSize(iNewWidth + nHOffset, iNewHeight + nVOffset));
   } else {
       SetScrollSizes(MM_TEXT, m_szLastSize);
   }

   RepositionButtons();
   UpdateBars();
}
开发者ID:identity0815,项目名称:os45,代码行数:31,代码来源:StartupView.cpp


示例13: sizeOnDisk

Long64_t sizeOnDisk(TBranch *branch, bool inclusive) 
{
   // Return the size on disk on this branch.
   // If 'inclusive' is true, include also the size
   // of all its sub-branches.

   return GetTotalSize(branch, true, inclusive);
}
开发者ID:chunjie-sam-liu,项目名称:genome_resequencing_pipeline,代码行数:8,代码来源:printSizes.C


示例14: GetTotalSize

Long64_t GetTotalSize( TObjArray * branches, bool ondisk ) {
   Long64_t result = 0;
   size_t n = branches->GetEntries();
   for( size_t i = 0; i < n; ++ i ) {
      result += GetTotalSize( dynamic_cast<TBranch*>( branches->At( i ) ), ondisk, true );
      cerr << "After " << branches->At( i )->GetName() << " " << result << endl;
   }
   return result;
}
开发者ID:chunjie-sam-liu,项目名称:genome_resequencing_pipeline,代码行数:9,代码来源:printSizes.C


示例15: GetTotalSize

void CGUIControlGroupList::ValidateOffset()
{
  // calculate how many items we have on this page
  m_totalSize = GetTotalSize();
  // check our m_offset range
  if (m_scroller.GetValue() > m_totalSize - Size())
    m_scroller.SetValue(m_totalSize - Size());
  if (m_scroller.GetValue() < 0) m_scroller.SetValue(0);
}
开发者ID:AWilco,项目名称:xbmc,代码行数:9,代码来源:GUIControlGroupList.cpp


示例16: GetTotalSize

void CAutoPFAView::ZoomDocSize(double scale)//按scale比率放大或缩小图形
{
    CSize szDoc = GetTotalSize();
	m_Scale  *= scale;
	szDoc.cx *= scale;
	szDoc.cy *= scale;
	SetScrollSizes(MM_TEXT,szDoc);
	Invalidate();
}
开发者ID:uesoft,项目名称:AutoPFA,代码行数:9,代码来源:AutoPFAView.cpp


示例17: GetTotalSize

//*******************************************************************************
void CBCGPChartView::AdjustLayout(int nWidth, int nHeight)
{
	if (m_pWndChartCtrl->GetSafeHwnd () != NULL)
	{
		CSize szTotal = GetTotalSize();
		nWidth = max(szTotal.cx, nWidth);
		nHeight = max(szTotal.cy, nHeight);

		int nHorzOffset = -GetScrollPos(SB_HORZ);
		int nVertOffset = -GetScrollPos(SB_VERT);

		if (m_pWndLegendCtrl->GetSafeHwnd () == NULL)
		{
			m_pWndChartCtrl->SetWindowPos (NULL, nHorzOffset, nVertOffset, nWidth, nHeight,
				SWP_NOZORDER | SWP_NOACTIVATE);
		}
		else
		{
			CBCGPSize szLegend = m_pWndLegendCtrl->GetLegend()->GetLegendSize();
			szLegend += CSize(1, 1);

			switch (m_legendPosition)
			{
			case BCGPChartLayout::LP_RIGHT:
			case BCGPChartLayout::LP_TOPRIGHT:
				m_pWndChartCtrl->SetWindowPos (NULL, nHorzOffset, nVertOffset, nWidth - (int)szLegend.cx, nHeight,
					SWP_NOZORDER | SWP_NOACTIVATE);
				m_pWndLegendCtrl->SetWindowPos (NULL, nWidth - (int)szLegend.cx + nHorzOffset, nVertOffset, 
					(int)szLegend.cx, nHeight,SWP_NOZORDER | SWP_NOACTIVATE);
				break;

			case BCGPChartLayout::LP_LEFT:
				m_pWndLegendCtrl->SetWindowPos (NULL, nHorzOffset, nVertOffset, (int)szLegend.cx, nHeight,
					SWP_NOZORDER | SWP_NOACTIVATE);
				m_pWndChartCtrl->SetWindowPos (NULL, (int)szLegend.cx + nHorzOffset, nVertOffset, nWidth - (int)szLegend.cx, nHeight,
					SWP_NOZORDER | SWP_NOACTIVATE);
				break;

			case BCGPChartLayout::LP_TOP:
				m_pWndLegendCtrl->SetWindowPos (NULL, nHorzOffset, nVertOffset, nWidth, (int)szLegend.cy, 
					SWP_NOZORDER | SWP_NOACTIVATE);
				m_pWndChartCtrl->SetWindowPos (NULL, nHorzOffset, (int)szLegend.cy + nVertOffset, nWidth, nHeight - (int)szLegend.cy,
					SWP_NOZORDER | SWP_NOACTIVATE);
				break;

			case BCGPChartLayout::LP_BOTTOM:
				m_pWndChartCtrl->SetWindowPos (NULL, nHorzOffset, nVertOffset, nWidth, nHeight - (int)szLegend.cy, 
					SWP_NOZORDER | SWP_NOACTIVATE);

				m_pWndLegendCtrl->SetWindowPos (NULL, nHorzOffset, nHeight - (int)szLegend.cy + nVertOffset, nWidth, (int)szLegend.cy, 
					SWP_NOZORDER | SWP_NOACTIVATE);
				break;
			}
		}
	}
}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:57,代码来源:BCGPChartView.cpp


示例18: ReqProg_load

trap_retval ReqProg_load( void )
/***************************/
{
    char            *src;
    char            *dst;
    char            *name;
    char            ch;
    prog_load_ret   *ret;
    unsigned        len;
    int             rc;
    char            cmdl[128];

    _DBG1( "AccLoadProg\r\n" );
    ret = GetOutPtr( 0 );
    src = name = GetInPtr( sizeof( prog_load_req ) );
    while( *src++ != '\0' ) {}
    len = GetTotalSize() - ( src - name ) - sizeof( prog_load_req );
    if( len > 126 )
        len = 126;
    dst = cmdl + 1;
    for( ; len > 0; --len ) {
        ch = *src++;
        if( ch == '\0' ) {
            if( len == 1 )
                break;   
            ch = ' ';
        }
        *dst++ = ch;
    }
    *dst = '\0';
    *cmdl = dst - cmdl - 1;
    rc = DebugLoad( name, cmdl );
    _DBG1( "back from debugload - %d\r\n", rc );
    ret->flags = LD_FLAG_IS_BIG | LD_FLAG_IS_PROT | LD_FLAG_DISPLAY_DAMAGED | LD_FLAG_HAVE_RUNTIME_DLLS;
    ret->mod_handle = 0;
    if( rc == 0 ) {
        ret->err = 0;
        ret->task_id = DebugPSP;
        AddModsInfo( name, (epsp_t *)GetModuleHandle( DebugPSP ) );
    } else {
        ret->task_id = 0;
        if( rc == 1 ) {
            ret->err = ERR_ACCESS_DENIED;
        } else if( rc == 2 ) {
            ret->err = ERR_INVALID_FORMAT;
        } else if( rc == 3 ) {
            ret->err = ERR_INSUFFICIENT_MEMORY;
        } else {
            ret->err = rc;
        }
    }
    _DBG1( "done AccLoadProg\r\n" );
    return( sizeof( *ret ) );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:54,代码来源:cwacc.c


示例19: CalculateItemGap

void CGUIControlGroupList::ValidateOffset()
{
  // calculate item gap. this needs to be done
  // before fetching the total size
  CalculateItemGap();
  // calculate how many items we have on this page
  m_totalSize = GetTotalSize();
  // check our m_offset range
  if (m_scroller.GetValue() > m_totalSize - Size())
    m_scroller.SetValue(m_totalSize - Size());
  if (m_scroller.GetValue() < 0) m_scroller.SetValue(0);
}
开发者ID:anaconda,项目名称:xbmc,代码行数:12,代码来源:GUIControlGroupList.cpp


示例20: GetUsageInfo

 void FixedMalloc::DumpMemoryInfo()
 {
     size_t inUse, ask;
     GetUsageInfo(ask, inUse);
     GCLog("[mem] FixedMalloc total %d pages inuse %d bytes ask %d bytes\n", GetTotalSize(), inUse, ask);
     for (int i=0; i<kNumSizeClasses; i++) {
         m_allocs[i].GetUsageInfo(ask, inUse);
         if( m_allocs[i].GetNumBlocks() > 0)
             GCLog("[mem] FixedMalloc[%d] total %d pages inuse %d bytes ask %d bytes\n", kSizeClasses[i], m_allocs[i].GetNumBlocks(), inUse, ask);
     }
     GCLog("[mem] FixedMalloc[large] total %d pages\n", GetNumLargeBlocks());
 }
开发者ID:changm,项目名称:tessa,代码行数:12,代码来源:FixedMalloc.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetTotalStatValue函数代码示例发布时间:2022-05-30
下一篇:
C++ GetTotalAuraMultiplierByMiscValue函数代码示例发布时间: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