home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2000 April / VPR0004A.BIN / OLS / CSSH102 / CSSH102.LZH / csshtml / opencss.mac < prev    next >
Text File  |  1999-12-20  |  7KB  |  179 lines

  1. ////////////////////////////////////////////////////////////
  2. // opencss.mac
  3. // Toshiyuki Akutsu <locrian@mbd.sphere.ne.jp>
  4. // Mon, 20 Dec 1999 21:30:54
  5. ////////////////////////////////////////////////////////////
  6. //    execmacro $__macroPath + "csshtml\\opencss.mac";
  7.     openreg "CURRENTUSER", "Software\\Hidemaruo\\Hidemaru\\Env";
  8.     if( ! result ) endmacro;
  9.     $__macroPath = getregstr( "MacroPath" );
  10.     closereg;
  11.     if( $__macroPath == "" ) $__macroPath = hidemarudir;
  12.     if( rightstr( $__macroPath, 1 ) != "\\" ) $__macroPath = $__macroPath + "\\";
  13.     $__INI = $__macroPath + "csshtml\\csshtml.ini";
  14. ////////////////////////////////////////////////////////////
  15.  
  16.     $$ACC = "&1 &2 &3 &4 &5 &6 &7 &8 &9 &A &B &C &D";
  17.     ##size = getininum($__INI,"CSSFILE","SIZE");
  18.     if( ##size < 1 || ##size > 30 ) endmacro;
  19.     ##i = 0;
  20.     while( ##i < ##size ){
  21.         $$num = str(##i);
  22.         $$acc = midstr( $$ACC,3 * ##i, 3 );
  23.         //$$file = getinistr($__INI,"CSSFILE",$$num);
  24.         $$name = getinistr($__INI,"CSSFILE_NAME",$$num);
  25.         $$mi[##i] = $$acc + $$name;
  26.         ##i = ##i + 1;
  27.     }
  28.     ##exit = ##i; // = ##size;
  29.     $$mi[##exit] = "&Q 終了 ( ESC )";
  30.     ##end = ##exit + 1;
  31.     menuarray $$mi, ##end;
  32.     ##item = result - 1;
  33.     if( ##item < 0 || ##item == ##exit ) endmacro;
  34.  
  35.     $$num = str(##item);
  36.     $$file = getinistr($__INI,"CSSFILE",$$num);
  37.     call openFile $$file;
  38.     if( ##return < 0 ) call createCssFile ##item;
  39.  
  40. endmacro;
  41. ////////////////////////////////////////////////////////////
  42. openFile:
  43.     $$option = $$1;
  44.     $$targetFile = $$2;
  45.     if( $$targetFile == "" ){
  46.         $$targetFile = $$option; $$option = "";
  47.     }
  48.  
  49.     call toLowerCase $$targetFile;
  50.     $$targetFile = $$return;
  51.  
  52.     $$clientFile = filename;
  53.     ##opened = 0;
  54.     if( $$targetFile != $$clientFile ){
  55.         ##num_targetFile = findhidemaru( $$targetFile );
  56.         if( ##num_targetFile > 0 ){
  57.             setactivehidemaru ##num_targetFile;
  58.         }else{
  59.             if( existfile( $$targetFile ) ){
  60.                 openfile $$option + "\"" + $$targetFile + "\"";
  61.                 ##opened = 1;
  62.             }else{
  63.                 ##opened = -1;
  64.             }
  65.         }
  66.     }
  67.  
  68. return ##opened;
  69. // end of openFile
  70. // openFileHelp@
  71. ////////////////////////////////////////////////////////////
  72. toLowerCase:
  73.     $$str = $$1; $$ret = "";
  74.     ##iend = strlen( $$str );
  75.     ##i = 0;
  76.     while( ##i < ##iend ){
  77.         ##code = ascii( midstr( $$str, ##i, 1 ) );
  78.         if( ##code & 0xFF00 ){
  79.             $$ret = $$ret + midstr( $$str, ##i, 2 );
  80.             ##i = ##i + 2;
  81.         }else{
  82.             if( ##code >= 0x41 && ##code <= 0x5A ) ##code = ##code + 32;
  83.             $$ret = $$ret + char( ##code );
  84.             ##i = ##i + 1;
  85.         }
  86.     }
  87. return $$ret;
  88. // end of toLowerCase
  89. ////////////////////////////////////////////////////////////
  90. createCssFile:
  91.     $$num = str(##1);
  92. //    $$file = getinistr($__INI,"CSSFILE",$$num);
  93.     $$name = getinistr($__INI,"CSSFILE_NAME",$$num);
  94.  
  95. newfile;
  96. insert "/* -----------------------------------------------\n";
  97. insert "   MenuItemNumber: " + $$num + " ( in csshtml.ini )\n";
  98. insert "   Name: " + $$name + " ( in [CSSFILE_NAME] )\n";
  99. //insert "   File: " + $$file + " ( in [CSSFILE] )\n";
  100.  
  101. insert "   -----------------------------------------------\n";
  102. insert "   ファイルタイプ別設定の「カラー」表示順\n";
  103. insert "   -----------------------------------------------\n";
  104. insert "*/\n\n";
  105. insert "BODY{ }  /* 普通の文字 と 背景 */\n";
  106. insert ".h200{ } /* 改行 ↓ */\n";
  107. insert ".h04{ }  /* 強調表示 1 */\n";
  108. insert ".h07{ }  /* 強調表示 2 */\n";
  109. insert ".h22{ }  /* 強調表示 3 */\n";
  110. insert ".h23{ }  /* 強調表示 4 */\n";
  111. insert ".h06{ }  /* 行の強調表示 1 */\n";
  112. insert ".h09{ }  /* 行の強調表示 2 */\n";
  113. insert ".h03{ }  /* コメント */\n";
  114. insert ".h20{ }  /* 文字定数(\"...\") */\n";
  115. insert ".h13{ }  /* HTMLタグ全体(<...>) */\n";
  116. insert ".h14{ }  /* HTMLタグのエレメント */\n";
  117. insert ".h15{ }  /* HTMLタグのアトリビュート */\n";
  118. insert ".h11{ }  /* ホームページ URL(http:等) */\n";
  119. insert ".h12{ }  /* メールアドレス(abc@xyz.co.jp) */\n";
  120. insert ".h21{ }  /* ファイル名 */\n";
  121. insert ".h05{ }  /* 特に強調表示 1 */\n";
  122. insert ".h08{ }  /* 特に強調表示 2 */\n\n";
  123.  
  124. insert "/* -----------------------------------------------\n";
  125. insert "   白い背景のデフォルトの配色( おおよそ )\n";
  126. insert "   BODY{ color:#000000; background:#FFFFFF }\n";
  127. insert "   白          color:#ffffff\n";
  128. insert "   赤          color:#800000\n";
  129. insert "   緑          color:#008000\n";
  130. insert "   紫          color:#800080\n";
  131. insert "   青          color:#000080\n";
  132. insert "   空色        color:#008080\n";
  133. insert "   茶色        color:#808000\n";
  134. insert "   灰色        color:#808080\n";
  135. insert "   黒い灰色    color:#404040\n";
  136. insert "   白い灰色    color:#c0c0c0\n";
  137. insert "   黒          color:#000000\n";
  138. insert "   明るい赤    color:#ff0000\n";
  139. insert "   明るい紫    color:#ff00ff\n";
  140. insert "   明るい青    color:#0000ff\n";
  141. insert "   赤の反転    color:#ffffff;background:#800000\n";
  142. insert "   緑の反転    color:#ffffff;background:#008000\n";
  143. insert "   紫の反転    color:#ffffff;background:#800080\n";
  144. insert "   青の反転    color:#ffffff;background:#000080\n";
  145. insert "   空色の反転  color:#ffffff;background:#008080\n";
  146. insert "   茶色の反転  color:#ffffff;background:#808000\n";
  147. insert "   灰色の反転  color:#ffffff;background:#808080\n";
  148. insert "   黒の反転    color:#ffffff;background:#000000\n";
  149. insert "\n";
  150. insert "   黒い背景のデフォルトの配色( おおよそ )\n";
  151. insert "   BODY{ color:#FFFFFF;background:#000000 }\n";
  152. insert "   白          color:#ffffff\n";
  153. insert "   赤          color:#ff4040\n";
  154. insert "   緑          color:#40ff40\n";
  155. insert "   紫          color:#ff40ff\n";
  156. insert "   青          color:#4040ff\n";
  157. insert "   空色        color:#40ffff\n";
  158. insert "   黄色        color:#ffff40\n";
  159. insert "   灰色        color:#c0c0c0\n";
  160. insert "   反転        color:#000000;background:#ffffff\n";
  161. insert "   赤い背景    color:#ffffff;background:#ff0000\n";
  162. insert "   緑の背景    color:#ffffff;background:#008000\n";
  163. insert "   紫色の背景  color:#ffffff;background:#800080\n";
  164. insert "   青い背景    color:#ffffff;background:#0000ff\n";
  165. insert "   空色の背景  color:#ffffff;background:#008080\n";
  166. insert "   茶色の背景  color:#ffffff;background:#808000\n";
  167. insert "   灰色の背景  color:#ffffff;background:#808080\n";
  168. insert "   -----------------------------------------------\n";
  169. insert "*/\n\n";
  170. gofiletop;
  171.  
  172. //    if( rightstr( $$name, 4 ) != ".css" ) $$name = $$name + ".css";
  173.     changename $$name;
  174.     $$file = filename;
  175.     writeinistr $__INI,"CSSFILE",$$num,$$file;
  176.  
  177. return;
  178. ////////////////////////////////////////////////////////////
  179.