home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Kyūkyoku!! X68000 Emulator
/
X68000Book.dat
/
mac
/
OLS
/
X68000
/
Ko-Window
/
kow142s.lzh
/
corlib
/
MgInputSimpleOpen.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-09-07
|
1KB
|
63 lines
/* Copyright 1994 Ogasawara Hiroyuki (COR.) */
#include "corlib.h"
#include <HS_wlib.h>
#define INPUTMAX 128
static int
Exec( wp, info )
WindowID wp;
EventInfo *info;
{
DrawBuf dbuf[10];
MgInput *mp= WindowGetClientPointer( wp );
switch( info->option ){
case EventOpen:
return TRUE;
case EventKey:
MgInputKey( mp, info->KeyCode, info->ShiftStat );
return TRUE;
case EventClose:
WindowClose( wp );
return TRUE;
case EventRedraw:
DrawSetClear( dbuf, mp->input.attr & AttrReverse ?
mp->input.attr & 3 : 0 );
WindowDraw( wp, dbuf, InputSetDraw( dbuf+1, &mp->input )+1 );
return TRUE;
case EventMouseSwitch:
if( info->LeftON ){
UserSendOperation( mp->pwp,info, UserString, mp->buf );
return TRUE;
}
break;
case EventMouseEnter:
case EventMouseOut:
MgInputSetCursorVisible( mp, info->option == EventMouseEnter );
return TRUE;
}
return FALSE;
}
#define SCROFFSETH 0
#define SCROFFSETV 0
WindowID
MgInputSimpleOpen( mp, x, y, wp, len, attr, font )
MgInput *mp;
WindowID wp;
{
mp->x= x;
mp->y= y;
mp->h= font*len/2+ SCROFFSETH;
mp->v= font+ SCROFFSETV;
mp->pwp= wp;
mp->wp= WindowOpen( x, y, mp->h, mp->v, wp, Exec );
InputSet( &mp->input, 0, 0, mp->buf, INPUTMAX, attr, font );
WindowSetClientData( mp->wp, 0, mp );
WindowRedraw( mp->wp );
return mp->wp;
}