home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 3
/
CDPDIII.bin
/
pd
/
graphics
/
3d
/
icoons
/
source
/
center.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-10-04
|
2KB
|
81 lines
/* :ts=8 */
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include "general.h"
#include "globals.h"
#include "intui.h"
#include "normal.h"
#include "spl_math.h"
#include "spl_util.h"
static
void Center_Select_Down(short X, short Y)
/************************************************************************/
/* */
/* Function called when mouse is selected to mark a new center. */
/* X, Y are the actual coordinates in the active window 'Win'. */
/* */
/************************************************************************/
{
short View_Id;
View_Id = Screen_To_World(X, Y, Current_Pos);
if (View_Id < 0) return;
Set_Offset(Current_Pos, View_Id);
Compute_Splines();
Set_Mode_Normal();
Redraw_Mask |= What_All;
} /* Center_Select_Down */
Boolean_T Center_Handle_Event(struct IntuiMessage *Msg)
/************************************************************************/
/* */
/* */
/************************************************************************/
{
switch (Msg->Class) {
case IDCMP_MOUSEBUTTONS:
/* Msg->Code contain id of button pressed */
/* Msg->MouseX and Msg->MouseY contain mouse position */
switch (Msg->Code) {
case SELECTDOWN:
Center_Select_Down(Msg->MouseX, Msg->MouseY);
return(TRUE);
} /* switch (Msg->Code) */
break;
} /* switch (Msg->Class) */
return(FALSE);
} /* Center_Handle_Event */
void Set_Mode_Center()
/************************************************************************/
/* */
/* */
/************************************************************************/
{
State.Handle_Event = Center_Handle_Event;
State.Redraw = Normal_Redraw;
Display_Status("Center");
} /* Set_Mode_Center */