OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [library/] [DirDlg.tcl] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# DirDlg.tcl --
2
#
3
#       Implements the Directory Selection Dialog widget.
4
#
5
# Copyright (c) 1996, Expert Interface Technologies
6
#
7
# See the file "license.terms" for information on usage and redistribution
8
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
9
#
10
 
11
tixWidgetClass tixDirSelectDialog {
12
    -classname TixDirSelectDialog
13
    -superclass tixDialogShell
14
    -method {}
15
    -flag   {
16
        -command
17
    }
18
    -configspec {
19
        {-command command Command ""}
20
        {-title title Title "Select A Directory"}
21
    }
22
 
23
    -default {
24
        {*ok.text               "OK"}
25
        {*ok.underline          0}
26
        {*ok.width              6}
27
        {*cancel.text           "Cancel"}
28
        {*cancel.underline      0}
29
        {*cancel.width          6}
30
        {*dirbox.borderWidth    1}
31
        {*dirbox.relief         raised}
32
    }
33
}
34
 
35
proc tixDirSelectDialog:ConstructWidget {w} {
36
    upvar #0 $w data
37
 
38
    tixChainMethod $w ConstructWidget
39
 
40
    # the buttons
41
    frame $w.f -relief raised -bd 1
42
    set data(w:ok)     [button $w.f.ok -command \
43
        "tixDirSelectDialog:OK $w"]
44
    set data(w:cancel) [button $w.f.cancel -command \
45
        "tixDirSelectDialog:Cancel $w"]
46
 
47
    pack $data(w:ok) $data(w:cancel) -side left -expand yes -padx 10 -pady 8
48
    pack $w.f -side bottom -fill x
49
    # the dir select box
50
    set data(w:dirbox) [tixDirSelectBox $w.dirbox \
51
        -command "tixDirSelectDialog:DirBoxCmd $w"]
52
    pack $data(w:dirbox) -expand yes -fill both
53
}
54
 
55
proc tixDirSelectDialog:SetBindings {w} {
56
    upvar #0 $w data
57
 
58
    tixChainMethod $w SetBindings
59
 
60
    bind $w <Alt-Key-d> "focus [$data(w:dirbox) subwidget dircbx]"
61
}
62
 
63
proc tixDirSelectDialog:OK {w} {
64
    upvar #0 $w data
65
 
66
    wm withdraw $w
67
    $data(w:dirbox) subwidget dircbx invoke
68
}
69
 
70
proc tixDirSelectDialog:DirBoxCmd {w args} {
71
    upvar #0 $w data
72
 
73
    set value [tixEvent flag V]
74
    wm withdraw $w
75
    tixDirSelectDialog:CallCmd $w $value
76
}
77
 
78
proc tixDirSelectDialog:CallCmd {w value} {
79
    upvar #0 $w data
80
 
81
    if {$data(-command) != ""} {
82
        set bind(specs) "%V"
83
        set bind(%V) $value
84
        tixEvalCmdBinding $w $data(-command) bind $value
85
    }
86
}
87
 
88
proc tixDirSelectDialog:Cancel {w} {
89
    wm withdraw $w
90
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.