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

C++ GetRect函数代码示例

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

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



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

示例1: GetActiveView

BOOL CRectItem::OnChangeItemPosition(const CRect& rectPos)
{
	CMainView* pView = GetActiveView();
	if (pView == NULL)
		return FALSE;
	ASSERT_VALID(pView);

	CRect rc = rectPos;
	pView->ClientToDoc(rc);

	if (rc != GetRect())
	{
		// The following lines were commented out because of a bug 
		// in Microsoft Equation Editor 3.0.  The rc keeps growing
		// when activated/deactivated.
		// Uncomment them if necessary for other objects.

		/*
		// invalidate old item
		Invalidate();
		// update to new rectangle
		SetRect(rc);
		*/

		GetDocument()->SetModifiedFlag();

		/*
		CSize sizeExtent;
		GetCachedExtent(&sizeExtent);
		SetBaseSize(sizeExtent);
		*/

		// and invalidate new
		Invalidate();
	}
	return COleClientItem::OnChangeItemPosition(rectPos);
}
开发者ID:jetlive,项目名称:skiaming,代码行数:37,代码来源:rectitem.cpp


示例2: GetTheme

// Rendering:
bool nuiWindow::Draw(nuiDrawContext* pContext)
{
  pContext->PushState();
  pContext->ResetState();
  nuiWindowManager* pRoot = dynamic_cast<nuiWindowManager*>(mpParent);

  pContext->EnableBlending(false);

  if (!mRawWindow)
  {
    nuiTheme* pTheme = GetTheme();
    NGL_ASSERT(pTheme);
    pTheme->DrawWindowShade(pContext, mRect.Size(), nuiColor(1.0f, 1.0f, 1.0f, GetMixedAlpha()), IsParentActive());

    pContext->PushClipping();
    pContext->Clip(GetRect().Size());
    pContext->EnableClipping(true);

    if (pRoot->GetActiveWindow() == this)
    {
      if (mMoving)
        pTheme->DrawMovingWindow(pContext, this);
      else
        pTheme->DrawActiveWindow(pContext, this);
    }
    else
      pTheme->DrawWindow(pContext,this);

    pTheme->Release();

    pContext->PopClipping();
  }

  DrawChildren(pContext);

  return true;
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:38,代码来源:nuiWindow.cpp


示例3: CHECK_PTR_RET

void wxCodeCompletionBox::DoShowCompletionBox()
{
    CHECK_PTR_RET(m_stc);

    // guesstimate a line height
    wxMemoryDC dc;
    wxBitmap bmp(1, 1);
    dc.SelectObject(bmp);
    wxFont font = m_stc->StyleGetFont(0);
    dc.SetFont(font);
    wxSize textSize = dc.GetTextExtent("Tp");

    int lineHeight = textSize.y + 3; // 3 pixels margins
    wxRect rect = GetRect();
    wxSize screenSize = ::wxGetDisplaySize();

    // determine the box x position
    int wordStart = m_startPos;
    wxPoint pt = m_stc->PointFromPosition(wordStart);
    pt = m_stc->ClientToScreen(pt);
    pt.y += lineHeight;

    // Check Y axis
    if((pt.y + rect.GetHeight()) > screenSize.GetHeight()) {
        // the completion box goes out of the Y axis, move it up
        pt.y -= lineHeight;
        pt.y -= rect.GetHeight();
    }

    // Check X axis
    if((pt.x + rect.GetWidth()) > screenSize.GetWidth()) {
        // the completion box goes out of the X axis. Move it to the left
        pt.x -= ((pt.x + rect.GetWidth()) - screenSize.GetWidth());
    }
    Move(pt);
    Show();
}
开发者ID:huan5765,项目名称:codelite-translate2chinese,代码行数:37,代码来源:wxCodeCompletionBox.cpp


示例4: GetScreenPosition

void MainEmuFrame::OnMoveAround( wxMoveEvent& evt )
{
	if( IsBeingDeleted() || !IsVisible() || IsIconized() ) return;

	// Uncomment this when doing logger stress testing (and then move the window around
	// while the logger spams itself)
	// ... makes for a good test of the message pump's responsiveness.
	if( EnableThreadedLoggingTest )
		Console.Warning( "Threaded Logging Test!  (a window move event)" );

	// evt.GetPosition() returns the client area position, not the window frame position.
	// So read the window's screen-relative position directly.
	g_Conf->MainGuiPosition = GetScreenPosition();

	// wxGTK note: X sends gratuitous amounts of OnMove messages for various crap actions
	// like selecting or deselecting a window, which muck up docking logic.  We filter them
	// out using 'lastpos' here. :)

	static wxPoint lastpos( wxDefaultCoord, wxDefaultCoord );
	if( lastpos == evt.GetPosition() ) return;
	lastpos = evt.GetPosition();

	if( g_Conf->ProgLogBox.AutoDock )
	{
		if (ConsoleLogFrame* proglog = wxGetApp().GetProgramLog())
		{
			if (!proglog->IsMaximized())
			{
				g_Conf->ProgLogBox.DisplayPosition = GetRect().GetTopRight();
				proglog->SetPosition(g_Conf->ProgLogBox.DisplayPosition);
			}
		}
	}

	evt.Skip();
}
开发者ID:Alchemistxxd,项目名称:pcsx2,代码行数:36,代码来源:MainFrame.cpp


示例5: GetRect

void CFilterEdit::ResizeWindow()
{
	if (!::IsWindow(m_hWnd))
		return;

	CRect editrc, rc;
	GetRect(&editrc);
	GetClientRect(&rc);
	editrc.left = rc.left + 4;
	editrc.top = rc.top + 1;
	editrc.right = rc.right - 4;
	editrc.bottom = rc.bottom - 4;

	CWindowDC dc(this);
	HGDIOBJ oldFont = dc.SelectObject(GetFont()->GetSafeHandle());
	TEXTMETRIC tm = { 0 };
	dc.GetTextMetrics(&tm);
	dc.SelectObject(oldFont);

	m_rcEditArea.left = editrc.left + m_sizeInfoIcon.cx;
	m_rcEditArea.right = editrc.right - m_sizeCancelIcon.cx - 5;
	m_rcEditArea.top = (rc.Height() - tm.tmHeight) / 2;
	m_rcEditArea.bottom = m_rcEditArea.top + tm.tmHeight;

	m_rcButtonArea.left = m_rcEditArea.right + 5;
	m_rcButtonArea.right = rc.right;
	m_rcButtonArea.top = (((rc.bottom)-m_sizeCancelIcon.cy)/2);
	m_rcButtonArea.bottom = m_rcButtonArea.top + m_sizeCancelIcon.cy;

	m_rcInfoArea.left = 0;
	m_rcInfoArea.right = m_rcEditArea.left;
	m_rcInfoArea.top = (((rc.bottom)-m_sizeInfoIcon.cy)/2);
	m_rcInfoArea.bottom = m_rcInfoArea.top + m_sizeInfoIcon.cy;

	SetRect(&m_rcEditArea);
}
开发者ID:stahta01,项目名称:wxTortoiseGit,代码行数:36,代码来源:FilterEdit.cpp


示例6: GetGC

void FileDialog::OnPaint()
{
	axGC* gc = GetGC();

	axRect rect(GetRect());
	axRect rect0(axPoint(0, 0), rect.size);

	// Background.
	gc->SetColor(axColor(0.9, 0.9, 0.9), 1.0);
	gc->DrawRectangle(rect0);

	// Icon bar.
	axRect iconBarRect(1, 1, rect0.size.x - 1, 31);
	gc->DrawRectangle(iconBarRect);
	gc->DrawRectangleColorFade(iconBarRect, 
							  axColor(0.6, 0.6, 0.6), 1.0, 
							  axColor(0.7, 0.7, 0.7), 1.0);


	gc->SetColor(axColor(0.0, 0.0, 0.0), 1.0);
	gc->DrawRectangleContour(iconBarRect);

	// Folder name.
	gc->SetColor(axColor(0.2, 0.2, 0.2), 1.0);
	gc->SetFontSize(14);
	gc->DrawString(_dirNavigation->GetCurrentDirectoryName(), axPoint(50, 7));

	axRect buttonBarRect(1, rect0.size.y - 30, rect0.size.x - 1, 30);
	gc->DrawRectangle(buttonBarRect);
	gc->DrawRectangleColorFade(buttonBarRect, 
							  axColor(0.6, 0.6, 0.6), 1.0, 
							  axColor(0.7, 0.7, 0.7), 1.0);

	gc->SetColor(axColor(0.0, 0.0, 0.0), 1.0);
	gc->DrawRectangleContour(buttonBarRect);
}
开发者ID:EQ4,项目名称:axLib,代码行数:36,代码来源:main.cpp


示例7: input

CString CDiagramGroupbox::Export( UINT /*format*/ )
/* ============================================================
	Function :		CDiagramGroupbox::Export
	Description :	Exports this object to str using format
					
	Return :		CString		-	The resulting string
	Parameters :	UINT format	-	The format to export to
					
	Usage :			An example Export-function. In this case, 
					we are not using the format parameter, as 
					we only have one format.

   ============================================================*/
{
	return "";

	CString input( "\t<div class='controls' style='border-width:2;border-style:groove;position:absolute;left:%i;top:%i;width:%i;height:%i;'><div class='controls' style='position:absolute;left:6;top:-6;background-color:#c0c0c0;'>%s</div></div>" );
	CString str;
	CRect rect = GetRect();
	CString title = GetTitle();
	title.Replace( " ", "&nbsp;" );
	str.Format( input, rect.left - 2, rect.top - 2, rect.Width(), rect.Height(), title );
	return str;
}
开发者ID:BackupTheBerlios,项目名称:iris-svn,代码行数:24,代码来源:DiagramGroupbox.cpp


示例8: GetRect

// virtual, overloaded from nuiWidget, to be able to draw the oscillo manually
bool guiOscillo::Draw(nuiDrawContext* pContext)
{
 if (mrData.empty())
    return false;
  
  const nuiRect& rect = GetRect();
  
  uint32 s1 = mrData[0].size();
  uint32 s2 = rect.GetWidth();
  uint32 count = MIN(s1, s2);
  nuiSize hi = rect.GetHeight();
  nuiSize mid = hi / 2;

  nuiColor color[2];
  color[0] = nuiColor(84,117,203);
  color[1] = nuiColor(200,0,0);
  
  for (uint32 c = 0; c < mrData.size(); c++)
  {
    
    nuiRenderArray* pArray = new nuiRenderArray(GL_LINE_STRIP);
    pArray->EnableArray(nuiRenderArray::eColor, true);
    
    pArray->SetColor(color[c]);
    for (uint32 s = 0; s < count; s++)
    {
      float value = mrData[c][s];
      pArray->SetVertex(s, mid + hi * value);
      pArray->PushVertex();
    }
    
    pContext->DrawArray(pArray);
  }
  
  return true;
}
开发者ID:JamesLinus,项目名称:nui3,代码行数:37,代码来源:guiOscillo.cpp


示例9: OnPaint

        void    Widget::Render(RenderTarget& target, RenderQueue& queue) const
        {
            OnPaint(target, queue);

            if (mUseScissor)
            {
                Area& area = ResourceManager::Get()->WidgetArea;
                area.PushArea(GetRect(true));
                const FloatRect& top = area.GetTopArea();

                target.Flush();

                RenderChildren(target, queue);

                queue.SetScissor(true, Vector2f(top.Left, target.GetHeight() - top.Bottom), Vector2f(top.GetSize().x, top.GetSize().y));
                target.Flush();
                area.PopArea();
            }
            else
            {
                queue.SetScissor(false);
                RenderChildren(target, queue);
            }
        }
开发者ID:MStr3am,项目名称:sfui,代码行数:24,代码来源:Widget.cpp


示例10: GetRect

BOOL CGumpButton::FromString( XML::Node* node )
{
	if (!CGumpEntity::FromString(node)) return FALSE;

	int normal, over, pressed;;

	XML::Node* gump_node = node->findNode("gump");
	if (gump_node) { 
		gump_node->lookupAttribute("normal", normal);
		gump_node->lookupAttribute("over", over);
		gump_node->lookupAttribute("pressed", pressed);
	}

	CSize size = GetRect().Size();
	SetConstraints(size,size);
	
	CGumpEditorDoc* pDoc = GfxGetGumpDocument(); ASSERT(pDoc);
	
	m_pGump[NORMAL] = pDoc->LoadGump(normal);
	m_pGump[HOVER] = pDoc->LoadGump(over);
	m_pGump[PRESSED] = pDoc->LoadGump(pressed);
	
	return TRUE;
}
开发者ID:BackupTheBerlios,项目名称:iris-svn,代码行数:24,代码来源:GumpButton.cpp


示例11: CalcLineNumberWidth

void CLineNumberEdit::Prepare()
{
	// Calc sizes
	int width = CalcLineNumberWidth();
	CRect rect;
	GetClientRect( &rect );
	CRect rectEdit( rect );
	rect.right = width;
	rectEdit.left = rect.right + 3;

	// Setting the edit rect and
	// creating or moving child control
	SetRect( &rectEdit );
	if( m_line.m_hWnd )
		m_line.MoveWindow( 0, 0, width, rect.Height() );
	else
		m_line.Create(NULL,WS_CHILD | WS_VISIBLE | SS_NOTIFY, rect, this, 1 );

	GetRect( &rectEdit );

	// Update line number control data
	m_line.SetTopMargin( rectEdit.top );
	UpdateTopAndBottom();
}
开发者ID:WinnerSoftLab,项目名称:WinnerMediaPlayer,代码行数:24,代码来源:LineNumberEdit.cpp


示例12: GetRect

void duListCtrl::AdjustVisibleLine(int nTop)
{
	duRect rcListCtrl;
	GetRect(&rcListCtrl);

	int i;
	for (i = m_nFirstLine; i < m_vtLines.size(); i++)
	{
		duPlugin *pTemp = m_vtLines[i];
		if (pTemp)
		{
			duRect rcTemp;
			pTemp->GetRect(&rcTemp);
			
			pTemp->SetPosTop(nTop);
			pTemp->Resize(NULL);
			pTemp->SetVisible(TRUE); // 后面的控件还需要SetVisible(FALSE);
			
			nTop += rcTemp.Height();
			if (nTop >= rcListCtrl.Height())
				break;
		}
	}
}
开发者ID:blueantst,项目名称:dulib,代码行数:24,代码来源:duListCtrl.cpp


示例13: input

CString CDiagramCombobox::Export( UINT /*format*/ )
/* ============================================================
	Function :		CDiagramCombobox::Export
	Description :	Exports this object to str using format
					
	Return :		CString		-	The resulting string
	Parameters :	UINT format	-	The format to export to
					
	Usage :			An example Export-function. In this case, 
					we are not using the format parameter, as 
					we only have one format.

   ============================================================*/
{
	return "";


	CString input( "\t<select class='controls' style='position:absolute;left:%i;top:%i;width:%i;height:%i;' onchange='JavaScript:comboboxHandler(this)' name='%s'></select>" );
	CString str;
	CRect rect = GetRect();
	str.Format( input, rect.left - 2, rect.top - 2, rect.Width(), rect.Height(), GetName() );

	return str;
}
开发者ID:BackupTheBerlios,项目名称:iris-svn,代码行数:24,代码来源:DiagramCombobox.cpp


示例14: rg

void ConsoleCanvas::MouseEvent(wxMouseEvent& event)
{
      m_pParent->SetCursor ( wxCURSOR_ARROW );

      int x,y;
      event.GetPosition(&x, &y);


//    Check the region of the Route/Leg button
#ifdef __WXMSW__
      if(event.LeftDown())
      {
            wxRegion rg(m_pLegRouteButton->GetRect());
            if(rg.Contains(x,y)  == wxInRegion)
            {
                  m_bShowRouteTotal = !m_bShowRouteTotal;
                  if(m_bShowRouteTotal)
                        pThisLegBox->SetLabel(_("Route"));
                  else
                        pThisLegBox->SetLabel(_("This Leg"));

                  pThisLegBox->Refresh(true);
            }
      }

///  Why is this necessary???
//    Because of the CaptureMouse call in chcanv.cpp when mouse enters concanv region

      wxRect rr = GetRect();
      if(!rr.Contains(x + rr.x, y + rr.y) )
            ReleaseMouse();

#endif


}
开发者ID:dongmingdmdm,项目名称:OpenCPN,代码行数:36,代码来源:concanv.cpp


示例15: SGD_ASSERT

void Player::Render(void) {

	if (m_pCharaterAnim != nullptr) {


		// Validate the image
		SGD_ASSERT(m_hImage != SGD::INVALID_HANDLE, "Entity::Render - image was not set!");

		SGD::Point ptOffset = SGD::Point{ 
			(m_ptPosition /*- m_szSize / 2*/).x - GameplayState::GetInstance()->GetWorldCamPosition().x,
			(m_ptPosition /*- m_szSize / 2*/).y - GameplayState::GetInstance()->GetWorldCamPosition().y 
		};
		SGD::Rectangle rectOffset = GetRect();
		rectOffset.Offset(-GameplayState::GetInstance()->GetWorldCamPosition().x, -GameplayState::GetInstance()->GetWorldCamPosition().y);

		// Draw the image
		SGD::GraphicsManager::GetInstance()->DrawRectangle(rectOffset, SGD::Color(255, 255, 0));
		//SGD::GraphicsManager::GetInstance()->DrawTexture(m_hImage, ptOffset, m_fRotation, m_szSize / 2, SGD::Color{ 255, 255, 255 });
		//SGD::GraphicsManager::GetInstance()->DrawTextureSection(m_hImage, ptOffset, {0.0f, 0.0f, 64.0f, 64.0f}, m_fRotation, m_szSize / 2, SGD::Color{ 255, 255, 255 });
		m_pCharaterAnim->Render(ptOffset, m_bIsFlipped);

	}

}
开发者ID:aosyang,项目名称:FS-Project,代码行数:24,代码来源:Player.cpp


示例16: GetClientRect

void CStaticStatusBar::DrawBk(CDC *pDC)
{
	int crOldBk = pDC->GetBkColor();

	CRect rect;
	GetClientRect(&rect);

	//Background
	pDC->FillSolidRect(&rect, m_crBk);

	//Top line
	pDC->FillSolidRect(rect.left, rect.top, rect.Width(), 1, m_crTopSep);
	pDC->FillSolidRect(rect.left, rect.top + 1, rect.Width(), 1, m_crTopLeft);

	//Bottom line
	pDC->FillSolidRect(rect.left, rect.bottom, rect.Width(), 1, m_crBottomRight);

	PartData* pPartData = NULL;
	CRect rcPart;

	int nPane, nCount = m_mapParts.GetCount();
	for(nPane = 0; nPane < nCount; nPane++)
	{
		GetRect(nPane, &rcPart);

		m_mapParts.Lookup(nPane, pPartData);
		if(pPartData->nDrawType != SBT_NOBORDERS)
		{
			ASSERT((UINT)rcPart.Width() > m_nSepWidth);
			rcPart.left = rcPart.right - m_nSepWidth;
			DrawSep(pDC, &rcPart);
		}
	}
	
	pDC->SetBkColor(crOldBk);
}
开发者ID:killbug2004,项目名称:cosps,代码行数:36,代码来源:StaticStatusBar.cpp


示例17: dc

void CXTPReportFilterEditControl::OnPaint()
{
	if (GetWindowTextLength() == 0 && ::GetFocus() != m_hWnd)
	{
		CPaintDC dc(this); // device context for painting

		CXTPFontDC autoFont(&dc, GetFont(), GetXtremeColor(COLOR_GRAYTEXT));

		// show hint text
		CString  strText = GetHint();

		CRect rc;
		GetClientRect(&rc);
		dc.FillSolidRect(rc, GetXtremeColor(COLOR_WINDOW));

		CRect rcText;
		GetRect(&rcText);
		dc.DrawText(strText, rcText, DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_EDITCONTROL);
	}
	else
	{
		Default();
	}
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:24,代码来源:XTPReportFilterEditControl.cpp


示例18: GetRect

void TBScrollBar::UpdateHandle()
{
	// Calculate the mover size and position
	bool horizontal = m_axis == AXIS_X;
	int available_pixels = horizontal ? GetRect().w : GetRect().h;
	int min_thickness_pixels = MIN(GetRect().h, GetRect().w);

	int visible_pixels = available_pixels;

	if (m_max - m_min > 0 && m_visible > 0)
	{
		double visible_proportion = m_visible / (m_visible + m_max - m_min);
		visible_pixels = (int)(visible_proportion * available_pixels);

		// Limit the size of the indicator to the slider thickness so that it doesn't
		// become too tiny when the visible proportion is very small.
		visible_pixels = MAX(visible_pixels, min_thickness_pixels);

		m_to_pixel_factor = (double)(available_pixels - visible_pixels) / (m_max - m_min)/*+ 0.5*/;
	}
	else
	{
		m_to_pixel_factor = 0;

		// If we can't scroll anything, make the handle invisible
		visible_pixels = 0;
	}

	int pixel_pos = (int)(m_value * m_to_pixel_factor);

	TBRect rect;
	if (horizontal)
		rect.Set(pixel_pos, 0, visible_pixels, GetRect().h);
	else
		rect.Set(0, pixel_pos, GetRect().w, visible_pixels);

	m_handle.SetRect(rect);
}
开发者ID:CarlJacobs,项目名称:turbobadger,代码行数:38,代码来源:tb_widgets_common.cpp


示例19: CDuiMenu

// 显示弹出菜单
void CMenuItem::ShowPopupMenu()
{
	// 如果已经显示了子菜单,则直接退出
	if(m_pPopupMenu)
	{
		return;
	}

	if(m_bIsPopup)
	{
		m_pPopupMenu = new CDuiMenu(DuiSystem::GetDefaultFont(), 12);
		m_pPopupMenu->SetAutoClose(FALSE);
		m_pPopupMenu->SetParent(this);
		m_pPopupMenu->m_clrRowHover = m_clrHover;	// 设置菜单菜单的背景色
		CPoint point;
		CRect rc = GetRect();
		point.SetPoint(rc.left + rc.Width(), rc.top);
		int nMenuWidth = rc.Width();

		CDlgBase* pParentDlg = GetParentDialog();
		// 如果菜单项定义了XML文件,则使用此菜单项定义的XML文件加载子菜单
		// 否则查找父菜单对象,找到对应的XML文件名,使用此XML文件名加载子菜单
		CString strXmlFile = _T("");		
		CDuiMenu* pParentMenu = GetParentMenu();
		if(pParentMenu)
		{
			if(!m_strMenuXml.IsEmpty())
			{
				// 使用菜单项定义的XML文件
				strXmlFile = m_strMenuXml;
			}else
			{
				// XML文件设置为父菜单对象的XML文件
				strXmlFile = pParentMenu->GetXmlFile();
			}
			// 必须将父菜单对象的自动关闭关掉,否则子菜单显示时候,父菜单失去焦点,会自动销毁
			pParentMenu->SetAutoClose(FALSE);
			// 转换子菜单的坐标
			::ClientToScreen(pParentMenu->GetSafeHwnd(), &point);

			// 将父菜单的预设值菜单项列表添加到子菜单中
			for (size_t i = 0; i < pParentMenu->m_vecMenuItemValue.size(); i++)
			{
				MenuItemValue& itemValue = pParentMenu->m_vecMenuItemValue.at(i);
				m_pPopupMenu->m_vecMenuItemValue.push_back(itemValue);
			}
		}

		if(!strXmlFile.IsEmpty())
		{
			BOOL bSucc = m_pPopupMenu->LoadXmlFile(strXmlFile, pParentDlg, point, WM_DUI_MENU, GetName());
			if(bSucc)	// 加载弹出菜单成功才显示弹出菜单
			{
				// 计算菜单的位置并显示
				CRect rc;
				m_pPopupMenu->GetWindowRect(&rc);
				// 如果超出屏幕右侧范围,则菜单窗口往左移动一些,移动到当前菜单的左侧
				int nScreenWidth= GetSystemMetrics(SM_CXFULLSCREEN);
				if(rc.right > nScreenWidth)
				{
					//rc.OffsetRect(nScreenWidth - rc.right -10, 0);	// 移动到屏幕最右侧
					rc.OffsetRect(-(nMenuWidth + rc.Width()), 0);	// 移动到当前菜单左侧
				}
				int nScreenHeight= GetSystemMetrics(SM_CYFULLSCREEN);
				if(rc.bottom > nScreenHeight)
				{
					rc.OffsetRect(0, -(rc.Height() - m_rc.Height()));	// 高度超出屏幕则改为下对齐方式
				}
				m_pPopupMenu->MoveWindow(rc);
				m_pPopupMenu->ShowWindow(SW_SHOW);
				m_pPopupMenu->SetAutoClose(TRUE);
			}else
			{
				// 弹出菜单加载失败,删除菜单对象
				delete m_pPopupMenu;
				m_pPopupMenu = NULL;
			}
		}
	}
}
开发者ID:ForkProject,项目名称:DuiVision,代码行数:81,代码来源:MenuItem.cpp


示例20: GetRect

NS_IMETHODIMP
nsBaseScreen::GetRectDisplayPix(int32_t *outLeft,  int32_t *outTop,
                                int32_t *outWidth, int32_t *outHeight)
{
  return GetRect(outLeft, outTop, outWidth, outHeight);
}
开发者ID:AshishNamdev,项目名称:mozilla-central,代码行数:6,代码来源:nsBaseScreen.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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