home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Kyūkyoku!! X68000 Emulator
/
X68000Book.dat
/
mac
/
OLS
/
X68000
/
Ko-Window
/
kow142s.lzh
/
corlib
/
DialogMessage.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-04-16
|
1KB
|
54 lines
/* 1995 H.Ogasawara (COR.) */
#include <corlib.h>
#include <HS_wlib.h>
#define DIALOGSIZEH (34*8)
#define DIALOGSIZEV (16*2)
#define FONT 16
#define OFX 8
#define OFY 8
static
DialogExec( wp, info )
WindowID wp;
EventInfo *info;
{
switch( info->option ){
DrawBuf dbuf[4];
case EventRedraw:
DrawSetClear( dbuf, ColorGray );
DrawSetSymbol( dbuf+1, OFX, OFY, HS_WindowGetClientPointer(wp),
HS_WindowGetClientData(wp), FONT );
DrawSetLine( dbuf+2, 4, 4, DIALOGSIZEH-4, DIALOGSIZEV-4,
ShadowDown, OptionShadow );
WindowDraw( wp, dbuf, 3 );
break;
case EventClose:
WindowClose( wp );
break;
}
return TRUE;
}
WindowID
DialogMessageOpen( msg, attr )
char *msg;
{
int x, y;
unsigned short *sp;
WindowID wp;
WindowGetRootScroll( &x, &y );
sp= WindowGetScreenTable( WindowGetScreenMode() );
x+= (sp[0]-DIALOGSIZEH)/2;
y+= (sp[1]-DIALOGSIZEV)/2;
wp= WindowSimpleOpen( x, y, DIALOGSIZEH, DIALOGSIZEV,
NULL, DialogExec );
HS_WindowGetClientPointer( wp )= msg;
HS_WindowGetClientData( wp )= attr;
WindowRedraw( wp );
return wp;
}