home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1999 February
/
VPR9902A.BIN
/
FFILLY
/
UG
/
card.tfy
< prev
next >
Wrap
Text File
|
1998-04-30
|
4KB
|
110 lines
// WIN ----------------------------------------------------------------
int CardWin( int winnum, int mwn, int spic ) {
int mwin, pic, facepic;
int x, y, w, h;
int n, i;
int fw, fh, mfw, mfh;
int fx, fy, mfx, mfy;
int c_type[], lr;
str bfname;
fw = 130; fh = 130; mfw = 80; mfh = 80;
w = 20*2 + fw*2; h = 80 + fh + 20 + mfh + 60;
x = scrW/2 - w/2; y = scrH/2 - h/2;
fx = w/2 - fw - 10; fy = 80;
mfx = w/2 - mfw/2 - mfw -10; mfy = fy + fh + 20;
c_type[0] = C_Type[0]; c_type[1] = C_Type[1];
lr = LR;
bfname = "b";
GB_Cap[0] = ""; // NON 3D
inputButArr( "", -1, fy, fw, fh, -2, 3, 1,2 );
GB_X[1] = fx;
GB_X[2] = fx + ( fw +20 );
inputButArr( "", -1,mfy, mfw,mfh, -2, 3, 3,5 );
GB_X[3] = mfx;
GB_X[4] = mfx +( mfw +10 );
GB_X[5] = mfx +( mfw +10 )*2;
inputButArr( "", -1, h - 40, 60, 20, -2, 3, 6,8 );
GB_Cap[6] = "BGM"; GB_X[6] = w/2 - 100;
GB_Cap[7] = "OK"; GB_X[7] = w/2 - 30;
GB_Cap[8] = "CANCEL"; GB_X[8] = w/2 + 40;
// ウインドウ作成
pic = CreatePic( spic, w, h );
TextColor( 0, 0, 0 ); BackMode(1);
makeWindow( winnum, pic, 0,0, w,h, 8, 0, 0xc0c0c0 );
paintLabel( pic, w/2 - 130, 10, 260, 30, 0x000000, " CARD SELECTOR" );
paintSelect( pic, w, fw, 55, lr );
facepic = LoadPic( StrPrint( "face.%s", picExt ) );
for( i = 0; i < 2; i = i + 1 ) {
MovePic( facepic, c_type[i]*fw +1, 1, fw-2, fh-2,
pic, fx +( fw +20 )*i +1, fy +1 );
}
for( i = 0; i < 3; i = i + 1 ){
MoveSPic( facepic, i*fw +1, 1, fw-2, fh-2,
pic, mfx +( mfw+10 )*i +1, mfy +1, mfw-2, mfh-2 );
}
CapTitle( " CARD SELECTOR" );
mwin = OpenWin( pic, x,y, w,h, 0,0, 0x000000 ); // ウィンドウ
mes( USER ) {
if ( GetHiWord( MesP1 ) == winnum ) { // GET WIN NUM
n = GetLowWord( MesP1 ); // GET MES NUM
if ( 1 <= n && n <= 2 ) { // LR
lr = n -1;
paintSelect( pic, w, fw, 55, lr );
}
else if ( 3 <= n && n <= 5 ) { // CHARA
c_type[ lr ] = n -3;
i = lr;
MovePic( facepic, c_type[i]*fw +1, 1, fw-2, fh-2,
pic, fx +( fw +20 )*i +1, fy +1 );
}
else if ( n == 6 ) { // BGM
bfname = StrInput( ".mid", "MIDI File(*.mid)|*.mid||", 1, 0x1000, "",1 );
PostMes( LBUP );
}
else if ( n == 7 || n == 8 ) { // EXIT
if ( n == 7 ) { // OK
C_Type[0] = c_type[0]; C_Type[1] = c_type[1];
LR = lr;
if ( bfname != "b" ) { // CHANGE
if ( M_Open == 1 ) { closeBGM(); }
if ( bfname != "" ) { openBGM( bfname ); }
}
}
PostMes( USER, MakeLong( 1000, winnum ) );
CloseWin( mwin );
DelPic( pic ); DelPic( facepic );
WinFocus = mwn;
del_me;
}
} // if winnum end
} // mesUSER end
} // method end
// PAINT --------------------------------------------------------------
int paintSelect( int pic, int w, int fw, int sy, int lr ) {
int col1, col2;
str ser1, ser2;
if ( lr == 0 ) {
col1 = 0x0000ff; col2 = 0x000000;
ser1 = " SELECTED"; ser2 = "";
}
else {
col1 = 0x000000; col2 = 0x0000ff;
ser1 = ""; ser2 = " SELECTED";
}
paintLabel( pic, w/2 - fw - 10, sy, fw,20, col1, ser1 );
paintLabel( pic, w/2 + 10, sy, fw,20, col2, ser2 );
} // method end