Revision: 44846
          http://brlcad.svn.sourceforge.net/brlcad/?rev=44846&view=rev
Author:   bhinesley
Date:     2011-06-09 00:22:28 +0000 (Thu, 09 Jun 2011)

Log Message:
-----------
Removed existing MGED man dialog code, inswitching to the ManBrowser 
mega-widget. Now MGED/Archer Manual page dialogs are identical, but ToC may 
vary depending on configuration.

Modified Paths:
--------------
    brlcad/trunk/src/tclscripts/mged/man.tcl

Modified: brlcad/trunk/src/tclscripts/mged/man.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/mged/man.tcl    2011-06-09 00:04:37 UTC (rev 
44845)
+++ brlcad/trunk/src/tclscripts/mged/man.tcl    2011-06-09 00:22:28 UTC (rev 
44846)
@@ -18,117 +18,18 @@
 # information.
 #
 
-package require Tkhtml 3.0
+package require ManBrowser 1.0
 
 encoding system utf-8
 
-proc handle_select { w y } {
-    set curr_sel [$w curselection]
-    if { $curr_sel != "" } {
-        $w selection clear $curr_sel
-    }
-    $w selection set [$w nearest $y]
-}
-
-proc get_html_data {cmdname} {
-    global man_data
-
-    # get file data
-    set man_fd [open [file join [bu_brlcad_data "html"] mann en $cmdname.html]]
-    set man_data [read $man_fd]
-    close $man_fd
-}
-
-proc re_display {w} {
-
-    global man_data
-    $w reset;
-    $w configure -parsemode html
-    $w parse $man_data    
-
-}
-
-
 proc man {cmdname} {
-    global mged_gui
-    global ::tk::Priv
-    global mged_players
-    global man_data
-
-    if [winfo exists .man] {
-        catch {destroy .man}
+    if {![winfo exists .mgedMan]} {
+       ManBrowser .mgedMan -parentName MGED
     }
-
-
-    # determine the framebuffer window id
-    if { [ catch { set mged_players } _mgedFramebufferId ] } {
-       puts $_mgedFramebufferId
-       puts "assuming default mged framebuffer id: id_0"
-       set _mgedFramebufferId "id_0"
-    }
-    # just in case there are more than one returned
-    set _mgedFramebufferId [ lindex $_mgedFramebufferId 0 ]
-
-
-    if {![file exists [file join [bu_brlcad_data "html"] mann en 
$cmdname.html]]} {
-       puts "No man page found for $cmdname"
-       return
-    } else {
-       get_html_data $cmdname
-       # make dialog
-       toplevel .man -screen $mged_gui($_mgedFramebufferId,screen)
-       wm title .man $cmdname
-       frame .man.top -relief raised -bd 1
-       pack .man.top -side top -expand yes -fill both
-       frame .man.bot -relief raised -bd 1
-       pack .man.bot -side bottom -fill both
-
-       # Use tkhtml to dispay the data
-       frame .man.top.msgF
-       html .man.top.msgT -yscrollcommand ".man.top.msgS set"
-       .man.top.msgT configure -parsemode html
-       .man.top.msgT parse $man_data
-       scrollbar .man.top.msgS -command ".man.top.msgT yview"
-       grid .man.top.msgT .man.top.msgS -sticky nsew -in .man.top.msgF
-       grid columnconfigure .man.top.msgF 0 -weight 1
-       grid rowconfigure .man.top.msgF 0 -weight 1
-       pack .man.top.msgF -side right -expand yes -fill both -padx 2m -pady 2m
-
-       frame .man.top.listing
-       scrollbar .man.top.s -command ".man.top.l yview"
-       listbox .man.top.l -bd 2 -yscroll ".man.top.s set" -width 16 
-exportselection false
-       grid .man.top.l .man.top.s -sticky nsew -in .man.top.listing
-       grid columnconfigure .man.top.listing 0 -weight 0
-       grid rowconfigure .man.top.listing 0 -weight 1
-       set cmdfiles [glob -directory [file join [bu_brlcad_data "html"] mann 
en] *.html ]
-       set cmds [list ]
-       foreach cmdfile $cmdfiles {
-          regexp {(.+/)(.+)(.html)} $cmdfile -> url cmdrootname htmlsuffix 
-           if {[string compare $cmdrootname "Introduction"]} {
-             set cmds [concat $cmds [list $cmdrootname]]
-           }
-       }
-       set cmds [lsort $cmds]
-       foreach cmd $cmds {
-           .man.top.l insert end $cmd
-       }
-       pack .man.top.listing -side left -expand no -fill y
-
-       button .man.bot.buttonOK -text "OK" -command "catch {destroy .man} "
-       frame .man.bot.default -relief sunken -bd 1
-       raise .man.bot.buttonOK
-       pack .man.bot.default -side left -expand yes -padx 2m -pady 1m
-       pack .man.bot.buttonOK -in .man.bot.default -side left -padx 1m \
-              -pady 1m -ipadx 1m -ipady 1
-
-       bind .man.top.l <Button-1> {handle_select %W %y; get_html_data [%W get 
[%W curselection]]; re_display .man.top.msgT}
-       
-       bind .man <Return> "catch {destroy .man}"
-       place_near_mouse .man   
-    }
+    .mgedMan select $cmdname
+    .mgedMan activate
 }
 
-
 # Local Variables:
 # mode: Tcl
 # tab-width: 8


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to