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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [itcl/] [iwidgets3.0.0/] [generic/] [promptdialog.itk] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
#
2
# Promptdialog
3
# ----------------------------------------------------------------------
4
# Implements a prompt dialog similar to the OSF/Motif standard prompt
5
# dialog composite widget.  The Promptdialog is derived from the
6
# Dialog class and is composed of a EntryField with methods to
7
# manipulate the dialog buttons.
8
#
9
# ----------------------------------------------------------------------
10
#  AUTHOR: Mark L. Ulferts              EMAIL: mulferts@austin.dsccc.com
11
#
12
#  @(#) $Id: promptdialog.itk,v 1.1.1.1 2002-01-16 10:24:50 markom Exp $
13
# ----------------------------------------------------------------------
14
#            Copyright (c) 1995 DSC Technologies Corporation
15
# ======================================================================
16
# Permission to use, copy, modify, distribute and license this software
17
# and its documentation for any purpose, and without fee or written
18
# agreement with DSC, is hereby granted, provided that the above copyright
19
# notice appears in all copies and that both the copyright notice and
20
# warranty disclaimer below appear in supporting documentation, and that
21
# the names of DSC Technologies Corporation or DSC Communications
22
# Corporation not be used in advertising or publicity pertaining to the
23
# software without specific, written prior permission.
24
#
25
# DSC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
26
# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND NON-
27
# INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE
28
# AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE,
29
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. IN NO EVENT SHALL
30
# DSC BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
31
# ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
32
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION,
33
# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
34
# SOFTWARE.
35
# ======================================================================
36
 
37
#
38
# Usual options.
39
#
40
itk::usual Promptdialog {
41
    keep -background -borderwidth -cursor -foreground -highlightcolor \
42
         -highlightthickness -insertbackground -insertborderwidth \
43
         -insertofftime -insertontime -insertwidth -labelfont -modality \
44
         -selectbackground -selectborderwidth -selectforeground \
45
         -textbackground -textfont
46
}
47
 
48
# ------------------------------------------------------------------
49
#                            PROMPTDIALOG
50
# ------------------------------------------------------------------
51
class iwidgets::Promptdialog {
52
    inherit iwidgets::Dialog
53
 
54
    constructor {args} {}
55
 
56
    public method get {}
57
    public method clear {}
58
    public method insert {args}
59
    public method delete {args}
60
    public method icursor {args}
61
    public method index {args}
62
    public method scan {args}
63
    public method selection {args}
64
    method xview {args}
65
}
66
 
67
#
68
# Provide a lowercased access method for the Dialogshell class.
69
#
70
proc ::iwidgets::promptdialog {pathName args} {
71
    uplevel ::iwidgets::Promptdialog $pathName $args
72
}
73
 
74
#
75
# Use option database to override default resources of base classes.
76
#
77
option add *Promptdialog.labelText Selection widgetDefault
78
option add *Promptdialog.labelPos nw widgetDefault
79
option add *Promptdialog.title "Prompt Dialog" widgetDefault
80
option add *Promptdialog.master "." widgetDefault
81
 
82
# ------------------------------------------------------------------
83
#                        CONSTRUCTOR
84
# ------------------------------------------------------------------
85
body iwidgets::Promptdialog::constructor {args} {
86
    #
87
    # Set the borderwidth to zero.
88
    #
89
    component hull configure -borderwidth 0
90
 
91
    #
92
    # Create an entry field widget.
93
    #
94
    itk_component add prompt {
95
        iwidgets::Entryfield $itk_interior.prompt -command [code $this invoke]
96
    } {
97
        usual
98
 
99
        keep -exportselection -invalid -labelpos -labeltext -relief \
100
            -show -textbackground -textfont -validate
101
    }
102
 
103
    pack $itk_component(prompt) -fill x -expand yes
104
    set itk_interior [childsite]
105
 
106
    hide Help
107
 
108
    #
109
    # Initialize the widget based on the command line options.
110
    #
111
    eval itk_initialize $args
112
}
113
 
114
# ------------------------------------------------------------------
115
#                            METHODS
116
# ------------------------------------------------------------------
117
 
118
# ------------------------------------------------------------------
119
# METHOD: get
120
#
121
# Thinwrapped method of entry field class.
122
# ------------------------------------------------------------------
123
body iwidgets::Promptdialog::get {} {
124
    return [$itk_component(prompt) get]
125
}
126
 
127
# ------------------------------------------------------------------
128
# METHOD: clear
129
#
130
# Thinwrapped method of entry field class.
131
# ------------------------------------------------------------------
132
body iwidgets::Promptdialog::clear {} {
133
    eval $itk_component(prompt) clear
134
}
135
 
136
# ------------------------------------------------------------------
137
# METHOD: insert args
138
#
139
# Thinwrapped method of entry field class.
140
# ------------------------------------------------------------------
141
body iwidgets::Promptdialog::insert {args} {
142
    eval $itk_component(prompt) insert $args
143
}
144
 
145
# ------------------------------------------------------------------
146
# METHOD: delete first ?last?
147
#
148
# Thinwrapped method of entry field class.
149
# ------------------------------------------------------------------
150
body iwidgets::Promptdialog::delete {args} {
151
    eval $itk_component(prompt) delete $args
152
}
153
 
154
# ------------------------------------------------------------------
155
# METHOD: icursor
156
#
157
# Thinwrapped method of entry field class.
158
# ------------------------------------------------------------------
159
body iwidgets::Promptdialog::icursor {args} {
160
    eval $itk_component(prompt) icursor $args
161
}
162
 
163
# ------------------------------------------------------------------
164
# METHOD: index
165
#
166
# Thinwrapped method of entry field class.
167
# ------------------------------------------------------------------
168
body iwidgets::Promptdialog::index {args} {
169
    return [eval $itk_component(prompt) index $args]
170
}
171
 
172
# ------------------------------------------------------------------
173
# METHOD: scan option args
174
#
175
# Thinwrapped method of entry field class.
176
# ------------------------------------------------------------------
177
body iwidgets::Promptdialog::scan {args} {
178
    eval $itk_component(prompt) scan $args
179
}
180
 
181
# ------------------------------------------------------------------
182
# METHOD: selection args
183
#
184
# Thinwrapped method of entry field class.
185
# ------------------------------------------------------------------
186
body iwidgets::Promptdialog::selection {args} {
187
    eval $itk_component(prompt) selection $args
188
}
189
 
190
# ------------------------------------------------------------------
191
# METHOD: xview args
192
#
193
# Thinwrapped method of entry field class.
194
# ------------------------------------------------------------------
195
body iwidgets::Promptdialog::xview {args} {
196
    eval $itk_component(prompt) xview $args
197
}
198
 
199
 

powered by: WebSVN 2.1.0

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