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


C++ GetScreenRect函数代码示例

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


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

示例1: GetMenuName

bool CollectionNavigationPane::ShowContextMenu(const OpPoint &point, BOOL center, OpTreeView* view, BOOL use_keyboard_context)
{
	const char* menu_name = GetMenuName();
	if (!menu_name)
		return true;

	NavigationItem* item = static_cast<NavigationItem*>(m_tree_view->GetOpWidget()->GetSelectedItem());

	OpPoint p(point.x+GetScreenRect().x, point.y+GetScreenRect().y);
	g_application->GetMenuHandler()->ShowPopupMenu(menu_name, PopupPlacement::AnchorAt(p, center), item->GetID(), use_keyboard_context);
	return true;
}
开发者ID:prestocore,项目名称:browser,代码行数:12,代码来源:CollectionNavigationPane.cpp

示例2: GetScreenRect

void CCWidget::Draw(CCDrawContext* pDC){
	if(m_bVisible==false) return;

	unsigned char nLastOpacity;
	nLastOpacity = pDC->GetOpacity();

	sRect sr = GetScreenRect();
	pDC->SetOrigin(sPoint(sr.x, sr.y));

	if(m_pFont!=NULL) pDC->SetFont(m_pFont);
	else pDC->SetFont(CCFontManager::Get(NULL));

	pDC->SetOpacity((unsigned char)(nLastOpacity * (float)(m_iOpacity / 255.0f)));
	if(!IsEnable())
		pDC->SetOpacity((unsigned char)(pDC->GetOpacity()*0.70));	

	bool bIntersect = true;
	sRect rectScreen(0, 0, CCGetWorkspaceWidth()-1, CCGetWorkspaceHeight()-1);
	sRect PrevClipRect;
	if(GetParent()!=NULL) {
		sRect parentClipRect = CCClientToScreen(GetParent(), GetParent()->GetClientRect());
		bIntersect = rectScreen.Intersect(&PrevClipRect,parentClipRect);
	}else
		PrevClipRect = rectScreen;

	sRect CurrClipRect = GetScreenRect();
	sRect IntersectClipRect;

	if(m_bClipByParent==true){
		if(PrevClipRect.Intersect(&IntersectClipRect, CurrClipRect)==true){
			sRect test = IntersectClipRect;
			if(IntersectClipRect.w>0 && IntersectClipRect.h>0) {
				pDC->SetClipRect(IntersectClipRect);
				OnDraw(pDC);
			}
		}
	}
	else{
		pDC->SetClipRect(CurrClipRect);
		OnDraw(pDC);
	}

	for(int i=0; i<m_Children.GetCount(); i++){
		CCWidget* pCurWnd = m_Children.Get(i);
		if(pCurWnd==GetLatestExclusive()) continue;
		if(pCurWnd != NULL ) pCurWnd->Draw(pDC);
	}
	if(GetLatestExclusive()!=NULL) 
		GetLatestExclusive()->Draw(pDC);

	pDC->SetOpacity(nLastOpacity);
}
开发者ID:Kallontz,项目名称:gunz-the-tps-mmorpg,代码行数:52,代码来源:CCWidget.cpp

示例3: switch

void DockCont::EventProc(XWindow& w, XEvent *event)
{

	if (IsOpen()) {
		switch(event->type) {
		case ConfigureNotify:{
				XConfigureEvent& e = event->xconfigure;
				if (Point(e.x, e.y) != GetScreenRect().TopLeft()) {
					if (!dragging)
						MoveBegin();
					Moving();
					SetFocus();
					dragging = true;
				}
			}
			break;
		case FocusIn: {
				XFocusChangeEvent &e = event->xfocus;
				if (e.mode == NotifyUngrab && dragging) {
					dragging = false;
					MoveEnd();
	//				SetFocus();
					return;
				}
				break;
			}
		}
	}
	TopWindow::EventProc(w, event);
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:30,代码来源:DockCont.cpp

示例4: memcpy

void CCWidget::MakeLocalEvent(CCEvent* pLoalEvent, const CCEvent* pEvent){
	memcpy(pLoalEvent, pEvent, sizeof(CCEvent));

	sRect sr = GetScreenRect();
	pLoalEvent->sPos.x -= sr.x;
	pLoalEvent->sPos.y -= sr.y;
}
开发者ID:Kallontz,项目名称:gunz-the-tps-mmorpg,代码行数:7,代码来源:CCWidget.cpp

示例5: MessageBox

bool SharedDesktopArea::Apply()
{
	if (IsChecked(IDC_WINDOW) && m_hwndShared == NULL) {
		MessageBox(NULL,
				"You have not yet selected a window to share.\n"
				"Please first select a window with the 'Window Target'\n"
				"icon, and try again.", "No Window Selected",
				 MB_OK | MB_ICONEXCLAMATION);
		return false;
	}

	m_server->FullScreen(IsChecked(IDC_FULLSCREEN));
	m_server->PrimaryDisplayOnlyShared(IsChecked(IDC_PRIMARY_DISPLAY_ONLY));
	m_server->ScreenAreaShared(IsChecked(IDC_SCREEN));
	m_server->WindowShared(IsChecked(IDC_WINDOW));

	if (m_server->FullScreen()) {
		RECT temp = GetScreenRect();
		m_server->SetMatchSizeFields(temp.left, temp.top, temp.right, temp.bottom);
	} else if (m_server->PrimaryDisplayOnlyShared()) {
		int w = GetSystemMetrics(SM_CXSCREEN);
		int h = GetSystemMetrics(SM_CYSCREEN);
		m_server->SetMatchSizeFields(0, 0, w, h);
	} else if (m_server->ScreenAreaShared()) {
		int left, right, top, bottom;
		m_pMatchWindow->GetPosition(left, top, right, bottom);
		m_server->SetMatchSizeFields(left, top, right, bottom);
	} else if  (m_server->WindowShared()) {
		m_server->SetWindowShared(m_hwndShared);
	}

	return true;
}
开发者ID:bk138,项目名称:CollabTool,代码行数:33,代码来源:SharedDesktopArea.cpp

示例6: wxMenu

/**< context menu */
void ImagePanel::OnContextMenu(wxContextMenuEvent& event)
{
	if (m_stMP.iState != 0)
		return;

	wxMenu* pMenu = new wxMenu();
	wxASSERT_MSG(pMenu != nullptr, _T("Create Popup Menu failed."));
	wxMenuItem* pMenuItem = nullptr;
	// group 1
	if (m_img.IsOk())
	{
		pMenuItem = new wxMenuItem(pMenu, ID_CMENU_SAVE, _("&Save Image"), _("Save the Image"));
		pMenu->Append(pMenuItem);
	}
	// popup
	if (pMenuItem != nullptr)
	{
		wxPoint pt = event.GetPosition();
		if (pt == wxDefaultPosition)
		{
			// position invalide, get the mouse position
			pt = wxGetMousePosition();
			wxRect rc = GetScreenRect();
			if (!rc.Contains(pt))
			{
				// mouse is't in the panel, get the panel center
				pt.x = rc.x + rc.width/2;
				pt.y = rc.y + rc.height/2;
			}
		}
		pt = ScreenToClient(pt);
		PopupMenu(pMenu, pt);
	}
	delete pMenu;
}
开发者ID:gxcast,项目名称:GEIM,代码行数:36,代码来源:ImagePanel.cpp

示例7: OnModulesLoded

static int OnModulesLoded(WPARAM, LPARAM)
{
	HookEvent(ME_CLIST_CONTACTICONCHANGED, OnContactIconChanged);
	HookEvent(ME_SKIN_ICONSCHANGED, OnSkinIconsChanged);
	HookEvent(ME_CLUI_CONTACTDRAGGING, OnContactDrag);
	HookEvent(ME_CLUI_CONTACTDROPPED, OnContactDrop);
	HookEvent(ME_CLUI_CONTACTDRAGSTOP, OnContactDragStop);
	HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged);
	HookEvent(ME_DB_CONTACT_DELETED, OnContactDeleted);
	HookEvent(ME_OPT_INITIALISE, OnOptionsInitialize);
	HookEvent(ME_CLIST_STATUSMODECHANGE, OnStatusModeChange);
	HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnPrebuildContactMenu);

	hwndMiranda = pcli->hwndContactList;
	mir_subclassWindow(hwndMiranda, newMirandaWndProc);

	// No thumbs yet
	bEnableTip = ServiceExists("mToolTip/ShowTip");

	RegisterWindowClass();
	GetScreenRect();
	LoadDBSettings();
	CreateBackgroundBrush();
	CreateThumbsFont();
	LoadContacts();
	LoadMenus();

	if (fcOpt.bToTop) {
		fcOpt.ToTopTime = (fcOpt.ToTopTime < 1) ? 1 : fcOpt.ToTopTime;
		fcOpt.ToTopTime = (fcOpt.ToTopTime > TOTOPTIME_MAX) ? TOTOPTIME_MAX : fcOpt.ToTopTime;
		ToTopTimerID = SetTimer(NULL, 0, fcOpt.ToTopTime*TOTOPTIME_P, ToTopTimerProc);
	}
	return 0;
}
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:34,代码来源:main.cpp

示例8: GetDialogRect

const Rect ColorPicker::GetDialogRect() const
{
    Rect dialogRect;
    dialogRect.dx = ControlsFactory::COLOR_MAP_SIDE + 
                    ControlsFactory::COLOR_SELECTOR_WIDTH + 
                    ControlsFactory::COLOR_PREVIEW_SIDE + 
                    ControlsFactory::OFFSET * 4;

    dialogRect.dy = ControlsFactory::COLOR_MAP_SIDE + 
                    ControlsFactory::BUTTON_HEIGHT*2 + 
                    ControlsFactory::OFFSET * 3;

    dialogRect.x = (GetScreenRect().dx - dialogRect.dx) / 2;
    dialogRect.y = (GetScreenRect().dy - dialogRect.dy) / 2;
    return dialogRect;
}
开发者ID:abaradulkin,项目名称:dava.framework,代码行数:16,代码来源:ColorPicker.cpp

示例9: GetScreenRect

void GUIEditMultiString::Draw()
{
	Rect	rc;
	GetScreenRect(rc);

	if(GUISystem::Instance()->GetFocus() == this)
	{
		if(textChanged)
		{
			GUIControlContainer::Draw();
			DrawText(rc, false);
			textChanged	=	false;
		}

		if(showCursor)
		{
			pApp->GetGraphicsSystem()->SetColor(0,0,0);
			pApp->GetGraphicsSystem()->DrawRect(rc.x + cursorX, rc.y + cursorY - yOffset, cursorWidth, pFont->GetHeight());
		}
	}
	else
	{
		GUIControlContainer::Draw();
		DrawText(rc, false);
	}
}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:26,代码来源:GUIEditMultiString.cpp

示例10: GetScreenRect

void tabButton::updateMouse(wxMouseEvent& event)
{
	if (m_bSelected)
		return;

	wxRect panelRec = GetScreenRect();
	panelRec.x += 2;
	panelRec.y += 2;
	panelRec.width -= 4;
	panelRec.height -= 4;

	wxPoint mousePoint = wxGetMousePosition();

	bool t1 = panelRec.x <= mousePoint.x;
	bool t2 = panelRec.y <= mousePoint.y;
	bool t3 = (panelRec.x + panelRec.width ) >= mousePoint.x;
	bool t4 = (panelRec.y + panelRec.height) >= mousePoint.y;

	if (t1 && t2 && t3 && t4)
	{
		this->SetBackgroundColour( MOUSEOVER );
	}
	else
	{
		this->SetBackgroundColour( NORMAL );
	}

	this->Refresh();
}
开发者ID:EasyCoding,项目名称:desura-app,代码行数:29,代码来源:TabButton.cpp

示例11: LLOG

void  Ctrl::ScrollView(const Rect& _r, int dx, int dy)
{
	GuiLock __;
	LLOG("ScrollView " << _r << " " << dx << " " << dy);
	if(IsFullRefresh() || !IsVisible())
		return;
	Size vsz = GetSize();
	dx = sgn(dx) * min(abs(dx), vsz.cx);
	dy = sgn(dy) * min(abs(dy), vsz.cy);
	Rect r = _r & vsz;
	LLOG("ScrollView2 " << r << " " << dx << " " << dy);
	Ctrl *w;
	for(w = this; w->parent; w = w->parent)
		if(w->InFrame()) {
			Refresh();
			return;
		}
	if(!w || !w->top) return;
	Rect view = InFrame() ? GetView() : GetClippedView();
	Rect sr = (r + view.TopLeft()) & view;
	sr += GetScreenRect().TopLeft() - w->GetScreenRect().TopLeft();
	if(w->AddScroll(sr, dx, dy))
		Refresh();
	else {
		LTIMING("ScrollCtrls1");
		Top *top = GetTopCtrl()->top;
		for(Ctrl *q = GetFirstChild(); q; q = q->GetNext())
			if(q->InView())
				ScrollCtrl(top, q, r, q->GetRect(), dx, dy);
		if(parent)
			for(Ctrl *q = parent->GetFirstChild(); q; q = q->GetNext())
				if(q->InView() && q != this)
					ScrollCtrl(top, q, r, q->GetScreenRect() - GetScreenView().TopLeft(), dx, dy);
	}
}
开发者ID:pedia,项目名称:raidget,代码行数:35,代码来源:CtrlDraw.cpp

示例12: InRect

bool CGUIObject::StealsMouse(int x, int y)
{
	if (isDisabled())
		return false;
	else
		return InRect(x, y, GetScreenRect());
}
开发者ID:daoluong,项目名称:interactivenovelengine,代码行数:7,代码来源:GUIObject.cpp

示例13: GetScreenRect

void StripMenuButton::updateMouse()
{
	wxRect panelRec = GetScreenRect(); 
	panelRec.x += 2;
	panelRec.y += 2;
	panelRec.width -= 4;
	panelRec.height -= 4;

	wxPoint mousePoint = wxGetMousePosition();

	bool t1 = panelRec.x <= mousePoint.x;
	bool t2 = panelRec.y <= mousePoint.y;
	bool t3 = (panelRec.x + panelRec.width ) >= mousePoint.x;
	bool t4 = (panelRec.y + panelRec.height) >= mousePoint.y;

	if (t1 && t2 && t3 && t4)
	{
		if (!m_bHovering)
		{
			SetForegroundColour( m_colHover );
			m_bHovering = true;
			invalidatePaint();
			this->Refresh();
		}
	}
	else if (m_bHovering)
	{
		SetForegroundColour( m_colNormal );
		m_bHovering = false;
		invalidatePaint();
		this->Refresh();
	}
}
开发者ID:CSRedRat,项目名称:desura-app,代码行数:33,代码来源:StripMenuButton.cpp

示例14: ASSERT

void PopUpDockWindow::ShowInnerPopUps(DockCont &dc, DockCont *target)
{
	ASSERT(target);
	Rect wrect = GetScreenRect();
	Size psz(style->innersize, style->innersize);
	Rect prect = Rect(psz);
	Point cp;
	psz /= 2;

	cp = target->GetScreenRect().CenterPoint();
	int d = psz.cy * 5;
	cp.x = minmax(cp.x, wrect.left + d, wrect.right - d);
	cp.y = minmax(cp.y, wrect.top + d, wrect.bottom - d);

	int align = GetDockAlign(*target);
	if (IsTB(align)) { // Left/right docking allowed
		ShowPopUp(inner[DOCK_LEFT], prect.Offseted(cp.x - psz.cx*3, cp.y - psz.cy));
		ShowPopUp(inner[DOCK_RIGHT], prect.Offseted(cp.x + psz.cx, cp.y - psz.cy));
	}
	else {
		inner[DOCK_LEFT].Close();
		inner[DOCK_RIGHT].Close();
	}
	if (!IsTB(align)) { // Top/bottom docking allowed
		ShowPopUp(inner[DOCK_TOP], prect.Offseted(cp.x - psz.cx, cp.y - psz.cy*3));
		ShowPopUp(inner[DOCK_BOTTOM], prect.Offseted(cp.x - psz.cx, cp.y + psz.cy));
	}
	else {
		inner[DOCK_TOP].Close();
		inner[DOCK_BOTTOM].Close();
	}
	if (IsTabbing())
		ShowPopUp(inner[4], prect.Offseted(cp.x-psz.cx, cp.y-psz.cy));
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:34,代码来源:DockWindow.cpp

示例15: DistributeAccessKeys

void TopWindow::Open(HWND hwnd)
{
	GuiLock __;
	if(dokeys && (!GUI_AKD_Conservative() || GetAccessKeysDeep() <= 1))
		DistributeAccessKeys();
	USRLOG("   OPEN " << Desc(this));
	LLOG("TopWindow::Open, owner HWND = " << FormatIntHex((int)hwnd, 8) << ", Active = " << FormatIntHex((int)::GetActiveWindow(), 8));
	IgnoreMouseUp();
	SyncCaption();
#ifdef PLATFORM_WINCE
	if(!GetRect().IsEmpty())
#endif
	if(fullscreen) {
		SetRect(GetScreenRect()); // 12-05-23 Tom changed from GetScreenSize() to GetScreenRect() in order to get full screen on correct display
		Create(hwnd, WS_POPUP, 0, false, SW_SHOWMAXIMIZED, false);
	}
	else {
		CenterRect(hwnd, hwnd && hwnd == GetTrayHWND__() ? center ? 2 : 0 : center);
		Create(hwnd, style, exstyle, false, state == OVERLAPPED ? SW_SHOWNORMAL :
		                                    state == MINIMIZED  ? SW_MINIMIZE :
		                                                          SW_MAXIMIZE, false);
	}
	PlaceFocus();
	SyncCaption();
	FixIcons();
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:26,代码来源:TopWin32.cpp


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