home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1999 April / macformat-075.iso / Shareware Plus / Applications / Alpha / Tcl / SystemCode / CorePackages / internationalMenus.tcl < prev    next >
Encoding:
Text File  |  1999-02-03  |  6.9 KB  |  179 lines  |  [TEXT/ALFA]

  1. # (auto-install)
  2. alpha::extension internationalMenus 0.3.4 {
  3.     alpha::package require -loose Alpha 7.1.5
  4.     # Menu-replacements (all western keyboards)
  5.     hook::register keyboard intlMenu::standard "Australian"
  6.     hook::register keyboard intlMenu::brasil "Brasil"
  7.     hook::register keyboard intlMenu::standard "British"
  8.     hook::register keyboard intlMenu::canadian_csa "Canadian - CSA"
  9.     hook::register keyboard intlMenu::canadian_iso "Canadian - ISO"
  10.     hook::register keyboard intlMenu::canadian_french "Canadian - French"
  11.     hook::register keyboard intlMenu::danish "Danish"
  12.     hook::register keyboard intlMenu::standard "Dutch"
  13.     hook::register keyboard intlMenu::euro_one "EspaƱol - ISO"
  14.     hook::register keyboard intlMenu::euro_one "Finnish"
  15.     hook::register keyboard intlMenu::euro_two "Flemish"
  16.     hook::register keyboard intlMenu::euro_two "French"
  17.     hook::register keyboard intlMenu::euro_two "French - numerical"
  18.     hook::register keyboard intlMenu::euro_one "German"
  19.     hook::register keyboard intlMenu::euro_two "Italian"
  20.     hook::register keyboard intlMenu::euro_one "Norwegian"
  21.     hook::register keyboard intlMenu::roman_jis "Roman - JIS"
  22.     hook::register keyboard intlMenu::spanish "Spanish"
  23.     hook::register keyboard intlMenu::euro_one "Swedish"
  24.     hook::register keyboard intlMenu::swiss "Swiss French"
  25.     hook::register keyboard intlMenu::swiss "Swiss German"
  26.     hook::register keyboard intlMenu::slovencrotian "Slovenian"
  27.     hook::register keyboard intlMenu::slovencrotian "Croatian"
  28.     hook::register keyboard intlMenu::standard "U.S."
  29. } uninstall {this-file} help {
  30.     Changes incompatible menu key-bindings to keys which are useable
  31.     on any (western) international keyboard
  32. }
  33.  
  34. # Define some help procs so we save a lot of typing
  35. proc intlMenu::change_winMenu {zoom zoom_char choose choose_char} {
  36.     menu::replaceWith winMenu [list "//<Szoom" "//<S<I<OsinglePage" \
  37.       "<S/;chooseAWindow"] \
  38.       items "$zoom_char<Szoom" "$zoom_char<S<I<OsinglePage" \
  39.       "$choose_char<SchooseAWindow"
  40. }
  41.  
  42. proc intlMenu::change_editMenu {twiddle twiddle_char \
  43.   shiftLeft shiftLeft_char \
  44.   shiftRight shiftRight_char} {
  45.     menu::replaceWith Edit [list "/`<Stwiddle" "/`<S<I<OtwiddleWords"] \
  46.       items "$twiddle_char<Stwiddle" "$twiddle_char<S<I<OtwiddleWords"
  47.     menu::replaceWith Edit [list {/[<SshiftLeft} {/[<S<I<OshiftLeftSpace}] \
  48.       items "$shiftLeft_char<SshiftLeft" "$shiftLeft_char<S<I<OshiftLeftSpace" 
  49.     menu::replaceWith Edit [list {/]<SshiftRight} {/]<S<I<OshiftRightSpace}] \
  50.       items "$shiftRight_char<S<EshiftRight" "$shiftRight_char<S<I<OshiftRightSpace"
  51. }
  52.  
  53. proc intlMenu::change_editMenu_original {} {
  54.     menu::replaceWith Edit [list "/`<Stwiddle" "/`<S<I<OtwiddleWords"] \
  55.       items "/`<Stwiddle" "/`<S<I<OtwiddleWords"
  56.     menu::replaceWith Edit [list {/[<SshiftLeft} {/[<S<I<OshiftLeftSpace}] \
  57.       items {/[<SshiftLeft} {/[<S<I<OshiftLeftSpace} 
  58.     menu::replaceWith Edit [list {/]<SshiftRight} {/]<S<I<OshiftRightSpace}] \
  59.       items {/]<SshiftRight} {/]<S<I<OshiftRightSpace}
  60. }
  61.  
  62. proc intlMenu::change_markHilite {to hilite_char} {
  63.     menu::replaceWith Search "/=markHilite" items "$hilite_char<OmarkHilite"
  64. }
  65.  
  66. proc intlMenu::change_searchMenu {pop pop_char goto goto_char} {
  67.     menu::replaceWith Search [list "/.<BreturnToBookmark" "/G<IgotoLine"] \
  68.       items "$pop_char<BreturnToBookmark" "$goto_char<IgotoLine" 
  69. }
  70.  
  71. proc intlMenu::bindBraces {} {
  72.     Bind '\[' <zs>  normalLeftBrace
  73.     Bind '\]' <zs>  normalRightBrace
  74. }
  75.  
  76. proc intlMenu::unbindBraces {} {
  77.     unBind '\[' <zs>  normalLeftBrace
  78.     unBind '\]' <zs>  normalRightBrace
  79. }
  80.  
  81. # These are the procs which are called automatically when the user chooses 
  82. # one of the (western) international keyboards in the international prefs 
  83. # dialog.
  84. proc intlMenu::brasil {args} {
  85.     intlMenu::change_winMenu zoom "/-" choose "/,"
  86.     intlMenu::change_editMenu twiddle "/<" shiftLeft "" shiftRight ""
  87.     intlMenu::change_markHilite to "/\"
  88.     intlMenu::change_searchMenu pop "/." goto "/G"
  89.     intlMenu::bindBraces
  90. }
  91.  
  92. proc intlMenu::canadian_csa {args} {
  93.     intlMenu::change_winMenu zoom "//" choose "/;"
  94.     intlMenu::change_editMenu twiddle "" shiftLeft "" shiftRight ""
  95.     intlMenu::change_markHilite to "/="
  96.     intlMenu::change_searchMenu pop "/." goto "/G"
  97.     intlMenu::unbindBraces
  98. }
  99.  
  100. proc intlMenu::canadian_iso {args} {
  101.     intlMenu::change_winMenu zoom "/-" choose "/;"
  102.     intlMenu::change_editMenu twiddle "/<" shiftLeft "" shiftRight ""
  103.     intlMenu::change_markHilite to "/="
  104.     intlMenu::change_searchMenu pop "/." goto "/G"
  105.     intlMenu::unbindBraces
  106. }
  107.  
  108. proc intlMenu::canadian_french {args} {
  109.     intlMenu::change_winMenu zoom "//" choose "/;"
  110.     intlMenu::change_editMenu twiddle "/<" shiftLeft "" shiftRight ""
  111.     intlMenu::change_markHilite to "/="
  112.     intlMenu::change_searchMenu pop "/." goto "/G"
  113.     intlMenu::bindBraces
  114. }
  115.  
  116. proc intlMenu::danish {args} {
  117.     intlMenu::change_winMenu zoom "/-" choose "/,"
  118.     intlMenu::change_editMenu twiddle "/<" shiftLeft "" shiftRight ""
  119.     intlMenu::change_markHilite to "/$"
  120.     intlMenu::change_searchMenu pop "/." goto "/G"
  121.     intlMenu::unbindBraces
  122. }
  123.  
  124. proc intlMenu::euro_one {args} {
  125.     intlMenu::change_winMenu zoom "/-" choose "/,"
  126.     intlMenu::change_editMenu twiddle "/<" shiftLeft "" shiftRight ""
  127.     intlMenu::change_markHilite to ""
  128.     intlMenu::change_searchMenu pop "/." goto "/G"
  129.     intlMenu::unbindBraces
  130. }
  131.  
  132. proc intlMenu::euro_two {args} {
  133.     intlMenu::change_winMenu zoom "/-" choose "/;"
  134.     intlMenu::change_editMenu twiddle "/<" shiftLeft "/(" shiftRight "/)"
  135.     intlMenu::change_markHilite to "/="
  136.     intlMenu::change_searchMenu pop "/:" goto "/G"
  137.     intlMenu::unbindBraces
  138. }
  139.  
  140. proc intlMenu::spanish {args} {
  141.     intlMenu::change_winMenu zoom "/-" choose "/;"
  142.     intlMenu::change_editMenu twiddle "/<" shiftLeft "" shiftRight ""
  143.     intlMenu::change_markHilite to "/="
  144.     intlMenu::change_searchMenu pop "/." goto ""
  145.     intlMenu::unbindBraces
  146. }
  147.  
  148. proc intlMenu::swiss {args} {
  149.     intlMenu::change_winMenu zoom "/-" choose "/,"
  150.     intlMenu::change_editMenu twiddle "/<" shiftLeft "" shiftRight ""
  151.     intlMenu::change_markHilite to "/$"
  152.     intlMenu::change_searchMenu pop "/." goto ""
  153.     intlMenu::unbindBraces
  154. }
  155.  
  156. proc intlMenu::slovencrotian {args} {
  157.     intlMenu::change_winMenu zoom "//" choose "/,"
  158.     intlMenu::change_editMenu twiddle "/<" shiftLeft "" shiftRight ""
  159.     intlMenu::change_markHilite to "/-"
  160.     intlMenu::change_searchMenu pop "/." goto "/G"
  161.     intlMenu::unbindBraces
  162. }
  163.  
  164. proc intlMenu::standard {args} {
  165.     intlMenu::change_winMenu zoom "//" choose "/;"
  166.     intlMenu::change_editMenu_original
  167.     intlMenu::change_markHilite to "/="
  168.     intlMenu::change_searchMenu pop "/." goto "/G"
  169.     intlMenu::bindBraces
  170. }
  171.  
  172. proc intlMenu::roman_jis {args} {
  173.     intlMenu::change_winMenu zoom "//" choose "/;"
  174.     intlMenu::change_editMenu twiddle "/:" shiftLeft {/[} shiftRight {/]}
  175.     intlMenu::change_markHilite to "/-"
  176.     intlMenu::change_searchMenu pop "/." goto "/G"
  177.     intlMenu::bindBraces
  178. }
  179.