home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Kyūkyoku!! X68000 Emulator
/
X68000Book.dat
/
mac
/
OLS
/
X68000
/
Ko-Window
/
kow142s.lzh
/
wsrv
/
simple.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-11-29
|
2KB
|
99 lines
/*
* âEâCâôâhâEÅêù¥è╓Éö
*
* Copyright T.Kobayashi
* 1990.2.3
*/
#include "clip.h"
#include "window.h"
#include "simple.h"
#include "wopen.h"
#define SHADOW 2
/*
proto -s simple.c > temp
*/
/*static int SimpleEvent( SimpleClass*, EventInfo* );*/
static void SimpleRedraw( SimpleClass* );
void SimpleSet( wp, x, y, h, v, parent, id, event )
SimpleClass *wp ;
int x, y, h, v ;
WindowClass *parent ;
int id ;
int (*event)();
{
WindowSet( (WindowClass*)wp, x, y, h+(2+SHADOW), v+(2+SHADOW), parent, -1,
systemfunc[SimpleType].eventfunc );
wp->window.type = SimpleType ;
WindowSetEventAttr( (WindowClass*)wp, EventAttrDefault );
WindowSetAttr( (WindowClass*)wp, 0 );
ClipSet( &(wp->window.curclip), 1, 1, h, v );
wp->simple.id = id ;
wp->simple.event = event ;
}
void SimpleResize( wp, x, y, h, v )
SimpleClass *wp ;
int x, y, h, v ;
{
WindowResize( (WindowClass*)wp, x, y, h+(2+SHADOW), v+(2+SHADOW) );
}
int SimpleEvent( wp, info )
SimpleClass *wp ;
EventInfo *info ;
{
switch( info->option )
{
case EventRedraw :
SimpleRedraw( wp );
case EventMouseSwitch :
case EventMouseMove :
case EventKey :
info->x -= 1 ;
info->y -= 1 ;
case EventOpen :
case EventClose :
case EventPop :
case EventPush :
case EventMove :
case EventResize :
case EventScroll :
case EventZoom :
case EventIconify :
case EventInterval :
case EventMouseEnter :
case EventMouseOut :
case EventUser :
case EventGraphic :
return( SendEvent( wp->simple.id, wp->simple.event, (WindowClass*)wp, info ) );
default :
ErrorCheck( FALSE, "SimpleEvent" );
}
return( FALSE );
}
static void SimpleRedraw( wp )
SimpleClass *wp ;
{
int h, v ;
DrawBuf buf[6], *bufp = buf ;
ClipGetSize( (ClipClass*)wp, &h, &v );
h -= SHADOW + 2 ;
v -= SHADOW + 2 ;
/* ÿg */
DrawSetLine( bufp++, 0, 0, h+1, v+1, ShadowUp, OptionShadow );
/* ëe */
DrawSetLine( bufp++, SHADOW+1, v+2, h+1, v+(1+SHADOW), 0, OptionFill );
DrawSetLine( bufp++, h+2, SHADOW+1, h+(1+SHADOW), v+(1+SHADOW), 0, OptionFill );
WindowDrawAbs( (WindowClass*)wp, buf, 3/*bufp-buf*/ );
ClipSet( &(wp->window.curclip), 1, 1, h, v );
}