home *** CD-ROM | disk | FTP | other *** search
/ Freesoft 1999 February / Freesoft_1999-02_cd.bin / Recenz / Utility / DisplayDoctorLinux / scitech-display-doctor-1.0beta-3.i386.rpm / scitech-display-doctor-1.0beta.3.cpio.gz / scitech-display-doctor-1.0beta.3.cpio / usr / lib / nucleus / XF86Setup / phase2.tcl < prev    next >
Text File  |  1998-09-19  |  8KB  |  242 lines

  1. # $XConsortium: phase2.tcl /main/2 1996/10/25 10:21:29 kaleb $
  2. #
  3. #
  4. #
  5. #
  6. # $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/phase2.tcl,v 3.10.2.5 1998/02/26 13:59:00 dawes Exp $
  7. #
  8. # Copyright 1996 by Joseph V. Moss <joe@XFree86.Org>
  9. #
  10. # See the file "LICENSE" for information regarding redistribution terms,
  11. # and for a DISCLAIMER OF ALL WARRANTIES.
  12. #
  13.  
  14. #
  15. # Phase II - Commands run after connection is made to SDD server
  16. #
  17.  
  18. set_resource_defaults
  19.  
  20. wm withdraw .
  21.  
  22. create_main_window [set w .xf86setup]
  23.  
  24. # put up a message ASAP so the user knows we're still alive
  25. label $w.waitmsg -text $messages(phase2.1)
  26. pack  $w.waitmsg -expand yes -fill both
  27. update idletasks
  28.  
  29. if $StartServer {
  30.     mesg "The program is running on a different virtual terminal\n\n\
  31.         Please switch to the correct virtual terminal" info
  32. }
  33.  
  34. set XKBrules $Xwinhome/lib/X11/xkb/rules/xfree86
  35.  
  36. if { [catch {set XKBhandle [xkb_read from_server]} res] } {
  37.     $w.waitmsg configure -text $messages(phase2.2)
  38.     update idletasks
  39.     after 10000
  40.     set XKBinserver 0
  41. } else {
  42.     set XKBinserver 1
  43. }
  44.  
  45. set retval [xkb_listrules $XKBrules]
  46.  
  47. if { [llength $retval] < 4 } {
  48.     set XKBComponents(models,names)         "pc101 pc102 microsoft"
  49.     set XKBComponents(models,descriptions)     [list \
  50.         "Generic 101key PC" "Generic 102key PC" \
  51.         "Microsoft Natural"]
  52.     set XKBComponents(layouts,names)     "us de it gb"
  53.     set XKBComponents(layouts,descriptions)     [list \
  54.         "U.S. English" "German" "Italian" "U.K."]
  55.     set XKBComponents(variants,names)     ""
  56.     set XKBComponents(variants,descriptions) ""
  57.     set XKBComponents(options,names)     ""
  58.     set XKBComponents(options,descriptions)     ""
  59. } else {
  60.     set XKBComponents(models,names)         [lindex $retval 0]
  61.     set XKBComponents(models,descriptions)     [lindex $retval 1]
  62.     set XKBComponents(layouts,names)     [lindex $retval 2]
  63.     set XKBComponents(layouts,descriptions)     [lindex $retval 3]
  64.     set XKBComponents(variants,names)     [lindex $retval 4]
  65.     set XKBComponents(variants,descriptions) [lindex $retval 5]
  66.     set XKBComponents(options,names)     [lindex $retval 6]
  67.     set XKBComponents(options,descriptions)     [lindex $retval 7]
  68. }
  69.  
  70. # Setup the default bindings for the various widgets
  71. source $tcl_library/tk.tcl
  72.  
  73. source $XF86Setup_library/mseproto.tcl
  74. source $XF86Setup_library/mouse.tcl
  75. source $XF86Setup_library/keyboard.tcl
  76. source $XF86Setup_library/card.tcl
  77. source $XF86Setup_library/monitor.tcl
  78. source $XF86Setup_library/srvflags.tcl
  79. source $XF86Setup_library/done.tcl
  80. source $XF86Setup_library/modeselect.tcl
  81.  
  82. proc Intro_create_widgets { win } {
  83.     global XF86Setup_library
  84.     global pc98_EGC pc98 messages
  85.  
  86.     set w [winpathprefix $win]
  87.     if !$pc98_EGC {
  88.         frame $w.intro -width 640 -height 420 \
  89.         -relief ridge -borderwidth 5
  90.     } else {
  91.         frame $w.intro -width 640 -height 400 \
  92.         -relief ridge -borderwidth 5
  93.     }
  94.     image create bitmap XFree86-logo \
  95.         -foreground black -background cyan \
  96.         -file $XF86Setup_library/pics/XFree86.xbm \
  97.         -maskfile $XF86Setup_library/pics/XFree86.msk
  98.     label $w.intro.logo -image XFree86-logo
  99. #    pack  $w.intro.logo
  100.  
  101.     image create photo SciTech-logo \
  102.         -file $XF86Setup_library/pics/scitech.gif
  103.     label $w.intro.logo-sci -image SciTech-logo
  104.     pack $w.intro.logo-sci
  105.  
  106.     image create photo SDD-logo \
  107.         -file $XF86Setup_library/pics/sdd_logo.gif
  108.  
  109.     frame $w.intro.textframe
  110.     text $w.intro.textframe.text
  111.     $w.intro.textframe.text tag configure heading \
  112.         -justify center -foreground yellow \
  113.         -font -adobe-times-bold-i-normal--25-180-*-*-p-*-iso8859-1
  114.     make_intro_headline $w.intro.textframe.text
  115.     $w.intro.textframe.text insert end $messages(phase2.12)
  116.     scrollbar $w.intro.textframe.scroll \
  117.         -command "$w.intro.textframe.text yview"
  118.     bind $w <Prior> \
  119.         "$w.intro.textframe.text yview scroll -1 unit;break;"
  120.     bind $w <Next> \
  121.         "$w.intro.textframe.text yview scroll  1 unit;break;"
  122.     
  123.     $w.intro.textframe.text configure \
  124.         -yscrollcommand "$w.intro.textframe.scroll set"
  125.     pack $w.intro.textframe.scroll -side right -fill y
  126.     pack $w.intro.textframe.text -fill both -expand yes -side right
  127.     pack $w.intro.textframe -fill both  -expand yes -padx 10 -pady 10
  128.     $w.intro.textframe.text configure -state disabled
  129. }
  130.  
  131. proc Intro_activate { win } {
  132.     set w [winpathprefix $win]
  133.     pack $w.intro -side top -fill both -expand yes
  134. }
  135.  
  136. proc Intro_deactivate { win } {
  137.     set w [winpathprefix $win]
  138.     pack forget $w.intro
  139. }
  140.  
  141. proc config_select { win } {
  142.     global CfgSelection prevSelection
  143.  
  144.     set w [winpathprefix $win]
  145.     $win configure -cursor watch
  146.     ${prevSelection}_deactivate $win
  147.     set prevSelection $CfgSelection
  148.     ${CfgSelection}_activate $w
  149.     $win configure -cursor top_left_arrow
  150. }
  151.  
  152. proc config_help { win } {
  153.     global CfgSelection
  154.  
  155.     set w [winpathprefix $win]
  156.     ${CfgSelection}_popup_help $win
  157. }
  158.  
  159. frame $w.menu -width 640
  160.  
  161. radiobutton $w.menu.mouse -text $messages(phase2.3) -indicatoron false \
  162.     -variable CfgSelection -value Mouse -underline 0 \
  163.     -command [list config_select $w]
  164. radiobutton $w.menu.keyboard -text $messages(phase2.4) \
  165.         -indicatoron false \
  166.         -variable CfgSelection -value Keyboard -underline 0 \
  167.         -command [list config_select $w]
  168. radiobutton $w.menu.card -text $messages(phase2.5) -indicatoron false \
  169.     -variable CfgSelection -value Card -underline 0 \
  170.     -command [list config_select $w]
  171. radiobutton $w.menu.monitor -text  $messages(phase2.6) -indicatoron false \
  172.     -variable CfgSelection -value Monitor -underline 2 \
  173.     -command [list config_select $w]
  174. radiobutton $w.menu.modeselect -text  $messages(phase2.7) -indicatoron false \
  175.     -variable CfgSelection -value Modeselection -underline 4 \
  176.     -command [list config_select $w]
  177. radiobutton $w.menu.other -text  $messages(phase2.8) -indicatoron false \
  178.     -variable CfgSelection -value Other -underline 0 \
  179.     -command [list config_select $w]
  180. if !$pc98 {
  181.     pack $w.menu.mouse $w.menu.keyboard $w.menu.card \
  182.         $w.menu.monitor $w.menu.modeselect $w.menu.other \
  183.         -side left -fill both -expand yes
  184. } else {
  185.     pack $w.menu.mouse $w.menu.card $w.menu.monitor \
  186.         $w.menu.modeselect $w.menu.other \
  187.         -side left -fill both -expand yes
  188. }
  189.  
  190. frame $w.buttons
  191. #label $w.buttons.xlogo -bitmap @/usr/X11R6/include/X11/bitmaps/xlogo16 -anchor w
  192. #label $w.buttons.xlogo -bitmap @/usr/tmp/xfset1.xbm -anchor w \
  193.     -foreground black
  194. #pack $w.buttons.xlogo -side left -anchor w -expand no -padx 0 -fill x
  195. button $w.buttons.abort -text $messages(phase2.9) -underline 0 \
  196.     -command "clear_scrn;puts stderr Aborted;shutdown 1"
  197. button $w.buttons.done  -text $messages(phase2.10) -underline 0 \
  198.     -command [list Done_execute $w]
  199. button $w.buttons.help  -text $messages(phase2.11) -underline 0 \
  200.     -command [list config_help $w]
  201. pack   $w.buttons.abort $w.buttons.done $w.buttons.help \
  202.     -expand no -side left -padx 50
  203. make_underline $w
  204.  
  205. Intro_create_widgets    $w
  206. if !$pc98 {
  207.     Keyboard_create_widgets    $w
  208. }
  209. Mouse_create_widgets    $w
  210. Card_create_widgets    $w
  211. Monitor_create_widgets    $w
  212. Modeselect_create_widgets    $w
  213. Other_create_widgets    $w
  214. Done_create_widgets    $w
  215.  
  216. proc ac_bind { win letter command } {
  217.     bind $win <Alt-$letter>        $command
  218.     bind $win <Control-$letter>    $command
  219. }
  220.  
  221. bind $w <Alt-x>        [list I'm an error]
  222. ac_bind $w a        [list $w.buttons.abort invoke]
  223. ac_bind $w d        [list $w.buttons.done invoke]
  224. ac_bind $w h        [list config_help $w]
  225. bind $w ?        [list config_help $w]
  226. ac_bind $w m        [list $w.menu.mouse invoke]
  227. ac_bind $w c        [list $w.menu.card invoke]
  228. ac_bind $w k        [list $w.menu.keyboard invoke]
  229. ac_bind $w n        [list $w.menu.monitor invoke]
  230. ac_bind $w s        [list $w.menu.modeselect invoke]
  231. ac_bind $w o        [list $w.menu.other invoke]
  232. set_default_arrow_bindings
  233.  
  234. set CfgSelection  Intro
  235. set prevSelection Intro
  236. destroy $w.waitmsg
  237. pack $w.menu -side top -fill x
  238. pack $w.buttons -side bottom -expand no
  239. config_select $w
  240. focus $w.menu.mouse
  241.  
  242.