您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetBorderSize函数代码示例

51自学网 2021-06-01 21:04:23
  C++
这篇教程C++ GetBorderSize函数代码示例写得很实用,希望能帮到您。

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

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


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例16: GetBorderSize

    CSize GetBorderSize(HWND hWnd, bool dwmEnabled)    {        // Check for Caption        DWORD dwStyle = ::GetWindowLong(hWnd, GWL_STYLE);        bool caption = (dwStyle & WS_CAPTION) != 0;        DWORD dwExStyle = ::GetWindowLong(hWnd, GWL_EXSTYLE);        // Get BorderMultiplierFactor        int bmfactor = 0;        ::SystemParametersInfo(SPI_GETBORDER, 0, &bmfactor, 0);        int factor = bmfactor - 1;        CSize border;        if ((dwExStyle & WS_EX_CLIENTEDGE) != 0)        {            // Fixed3D            border = GetFixedFrameBorderSize() + GetBorder3DSize();        }        else if ((dwStyle & WS_THICKFRAME) != 0)        {            // Dialog            if ((dwExStyle & WS_EX_DLGMODALFRAME) != 0)            {                // Dialog with WS_EX_DLGMODALFRAME has double border                int cx = ::GetSystemMetrics(SM_CXDLGFRAME);                int cy = ::GetSystemMetrics(SM_CYDLGFRAME);                border.SetSize(cx + cx, cy + cy);            }            // Sizable or SizableToolWindow            else if (IsVista())                border = GetFrameBorderSize();            else                border = GetFixedFrameBorderSize() +                            (caption ? GetBorderSize() + CSize(factor, factor)                                : CSize(factor, factor));        }        else        {            if (dwmEnabled)                border = GetFrameBorderSize();            else                border = GetFixedFrameBorderSize();        }        return border;    }
开发者ID:Crawping,项目名称:MetroWindow,代码行数:46,


示例17: WriteFrameExtents

/** Set _NET_FRAME_EXTENTS. */void WriteFrameExtents(Window win, const ClientState *state){   unsigned long values[4];   int north, south, east, west;   GetBorderSize(state, &north, &south, &east, &west);   /* left, right, top, bottom */   values[0] = west;   values[1] = east;   values[2] = north;   values[3] = south;   JXChangeProperty(display, win, atoms[ATOM_NET_FRAME_EXTENTS],                    XA_CARDINAL, 32, PropModeReplace,                    (unsigned char*)values, 4);}
开发者ID:Miteam,项目名称:jwm,代码行数:19,


示例18: StopMove

/** Stop move. */void StopMove(ClientNode *np, int doMove,              int oldx, int oldy, MaxFlags maxFlags){   int north, south, east, west;   Assert(np);   Assert(np->controller);   (np->controller)(0);   np->controller = NULL;   SetDefaultCursor(np->parent);   UnregisterCallback(SignalMove, NULL);   if(!doMove) {      np->x = oldx;      np->y = oldy;      /* Restore maximized status. */      if(maxFlags) {         MaximizeClient(np, maxFlags);      }      return;   }   GetBorderSize(&np->state, &north, &south, &east, &west);   if(np->parent != None) {      JXMoveWindow(display, np->parent, np->x - west, np->y - north);   } else {      JXMoveWindow(display, np->window, np->x - west, np->y - north);   }   SendConfigureEvent(np);   /* Restore maximized status. */   if(maxFlags) {      MaximizeClient(np, maxFlags);   }}
开发者ID:pecarter-work,项目名称:jwm,代码行数:45,


示例19: GetClientRectangle

/** Get a rectangle to represent a client window. */void GetClientRectangle(const ClientNode *np, RectangleType *r){   int north, south, east, west;   GetBorderSize(&np->state, &north, &south, &east, &west);   r->left = np->x - west;   r->right = np->x + np->width + east;   r->top = np->y - north;   if(np->state.status & STAT_SHADED) {      r->bottom = np->y + south;   } else {      r->bottom = np->y + np->height + south;   }   r->valid = 1;}
开发者ID:Nehamkin,项目名称:jwm,代码行数:20,


示例20: ResizeMoveCtrl

void ResizeMoveCtrl(HWND hDlg, HWND hCtrl, int dx, int dy, int dw, int dh){	RECT rect;	POINT point;	SIZE border;	GetWindowRect(hCtrl, &rect);	point.x = right_to_left_mode?rect.right:rect.left;	point.y = rect.top;	ScreenToClient(hDlg, &point);	GetClientRect(hCtrl, &rect);	// If the control has any borders (dialog, edit box), take them into account	border = GetBorderSize(hCtrl);	MoveWindow(hCtrl, point.x + (int)(fScale*(float)dx), point.y + (int)(fScale*(float)dy),		(rect.right - rect.left) + (int)(fScale*(float)dw + border.cx),		(rect.bottom - rect.top) + (int)(fScale*(float)dh + border.cy), TRUE);	InvalidateRect(hCtrl, NULL, TRUE);}
开发者ID:DesignD,项目名称:rufus,代码行数:19,


示例21: wxMax

wxSize wxSplitterWindow::DoGetBestSize() const{    // get best sizes of subwindows    wxSize size1, size2;    if ( m_windowOne )        size1 = m_windowOne->GetEffectiveMinSize();    if ( m_windowTwo )        size2 = m_windowTwo->GetEffectiveMinSize();    // sum them    //    // pSash points to the size component to which sash size must be added    int *pSash;    wxSize sizeBest;    if ( m_splitMode == wxSPLIT_VERTICAL )    {        sizeBest.y = wxMax(size1.y, size2.y);        sizeBest.x = wxMax(size1.x, m_minimumPaneSize) +                        wxMax(size2.x, m_minimumPaneSize);        pSash = &sizeBest.x;    }    else // wxSPLIT_HORIZONTAL    {        sizeBest.x = wxMax(size1.x, size2.x);        sizeBest.y = wxMax(size1.y, m_minimumPaneSize) +                        wxMax(size2.y, m_minimumPaneSize);        pSash = &sizeBest.y;    }    // account for the sash if the window is actually split    if ( m_windowOne && m_windowTwo )        *pSash += GetSashSize();    // account for the border too    int border = 2*GetBorderSize();    sizeBest.x += border;    sizeBest.y += border;    return sizeBest;}
开发者ID:CodeSmithyIDE,项目名称:wxWidgets,代码行数:42,


示例22: StopMove

/** Stop move. */void StopMove(ClientNode *np, int doMove,              int oldx, int oldy, int hmax, int vmax){   int north, south, east, west;   Assert(np);   Assert(np->controller);   (np->controller)(0);   np->controller = NULL;   SetDefaultCursor(np->parent);   UnregisterCallback(SignalMove, NULL);   if(!doMove) {      np->x = oldx;      np->y = oldy;      /* Restore maximized status if only maximized in one direction. */      if((hmax || vmax) && !(hmax && vmax)) {         MaximizeClient(np, hmax, vmax);      }      return;   }   GetBorderSize(&np->state, &north, &south, &east, &west);   JXMoveWindow(display, np->parent, np->x - west, np->y - north);   SendConfigureEvent(np);   /* Restore maximized status. */   if((hmax || vmax) && !(hmax && vmax)) {      MaximizeClient(np, hmax, vmax);   }}
开发者ID:technosaurus,项目名称:jwm,代码行数:42,


示例23: DoSnapScreen

/** Snap to the screen. */void DoSnapScreen(ClientNode *np){   RectangleType client;   int screen;   const ScreenType *sp;   int screenCount;   int north, south, east, west;   GetClientRectangle(np, &client);   GetBorderSize(&np->state, &north, &south, &east, &west);   screenCount = GetScreenCount();   for(screen = 0; screen < screenCount; screen++) {      sp = GetScreen(screen);      if(abs(client.right - sp->width - sp->x) <= settings.snapDistance) {         np->x = sp->x + sp->width - west - np->width;      }      if(abs(client.left - sp->x) <= settings.snapDistance) {         np->x = sp->x + east;      }      if(abs(client.bottom - sp->height - sp->y) <= settings.snapDistance) {         np->y = sp->y + sp->height - south;         if(!(np->state.status & STAT_SHADED)) {            np->y -= np->height;         }      }      if(abs(client.top - sp->y) <= settings.snapDistance) {         np->y = north + sp->y;      }   }}
开发者ID:Nehamkin,项目名称:jwm,代码行数:38,


示例24: MoveClient

/** Move a client window. */char MoveClient(ClientNode *np, int startx, int starty){   XEvent event;   int oldx, oldy;   int doMove;   int north, south, east, west;   int height;   MaxFlags maxFlags;   Assert(np);   if(!(np->state.border & BORDER_MOVE)) {      return 0;   }   if(np->state.status & STAT_FULLSCREEN) {      return 0;   }   GrabMouseForMove();   RegisterCallback(0, SignalMove, NULL);   np->controller = MoveController;   shouldStopMove = 0;   oldx = np->x;   oldy = np->y;   maxFlags = np->state.maxFlags;   if(!(GetMouseMask() & (Button1Mask | Button2Mask))) {      StopMove(np, 0, oldx, oldy, maxFlags);      return 0;   }   GetBorderSize(&np->state, &north, &south, &east, &west);   startx -= west;   starty -= north;   currentClient = np;   atTop = atBottom = atLeft = atRight = 0;   doMove = 0;   for(;;) {      WaitForEvent(&event);      if(shouldStopMove) {         np->controller = NULL;         SetDefaultCursor(np->parent);         UnregisterCallback(SignalMove, NULL);         return doMove;      }      switch(event.type) {      case ButtonRelease:         if(event.xbutton.button == Button1            || event.xbutton.button == Button2) {            StopMove(np, doMove, oldx, oldy, maxFlags);            return doMove;         }         break;      case MotionNotify:         DiscardMotionEvents(&event, np->window);         np->x = event.xmotion.x_root - startx;         np->y = event.xmotion.y_root - starty;         /* Get the move time used for desktop switching. */         if(!(atLeft | atTop | atRight | atBottom)) {            if(event.xmotion.state & Mod1Mask) {               moveTime.seconds = 0;               moveTime.ms = 0;            } else {               GetCurrentTime(&moveTime);            }         }         /* Determine if we are at a border for desktop switching. */         atLeft = atTop = atRight = atBottom = 0;         if(event.xmotion.x_root == 0) {            atLeft = 1;         } else if(event.xmotion.x_root == rootWidth - 1) {            atRight = 1;         }         if(event.xmotion.y_root == 0) {            atTop = 1;         } else if(event.xmotion.y_root == rootHeight - 1) {            atBottom = 1;         }         if(event.xmotion.state & Mod1Mask) {            /* Switch desktops immediately if alt is pressed. */            if(atLeft | atRight | atTop | atBottom) {               TimeType now;               GetCurrentTime(&now);               UpdateDesktop(&now);            }         } else {//.........这里部分代码省略.........
开发者ID:Nehamkin,项目名称:jwm,代码行数:101,


示例25: DoSnapBorder

/** Snap to window borders. */void DoSnapBorder(ClientNode *np){   const ClientNode *tp;   const TrayType *tray;   RectangleType client, other;   RectangleType left = { 0 };   RectangleType right = { 0 };   RectangleType top = { 0 };   RectangleType bottom = { 0 };   int layer;   int north, south, east, west;   GetClientRectangle(np, &client);   GetBorderSize(&np->state, &north, &south, &east, &west);   other.valid = 1;   /* Work from the bottom of the window stack to the top. */   for(layer = 0; layer < LAYER_COUNT; layer++) {      /* Check tray windows. */      for(tray = GetTrays(); tray; tray = tray->next) {         if(tray->hidden) {            continue;         }         other.left = tray->x;         other.right = tray->x + tray->width;         other.top = tray->y;         other.bottom = tray->y + tray->height;         left.valid = CheckLeftValid(&client, &other, &left);         right.valid = CheckRightValid(&client, &other, &right);         top.valid = CheckTopValid(&client, &other, &top);         bottom.valid = CheckBottomValid(&client, &other, &bottom);         if(CheckOverlapTopBottom(&client, &other)) {            if(abs(client.left - other.right) <= settings.snapDistance) {               left = other;            }            if(abs(client.right - other.left) <= settings.snapDistance) {               right = other;            }         }         if(CheckOverlapLeftRight(&client, &other)) {            if(abs(client.top - other.bottom) <= settings.snapDistance) {               top = other;            }            if(abs(client.bottom - other.top) <= settings.snapDistance) {               bottom = other;            }         }      }      /* Check client windows. */      for(tp = nodeTail[layer]; tp; tp = tp->prev) {         if(tp == np || !ShouldSnap(tp)) {            continue;         }         GetClientRectangle(tp, &other);         /* Check if this border invalidates any previous value. */         left.valid = CheckLeftValid(&client, &other, &left);         right.valid = CheckRightValid(&client, &other, &right);         top.valid = CheckTopValid(&client, &other, &top);         bottom.valid = CheckBottomValid(&client, &other, &bottom);         /* Compute the new snap values. */         if(CheckOverlapTopBottom(&client, &other)) {            if(abs(client.left - other.right) <= settings.snapDistance) {               left = other;            }            if(abs(client.right - other.left) <= settings.snapDistance) {               right = other;            }         }         if(CheckOverlapLeftRight(&client, &other)) {            if(abs(client.top - other.bottom) <= settings.snapDistance) {               top = other;            }            if(abs(client.bottom - other.top) <= settings.snapDistance) {               bottom = other;            }         }      }   }   if(right.valid) {      np->x = right.left - np->width - west;   }   if(left.valid) {//.........这里部分代码省略.........
开发者ID:Nehamkin,项目名称:jwm,代码行数:101,


示例26: MoveClientKeyboard

/** Move a client window (keyboard or menu initiated). */char MoveClientKeyboard(ClientNode *np){   XEvent event;   int oldx, oldy;   int moved;   int height;   int north, south, east, west;   MaxFlags maxFlags;   Assert(np);   if(!(np->state.border & BORDER_MOVE)) {      return 0;   }   if(np->state.status & STAT_FULLSCREEN) {      return 0;   }   maxFlags = np->state.maxFlags;   if(np->state.maxFlags != MAX_NONE) {      MaximizeClient(np, MAX_NONE);   }   if(JUNLIKELY(JXGrabKeyboard(display, np->parent, True, GrabModeAsync,                               GrabModeAsync, CurrentTime))) {      Debug("MoveClient: could not grab keyboard");      return 0;   }   GrabMouseForMove();   GetBorderSize(&np->state, &north, &south, &east, &west);   oldx = np->x;   oldy = np->y;   RegisterCallback(0, SignalMove, NULL);   np->controller = MoveController;   shouldStopMove = 0;   CreateMoveWindow(np);   UpdateMoveWindow(np);   MoveMouse(rootWindow, np->x, np->y);   DiscardMotionEvents(&event, np->window);   if(np->state.status & STAT_SHADED) {      height = 0;   } else {      height = np->height;   }   for(;;) {      WaitForEvent(&event);      if(shouldStopMove) {         np->controller = NULL;         SetDefaultCursor(np->parent);         UnregisterCallback(SignalMove, NULL);         return 1;      }      moved = 0;      if(event.type == KeyPress) {         DiscardKeyEvents(&event, np->window);         switch(GetKey(&event.xkey) & 0xFF) {         case KEY_UP:            if(np->y + height > 0) {               np->y -= 10;            }            break;         case KEY_DOWN:            if(np->y < rootHeight) {               np->y += 10;            }            break;         case KEY_RIGHT:            if(np->x < rootWidth) {               np->x += 10;            }            break;         case KEY_LEFT:            if(np->x + np->width > 0) {               np->x -= 10;            }            break;         default:            StopMove(np, 1, oldx, oldy, maxFlags);            return 1;         }         MoveMouse(rootWindow, np->x, np->y);         DiscardMotionEvents(&event, np->window);         moved = 1;//.........这里部分代码省略.........
开发者ID:Nehamkin,项目名称:jwm,代码行数:101,


示例27: MoveClient

/** Move a client window. */char MoveClient(ClientNode *np, int startx, int starty, int snap){   XEvent event;   int oldx, oldy;   int doMove;   int north, south, east, west;   int height;   int hmax, vmax;   Assert(np);   if(!(np->state.border & BORDER_MOVE)) {      return 0;   }   if(np->state.status & STAT_FULLSCREEN) {      return 0;   }   GrabMouseForMove();   RegisterCallback(0, SignalMove, NULL);   np->controller = MoveController;   shouldStopMove = 0;   oldx = np->x;   oldy = np->y;   vmax = 0;   hmax = 0;   if(!(GetMouseMask() & (Button1Mask | Button2Mask))) {      StopMove(np, 0, oldx, oldy, 0, 0);      return 0;   }   GetBorderSize(&np->state, &north, &south, &east, &west);   startx -= west;   starty -= north;   currentClient = np;   atTop = 0;   atBottom = 0;   atLeft = 0;   atRight = 0;   doMove = 0;   for(;;) {      WaitForEvent(&event);      if(shouldStopMove) {         np->controller = NULL;         SetDefaultCursor(np->parent);         UnregisterCallback(SignalMove, NULL);         return doMove;      }      switch(event.type) {      case ButtonRelease:         if(event.xbutton.button == Button1            || event.xbutton.button == Button2) {            StopMove(np, doMove, oldx, oldy, hmax, vmax);            return doMove;         }         break;      case MotionNotify:         DiscardMotionEvents(&event, np->window);         np->x = event.xmotion.x_root - startx;         np->y = event.xmotion.y_root - starty;         GetCurrentTime(&moveTime);         atLeft = 0;         atTop = 0;         atRight = 0;         atBottom = 0;         if(event.xmotion.x_root == 0) {            atLeft = 1;         } else if(event.xmotion.x_root == rootWidth - 1) {            atRight = 1;         }         if(event.xmotion.y_root == 0) {            atTop = 1;         } else if(event.xmotion.y_root == rootHeight - 1) {            atBottom = 1;         }         if(snap) {            DoSnap(np);         }         if(!doMove && (abs(np->x - oldx) > MOVE_DELTA            || abs(np->y - oldy) > MOVE_DELTA)) {            if(np->state.status & (STAT_HMAX | STAT_VMAX)) {               if(np->state.status & STAT_HMAX) {                  hmax = 1;               }//.........这里部分代码省略.........
开发者ID:technosaurus,项目名称:jwm,代码行数:101,


示例28: ConvertSashPosition

// Position and size subwindows.// Note that the border size applies to each subwindow, not// including the edges next to the sash.void wxSplitterWindow::SizeWindows(){    // check if we have delayed setting the real sash position    if ( m_requestedSashPosition != INT_MAX )    {        int newSashPosition = ConvertSashPosition(m_requestedSashPosition);        if ( newSashPosition != m_sashPosition )        {            DoSetSashPosition(newSashPosition);        }        if ( newSashPosition <= m_sashPosition            && newSashPosition >= m_sashPosition - GetBorderSize() )        {            // don't update it any more            m_requestedSashPosition = INT_MAX;        }    }    int w, h;    GetClientSize(&w, &h);    if ( GetWindow1() && !GetWindow2() )    {        GetWindow1()->SetSize(GetBorderSize(), GetBorderSize(),                              w - 2*GetBorderSize(), h - 2*GetBorderSize());    }    else if ( GetWindow1() && GetWindow2() )    {        const int border = GetBorderSize(),                  sash = GetSashSize();        int size1 = GetSashPosition() - border,            size2 = GetSashPosition() + sash;        int x2, y2, w1, h1, w2, h2;        if ( GetSplitMode() == wxSPLIT_VERTICAL )        {            w1 = size1;            w2 = w - 2*border - sash - w1;            if (w2 < 0)                w2 = 0;            h2 = h - 2*border;            if (h2 < 0)                h2 = 0;            h1 = h2;            x2 = size2;            y2 = border;        }        else // horz splitter        {            w2 = w - 2*border;            if (w2 < 0)                w2 = 0;            w1 = w2;            h1 = size1;            h2 = h - 2*border - sash - h1;            if (h2 < 0)                h2 = 0;            x2 = border;            y2 = size2;        }        GetWindow2()->SetSize(x2, y2, w2, h2);        GetWindow1()->SetSize(border, border, w1, h1);    }    wxClientDC dc(this);    DrawSash(dc);}
开发者ID:CodeSmithyIDE,项目名称:wxWidgets,代码行数:73,


示例29: SetWMode

void SetWMode(int width, int height, bool state){#ifndef SHADOW_BROODWAR  // Compatibility for Xen W-Mode  if ( ghMainWnd && !(GetWindowLong(ghMainWnd, GWL_STYLE) & WS_SYSMENU) )    return;  if ( !isCorrectVersion )    return;  if ( state )  {    wmode = true;    if ( !ghMainWnd )      return;    // Call the DirectDraw destructor    DDrawDestroy();    InitializeWModeBitmap(BW::BWDATA::GameScreenBuffer.width(), BW::BWDATA::GameScreenBuffer.height());    // Hack to enable drawing in Broodwar    BW::BWDATA::PrimarySurface = (LPDIRECTDRAWSURFACE)1;    const int shift = gdwProcNum > 1 ? 32 : 0;    POINT pos = { windowRect.left + shift, windowRect.top + shift };    // Change the window settings    SetWindowLong(ghMainWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW);    SetWindowPos(ghMainWnd, HWND_NOTOPMOST, pos.x, pos.y, width, height, SWP_SHOWWINDOW);    ShowWindow(ghMainWnd, SW_RESTORE);    SIZE border;    GetBorderSize(ghMainWnd, &border);    int w = width + border.cx;    int h = height + border.cy;    int cx = GetSystemMetrics(SM_CXFULLSCREEN);    int cy = GetSystemMetrics(SM_CYFULLSCREEN);    while ( pos.x < 0 )      pos.x = 0;    while ( pos.y < 0 )      pos.y = 0;    if ( pos.y + h >= cy )    {      if (gdwProcNum > 1)        pos.y -= cy - h;      else        pos.y = cy - h;    }    if ( pos.x + w >= cx )    {      if (gdwProcNum > 1)        pos.x -= cx - w;      else        pos.x = cx - w;    }    MoveWindow(ghMainWnd, pos.x, pos.y, w, h, TRUE);    SetCursor(NULL);    SetCursorShowState(false);    SetDIBColorTable(hdcMem, 0, 256, wmodebmp.bmiColors);    WriteConfig("window", "windowed", "ON");  }  else  {    wmode = false;    BW::BWDATA::PrimarySurface = NULL;    if ( hdcMem )      DeleteDC(hdcMem);    hdcMem = NULL;    if (ghMainWnd)    {      SetWindowLong(ghMainWnd, GWL_STYLE, WS_POPUP | WS_VISIBLE | WS_SYSMENU);      SetWindowPos(ghMainWnd, HWND_TOPMOST, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), SWP_SHOWWINDOW);      SetCursor(NULL);      SetCursorShowState(false);      SetFocus(ghMainWnd);    }    DDrawDestroy();    DDrawInitialize(width, height);    WriteConfig("window", "windowed", "OFF");  }#endif}
开发者ID:Maiven,项目名称:bwapi,代码行数:84,


示例30: WindowProc

LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam){  if ( wmode )  {    // Perform W-Mode only functionality    switch ( uMsg )    {    case WM_SIZING:      {        SIZE border;        GetBorderSize(hWnd, &border);        RECT *rct = (RECT*)lParam;        SIZE ws   = { rct->right - rct->left - border.cx, rct->bottom - rct->top - border.cy };        if ( ws.cx < WMODE_MIN_WIDTH )        {          ws.cx = WMODE_MIN_WIDTH;          CorrectWindowWidth(wParam, &ws, rct, &border);        }        if ( ws.cy < WMODE_MIN_HEIGHT )        {          ws.cy = WMODE_MIN_HEIGHT;          CorrectWindowHeight(wParam, &ws, rct, &border);        }        if ( GetKeyState(VK_CONTROL) & 0x8000 && ws.cy != ws.cx * 3 / 4 )        {          if ( wParam == WMSZ_TOP || wParam == WMSZ_BOTTOM )          {            ws.cx = ws.cy * 4 / 3;            CorrectWindowWidth(WMSZ_RIGHT, &ws, rct, &border);          }          else          {            ws.cy = ws.cx * 3 / 4;            CorrectWindowHeight( (wParam == WMSZ_RIGHT || wParam == WMSZ_LEFT) ? WMSZ_BOTTOM : wParam, &ws, rct, &border);          }        }        if ( isCorrectVersion ) // must be correct version to reference BWDATA        {          if ( ws.cx >= BW::BWDATA::GameScreenBuffer.width() - WMODE_SNAP_RANGE &&               ws.cx <= BW::BWDATA::GameScreenBuffer.width() + WMODE_SNAP_RANGE )          {            ws.cx = BW::BWDATA::GameScreenBuffer.width();            CorrectWindowWidth( (wParam == WMSZ_TOP || wParam == WMSZ_BOTTOM) ? WMSZ_RIGHT : wParam, &ws, rct, &border);          }          if ( ws.cy >= BW::BWDATA::GameScreenBuffer.height() - WMODE_SNAP_RANGE &&               ws.cy <= BW::BWDATA::GameScreenBuffer.height() + WMODE_SNAP_RANGE )          {            ws.cy = BW::BWDATA::GameScreenBuffer.height();            CorrectWindowHeight( (wParam == WMSZ_RIGHT || wParam == WMSZ_LEFT) ? WMSZ_BOTTOM : wParam, &ws, rct, &border);          }        }        break;      } // case WM_SIZING    case WM_SIZE:      {        switch ( wParam )        {        case SIZE_RESTORED:          {            RECT tempRect;            GetClientRect(hWnd, &tempRect);            windowRect.right  = tempRect.right;            windowRect.bottom = tempRect.bottom;            WriteConfig("window", "width", tempRect.right);            WriteConfig("window", "height", tempRect.bottom);            break;          }        }// wParam switch        break;      } // case WM_SIZE    case WM_MOVE:      {        RECT tempRect;        GetWindowRect(hWnd, &tempRect);        if ( tempRect.right > 0 &&              tempRect.bottom > 0 &&              tempRect.left < GetSystemMetrics(SM_CXFULLSCREEN) &&             tempRect.top  < GetSystemMetrics(SM_CYFULLSCREEN) )        {          windowRect.left = tempRect.left;          windowRect.top  = tempRect.top;          WriteConfig("window", "left", tempRect.left);          WriteConfig("window", "top",  tempRect.top);        }        break;      } // case WM_MOVE    case WM_PAINT:      if ( gbWantUpdate && pBits)      {        static DWORD dwLastUpdate = 0;        DWORD dwNewTick = GetTickCount();        if ( dwLastUpdate + (IsIconic(hWnd) ? 200 : 20) > dwNewTick )          break;        dwLastUpdate = dwNewTick;        gbWantUpdate = false;        // begin paint//.........这里部分代码省略.........
开发者ID:Maiven,项目名称:bwapi,代码行数:101,



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


C++ GetBossSaveData函数代码示例
C++ GetBorder函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。