示例#1
0
void	MIOMouse_Where (OOTint *pmX, OOTint *pmY, OOTint *pmButtonUpDown)
{
    int	myButtonUpDown;
    
    MIO_CheckOuputIsToWindow ("Mouse.Where");
    MIO_CheckOuputWindowIsInGraphicsMode ("Mouse.Where");
    MIO_MakePopupWindowVisible ();

    MDIOWinGraph_GetMousePos (MIO_selectedRunWindow, pmX, pmY, &myButtonUpDown);

    // Convert the internal representation of the button to the Turing one.
    *pmButtonUpDown = 0;
    if (stMultiButtonMode)
    {
	if (myButtonUpDown & LEFT_BUTTON)
	    *pmButtonUpDown += 1;
	else if (myButtonUpDown & MIDDLE_BUTTON)
	    *pmButtonUpDown += 10;
	else if (myButtonUpDown & RIGHT_BUTTON)
	    *pmButtonUpDown += 100;
    }
    else
    {
    	if (myButtonUpDown != 0) 
    	    *pmButtonUpDown = 1;
    }
} // MIOMouse_Where
示例#2
0
void	MIOMouse_Show (void)
{
    MIO_CheckOuputIsToWindow ("Mouse.Show");
    MIO_CheckOuputWindowIsInGraphicsMode ("Mouse.Show");
    MIO_MakePopupWindowVisible ();

    // TW Fill in
} // MIOMouse_Show
示例#3
0
void	MIOMouse_SetPosition (OOTint pmX, OOTint pmY)
{
    MIO_CheckOuputIsToWindow ("Mouse.SetPosition");
    MIO_CheckOuputWindowIsInGraphicsMode ("Mouse.SetPosition");
    MIO_MakePopupWindowVisible ();

    // TW Fill in
} // MIOMouse_SetPosition
示例#4
0
void	MIOMouse_Hide (void)
{
    MIO_CheckOuputIsToWindow ("Mouse.ButtonMoved");
    MIO_CheckOuputWindowIsInGraphicsMode ("Mouse.ButtonMoved");
    MIO_MakePopupWindowVisible ();

    // TW Fill in
} // MIOMouse_Hide
示例#5
0
int	MIOMouse_ButtonMoved (OOTstring pmString)
{
    MIO_CheckOuputIsToWindow ("Mouse.ButtonMoved");
    MIO_CheckOuputWindowIsInGraphicsMode ("Mouse.ButtonMoved");
    MIO_MakePopupWindowVisible ();

    return MIOMouse_ButtonMoved1 (MyConvertButtonString (pmString));
} // MIOMouse_ButtonMoved
示例#6
0
void	MIOMouse_ButtonWait (OOTstring pmString, OOTint *pmX, OOTint *pmY, 
			     OOTint *pmButtonNumber, OOTint *pmButtonUpDown)
{
    int			myMotionType = MyConvertButtonString (pmString);
    MIOWinInfoPtr	myInfo = MIOWin_GetInfo (MIO_selectedRunWindow);
    MOUSEPOINT		*myPtr;
    EventDescriptor	myEvent;
    
    MIO_CheckOuputIsToWindow ("Mouse.ButtonWait");
    MIO_CheckOuputWindowIsInGraphicsMode ("Mouse.ButtonWait");
    MIO_MakePopupWindowVisible ();

    if (MIOMouse_ButtonMoved1 (myMotionType))
    {
    	while (myInfo -> mouseBufferTail != myInfo -> mouseBufferHead)
    	{
	    myPtr = &myInfo -> mouseBuffer [myInfo -> mouseBufferTail];
	    myInfo -> mouseBufferTail = INC(myInfo -> mouseBufferTail);
	    if (myPtr -> buttonDirection & myMotionType)
	    {
	    	*pmX = myPtr -> x;
	    	*pmY = myPtr -> y;
	    	*pmButtonNumber = 1;
	    	if (stMultiButtonMode)
	    	{
	    	    if (myPtr -> button == LEFT_BUTTON)
		    	*pmButtonNumber = 1;
		    else if (myPtr -> button == MIDDLE_BUTTON)
		    	*pmButtonNumber = 2;
		    else if (myPtr -> button == RIGHT_BUTTON)
		    	*pmButtonNumber = 3;
	    	}
	    	if (myPtr -> buttonDirection = BUTTON_UP)
	            *pmButtonUpDown = 1;
	    	else
	    	    *pmButtonUpDown = 0;
	    	
	    	return;
	    } // if (myPtr -> buttonDirection & myMotionType)    	
        } // while

	// TW - Internal Error!    	
    }

    // There is no mouse event in the queue.  Wait for the event
    myEvent.mode = EventMode_MouseButton;
    myEvent.count = myMotionType;
    Language_Execute_EventQueueInsert ((int) NULL, &myEvent);
} // MIOMouse_ButtonWait
示例#7
0
OOTint	MIOSprite_New (OOTint pmPicID, SRCPOS *pmSrcPos)
{
    SpriteInfo		*mySpriteInfo;
    char		myAllocMessage [4096];
    static int		myStSpriteCount = 1;
    
    MIO_CheckOuputIsToWindow ("Sprite.New");
    MIO_CheckOuputWindowIsInGraphicsMode ("Sprite.New");
    MIO_MakePopupWindowVisible ();
    
    mySpriteInfo = (SpriteInfo *) malloc (sizeof (SpriteInfo));
    if (mySpriteInfo == NULL)
    {
	SET_ERRNO (E_PIC_CANT_ALLOC_MEM_FOR_PIC);
	return 0;
    }

//    mySpriteInfo -> picID = pmPicID;
    MIOPic_GetInfoForSprite (pmPicID, &(mySpriteInfo -> picWidth),
			     &(mySpriteInfo -> picHeight),
			     &(mySpriteInfo -> picTransparentColour),
			     &(mySpriteInfo -> picMDPicInfo));
    mySpriteInfo -> x = MIO_selectedRunWindowInfo -> width / 2;
    mySpriteInfo -> y = MIO_selectedRunWindowInfo -> height / 2;
    mySpriteInfo -> spriteRect = MyGetSpriteRect (mySpriteInfo);
    mySpriteInfo -> spriteHeight = FOREGROUND_HEIGHT + myStSpriteCount;
    mySpriteInfo -> centered = FALSE;
    mySpriteInfo -> visible = FALSE;
    myStSpriteCount++;

    MDIO_sprintf (myAllocMessage, "Allocated from picture %d", pmPicID);
    mySpriteInfo -> spriteID = MIO_IDAdd (SPRITE_ID, mySpriteInfo, pmSrcPos, 
					  myAllocMessage, NULL);

    // Couldn't allocate an identifier.  Return the default font ID.
    if (mySpriteInfo -> spriteID == 0)
    {
	MyFreeSprite (mySpriteInfo);
	return 0;
    }

    MIOPic_IncremementSpriteUse (pmPicID);

    MyAddToQueue (MIO_selectedRunWindowInfo, mySpriteInfo);

    return mySpriteInfo -> spriteID;
} // MIOSprite_New
示例#8
0
xxx
#endif

/**********/
/* Macros */
/**********/

/*************/
/* Constants */
/*************/

/********************/
/* Global variables */
/********************/

/*********/
/* Types */
/*********/

/**********************/
/* External variables */
/**********************/

/********************/
/* Static constants */
/********************/

/********************/
/* Static variables */
/********************/

/******************************/
/* Static callback procedures */
/******************************/

/*********************/
/* Static procedures */
/*********************/


/***********************/
/* External procedures */
/***********************/
/************************************************************************/
/* MIOText_Cls								*/
/************************************************************************/
void	MIOText_Cls (void)
{
    MIOWinInfoPtr	myInfo = MIOWin_GetInfo (MIO_selectedRunWindow);
    BOOL		myOldXOR;
    
    MIO_CheckOuputIsToWindow ("Text.Cls");
    MIO_CheckOuputWindowIsInGraphicsMode ("Text.Cls");
    MIO_MakePopupWindowVisible ();
    
    // Implemented simply as a drawfillbox of the entire screen in the
    // text background color
    myOldXOR = myInfo -> xor;
    myInfo -> xor = FALSE;
    MIODraw_Box (0, 0, myInfo -> width - 1, myInfo -> height - 1, NO_STYLE,
    		 NORMAL_WIDTH, myInfo -> textBGColour, FILL);
    myInfo -> xor = myOldXOR;

    // Set the cursor positon to upper-left corner
    myInfo -> actualCol = 0;
    myInfo -> actualRow = 0;
    myInfo -> row = 0;
    myInfo -> col = 0;
    myInfo -> startInputRow = 0;
    myInfo -> startInputCol = 0;
    
    // Display the caret, if appropriate
    MIOWin_CaretDisplay (MIO_selectedRunWindow);
} // MIOText_Cls