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


C++ GetBorderSize函数代码示例

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


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

示例1: GetBorderSize

int wxSplitWindow::AdjustSashPosition(int sashPos) const {
    wxWindow *win;

    win = m_windowOne;
    if (win) {

        // the window shouldn't be smaller than its own minimal size nor
        // smaller than the minimual pane size specified for this splitwindow
        int minSize = m_splitMode == wxSPLIT_VERTICAL? win->GetMinWidth(): win->GetMinHeight();

        if (minSize == -1 || m_minimumPaneSize > minSize) minSize = m_minimumPaneSize;
        minSize += GetBorderSize();

        if (sashPos > 0 && sashPos < minSize) sashPos = minSize;
    }

    win = m_windowTwo;
    if (win) {

        int minSize = m_splitMode == wxSPLIT_VERTICAL? win->GetMinWidth(): win->GetMinHeight();

        if (minSize == -1 || m_minimumPaneSize > minSize) minSize = m_minimumPaneSize;
        minSize += GetBorderSize();

        int maxSize = GetWindowSize() - minSize - GetSashSize();
        if (sashPos < GetWindowSize() && sashPos > maxSize) sashPos = maxSize;
    }

    return sashPos;
}
开发者ID:stahta01,项目名称:wxCode_components,代码行数:30,代码来源:splitwindow.cpp

示例2: if

	void CComboBoxUI::PaintStatusImage(HDC hDC)
	{
		if (m_sArrowImage.IsEmpty())
			CComboUI::PaintStatusImage(hDC);
		else
		{
			// get index
			if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED;
			else m_uButtonState &= ~ UISTATE_FOCUSED;
			if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED;
			else m_uButtonState &= ~ UISTATE_DISABLED;

			int nIndex = 0;
			if ((m_uButtonState & UISTATE_DISABLED) != 0)
				nIndex = 4;
			else if ((m_uButtonState & UISTATE_PUSHED) != 0)
				nIndex = 2;
			else if ((m_uButtonState & UISTATE_HOT) != 0)
				nIndex = 1;
			else if ((m_uButtonState & UISTATE_FOCUSED) != 0)
				nIndex = 3;

			// make modify string
			CDuiString sModify = m_sArrowImage;

			int nPos1 = sModify.Find(_T("source"));
			int nPos2 = sModify.Find(_T("'"), nPos1 + 7);
			if (nPos2 == -1) return; //first
			int nPos3 = sModify.Find(_T("'"), nPos2 + 1);
			if (nPos3 == -1) return; //second

			CDuiRect rcBmpPart;
			LPTSTR lpszValue = NULL;
			rcBmpPart.left = _tcstol(sModify.GetData() + nPos2 + 1, &lpszValue, 10);  ASSERT(lpszValue);    
			rcBmpPart.top = _tcstol(lpszValue + 1, &lpszValue, 10);    ASSERT(lpszValue);    
			rcBmpPart.right = _tcstol(lpszValue + 1, &lpszValue, 10);  ASSERT(lpszValue);    
			rcBmpPart.bottom = _tcstol(lpszValue + 1, &lpszValue, 10); ASSERT(lpszValue); 

			m_nArrowWidth = rcBmpPart.GetWidth() / 5;
			rcBmpPart.left += nIndex * m_nArrowWidth;
			rcBmpPart.right = rcBmpPart.left + m_nArrowWidth;

			CDuiRect rcDest(0, 0, m_rcItem.right - m_rcItem.left, m_rcItem.bottom - m_rcItem.top);
			rcDest.Deflate(GetBorderSize(), GetBorderSize());
			rcDest.left = rcDest.right - m_nArrowWidth;

			CDuiString sSource = sModify.Mid(nPos1, nPos3 + 1 - nPos1);
			CDuiString sReplace;
			sReplace.SmallFormat(_T("source='%d,%d,%d,%d' dest='%d,%d,%d,%d'"),
				rcBmpPart.left, rcBmpPart.top, rcBmpPart.right, rcBmpPart.bottom,
				rcDest.left, rcDest.top, rcDest.right, rcDest.bottom);

			sModify.Replace(sSource, sReplace);

			// draw image
			if (!DrawImage(hDC, m_sArrowImage, sModify))
				m_sNormalImage.Empty();
		}
	}
开发者ID:Crawping,项目名称:IocpServerClient_Side,代码行数:59,代码来源:UIComboBox.cpp

示例3: GetBorderSize

void IFWL_Widget::GetEdgeRect(CFX_RectF& rtEdge) {
  rtEdge = m_pProperties->m_rtWidget;
  rtEdge.left = rtEdge.top = 0;
  if (HasBorder()) {
    FX_FLOAT fCX = GetBorderSize();
    FX_FLOAT fCY = GetBorderSize(false);
    rtEdge.Deflate(fCX, fCY);
  }
}
开发者ID:documentcloud,项目名称:pdfium,代码行数:9,代码来源:ifwl_widget.cpp

示例4: HandleButtonEvent

/** Process a button event. */
void HandleButtonEvent(const XButtonEvent *event)
{

   ClientNode *np;
   int north, south, east, west;

   np = FindClientByParent(event->window);
   if(np) {
      if(event->type == ButtonPress) {
         FocusClient(np);
         RaiseClient(np);
      }
      DispatchBorderButtonEvent(event, np);
   } else if(event->window == rootWindow && event->type == ButtonPress) {
      if(!ShowRootMenu(event->button, event->x, event->y, 0)) {
         if(event->button == Button4) {
            LeftDesktop();
         } else if(event->button == Button5) {
            RightDesktop();
         }
      }
   } else {
      const unsigned int mask = event->state & ~lockMask;
      np = FindClientByWindow(event->window);
      if(np) {
         switch(event->button) {
         case Button1:
         case Button2:
            FocusClient(np);
            RaiseClient(np);
            if(mask == Mod1Mask) {
               GetBorderSize(&np->state, &north, &south, &east, &west);
               MoveClient(np, event->x + west, event->y + north);
            }
            break;
         case Button3:
            if(mask == Mod1Mask) {
               GetBorderSize(&np->state, &north, &south, &east, &west);
               ResizeClient(np, BA_RESIZE | BA_RESIZE_E | BA_RESIZE_S,
                            event->x + west, event->y + north);
            } else {
               FocusClient(np);
               RaiseClient(np);
            }
            break;
         default:
            break;
         }
         JXAllowEvents(display, ReplayPointer, eventTime);
      }

   }

}
开发者ID:pecarter-work,项目名称:jwm,代码行数:55,代码来源:event.c

示例5: ConstrainPosition

/** Constrain the position of a client. */
void ConstrainPosition(ClientNode *np)
{

   BoundingBox box;
   int north, south, east, west;

   /* Get the bounds for placement. */
   box.x = 0;
   box.y = 0;
   box.width = rootWidth;
   box.height = rootHeight;
   SubtractTrayBounds(GetTrays(), &box, np->state.layer);
   SubtractStrutBounds(&box, np);

   /* Fix the position. */
   GetBorderSize(&np->state, &north, &south, &east, &west);
   if(np->x + np->width + east + west > box.x + box.width) {
      np->x = box.x + box.width - np->width - east;
   }
   if(np->y + np->height + north + south > box.y + box.height) {
      np->y = box.y + box.height - np->height - south;
   }
   if(np->x < box.x + west) {
      np->x = box.x + west;
   }
   if(np->y < box.y + north) {
      np->y = box.y + north;
   }

}
开发者ID:KarlGodt,项目名称:jwm,代码行数:31,代码来源:place.c

示例6: GetBorderSize

void cdxCDynamicWnd::DoOnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
	if(IsWindow() && !IsDisabled())
	{
		CSize	szDelta	=	GetBorderSize();

		lpMMI->ptMinTrackSize.x	=	m_szMin.cx + szDelta.cx;
		lpMMI->ptMinTrackSize.y	=	m_szMin.cy + szDelta.cy;

		if(m_Freedom & fdHoriz)
		{
			if(m_szMax.cx > 0)
				lpMMI->ptMaxTrackSize.x	=	m_szMax.cx + szDelta.cx;
		}
		else
			lpMMI->ptMaxTrackSize.x	=	lpMMI->ptMinTrackSize.x;

		if(m_Freedom & fdVert)
		{
			if(m_szMax.cy > 0)
				lpMMI->ptMaxTrackSize.y	=	m_szMax.cy + szDelta.cy;
		}
		else
			lpMMI->ptMaxTrackSize.y	=	lpMMI->ptMinTrackSize.y;
	}
}
开发者ID:Luomu,项目名称:workspacewhiz,代码行数:26,代码来源:cdxCDynamicWnd.cpp

示例7: if

	void CComboBoxUI::PaintStatusImage(HDC hDC)
	{
		if (m_sArrowImage.IsEmpty())
			CComboUI::PaintStatusImage(hDC);
		else
		{
			// get index
			if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED;
			else m_uButtonState &= ~ UISTATE_FOCUSED;
			if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED;
			else m_uButtonState &= ~ UISTATE_DISABLED;

			int nIndex = 0;
			if ((m_uButtonState & UISTATE_DISABLED) != 0)
				nIndex = 4;
			else if ((m_uButtonState & UISTATE_PUSHED) != 0)
				nIndex = 2;
			else if ((m_uButtonState & UISTATE_HOT) != 0)
				nIndex = 1;
			else if ((m_uButtonState & UISTATE_FOCUSED) != 0)
				nIndex = 3;

			CDuiRect rcBmpPart(m_sArrowImage.GetSource());

			m_nArrowWidth = rcBmpPart.GetWidth() / 5;
			rcBmpPart.left += nIndex * m_nArrowWidth;
			rcBmpPart.right = rcBmpPart.left + m_nArrowWidth;

			CDuiRect rcDest(0, 0, m_rcItem.right - m_rcItem.left, m_rcItem.bottom - m_rcItem.top);
			rcDest.Deflate(GetBorderSize(), GetBorderSize());
			rcDest.left = rcDest.right - m_nArrowWidth;

			// draw image
			if (!DrawImage(hDC, m_sArrowImage))
				m_sNormalImage.Empty();
			else 
			{
				DrawImage(hDC, m_sArrowImage,rcBmpPart);
				DrawImage(hDC, m_sArrowImage,rcDest);
			}
		}
	}
开发者ID:charliewin,项目名称:uilib-project,代码行数:42,代码来源:UIComboBox.cpp

示例8: GetBorderSize

//*********************************************************************************************************
void CBCGPBaseFilterPopupMenu::RecalcLayout(BOOL bNotify /* = TRUE */)
{
	CBCGPPopupMenu::RecalcLayout(bNotify);

	if (m_wndMenuBar.GetSafeHwnd() != NULL)
	{
		m_wndMenuBar.m_arColumns.RemoveAll();
		m_wndMenuBar.AdjustLayout();
	}

	if (m_wndList.GetSafeHwnd() == NULL)
	{
		return;
	}

	const int nShadowSize = CBCGPToolBar::IsCustomizeMode () ? 0 : m_iShadowSize;
	const int nBorderSize = GetBorderSize();

	CRect rectClient;
	GetClientRect(rectClient);

	rectClient.DeflateRect (nBorderSize, nBorderSize);

	if (GetExStyle() & WS_EX_LAYOUTRTL)
	{
		rectClient.left += nShadowSize;
	}
	else
	{
		rectClient.right -= nShadowSize;
	}
	
	rectClient.top += m_nMenuBarHeight;
	rectClient.bottom -= nShadowSize;

#ifndef _BCGSUITE_
	rectClient.left += m_wndMenuBar.GetGutterWidth();
#endif

	if (!m_rectResize.IsRectEmpty())
	{
		if (m_bIsResizeBarOnTop)
		{
			rectClient.top += m_rectResize.Height();
		}
		else
		{
			rectClient.bottom -= m_rectResize.Height();
		}
	}

	m_wndList.SetWindowPos(NULL, rectClient.left, rectClient.top, rectClient.Width(), rectClient.Height(), SWP_NOZORDER | SWP_NOACTIVATE);
	m_wndList.m_bIsEmptyMenu = GetMenuItemCount() == 0;
}
开发者ID:iclosure,项目名称:jframework,代码行数:55,代码来源:BCGPGridFilterMenu.cpp

示例9: wxMax

wxSize wxSplitWindow::DoGetBestSize() const {
    // get best sizes of subwindows
    wxSize size1, size2;
    size1.x = 0; size1.y = 0; size2.x = 0; size2.y = 0;
    if (m_windowOne) size1 = m_windowOne->GetEffectiveMinSize();
    if (m_windowTwo) size2 = m_windowTwo->GetEffectiveMinSize();

    // sum them up
    wxSize sizeBest;
    if (m_splitMode == wxSPLIT_VERTICAL) {
        sizeBest.x = wxMax(size1.x, m_minimumPaneSize) + wxMax(size2.x, m_minimumPaneSize);
        sizeBest.y = wxMax(size1.y, size2.y);
        sizeBest.x += GetSashSize();
    }else{ // wxSPLIT_HORIZONTAL
        sizeBest.x = wxMax(size1.x, size2.x);
        sizeBest.y = wxMax(size1.y, m_minimumPaneSize) + wxMax(size2.y, m_minimumPaneSize);
        sizeBest.y += GetSashSize();
    }
    sizeBest.x += 2*GetBorderSize();
    sizeBest.y += 2*GetBorderSize();

    return sizeBest;
}
开发者ID:stahta01,项目名称:wxCode_components,代码行数:23,代码来源:splitwindow.cpp

示例10: GetGravityDelta

/** Determine which way to move the client for the border. */
void GetGravityDelta(const ClientNode *np, int gravity, int *x, int  *y)
{

   int north, south, east, west;
   GetBorderSize(&np->state, &north, &south, &east, &west);
   switch(gravity) {
   case NorthWestGravity:
      *y = -north;
      *x = -west;
      break;
   case NorthGravity:
      *y = -north;
      *x = (west - east) / 2;
      break;
   case NorthEastGravity:
      *y = -north;
      *x = west;
      break;
   case WestGravity:
      *x = -west;
      *y = (north - south) / 2;
      break;
   case CenterGravity:
      *y = (north - south) / 2;
      *x = (west - east) / 2;
      break;
   case EastGravity:
      *x = west;
      *y = (north - south) / 2;
      break;
   case SouthWestGravity:
      *y = south;
      *x = -west;
      break;
   case SouthGravity:
      *x = (west - east) / 2;
      *y = south;
      break;
   case SouthEastGravity:
      *y = south;
      *x = west;
      break;
   default: /* Static */
      *x = 0;
      *y = 0;
      break;
   }

}
开发者ID:KarlGodt,项目名称:jwm,代码行数:50,代码来源:place.c

示例11: GetEdgeWidth

void IFWL_Widget::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
  if (!bAutoSize) {
    rect = m_pProperties->m_rtWidget;
    return;
  }

  if (HasEdge()) {
    FX_FLOAT fEdge = GetEdgeWidth();
    rect.Inflate(fEdge, fEdge);
  }
  if (HasBorder()) {
    FX_FLOAT fBorder = GetBorderSize();
    rect.Inflate(fBorder, fBorder);
  }
}
开发者ID:documentcloud,项目名称:pdfium,代码行数:15,代码来源:ifwl_widget.cpp

示例12: ASSERT

bool cdxCDynamicWndEx::StretchWindow(int iAddPcnt)
{
	if(!IsWindow())
	{
		ASSERT(false);
		return false;
	}

	CSize	szDelta	=	GetCurrentClientSize() + GetBorderSize();

	szDelta.cx	=	(szDelta.cx * iAddPcnt) / 100;
	szDelta.cy	=	(szDelta.cy * iAddPcnt) / 100;

	return StretchWindow(szDelta);
}
开发者ID:Luomu,项目名称:workspacewhiz,代码行数:15,代码来源:cdxCDynamicWndEx.cpp

示例13: GetBorderSize

void CBaseContainerNode::DrawGrabIcon()
{
	const float bSize = GetBorderSize();

	surface()->DrawSetColor( Color( 192, 192, 192, 255 ) );
	surface()->DrawSetTexture( m_iGrabIcon );

	Vector2D icooffset( -GRABICO_OFFSET, GRABICO_OFFSET );
	Vector2D gi_max = Vector2D( GetContainerMaxs().x, GetContainerMins().y ) + icooffset;
	Vector2D gi_min = gi_max + Vector2D( -bSize, bSize );

	pNodeView->ToPanelSpace( gi_max );
	pNodeView->ToPanelSpace( gi_min );

	surface()->DrawTexturedRect( gi_min.x, gi_min.y, gi_max.x, gi_max.y );
}
开发者ID:BSVino,项目名称:source-shader-editor,代码行数:16,代码来源:vbasecontainer.cpp

示例14: GetCenter

Vector2D CBaseContainerNode::GetContainerBorderMin( int mode )
{
	Vector2D out;
	Vector2D center = GetCenter();
	center.x = GetBoundsMaxNodeSpace().x;
	const float bSize = GetBorderSize();

	switch ( mode )
	{
	default:
		Assert( 0 );
	case CBORDER_TOP_LEFT:
		out.x = center.x;
		out.y = center.y + m_vecContainerExtents.x - bSize;
		break;
	case CBORDER_TOP:
		out.x = center.x + bSize;
		out.y = center.y + m_vecContainerExtents.x - bSize;
		break;
	case CBORDER_TOP_RIGHT:
		out.x = center.x + m_vecContainerExtents.y - bSize;
		out.y = center.y + m_vecContainerExtents.x - bSize;
		break;
	case CBORDER_RIGHT:
		out.x = center.x + m_vecContainerExtents.y - bSize;
		out.y = center.y + m_vecContainerExtents.z + bSize;
		break;
	case CBORDER_BOTTOM_RIGHT:
		out.x = center.x + m_vecContainerExtents.y - bSize;
		out.y = center.y + m_vecContainerExtents.z;
		break;
	case CBORDER_BOTTOM:
		out.x = center.x + bSize;
		out.y = center.y + m_vecContainerExtents.z;
		break;
	case CBORDER_BOTTOM_LEFT:
		out.x = center.x;
		out.y = center.y + m_vecContainerExtents.z;
		break;
	case CBORDER_LEFT:
		out.x = center.x;
		out.y = center.y + m_vecContainerExtents.z + bSize;
		break;
	}

	return out;
}
开发者ID:BSVino,项目名称:source-shader-editor,代码行数:47,代码来源:vbasecontainer.cpp

示例15: CascadeClient

/** Cascade placement. */
void CascadeClient(const BoundingBox *box, ClientNode *np)
{

   const ScreenType *sp;
   int north, south, east, west;
   int cascadeIndex;
   char overflow;

   GetBorderSize(&np->state, &north, &south, &east, &west);
   sp = GetMouseScreen();
   cascadeIndex = sp->index * settings.desktopCount + currentDesktop;

   /* Set the cascaded location. */
   np->x = box->x + west + cascadeOffsets[cascadeIndex];
   np->y = box->y + north + cascadeOffsets[cascadeIndex];
   cascadeOffsets[cascadeIndex] += settings.borderWidth
                                 + settings.titleHeight;

   /* Check for cascade overflow. */
   overflow = 0;
   if(np->x + np->width - box->x > box->width) {
      overflow = 1;
   } else if(np->y + np->height - box->y > box->height) {
      overflow = 1;
   }

   if(overflow) {
      cascadeOffsets[cascadeIndex] = settings.borderWidth
                                   + settings.titleHeight;
      np->x = box->x + west + cascadeOffsets[cascadeIndex];
      np->y = box->y + north + cascadeOffsets[cascadeIndex];

      /* Check for client overflow and update cascade position. */
      if(np->x + np->width - box->x > box->width) {
         np->x = box->x + west;
      } else if(np->y + np->height - box->y > box->height) {
         np->y = box->y + north;
      } else {
         cascadeOffsets[cascadeIndex] += settings.borderWidth
                                       + settings.titleHeight;
      }
   }

   ConstrainSize(np);
   ConstrainPosition(np);

}
开发者ID:KarlGodt,项目名称:jwm,代码行数:48,代码来源:place.c


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