# Main Window -- S2K browser
#  Ray R. Larson (Dec 92)
#
proc MainBrowse {} {


global BIGFONT
global CURRENTDATABASE
global PGUSERATTRLIST
global S2K_VERSION

frame .fm15 -borderwidth {2}  -geometry {20x20}  -relief {raised}

message .fm15.mess19 -aspect {959}  -justify {left}  -padx {7}  -pady {3}  -relief {sunken}  -text "Current Database is: $CURRENTDATABASE"

message .fm15.mess18 -aspect {500}  -justify {center}  -padx {7}  -pady {3}  -text "$S2K_VERSION" -foreground LightSkyBlue3

message .fm15.mess16 -aspect {686}  -borderwidth {0}  -font $BIGFONT  -justify {center}  -padx {34}  -pady {7}  -relief {raised}  -text {Sequoia 2000: Lassen Text Browser} -foreground red

pack append .fm15 \
              .fm15.mess16 {top frame n padx 76} \
              .fm15.mess18 {top frame center padx 5 pady 10 expand fill} \
              .fm15.mess19 {top frame center padx 58 pady 23 expand}
frame .fm2 -borderwidth {2}  -geometry {20x20}  -relief {raised}

#  QUIT menu
menubutton .fm2.mbt12 -activebackground {OrangeRed1}  -menu {.fm2.mbt12.m}  -text {Quit} -foreground LightSkyBlue3
#bind.defaultmenubutton .fm2.mbt12

menu .fm2.mbt12.m
     .fm2.mbt12.m add command  -command {finishup}  -label "Really QUIT?" -activebackground OrangeRed1
#bind.defaultmenu .fm2.mbt12.m


# POSTQUEL menu
menubutton .fm2.mbt11   -menu {.fm2.mbt11.m}  -text {PostQuel} -foreground LightSkyBlue3
#bind.defaultmenubutton .fm2.mbt11

menu .fm2.mbt11.m
     .fm2.mbt11.m add command  -command {buildpqcommand}  -label "Build PostQuel Command"  
     .fm2.mbt11.m add command  -command {dbquery .winquery}  -label "Edit PostQuel Command"  
     .fm2.mbt11.m add command  -command {recallpqcommand}  -label "Recall PostQuel Command"  
#bind.defaultmenu .fm2.mbt11.m


# SEARCH menu
menubutton .fm2.mbt10   -menu {.fm2.mbt10.m}  -text {Search} -foreground LightSkyBlue3 
#bind.defaultmenubutton .fm2.mbt10

menu .fm2.mbt10.m
     .fm2.mbt10.m add command  -command {SearchDocs}  -label "Search Window"  
#bind.defaultmenu .fm2.mbt10.m


# REMOTE menu
menubutton .fm2.mbt9   -menu {.fm2.mbt9.m}  -text {Remote} -foreground LightSkyBlue3
#bind.defaultmenubutton .fm2.mbt9

menu .fm2.mbt9.m
     .fm2.mbt9.m add command  -command {}  -label {--WWW Disabled---}  
     .fm2.mbt9.m add separator

     .fm2.mbt9.m add command  -command {WaitWindow {TEST}}  -label {test_wait}  



# BROWSE menu
menubutton .fm2.mbt8   -menu {.fm2.mbt8.m}  -text {Browse} -foreground LightSkyBlue3
#bind.defaultmenubutton .fm2.mbt8

menu .fm2.mbt8.m
     .fm2.mbt8.m add command  -command {geobrowse}  -label "Geographic Browser"  
     .fm2.mbt8.m add command  -accelerator {N}  -command {browsedocnames}  -label "Document Names"  
     .fm2.mbt8.m add command  -accelerator {A}  -command {browseauthornames}  -label "Document Authors"  
     .fm2.mbt8.m add command  -accelerator {K}  -command {browsedockeywords}  -label "Document_Keywords"  
     .fm2.mbt8.m add separator
     .fm2.mbt8.m add command \
        -command "mkListList PGUSERATTRLIST {-text \"Database Attribute List\"}" \
        -label "Database Attributes"  
     .fm2.mbt8.m add command  \
        -command {mkList2 PGCLASS {-text "Database Classes List"}} \
       -label "Database Classes"  
     .fm2.mbt8.m add command  -command {Newlist / }  -label {Database Large Objs}  

pack append .fm2 \
              .fm2.mbt8 {left frame center padx 26} \
              .fm2.mbt9 {left frame center padx 6} \
              .fm2.mbt10 {left frame center padx 35} \
              .fm2.mbt11 {left frame center padx 42} \
              .fm2.mbt12 {left frame center}
pack append . \
              .fm2 {top frame center expand fill} \
              .fm15 {top frame center}

wm geometry . -10+0

#end of mainbrowse
}


proc finishup {} {
     global TEMPFILEPATH

     savequerylist
     catch {eval exec rm -rf [glob $TEMPFILEPATH*]}
     PQfinish
     destroy .
}
