home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1999 February
/
VPR9902A.BIN
/
FFILLY
/
UG
/
help.tfy
< prev
next >
Wrap
Text File
|
1998-04-29
|
8KB
|
213 lines
// GLOBAL VAL----------------------------------------------------------
int hFSize;
int AllKey;
int KeyX[], KeyY[];
int KeyW[];
int hVsVal; // scroll val
int hVsMax; // max scroll val (隠れ行数)
// HELP ------------------------------------------------------------
int makeHelp( int winnum, int mwn, int basepic, int x, int y,
str pageisc, str fname ) {
int helpwin, pic;
int w, h;
int n, i, k;
int AllHBut;
int TxtPic; // FOR HELP TEXT
int ZuPic; // 図解ピク
str picname; // 図解ピクファイル名
str isc;
str previsc[];
int pisize;
isc = "Config";
AllHBut = GetIniInt( isc, "AllHBut", 4, fname );
w = AllHBut * 80 + 20;
h = 435;
picname = GetIniStr( isc, "PicName", "", fname );
x = scrW/2 - w/2;
y = 0;
pisize = 0;
GB_Cap[0]=""; // NON 3D
inputButArr( "", w-25,-1, 20,15, -2, 3, 1,2 ); // SCROLL BUT
GB_Cap[1] = "▲"; GB_Y[1] = 30;
GB_Cap[2] = "▼"; GB_Y[2] = h-20;
inputButArr( "", -1,5, 80,20, -2, 3, 3, AllHBut +2 );
for ( i = 0; i < AllHBut; i = i + 1 ) {
GB_Cap[i+3] = GetIniStr( isc, StrPrint( "ButCap-%ld", i ), "", fname );
GB_X[i+3] = 10 + i * 80;
}
// ウインドウ作成
pic = CreatePic( basepic, w, h );
TextColor( 0, 0, 0 ); BackMode(1);
makeWindow( winnum, pic, 0,0, w,h, AllHBut+2, 0, 0xc0c0c0 );
TxtPic = CreatePic( pic, w-30, GetIniInt( isc, "TxtPic_H", 660, fname ) );
if( picname == ""){ ZuPic=pic; }
else{
picname = StrPrint( "%s%s", prgDir, picname );
if( IsExist( picname )==1){ ZuPic = LoadPic( picname ); }
else{ ZuPic = pic; }
}
// HELP SCR
paintButton( pic, 5,30, w-30,h-35, -2, 0x808080, 0xffffff );
// SCROLL BASE
paintButton( pic, w-25,45, 20,h-65, -2, 0x808080, 0xffffff );
// MAKE TEXT
makeHelpText( TxtPic, ZuPic, 5,30, w-30, h-35, pageisc, fname );
hVsVal=0;
paintHelp( pic, TxtPic, w-30, h-35 ); // SLIDER && TEXT
CapTitle( " HELP" );
helpwin = OpenWin( pic, x,y, w,h, 0,0 );
mes( USER ){
if( GetHiWord( MesP1 ) == winnum ){
n = GetLowWord( MesP1 );
if( n == 1 || n == 2){ // SCROLL
Scroll( pic, TxtPic, w-30, h-35, n-1 );
}
if( n >= 3 && n < AllHBut+2 ){ // CONTENTS
i = n -3;
if( i == 1 ){ // PREIOUSE
if( pisize > 0 ){
pageisc = previsc[ pisize ]; pisize = pisize -1;
}
}
else{ // CONTENTS
pisize = pisize +1; previsc[ pisize ] = pageisc;
pageisc
= GetIniStr( isc, StrPrint( "ButCap-%ld", i ), "", fname );
}
makeHelpText( TxtPic, ZuPic, 5,30, w-30, h-35, pageisc, fname );
hVsVal = 0;
paintHelp( pic, TxtPic, w-30, h-35 );
}
if( n == AllHBut +2 ){ // EXIT
mes( TIME ){
step( 5 ){
del_us;
PostMes( USER, MakeLong( 1000, winnum ) );
,
DelPic( pic ); DelPic( TxtPic );
if( picname != "" ){ DelPic( ZuPic ); }
CloseWin( helpwin );
WinFocus = mwn;
del_me;
}
} // mes end
}
} // if winnum end
} // mesUSER end
mes( LBDOWN ){
k = hVsVal*( hFSize+5 ); // スクロール分
for( i=0; i <= AllKey; i=i+1 ){
if( MesP3 > 30 &&
KeyX[i] <= MesP2 && MesP2 < KeyX[i]+KeyW[i] &&
KeyY[i]-k <= MesP3 && MesP3 < KeyY[i]-k+hFSize ){
pisize = pisize +1; previsc[ pisize ] = pageisc; // PREV
pageisc
= GetIniStr( pageisc, StrPrint( "KeyJump-%ld", i ), "", fname );
makeHelpText( TxtPic, ZuPic, 5,30, w-30, h-35, pageisc, fname );
hVsVal=0;
paintHelp( pic, TxtPic, w-30, h-35 );
break;
}
}
} // mes LB end
} // makeHelp end
// PAINT HELP ---------------------------------------------------------
int paintHelp( int pic, int TxtPic, int w, int h ){
int pos;
paintButton( pic, w+6,46, 18,h-32, 0x000000, -2, -2 ); // SCROLL BASE
if( hVsMax > 0 ){ pos = ( h-45 ) / hVsMax *hVsVal; } // h-45=MOVABLE DIST
else{ pos = 0; }
paintButton( pic, w+6,46+pos, 18,14, 0xc0c0c0, 0xffffff, 0x808080 );
MovePic( TxtPic, 1,hVsVal*( hFSize+5 )+1, w-2,h-2, pic, 6,31 );
} // paintHelp end
// SCROLL -------------------------------------------------------------
int Scroll( int pic, int TxtPic, int w, int h, int d ){
mes( TIME ){
step( 2 ){
if( d == 0 && hVsVal > 0 ){ hVsVal = hVsVal-1; }
if( d == 1 && hVsVal < hVsMax ){ hVsVal = hVsVal+1; }
paintHelp( pic, TxtPic, w, h );
}
}
mes( LBUP ){ del_us; del_me; }
} // Scroll end
// TEXT ---------------------------------------------------------------
int makeHelpText( int TxtPic, int ZuPic, int x, int y, int w, int h,
str isc, str fname ){
int i;
int hgyo;
int panelh;
int headh;
int allpic;
int px, py, pw, ph, psx, psy;
str dat;
hFSize = GetIniInt( isc, "FSize", 15, fname );
hgyo = GetIniInt( isc, "HGyo", h/20, fname );
headh = ( hFSize+5 )*3;
panelh = ( hFSize+5 )*hgyo+headh;
paintButton( TxtPic, 0,0, w, panelh, 0x808000, -2, -2 );
TextColor( 255, 255, 255 ); BackMode(1);
// TYTLE
dat = GetIniStr( isc, "Tytle", "", fname );
SetFont( hFSize+5,"MS 明朝",128,0,0,0,600 );
TextWrite( dat, TxtPic, 15, hFSize );
// CONTENTS
SetFont( hFSize,"MS 明朝",128,0,0,0,400 );
for( i=0; i < hgyo; i=i+1 ){
dat = GetIniStr( isc, StrPrint("h%ld", i ), "", fname );
TextWrite( dat, TxtPic, 15, headh + i*( hFSize+5 ) );
}
// KEYWORD
AllKey = GetIniInt(isc, "AllKey", 0, fname );
if( AllKey > 0 ){
TextColor( 0, 255, 255 ); BackMode(0); BgColor( 0, 128, 128 );
for( i=0; i < AllKey; i=i+1 ){
dat = GetIniStr( isc, StrPrint("KeyWord-%ld", i ), "", fname );
KeyX[i] = 15
+ GetIniInt( isc, StrPrint("KXn-%ld", i ), 0, fname ) *hFSize;
KeyY[i] = headh
+ GetIniInt( isc, StrPrint("KYn-%ld", i ), 0, fname ) *( hFSize+5 );
KeyW[i] = GetIniInt( isc, StrPrint("KWn-%ld", i ), 0, fname )*hFSize;
TextWrite( dat, TxtPic, KeyX[i], KeyY[i] );
}
for( i=0; i < AllKey; i=i+1 ){ // 座標補正(TextWriteの関係上)
KeyX[i] = x+KeyX[i]; KeyY[i] = y+KeyY[i];
}
} // if end
// 図解ピクチャ
allpic = GetIniInt( isc, "AllPic", 0, fname );
if( allpic>0 ){
for( i=0; i < allpic; i=i+1 ){
px = 15
+GetIniInt( isc, StrPrint("PXn-%ld", i ), 0, fname ) *hFSize;
py = headh
+GetIniInt( isc, StrPrint("PYn-%ld", i ), 0, fname ) *( hFSize+5 );
pw = GetIniInt( isc, StrPrint("PW-%ld", i ), 10, fname );
ph = GetIniInt( isc, StrPrint("PH-%ld", i ), 10, fname );
psx= GetIniInt( isc, StrPrint("PSrcX-%ld", i ), 0, fname );
psy= GetIniInt( isc, StrPrint("PSrcY-%ld", i ), 0, fname );
MovePic( ZuPic, psx,psy, pw,ph, TxtPic, px,py );
}
} // if end
hVsMax = hgyo+3 -h/( hFSize+5 ); // MAX SCROLL VAL (隠れ行数)
} // makeHelpText end