home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 3
/
CDPDIII.bin
/
pd
/
graphics
/
3d
/
icoons
/
source
/
origin.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-10-04
|
2KB
|
86 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"
#include "spl_gfx.h"
#include "origin.h"
static
void Origin_Select_Down(short X, short Y)
/************************************************************************/
/* */
/* Function called when mouse is selected to place origin. */
/* 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;
Draw_Origin(DM_Erase, What_All);
Set_Origin(Current_Pos);
Draw_Origin(DM_Normal, What_All);
Set_Mode_Normal();
} /* Origin_Select_Down */
Boolean_T Origin_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:
Origin_Select_Down(Msg->MouseX, Msg->MouseY);
return(TRUE);
} /* switch (Msg->Code) */
break;
} /* switch (Msg->Class) */
return(FALSE);
} /* Origin_Handle_Event */
void Set_Mode_Origin()
/************************************************************************/
/* */
/* */
/************************************************************************/
{
State.Handle_Event = Origin_Handle_Event;
State.Redraw = Normal_Redraw;
Display_Status("Place origin");
} /* Set_Mode_Origin */