home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
d
/
dir_nm20.zip
/
Dir_NM_2.0
/
NM-Table.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-07-16
|
18KB
|
616 lines
/* === NM-Table.c ===
*
* void On_Row()
* void On_Atom()
* void On_Column()
* void Un_Line()
* void Draw_Map(X,Y)
* void Draw_Table_Frame(Column_Num,Row_Num)
* void List()
* void Update_Table(Mouse_x,Mouse_y)
* void Do_Insert(Mouse_x,Mouse_y)
* void Do_Copy(Mouse_x,Mouse_y)
* void Do_Re_Name(Mouse_x,Mouse_y,Button)
* void Do_Move(Mouse_x,Mouse_y)
* void Do_Delete(Mouse_x,Mouse_y)
* void Do_Value()
* void Do_Check_Tempo(Mouse_x,Mouse_y)
* void Do_Switch(Mouse_x,Mouse_y)
* void Do_Load(Mouse_x,Mouse_y)
* void Edit_Table(Mouse_x,Mouse_y)
* void Re_New_Pos(Mouse_x,Mouse_y)
* void Add_Word(Mouse_x,Mouse_y,Capital)
* void Edit_Word(Button,Mouse_x,Mouse_y)
*
*/
#include "NM.h"
void On_Row()
{
Row_On=1;Atom_On=0;Column_On=0;Row_Id=-10;Column_Id=-10;
}
void On_Atom()
{
Atom_On=1;Row_On=0;Column_On=0;Row_Id=-10;Column_Id=-10;
}
void On_Column()
{
Column_On=1;Row_On=0;Atom_On=0;Row_Id=-10;Column_Id=-10;
}
void Un_Line()
{
if (Column_On==1) Show_Column_Line=1-Show_Column_Line;
else if (Row_On==1)Show_Row_Line=1-Show_Row_Line;
}
void Draw_Map(X,Y)
int X,Y;
{
int i,j;
Rub(X-2,Y-1,233,93,"MediumBlue");XSetLineAttributes(display,gc,2,0,0,0);
SetColor("DeepSkyBlue");DrawRectangle(X,Y,229,91);SetColor("ivory");
XSetLineAttributes(display,gc,1,0,0,0);S_bf=(char *)malloc(10);*S_bf='\0';
for (i=1;i<12;i++) Line(X+19*i,Y+1,X+19*i,Y+90);
for (i=1;i<5;i++) Line(X+1,Y+18*i,X+228,Y+18*i);SetColor("khaki");
for (i=0;i<5;i++)
for (j=0;j<12;j++)
{ sprintf(S_bf,"%c",Map_Letter(j,i));OutTextXY(X+6+19*j,Y+14+18*i,S_bf); }
}
void Draw_Table_Frame(Column_Num,Row_Num)
int Column_Num,Row_Num;
{
int i,Pos_X,Y;
Rub(0,94,1139,768,"MediumBlue");Use_Font("7x14");
XSetLineAttributes(display,gc,2,0,0,0);
Rub(Head_Len+4,97,Table_Width-Head_Len-2,23,"MidNightBlue");
if (Row_Num>36)
{
Rub(Head_Len+4,122+36*20,Table_Width-Head_Len-2,23,"MidNightBlue");
Rub(4,122,Head_Len,36*20,"MidNightBlue");
}
else
{
Rub(Head_Len+4,122+Row_Num*20,Table_Width-Head_Len-2,23,"MidNightBlue");
Rub(4,122,Head_Len,Row_Num*20,"MidNightBlue");
}
SetColor("cyan");
if (Row_Num>36) DrawRectangle(3,96,Table_Width,49+36*20);
else DrawRectangle(3,96,Table_Width,49+Row_Num*20);
SetColor("yellow");XSetLineAttributes(display,gc,1,0,0,0);Pos_X=Head_Len+3;
for (i=Column_Pointer;i<Column_Pointer+Column_Num-1;i++)
{
if (Show_Column_Line==1)
{
if (Row_Num>36) Line(Pos_X,97,Pos_X,144+36*20);
else Line(Pos_X,97,Pos_X,144+Row_Num*20);
}
Pos_X+=Column_Range[i].Delta*7;
}
SetColor("yellow");
for (i=0;i<Row_Num+1;i++)
{
Y=120+i*20;if (Show_Row_Line==1 && i<=36) Line(4,Y,Table_Width+3,Y);
Row_Range[i].Position=Y;Row_Range[i].Delta=20;
}
}
void List()
{
int i,j,Pos_X,Max_Length;
Column_Range[0].Position=0;Max_Length=strlen(Table_Name);Map_Dx=0;Map_Dy=0;
for (j=Row_Pointer;j<Table_Row_Num;j++)
Max_Length=Max(Max_Length,strlen(Atom_array[j][0]));
Column_Range[0].Delta=Max_Length+3;Head_Len=7*Column_Range[0].Delta;
Table_Width=Head_Len;
if (Table_Row_Num-Row_Pointer>36) Table_Height=2*23+36*20-3;
else Table_Height=2*23+(Table_Row_Num-Row_Pointer)*20-3;
for (i=Column_Pointer;i<Table_Column_Num;i++)
{
Max_Length=strlen(Out_name[i-1])+1;
for (j=Row_Pointer;j<Table_Row_Num;j++)
Max_Length=Max(Max_Length,strlen(Atom_array[j][i]));
Column_Range[i].Position=Table_Width;Column_Range[i].Delta=Max_Length+2;
Table_Width+=7*Column_Range[i].Delta;
}
Draw_Table_Frame(Table_Column_Num-Column_Pointer+1,Table_Row_Num-Row_Pointer);
SetColor("white");Pos_X=12;SetColor("white");OutTextXY(Pos_X,114,Table_Name);
OutTextXY(Pos_X,138+(Table_Row_Num-Row_Pointer)*20,Table_Name);
SetColor("PaleGreen");
if (Table_Row_Num-Row_Pointer>36) /* Display Row Names */
for (i=Row_Pointer;i<Row_Pointer+36;i++)
OutTextXY(Pos_X,136+(i-Row_Pointer)*20,Atom_array[i][0]);
else for (i=Row_Pointer;i<Table_Row_Num;i++)
OutTextXY(Pos_X,136+(i-Row_Pointer)*20,Atom_array[i][0]);
Pos_X=Head_Len+12;
for (i=Column_Pointer;i<Table_Column_Num;i++)
{
SetColor("gold");OutTextXY(Pos_X,114,Out_name[i-1]);
if (Table_Row_Num-Row_Pointer>36)
OutTextXY(Pos_X,138+36*20,Out_name[i-1]);
else OutTextXY(Pos_X,138+(Table_Row_Num-Row_Pointer)*20,Out_name[i-1]);
SetColor("ivory");
if (Table_Row_Num-Row_Pointer>36)
for (j=Row_Pointer;j<Row_Pointer+36;j++)
OutTextXY(Pos_X,136+(j-Row_Pointer)*20,Atom_array[j][i]);
else for (j=Row_Pointer;j<Table_Row_Num;j++)
OutTextXY(Pos_X,136+(j-Row_Pointer)*20,Atom_array[j][i]);
Pos_X+=Column_Range[i].Delta*7;
}
}
void Update_Table(Mouse_x,Mouse_y)
int Mouse_x,Mouse_y;
{
SetColor("MediumBlue");FillRectangle(0,95,1139,767);List();
if (In_Table(Mouse_x,Mouse_y)==1) Hi_light_Table(Mouse_x,Mouse_y);
}
void Do_Insert(Mouse_x,Mouse_y)
int Mouse_x,Mouse_y;
{
int i,j;
if (Column_Id!=0 && Row_Id!=0 && Atom_On==0)
{
if (Row_On==1)
{
for (i=0;i<Table_Column_Num;i++)
{
Atom_array[Table_Row_Num][i]=(char *)malloc(50);
*Atom_array[Table_Row_Num][i]='\0';
}
for (i=Table_Row_Num;i>Row_Id;i--)
for (j=0;j<Table_Column_Num;j++)
strcpy(Atom_array[i][j],Atom_array[i-1][j]);
for (j=0;j<Table_Column_Num;j++)
sprintf(Atom_array[Row_Id][j],"%s","?\n");
Table_Row_Num++;
}
else if (Column_On==1)
{
In_name[Table_Column_Num-1]=(char *)malloc(50);
*In_name[Table_Column_Num-1]='\0';
Out_name[Table_Column_Num-1]=(char *)malloc(50);
*Out_name[Table_Column_Num-1]='\0';
for (i=0;i<Table_Row_Num;i++)
{
Atom_array[i][Table_Column_Num]=(char *)malloc(50);
*Atom_array[i][Table_Column_Num]='\0';
}
for (j=Table_Column_Num;j>Column_Id;j--)
{
strcpy(In_name[j-1],In_name[j-2]);
strcpy(Out_name[j-1],Out_name[j-2]);
for (i=0;i<Table_Row_Num;i++)
strcpy(Atom_array[i][j],Atom_array[i][j-1]);
}
sprintf(In_name[Column_Id-1],"%s","?\n");
sprintf(Out_name[Column_Id-1],"%s","?\n");
for (i=0;i<Table_Row_Num;i++)
sprintf(Atom_array[i][Column_Id],"%s","?\n");
Table_Column_Num++;
}
Column_Id=-10;Row_Id=-10;Update_Table(Mouse_x,Mouse_y);
}
}
void Do_Copy(Mouse_x,Mouse_y)
int Mouse_x,Mouse_y;
{
int i;
if (Copy==0)
{
Copy=-1;
if (Atom_On==1) { Row_Aim=Row_Id;Column_Aim=Column_Id; }
else if (Row_On==1) Row_Aim=Row_Id;
else if (Column_On==1) Column_Aim=Column_Id;
}
else
{
Copy=0;
if (Atom_On==1 && ((Row_Id>=0 && Row_Aim>=0) || (Row_Id<0 && Row_Aim<0)))
{
if (Row_Id<0)
{
if (Column_Id>0)
{
if (Row_Id==-2)
strcpy(In_name[Column_Id-1],In_name[Column_Aim-1]);
else if (Row_Id==-3)
strcpy(Out_name[Column_Id-1],Out_name[Column_Aim-1]);
}
else { Copy=0;Column_Id=-10;Row_Id=-10; }
}
else
strcpy(Atom_array[Row_Id][Column_Id],
Atom_array[Row_Aim][Column_Aim]);
}
else if (Column_On==1)
{
for (i=0;i<Table_Row_Num;i++)
strcpy(Atom_array[i][Column_Id],Atom_array[i][Column_Aim]);
strcpy(In_name[Column_Id-1],In_name[Column_Aim-1]);
strcpy(Out_name[Column_Id-1],Out_name[Column_Aim-1]);
}
else if (Row_On==1)
for (i=0;i<Table_Column_Num;i++)
strcpy(Atom_array[Row_Id][i],Atom_array[Row_Aim][i]);
Column_Id=-10;Row_Id=-10;Update_Table(Mouse_x,Mouse_y);
}
}
void Do_Re_Name(Mouse_x,Mouse_y,Button)
int Mouse_x,Mouse_y,Button;
{
char ch;
int Num;
if (Atom_On==1)
{
if (Replace==0 && In_Table(Mouse_x,Mouse_y)==1)
{
Replace=-1;Row_Aim=Row_Id;Column_Aim=Column_Id;
if (Row_Aim<0)
{
if (Column_Aim==0)
{
*Table_Name='\0';
sprintf(Table_Name+strlen(Table_Name),"%c",'?');
}
else
{
if (*Old_name[Column_Aim-1]=='\0')
strcpy(Old_name[Column_Aim-1],In_name[Column_Aim-1]);
*In_name[Column_Aim-1]='\0';
sprintf(In_name[Column_Aim-1]+
strlen(In_name[Column_Aim-1]),"%c",'?');
S_bf=(char *)malloc(10);*S_bf='\0';
sprintf(S_bf,"%-4i",content[Column_Aim-1]);
*Out_name[Column_Aim-1]='\0';
strcpy(Out_name[Column_Aim-1],In_name[Column_Aim-1]);
sprintf(Out_name[Column_Aim-1]+
strlen(Out_name[Column_Aim-1])," = %s",S_bf);
}
}
else sprintf(Atom_array[Row_Aim][Column_Aim]+6,"%c",'?');
Update_Table(Mouse_x,Mouse_y);
}
else if (Replace==-1 && In_Map(Mouse_x,Mouse_y)==1)
{
if (Button==Button1)
ch=Map_Letter((Mouse_x-Map_SX-1)/19,(Mouse_y-4)/18);
else ch=Map_Letter((Mouse_x-Map_SX-1)/19,(Mouse_y-4)/18)-32;
if (Row_Aim<0)
{
if (Column_Aim==0)
{
sprintf(Table_Name+strlen(Table_Name)-1,"%c",ch);
sprintf(Table_Name+strlen(Table_Name),"%c",'\n');
}
else
{
sprintf(In_name[Column_Aim-1]
+strlen(In_name[Column_Aim-1])-1,"%c",ch);
sprintf(In_name[Column_Aim-1]
+strlen(In_name[Column_Aim-1]),"%c",'\n');
S_bf=(char *)malloc(10);*S_bf='\0';
sprintf(S_bf,"%-4i",content[Column_Aim-1]);
*Out_name[Column_Aim-1]='\0';
strcpy(Out_name[Column_Aim-1],In_name[Column_Aim-1]);
sprintf(Out_name[Column_Aim-1]+
strlen(Out_name[Column_Aim-1])-1," = %s\n",S_bf);
}
}
else
{
sprintf(Atom_array[Row_Aim][Column_Aim]+
strlen(Atom_array[Row_Aim][Column_Aim])-1,"%c",ch);
Str_Append(Atom_array[Row_Aim][Column_Aim],'\n',1);
Num=Column_Aim*1000+Row_Aim-1000;
if (Column_Aim<Max_kind)
{
names[Num]=(char *)malloc(50);*names[Num]='\0';
sprintf(names[Num]+strlen(names[Num]),
Atom_array[Row_Aim][Column_Aim]);
}
else
{
*cont[Row_Aim].Set_name='\0';
sprintf(cont[Row_Aim].Set_name+
strlen(cont[Row_Aim].Set_name),
Atom_array[Row_Aim][Column_Aim]);
}
}
Update_Table(Mouse_x,Mouse_y);
}
}
}
void Do_Move(Mouse_x,Mouse_y)
int Mouse_x,Mouse_y;
{
int From_kind,From_num,To_kind,To_num;
if (Move==0) { Move=-1;Row_Aim=Row_Id;Column_Aim=Column_Id; }
else
{
Move=0;
if (((Column_Aim==1 && Column_Id==1)||(1<Column_Aim && 1<Column_Id ))
&& 0<=Row_Id && 0<=Row_Aim && Row_Aim<content[Column_Aim-1])
{
From_kind=Column_Aim-1;To_kind=Column_Id-1;
From_num=Row_Aim;To_num=Row_Id;
Move_Melody(From_kind,From_num,To_kind,To_num);
Get_List();Column_Id=-10;Row_Id=-10;Update_Table(Mouse_x,Mouse_y);
}
Action=0;
}
}
void Do_Delete(Mouse_x,Mouse_y)
int Mouse_x,Mouse_y;
{
int i,k,n,from,to,Num,Lim;
if (Atom_On)
{
if (Delete==0) { Delete=-1;Row_Aim=Row_Id;Column_Aim=Column_Id; }
else
{
Delete=0;
if (Column_Aim==Column_Id && 0<Column_Id && 0<=Row_Id &&
0<=Row_Aim && Row_Aim<content[Column_Aim-1])
{
n=Column_Id-1;
if (Row_Aim<Row_Id)
{ from=Row_Aim;to=Row_Id;if (to>content[n]-1) to=content[n]-1; }
else { from=Row_Id;to=Row_Aim; }
Del=from;k=to-from+1;
if (Column_Aim<Max_kind)
{
Get_Filename(n);if (now != n) { now=n;Load(); }
Move_Word(now,from,-1,to);Save(k,tail);Del=-1;
}
else
{
Lim=content[Max_kind-1]-Del-k;
for (i=0;i<Lim;i++)
{
S_bf=(char *)malloc(10);*S_bf='\0';
*cont[Del+i].Set_name='\0';sprintf(S_bf,"%5ld",Del+i+1);
strcpy(cont[Del+i].Set_name,S_bf);ch='.';
sprintf(cont[Del+i].Set_name+strlen(cont[Del+i].Set_name),
"%c",ch);
sprintf(cont[Del+i].Set_name+6,"%s",
Sub_Str(cont[Del+i+k].Set_name,6,44));
for (Num=0;Num<6;Num++)
{
cont[Del+i].tempo[Num]=cont[Del+i+k].tempo[Num];
cont[Del+i].instru[Num]=cont[Del+i+k].instru[Num];
}
}
content[Max_kind-1]-=k;Lim=content[Max_kind-1];
for (i=Lim;i<Lim+k;i++)
{
S_bf=(char *)malloc(10);*S_bf='\0';
*cont[i].Set_name='\0';sprintf(S_bf,"%5ld",i+1);
strcpy(cont[i].Set_name,S_bf);ch='.';
sprintf(cont[i].Set_name+strlen(cont[i].Set_name),"%c"
,ch);
sprintf(cont[i].Set_name+strlen(cont[i].Set_name),"%s\n",
"???");
for (j=0;j<6;j++)
{ cont[i].tempo[j]=0;cont[i].instru[j]=0; }
}
}
Get_List();Column_Id=-10;Row_Id=-10;Update_Table(Mouse_x,Mouse_y);
}
Action=0;
}
}
}
void Do_Value()
{
int Melody_Id;
Melody_Id=-1;
if (Column_Id>0)
{
next=Column_Id-1;
if (0<=Row_Id && Row_Id<content[Column_Id-1]) Melody_Id=Row_Id;
}
if (next==0) return;
if (Melody_Id!=-1)
{ if (next!=now) { now=next;Load(); } Adjust_Value(Melody_Id); }
}
void Do_Check_Tempo(Mouse_x,Mouse_y)
int Mouse_x,Mouse_y;
{
if (1<Column_Id && Column_Id<Max_kind-1) next=Column_Id-1;else return;
if (-1<Row_Id && Row_Id<content[next]) M_Id=Row_Id;else return;
if (now != next) { now=next;Load(); }
Check_Tempo();Column_Id=-10;Row_Id=-10;Update_Table(Mouse_x,Mouse_y);
}
void Do_Switch(Mouse_x,Mouse_y)
int Mouse_x,Mouse_y;
{
if (Switch==0)
{
if (1<Column_Id && Column_Id<Max_kind)
{ Switch=-1;Column_Aim=Column_Id; } else Action=0;return;
}
else
{
Switch=0;
if (1<Column_Id && Column_Id<Max_kind)
{
Switch_Melody(Column_Aim-1,Column_Id-1);
Buffer[0]=(char *)malloc(50);*Buffer[0]='\0';
strcpy(Buffer[0],In_name[Column_Aim-1]);
strcpy(In_name[Column_Aim-1],In_name[Column_Id-1]);
strcpy(In_name[Column_Id-1],Buffer[0]);
Buffer[0]=(char *)malloc(50);*Buffer[0]='\0';
strcpy(Buffer[0],Out_name[Column_Aim-1]);
strcpy(Out_name[Column_Aim-1],Out_name[Column_Id-1]);
strcpy(Out_name[Column_Id-1],Buffer[0]);
Save_Name();Save_Words();Column_Id=-10;Row_Id=-10;
Update_Table(Mouse_x,Mouse_y);
if ((now==Column_Aim-1 || now==Column_Id-1) && content[now]>0) Load();
}
Action=0;
}
}
void Do_Load(Mouse_x,Mouse_y)
int Mouse_x,Mouse_y;
{
char f_head[100],fn[100],Suffix[10];
struct stat statbuf;
int rv_stat,Len;
struct dirent *dirbuf;
DIR *dir;
next=Column_Id-1;if (now!=next) { now=next;if (content[now]>0) Load(); }
strcpy(f_head,"Dir_Text");rv_stat = stat(f_head, &statbuf);
if (!S_ISDIR(statbuf.st_mode))
{ printf("%s is not a directory\n",f_head);return; }
if ((dir=opendir(f_head)) == NULL)
{ printf("failed to open %s\n",f_head);return; }
while ((dirbuf = readdir(dir)) != NULL)
{
Len=strlen(dirbuf->d_name);strcpy(fn,f_head);
strcpy(Suffix,Sub_Str(dirbuf->d_name,Len-5,5));
if (strcmp(".text",Suffix)==0)
{
sprintf(fn+strlen(fn),"/%s",dirbuf->d_name);Load_From_Back_Up(fn,0,0);
}
}
closedir(dir);Save(1,content[now]);
Column_Id=-10;Row_Id=-10;Update_Table(Mouse_x,Mouse_y);
}
void Edit_Table(Mouse_x,Mouse_y)
int Mouse_x,Mouse_y;
{
if (In_Table(Mouse_x,Mouse_y)==1)
{
switch (Action)
{
case Re_Name_On:Do_Re_Name(Mouse_x,Mouse_y,Button1);break;
case Move_On:Do_Move(Mouse_x,Mouse_y);break;
case Delete_On:Do_Delete(Mouse_x,Mouse_y);break;
case Value_On:Do_Value();break;
case Check_Tmp_On:Do_Check_Tempo(Mouse_x,Mouse_y);break;
case Switch_On:Do_Switch(Mouse_x,Mouse_y);break;
case Load_Text_On:Do_Load(Mouse_x,Mouse_y);break;
}
if (Action!=Re_Name_On) Renew_Notice();
}
}
void Re_New_Pos(Mouse_x,Mouse_y)
int Mouse_x,Mouse_y;
{
int Len;
High_Light_Char(Word_X,Word_Y);Len=strlen(Words[New_Word])+Text_Base;
Word_X=(Mouse_x-47)/7;Word_Y=(Mouse_y-148)/Dist;
if (page*300+Word_Y*150+Word_X>Len)
{ Word_X=Len % 150;Word_Y=(Len/150) % 2; }
else if (page*300+Word_Y*150+Word_X<Text_Base) { Word_X=Text_Base;Word_Y=0; }
else if (Word_X<0) { Word_X=0;Word_Y=(Len/150) % 2; }
else if (Word_X>150) { Word_X=150;Word_Y=(Len/150) % 2; }
High_Light_Char(Word_X,Word_Y);Word_Pos=page*300+Word_Y*150+Word_X;
}
void Add_Word(Mouse_x,Mouse_y,Capital)
int Mouse_x,Mouse_y,Capital;
{
char ch,Str[2],*Word_Tail;
int A_Pos;
if (Word_Pos<(page+1)*300)
{
if (Capital!=-2) High_Light_Char(Word_X,Word_Y);
switch (Capital)
{
case 2:ch=Map_Letter(Text_Column_Id,Text_Row_Id)-32;break;
case 1:ch=Map_Letter(Text_Column_Id,Text_Row_Id);break;
case 0:ch=' ';Re_New_Pos(Mouse_x,Mouse_y);break;
case -1:ch=' ';break;
case -2:ch=' ';Re_New_Pos(Mouse_x,Mouse_y);break;
}
if (Word_Pos==strlen(Words[New_Word])+Text_Base)
{
Rub(Word_X*7+47,Word_Y*Dist+148,7,13,"NavyBlue");SetColor("cyan");
sprintf(Str,"%c",ch);OutTextXY(Word_X*7+47,Word_Y*Dist+159,Str);
sprintf(Words[New_Word]+strlen(Words[New_Word]),"%c",ch);
if (Word_Pos<3000 && Word_Pos!=(page+1)*300-1) Word_Pos++;
}
else
{
A_Pos=Word_Pos-Text_Base;
Word_Tail=(char *)malloc(3000);*Word_Tail='\0';
if (Capital>-1)
{
sprintf(Word_Tail+strlen(Word_Tail),"%s",
Sub_Str(Words[New_Word],A_Pos,
strlen(Words[New_Word])-A_Pos));
sprintf(Words[New_Word]+A_Pos,"%c",ch);
sprintf(Words[New_Word]+A_Pos+1,"%s",Word_Tail);
if (Word_Pos<3000 && Word_Pos!=(page+1)*300-1) Word_Pos++;
}
else
{
sprintf(Word_Tail+strlen(Word_Tail),"%s",
Sub_Str(Words[New_Word],A_Pos+1,
strlen(Words[New_Word])-A_Pos));
sprintf(Words[New_Word]+A_Pos,"%s",Word_Tail);
if (Word_Pos>strlen(Words[New_Word])+Text_Base) Word_Pos--;
}
Show_Word(New_Word,page);
}
Word_X=Word_Pos%150;Word_Y=(Word_Pos/150)%2;
High_Light_Char(Word_X,Word_Y);
}
}
void Edit_Word(Button,Mouse_x,Mouse_y)
int Button,Mouse_x,Mouse_y;
{
Use_Font("7x14");if (Word_Num>=0) Word_Num=-Word_Num;
switch (Button)
{
case Button1:if (In_Text(Mouse_x,Mouse_y)==1) Add_Word(Mouse_x,Mouse_y,1);
else if ((Mouse_y-148)%Dist<10) Re_New_Pos(Mouse_x,Mouse_y);
break;
case Button2:if (In_Text(Mouse_x,Mouse_y)==1) Add_Word(Mouse_x,Mouse_y,2);
else if ((Mouse_y-148)%Dist<10) Add_Word(Mouse_x,Mouse_y,0);
break;
case Button3:if (In_Text(Mouse_x,Mouse_y)==1)
Add_Word(Mouse_x,Mouse_y,-1);
else if ((Mouse_y-148)%Dist<10) Add_Word(Mouse_x,Mouse_y,-2);
break;
}
}