当前位置: 首页>>代码示例>>C++>>正文


C++ GetTotalSize函数代码示例

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


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


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