#!/usr/bin/wish

package require wylib
wm geometry . 600x200

mbar::mbar .menu -relief raised -help {Common functions applicable to the whole application}\
    -mb {file File -under 0 -bg red -help {File related stuff}\
        -mi {save {Save File} {puts Save} {This will save the file} -s Sv}\
        -mi {load {Load File} {puts Load} {This will load a new file} -s Ld}\
        -mb {imp Import -help {Import stuff}\
            -mi {txt {Text File} {puts Import_Text} {Import a text file} -s Txt}\
            -mi {fmt {Formatted File} {puts Import_Formatted} {Import a formatted file}}\
            -mb {doc {Document} -help {Document stuff}\
                -mi {wp {Word Perfect} {puts Import_WP} {Import a Word Perfect file}}\
                -mi {ms {MS Word} {puts Import_MS} {Import a MS Word file}}\
            }
        }\
        -mi sep\
        -mi {exit Exit exit {Quit the program}}\
    }\
    -mb {tool Tools -under 0 -help {Tools and stuff}\
        -mi {awin {A Window} {puts Awin} {Open the A window}}\
        -mi {bwin {B Window} {puts Bwin} {Open the B window}}\
        -mi sep\
        -mi {grab {Grab Thingy} {puts Grab} {Grab the current item}}\
    }\
    -mb {rept Report -under 0 -bd 1 -relief sunken -indic 1 -help {Reports and stuff}\
        -mi {arep {A Report} {puts Arep} {Run the A report}}\
        -mi {brep {B Report} {puts Brep} {Run the B report}}\
    }\
    -b {com Commit {puts Commit} {Commit the transaction} -rep 200}\
    -mb {help Help -under 0 -bg blue -gmc {-side right -in .menu} -help {Give the user some help}\
        -mi {hlp1 {Help 1} {puts Help1} {Help screen 1}}\
        -mi {hlp2 {Help 2} {puts Help2} {Help screen 2}}\
    }\
    -s {dew::dew d2 chk {Active:} -textv v2 -init 1 -gmc {-side right} -help {Active window}}\
    -s {dew::dew d1 ent {Entry 1:} -fr {-bg black -bd 1} -width 8 -textv v1 -init Now -spf scm -gmc {-side right} -help {A test entry} -data {-list {Now is the time for all good men to come to the aid of their lady}}}

mbar::mbar .buts -gmc.b {-exp 1 -fill x}\
    -s {label t -text {Button Bar:} -help {To help people know what this set of buttons is for}}\
    -mb {test Test -indic 1 -bd 1 -relief raised -pady 2 -help {A menu in a button bar}\
        -mi {r1 R1 -type radio -help {Do an R1} -variable rrr}\
        -mi {r2 R2 -type radio -help {Do an R1} -variable rrr}\
        -mi {r3 R3 -type radio -help {Do an R1} -variable rrr}\
        -mi {r4 R4 -type radio -help {Do an R1} -variable rrr}\
        -mi sep\
        -mi {c1 C1 -type check -help {Do a C1} -variable cc1}\
        -mi {c2 C2 -type check -help {Do a C2} -variable cc2}\
        -mi {c3 C3 -type check -help {Do a C3} -variable cc3}\
        -mi {c4 C4 -type check -help {Do a C4} -variable cc4}\
    }\
    -b {addrec New {puts Addrec} {Add a new record to the database}}\
    -b {updrec Update {puts Updrec} {Update a record in the database}}\
    -b {delrec Delete {puts Delrec} {Delete a record in the database}}\
    -b {clear Clear {puts Clear} {Clear the editing pane}}\

mbar::mbar .sbut -relief raised -bd 2 -bg red -gmc {-side top}\
    -s {label title -text {DBE Functions} -help {A helpful label} -gmc {-fill x -exp 1}}\
    -b {addrec New {puts Addrec} {Add a new record to the database}}\
    -b {updrec Update {puts Updrec} {Update a record in the database}}\
    -b {delrec Delete {puts Delrec} {Delete a record in the database}}\
    -b {clear Clear {puts Clear} {Clear the editing pane}}\
    -s {dew::dew d1 ent {Entry 1:} -fr {-bd 2 -relief raised} -gmc {-side bottom} -width 8 -textv v3 -init hello -spf scm -help {A test entry} -data {-list {Now is the time for all good men to come to the aid of their lady}}}

pack .menu .buts -side top -fill x
pack .sbut -side right -anchor n

frame .f; pack .f -side top -fill both -exp 1

.buts b dial Dial {puts Dial} {Dial the selected phone number}
.sbut clear configure -state disabled

.menu file save configure -state disabled
