本文整理汇总了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;
}
示例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();
}
}
示例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);
}
}
示例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);
}
}
}
示例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;
}
}
示例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;
}
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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;
}
}
示例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);
}
}
示例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);
}
示例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 );
}
示例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;
}
示例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);
}