コード例 #1
0
ファイル: macnte.c プロジェクト: ChristianeDufresne/GUD
/* mouse procedure for TextEdit
 */
short NATEmousep(na_win *winp, Point p, short type, short mods)
{
	TEHandle	hTE = teinfo->hTE;
	
	if (!PtInRect(p, &(*hTE)->viewRect)) return (NA_NOTPROCESSED);
	if (type == NA_DOWN1 || type == NA_DOWN2 || type == NA_DOWNN) {
		TEClick(p, mods & shiftKey ? true : false, hTE);
		NAmousetime = TickCount();
		NAlastmouse++;
	}
	
	return (NA_PROCESSED);
}
コード例 #2
0
ファイル: _TEmodule.c プロジェクト: 0xcc/python-read
static PyObject *TEObj_TEClick(TEObject *_self, PyObject *_args)
{
    PyObject *_res = NULL;
    Point pt;
    Boolean fExtend;
#ifndef TEClick
    PyMac_PRECHECK(TEClick);
#endif
    if (!PyArg_ParseTuple(_args, "O&b",
                          PyMac_GetPoint, &pt,
                          &fExtend))
        return NULL;
    TEClick(pt,
        fExtend,
        _self->ob_itself);
    Py_INCREF(Py_None);
    _res = Py_None;
    return _res;
}
コード例 #3
0
static void click_DocWin(Point local, short /*modifiers*/)
{
	TEClick(local, 0, gDocTE);
}
コード例 #4
0
static void click_LogWin(Point local, short /*modifiers*/)
{
	TEClick(local, 0, gLogTE);
}
コード例 #5
0
ファイル: Retro68Test.c プロジェクト: clehner/Retro68Test
void RunLoop()
{
	EventRecord    theEvent;
	WindowPtr whichWindow;
	Rect txRect;
	
	txRect = qd.thePort->portRect;
	
	InsetRect(&txRect,4,0);
	textH = TENew(&txRect,&txRect);
	
	while (!quit)
	{
		SystemTask();
		TEIdle(textH);

		if (GetNextEvent(everyEvent, &theEvent))
		{
			switch (theEvent.what)
			{
				case mouseDown:
				{
					switch (FindWindow(theEvent.where, &whichWindow))
					{
						case inSysWindow:
						{
							SystemClick(&theEvent, whichWindow);
							break;
						}
						case inMenuBar:
						{
							DoCommand(MenuSelect(theEvent.where));
							break;
						}
						case inDrag:
						{
							DragWindow(whichWindow, theEvent.where, &qd.screenBits.bounds);
							break;
						}
						case inContent:
						{
							if (whichWindow != FrontWindow())
							{
								SelectWindow(whichWindow);
							}
							else
							{
								GlobalToLocal(&theEvent.where);
								if (theEvent.modifiers&shiftKey)
									isShift = true;
								
								TEClick(theEvent.where, isShift, textH);
							}
							break;
						}

						case inGoAway:
						{
							if (TrackGoAway(whichWindow, theEvent.where)) {
								quit = true;
							}
							break;
						}

						default:
							break;
					}
					break;
				}
				case autoKey:
				case keyDown:
				{
					char theChar = (theEvent.message&charCodeMask);
					
					if (theEvent.modifiers&cmdKey)
					{
						DoCommand(MenuKey(theChar));
						
						if (theChar == 'm')
						{
							quit = true;
						}
					}
					else
					{
						TEKey(theChar, textH);
					}
					
					break;
				}
				case activateEvt:
				{
					if (theEvent.modifiers&activeFlag)
					{
						TEActivate(textH);
					}
					else
					{
						TEDeactivate(textH);
					}
					break;
				}
				case updateEvt:
				{
					BeginUpdate((WindowPtr)theEvent.message);
					EraseRect(&(qd.thePort->portRect));
					TEUpdate(&(qd.thePort->portRect), textH);
					EndUpdate((WindowPtr)theEvent.message);
					break;
				}
				default:
					break;
			}
		}
	}
}