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

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

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

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

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

示例1: Bounds

voidQuaSymbolBridge::MouseDown(BPoint where){	long		channel, quant;	BRect		area = Bounds();	ulong		mods = modifiers(); // Key mods???	ulong		buts;	BMessage	*msg;	BPoint		pt;	drawing_mode	cur_mode = DrawingMode();	long		clicks;		GetMouse(&pt, &buts);	msg = Window()->CurrentMessage();		if ((clicks=msg->FindInt32("clicks")) == 1) {		if (buts & B_SECONDARY_MOUSE_BUTTON) {			BPopUpMenu	*qMenu = new BPopUpMenu("env sel", true, FALSE);						BPoint			orig = where;			ConvertToScreen(&where);						BMessage	*msg = new BMessage(SET_DISPLAY_MODE);			msg->AddInt32("display mode", OBJECT_DISPLAY_SMALL);			BMenuItem	*item = new BMenuItem("Small", msg);			qMenu->AddItem(item);			item->SetTarget(this);					msg = new BMessage(SET_DISPLAY_MODE);			msg->AddInt32("display mode", OBJECT_DISPLAY_BIG);			item = new BMenuItem("Large", msg);			qMenu->AddItem(item);			item->SetTarget(this);					qMenu->SetAsyncAutoDestruct(true);			qMenu->Go(where, true, false, true);		} else {			msg = new BMessage(MOVE_OBJECT);		 	msg->AddPointer("sym_object", this);		 				if (mods & B_SHIFT_KEY) {				((ObjectViewContainer *)Parent())->AddSelection(this);			} else {				((ObjectViewContainer *)Parent())->Select(this);			}					DragMessage(msg, area);		}	} else if (clicks > 1) {	// edit object		Edit();	} else {	}}
开发者ID:dakyri,项目名称:qua,代码行数:54,


示例2: GetMouse

// MouseWheelChangedboolDragSortableListView::MouseWheelChanged(float x, float y){	BPoint where;	uint32 buttons;	GetMouse(&where, &buttons, false);	if (Bounds().Contains(where))		return true;	else		return false;}
开发者ID:DonCN,项目名称:haiku,代码行数:12,


示例3: GetMouse

void TextScrollerView::MouseDown(BPoint point){	tracking_mouse = true;	uint32 buttons;	GetMouse(&point,&buttons);	previous_point = point;	while (buttons) {		float distance = (point.y - previous_point.y) / 10.0;		if (distance > 0)			distance = min_c(distance,5.0);		else			distance = max_c(distance,-5.0);		LockLooper();		text_view->ScrollBy(0,-distance);		GetMouse(&point,&buttons);		UnlockLooper();		snooze(20 * 1000);	}	tracking_mouse = false;}
开发者ID:puckipedia,项目名称:ArtPaint,代码行数:21,


示例4: DragGraphWindow

INT DragGraphWindow (GRAPH_WINDOW *gw, EventRecord *theEvent, DOC_DRAG_EVENT *docDrag){  WindowPtr theWindow;  int TopOld, BottomOld, LeftOld, RightOld, Left, Right, Top, Bottom, DelLeft, DelRight, DelTop, DelBottom;  Rect currentRect;  Rect theDragRect;  Point MouseLoc;  theWindow = MAC_WIN(gw);        #warning do we need kWindowContentRgn instead of kWindowStructureRgn?  GetWindowBounds(theWindow, kWindowStructureRgn, &currentRect);  /* store old corners of the window */  TopOld     = currentRect.top;  BottomOld  = currentRect.bottom;  LeftOld    = currentRect.left;  RightOld   = currentRect.right;  /* set drag rect */  GetMouse(&MouseLoc);  LocalToGlobal(&MouseLoc);  Left   = DragRect()->left       + MouseLoc.h - LeftOld;  Right  = DragRect()->right      + MouseLoc.h - RightOld;  Top    = DragRect()->top        + MouseLoc.v - TopOld;  Bottom = DragRect()->bottom + MouseLoc.v - BottomOld;  SetRect(&theDragRect,Left,Top,Right,Bottom);  /* drag window */  DragWindow (theWindow,theEvent->where,&theDragRect);  /* report new size */        #warning do we need kWindowContentRgn instead of kWindowStructureRgn?  GetWindowBounds(theWindow, kWindowStructureRgn, &currentRect);  Left   = currentRect.left;  Right  = currentRect.right;  Top    = currentRect.top;  Bottom = currentRect.bottom;  DelLeft         = Left  - LeftOld;  DelRight        = Right - RightOld;  DelTop          = Top   - TopOld;  DelBottom       = Bottom- BottomOld;  if (DelLeft==0 && DelRight==0 && DelTop==0 && DelBottom)    return (NO_POS_CHANGE);  docDrag->Global_LL[0] = gw->Global_LL[0] += DelLeft;  docDrag->Global_LL[1] = gw->Global_LL[1] += DelBottom;  docDrag->Global_UR[0] = gw->Global_UR[0] += DelRight;  docDrag->Global_UR[1] = gw->Global_UR[1] += DelTop;  return (POS_CHANGE);}
开发者ID:rolk,项目名称:ug,代码行数:52,


示例5: GetMouse

void Mover::MouseMoved(BPoint p,uint32 transit,const BMessage *bla){    if (moving)    {        uint32 dummy;        GetMouse(&p,&dummy,false);        p = ConvertToScreen(p);        BMessage moved(MOVER_MESSAGE);        moved.AddPointer(MM_VIEW,this);        float coord;        if (vertical)            coord = p.x-clickPoint.x;        else            coord = p.y-clickPoint.y;        moved.AddFloat(MM_COORD,coord);        // est-on dans les limites?        bool l_InLimits = true;        if (!vertical)        {            if ( (coord < limits.top) || (coord > limits.bottom))                l_InLimits = false;        }        else        {            if ( (coord < limits.left) || (coord > limits.right))                l_InLimits = false;        }        if (l_InLimits)            Window()->PostMessage(&moved);    }    else        switch(transit)        {        case B_ENTERED_VIEW:            if(vertical)                be_app->SetCursor(verticalMouse);            else                be_app->SetCursor(horizontalMouse);            break;        case B_EXITED_VIEW:        case B_OUTSIDE_VIEW:            be_app->SetCursor(B_HAND_CURSOR);            break;        default:            break;        }}
开发者ID:mmadia,项目名称:behappy-svn_clone,代码行数:52,


示例6: GetMouse

voidTMagnify::NudgeMouse(float x, float y){	BPoint loc;	uint32 button;	GetMouse(&loc, &button);	ConvertToScreen(&loc);	loc.x += x;	loc.y += y;	set_mouse_position((int32)loc.x, (int32)loc.y);}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:13,


示例7: GetMouse

voidTipsterText::MouseDown(BPoint pt){	BPoint temp;	uint32 buttons;	GetMouse(&temp, &buttons);	if (Bounds().Contains(temp)) {		BMessage message(M_UPDATE_TIP);				fMessenger->SendMessage(&message);	}}
开发者ID:hannahyp,项目名称:Tipster,代码行数:13,


示例8: MakeFocus

void PulseView::MouseDown(BPoint point) {	BPoint cursor;	uint32 buttons;	MakeFocus(true);	GetMouse(&cursor, &buttons, true);	if (buttons & B_SECONDARY_MOUSE_BUTTON) {		ConvertToScreen(&point);		// Use the asynchronous version so we don't interfere with		// the window responding to Pulse() events		popupmenu->Go(point, true, false, true);	}}
开发者ID:Barrett17,项目名称:haiku-contacts-kit-old,代码行数:13,


示例9: GetMouse

bool CObjectRotateCamera::Update(){    CMouseManager* mouse = GetMouse();    bool down[2] = {mouse->IsPressed(0), mouse->IsPressed(1)};    int x = mouse->GetX();    int y = mouse->GetY();    int dx = x - m_lastx;    int dy = y - m_lasty;        bool needUpdate = false;    if (!GetKeyboard()->IsPressed(VK_SHIFT) && m_lastDown[0] && down[0] && (abs(dx) + abs(dy) > 0))    {        m_anglex += dx * 0.01f; // * elapsedTime;        m_anglez += dy * 0.01f;// * elapsedTime;        m_anglex = NormAngle(m_anglex);        m_anglez = NormAngle(m_anglez);        Point3 eye = Angle2Pos(m_anglex, m_anglez);        SetEye(eye.x, eye.y, eye.z);                 needUpdate = true;    }    if (GetMouse()->GetWheel() != 0)    {        m_radius *= max(0.01f, 1 - GetMouse()->GetWheel() * 0.0003f);        Point3 eye = Angle2Pos(m_anglex, m_anglez);        SetEye(eye.x, eye.y, eye.z);        needUpdate = true;    }    m_lastDown[0] = down[0];    m_lastDown[1] = down[1];    m_lastx = x;    m_lasty = y;       return needUpdate;}
开发者ID:redclock,项目名称:GIEngine,代码行数:39,


示例10: GetGWorld

void MCScreenDC::querymouse(int2 &x, int2 &y){	CGrafPtr oldport;	GDHandle olddevice;	GetGWorld(&oldport, &olddevice);	MoveWindow(invisibleWin, 0, 0, False); // OS X moves this.	SetGWorld(GetWindowPort(invisibleWin), GetMainDevice());	Point mloc;	GetMouse(&mloc);      //get local mouse position	SetGWorld(oldport, olddevice);	x = mloc.h;	y = mloc.v;}
开发者ID:Bjoernke,项目名称:livecode,代码行数:13,


示例11: SetMouseEventMask

void PictureViewer::MouseDown(BPoint a) {  mouseDown = true;    oldMousePos = a;    SetMouseEventMask(1);  uint32 buttons;  int32 action = 0;  BPoint ad;  GetMouse(&ad, &buttons );    if ( buttons == B_PRIMARY_MOUSE_BUTTON )  action = setup->LeftMouseAction();  if ( buttons == B_SECONDARY_MOUSE_BUTTON )  action = setup->RightMouseAction();  if ( buttons == B_TERTIARY_MOUSE_BUTTON )  action = setup->MiddleMouseAction();  if (action == P_OPENNEW) {       if (thePic != NULL) {          if (theRef != NULL)  be_roster->Launch(theRef);          mouseDown = false;          return;       }  }  if (action == P_CLIPPING)   {    if (  (setup->ViewingMode() == PEEK_IMAGE_SCALED_NICELY)   ||          (setup->ViewingMode() == PEEK_IMAGE_SCALE_TO_WINDOW) ||          (setup->ViewingMode() == PEEK_IMAGE_SCALE_TO_WINDOW)       ) return;              if (thePic != NULL)        {          if (clipping) DrawClipping();          busyClipping = true;          clipping = true;          clippingRegion.Set( ad.x, ad.y, ad.x, ad.y );       }  }  if (action == P_FULLSCREEN) {      ((WindowPeek*)Window())->SetFullScreen( ! setup->FullScreen() );          return;  }  if (action == P_HIDEFILES) {      ((WindowPeek*)Window())->SetCompactMode( ! setup->CompactMode()   );      return;  }}
开发者ID:HaikuArchives,项目名称:Peek,代码行数:51,


示例12: GetMouse

void TPanelWindowView::MouseDown( BPoint point ){	uint32 buttons;	GetMouse( &point, &buttons );	if ( !fIsDraggingFromOutside )	{		if ( modifiers() & B_SHIFT_KEY )		{			int count = 5;			while ( count )			{				count --;				BPoint pw;				uint32 mods;				GetMouse( &pw, &mods );				if ( !mods )					break;				if ( !(modifiers() & B_SHIFT_KEY ) )					break;				if ( pw != point )				{//					TODO: fix this, we want this on separate thread so drawing doesnt block//					thread_id tid = spawn_thread( _rearrange_tabs_thread_entry, "ReArrangeTabsThread", B_NORMAL_PRIORITY, this );//					resume_thread(tid);					ReArrangeTabsThread();					return;				}				snooze( 500000 / 5 );			}		}		TInnerPanel *panel = PanelAt( point );		if ( panel )			panel->MouseDown(point, buttons);	}}
开发者ID:HaikuArchives,项目名称:DockBert,代码行数:38,


示例13: mac_eventloop

static void mac_eventloop(void) {    Boolean gotevent;    EventRecord event;    RgnHandle cursrgn;    Point mousenow, mousethen;    KeyState *ks;    WindowPtr front;    cursrgn = NewRgn();    GetMouse(&mousethen);    for (;;) {    	mac_adjustcursor(cursrgn);	gotevent = WaitNextEvent(everyEvent, &event, LONG_MAX, cursrgn);	mac_adjustcursor(cursrgn);	front = mac_frontwindow();	if (front != NULL) {	    ks = mac_windowkey(front);	    if (ks->collecting_entropy) {		GetMouse(&mousenow);		if (mousenow.h != mousethen.h || mousenow.v != mousethen.v) {		    ks->entropy[ks->entropy_got++] = *(unsigned *)&mousenow;		    ks->entropy[ks->entropy_got++] = TickCount();		    if (ks->entropy_got >= ks->entropy_required)			ks->collecting_entropy = 0;		    SetControlValue(ks->progress, ks->entropy_got);		    mousethen = mousenow;		}		SetEmptyRgn(cursrgn);	    }	}	    	if (gotevent)	    mac_event(&event);	if (borednow)	    cleanup_exit(0);    }    DisposeRgn(cursrgn);}
开发者ID:LapsedAcademicsInc,项目名称:putty,代码行数:38,


示例14: GetCursorPos

void GetCursorPos(MOUSE_POINT& point){	#ifdef _MSC_VER		POINT p;		GetCursorPos (&p);			point.x = p.x;		point.y = p.y;	#else		Point p;		GetMouse (&p);		point.x = p.h;		point.y = p.v;	#endif}
开发者ID:brettminnie,项目名称:BDBGame,代码行数:14,


示例15: delete

// MouseDownvoidTestView::MouseDown(BPoint where){	// clear previous stroke	int32 count = fMouseSamples.CountItems();	for (int32 i = 0; i < count; i++)		delete (BPoint*)fMouseSamples.ItemAtFast(i);	fMouseSamples.MakeEmpty();	FillRect(Bounds(), B_SOLID_LOW);	// sample new stroke	uint32 buttons;	GetMouse(&where, &buttons);	MovePenTo(where);	while (buttons) {		StrokeLine(where);		fMouseSamples.AddItem(new BPoint(where));		snooze(20000);		GetMouse(&where, &buttons);	}}
开发者ID:mmanley,项目名称:Antares,代码行数:24,


示例16: GetMouse

void CGUISlider::AfterUpdate( float elapsedTime ){    m_bChanged = false;    if (m_bPushed)    {        m_bPushed = GetMouse()->IsPressed(0);        m_value = ComputeValue();        if (m_value != m_lastValue)        {            m_bChanged = true;            m_lastValue = m_value;        }    }}
开发者ID:redclock,项目名称:GIEngine,代码行数:14,


示例17: PyMac_PRECHECK

static PyObject *Evt_GetMouse(PyObject *_self, PyObject *_args){    PyObject *_res = NULL;    Point mouseLoc;#ifndef GetMouse    PyMac_PRECHECK(GetMouse);#endif    if (!PyArg_ParseTuple(_args, ""))        return NULL;    GetMouse(&mouseLoc);    _res = Py_BuildValue("O&",                         PyMac_BuildPoint, mouseLoc);    return _res;}
开发者ID:0xcc,项目名称:python-read,代码行数:14,


示例18: GetMouse

void FontDrawView::MouseDown(BPoint where){	BPoint pt;	uint32 buttons;	GetMouse(&pt,&buttons);	if(buttons == B_PRIMARY_MOUSE_BUTTON)		oldpoint=where;	if(buttons == B_SECONDARY_MOUSE_BUTTON)	{	fontlocation=where;		Draw(Bounds());	}}
开发者ID:HaikuArchives,项目名称:BePhotoMagic,代码行数:14,


示例19: GetCursorPosition

static voidGetCursorPosition( const WindowInfo *window, int pos[2] ){	Point mouse_pos;	float window_rect[4];	GetMouse( &mouse_pos );	CGSGetScreenRectForWindow( window->connection, window->drawable, window_rect );	pos[0] = mouse_pos.h - (int) window_rect[0];	pos[1] = (int) window_rect[3] - (mouse_pos.v - (int) window_rect[1]);	/*crDebug( "%i %i", pos[0], pos[1] );*/}
开发者ID:boompig,项目名称:chromium,代码行数:14,


示例20: DrawImageAdv

///////////////////// Draw the scrollbarvoid CScrollbar::Draw(SDL_Surface * bmpDest){	int x=0;	int length;    	// Top arrow	if(bTopButton)		x=15;	DrawImageAdv(bmpDest, gfxGUI.bmpScrollbar, x,0, iX,iY, 15,14);	// Bottom arrow	x=0;	if(bBotButton)		x=15;	DrawImageAdv(bmpDest, gfxGUI.bmpScrollbar, x,14, iX,iY+iHeight-14, 15,14);	// Main bit	DrawRectFill(bmpDest, iX,iY+14, iX+iWidth, iY+iHeight-14, tLX->clScrollbarBack);	DrawVLine(bmpDest, iY+14, iY+iHeight-14, iX,tLX->clScrollbarBackLight);	DrawVLine(bmpDest, iY+14, iY+iHeight-14, iX+iWidth,tLX->clScrollbarBackLight);	// Slider	if(iMax > iItemsperbox && iMax > 0) {		length = (int)((float)iItemsperbox/(float)iMax * iHeight-30);        length = MAX(length, 12);        		int pos = iScrollPos;		if(pos+length > iHeight-30)			pos=iHeight-30-length;		if (pos < 0)  			pos = 0;		DrawRectFill(bmpDest, iX+2, iY+15+pos, iX+iWidth-1, iY+15+pos+length, tLX->clScrollbarFront);        // Shine        DrawVLine(bmpDest, iY+15+pos, iY+15+pos+length, iX+1, tLX->clScrollbarHighlight);        DrawHLine(bmpDest, iX+1, iX+iWidth-1, iY+15+pos, tLX->clScrollbarHighlight);        // Dark        DrawVLine(bmpDest, iY+15+pos, iY+15+pos+length, iX+iWidth-1, tLX->clScrollbarShadow);        DrawHLine(bmpDest, iX+1, iX+iWidth-1, iY+15+pos+length, tLX->clScrollbarShadow);	}	// Slight hack	if( !GetMouse()->Button ) {		bTopButton=false;		bBotButton=false;	}		}
开发者ID:iamnilay3,项目名称:openlierox,代码行数:51,


示例21: DisplayHelpBalloons

// --------------------------------------------------------------------------------------void DisplayHelpBalloons(WindowRef prefsWindow){	GrafPtr savedPort;	Point mouseLocation;	Rect hotRects[3];	short hotRectID;	static int previousHotRectID = kNotInHotRect;		GetPort(&savedPort);	SetPortWindowPort(prefsWindow);		GetMouse(&mouseLocation);		GetWindowProperty(prefsWindow, kAppSignature, kHotRectsTag, 3 * sizeof(Rect), NULL, 						hotRects);		for (hotRectID = kInList; hotRectID < kNotInHotRect; hotRectID++)	{		if (PtInRect(mouseLocation, &hotRects[hotRectID]))		{			if (hotRectID != previousHotRectID)			{				HMMessageRecord helpMessage;				Point tips[3];								helpMessage.hmmHelpType = khmmStringRes;				helpMessage.u.hmmStringRes.hmmResID = rHelpStrings;				helpMessage.u.hmmStringRes.hmmIndex = hotRectID + 1;								GetWindowProperty(prefsWindow, kAppSignature, kBalloonTipsTag, 									3 * sizeof(Point), NULL, tips);				LocalToGlobal(&tips[hotRectID]);								LocalToGlobal(&topLeft(hotRects[hotRectID]));				LocalToGlobal(&botRight(hotRects[hotRectID]));								HMShowBalloon(&helpMessage, tips[hotRectID], &hotRects[hotRectID], NULL, 								kBalloonWDEFID, kTopLeftTipPointsLeftVariant, 								kHMRegularWindow);			}							break;		}	}		previousHotRectID = hotRectID;	SetPort(savedPort);}
开发者ID:fruitsamples,项目名称:CarbonPorting,代码行数:49,


示例22: mac_adjustcursor

/* * Make sure the right cursor's being displayed. */static void mac_adjustcursor(RgnHandle cursrgn){    Point mouse;    WindowPtr window, front;    short part;#if TARGET_API_MAC_CARBON    Cursor arrow;    RgnHandle visrgn;#endif    GetMouse(&mouse);    LocalToGlobal(&mouse);    part = FindWindow(mouse, &window);    front = FrontWindow();    if (part != inContent || window == NULL || window != front) {	/* Cursor isn't in the front window, so switch to arrow */#if TARGET_API_MAC_CARBON	GetQDGlobalsArrow(&arrow);	SetCursor(&arrow);#else	SetCursor(&qd.arrow);#endif	SetRectRgn(cursrgn, SHRT_MIN, SHRT_MIN, SHRT_MAX, SHRT_MAX);	if (front != NULL) {#if TARGET_API_MAC_CARBON	    visrgn = NewRgn();	    GetPortVisibleRegion(GetWindowPort(front), visrgn);	    DiffRgn(cursrgn, visrgn, cursrgn);	    DisposeRgn(visrgn);#else	    DiffRgn(cursrgn, front->visRgn, cursrgn);#endif	}    } else {	if (mac_wininfo(window)->adjustcursor != NULL)	    (*mac_wininfo(window)->adjustcursor)(window, mouse, cursrgn);	else {#if TARGET_API_MAC_CARBON	    GetQDGlobalsArrow(&arrow);	    SetCursor(&arrow);	    GetPortVisibleRegion(GetWindowPort(window), cursrgn);#else	    SetCursor(&qd.arrow);	    CopyRgn(window->visRgn, cursrgn);#endif	}    }}
开发者ID:LapsedAcademicsInc,项目名称:putty,代码行数:51,


示例23: MakeFocus

void DeskbarPulseView::MouseDown(BPoint point) {	BPoint cursor;	uint32 buttons;	MakeFocus(true);	GetMouse(&cursor, &buttons, true);	if (buttons & B_PRIMARY_MOUSE_BUTTON) {		BMessage *message = Window()->CurrentMessage();		int32 clicks = message->FindInt32("clicks");		if (clicks >= 2) {			BMessenger messenger(this);			BMessage *m = new BMessage(PV_NORMAL_MODE);			messenger.SendMessage(m);		}	} else MiniPulseView::MouseDown(point);}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:16,


示例24: MouseUp

    void MouseUp(BPoint where)    {        (void) where;        BPoint mouseWhere;        ulong buttons;        GetMouse(&mouseWhere, &buttons);        BMessage msg(GNASH_MOUSE_CLICKED);        if (B_OK != msg.AddBool("pressed", false)            || B_OK != msg.AddInt32("mask", _pressedbuttons & ~buttons))            QQ(1);        else            be_app_messenger.SendMessage(&msg);        _pressedbuttons = buttons;    }
开发者ID:BrandRegard,项目名称:gnash,代码行数:16,


示例25: GetMouse

void AmUndoableIntControl::MouseMoved(	BPoint pt,										uint32 code,										const BMessage *msg){	/* Sometimes, views might not receive a mouse up for	 * whatever reason.  If it looks like that's happened,	 * then behave as if I've had a mouse up.	 */	if (mUndo) {		BPoint	pointypointy;		uint32	button;		GetMouse(&pointypointy, &button, false);		if( button == 0 ) CommitUndo();	}	inherited::MouseMoved(pt, code, msg);}
开发者ID:HaikuArchives,项目名称:Sequitur,代码行数:16,


示例26: GetPort

/*=================================	GetMouseRelativeToPort==================================*/void SUMiscUtils::GetMouseRelativeToPort( Point *outPt ){	GrafPtr		currentPort;		GetPort( &currentPort );	ThrowIfNil_( currentPort );				// should never happen		GetMouse( outPt );	Rect theRect;#if PP_Target_Carbon	::GetPortBounds(currentPort, &theRect);#else	theRect = currentPort->portRect;#endif	outPt->h -= theRect.left;	// repair SetOrigin changes	outPt->v -= theRect.top;}
开发者ID:MaddTheSane,项目名称:tntbasic,代码行数:20,


示例27: GetMouse

void RDDBIcon::MouseDown(BPoint point){	uint32 buttons=0;	BPoint cursor;	GetMouse(&cursor,&buttons,true);	ConvertToScreen(&cursor);	cursor.y--;	cursor.x--;	/*	In the future, we may want to contact the restart_daemon and build a list of	applications that requested restarting and dynamically populate the pop-up	menu with these items. In theory, we could allow the restart request to be removed	for any given application with a simple menu selection by the user. For now,	however, we will just show the restart_daemon specific menu items.	*/	pop_up_menu->Go(cursor,true,false,true);}
开发者ID:HaikuArchives,项目名称:RestartDaemon,代码行数:17,


示例28: MouseDown

    void MouseDown(BPoint where)    {        (void) where;        MakeFocus();        BPoint mouseWhere;        ulong buttons;        GetMouse(&mouseWhere, &buttons);        // XXX many buttons clicked simultaneously        BMessage msg(GNASH_MOUSE_CLICKED);        if (B_OK != msg.AddBool("pressed", true)            || B_OK != msg.AddInt32("mask", buttons))            QQ(1);        else            be_app_messenger.SendMessage(&msg);        _pressedbuttons = buttons;    }
开发者ID:BrandRegard,项目名称:gnash,代码行数:17,



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


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