2 # Cygnus enhanced version of the iwidget Pane class
3 # ----------------------------------------------------------------------
4 # Implements a pane for a paned window widget. The pane is itself a
5 # frame with a child site for other widgets. The pane class performs
6 # basic option management.
8 # ----------------------------------------------------------------------
9 # AUTHOR: Mark L. Ulferts EMAIL: mulferts@austin.dsccc.com
12 # ----------------------------------------------------------------------
13 # Copyright (c) 1995 DSC Technologies Corporation
14 # ======================================================================
15 # Permission to use, copy, modify, distribute and license this software
16 # and its documentation for any purpose, and without fee or written
17 # agreement with DSC, is hereby granted, provided that the above copyright
18 # notice appears in all copies and that both the copyright notice and
19 # warranty disclaimer below appear in supporting documentation, and that
20 # the names of DSC Technologies Corporation or DSC Communications
21 # Corporation not be used in advertising or publicity pertaining to the
22 # software without specific, written prior permission.
24 # DSC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
25 # ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND NON-
26 # INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE
27 # AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE,
28 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. IN NO EVENT SHALL
29 # DSC BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
30 # ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
31 # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION,
32 # ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
34 # ======================================================================
40 keep -background -cursor
43 # ------------------------------------------------------------------
45 # ------------------------------------------------------------------
51 itk_option define -maximum maximum Maximum 0
52 itk_option define -minimum minimum Minimum 10
53 itk_option define -margin margin Margin 0
54 itk_option define -resizable resizable Resizable 1
56 public method childSite {} {}
60 # Provide a lowercased access method for the Pane class.
62 proc ::cyg::pane {pathName args} {
63 uplevel ::cyg::Pane $pathName $args
66 # ------------------------------------------------------------------
68 # ------------------------------------------------------------------
69 body cyg::Pane::constructor {args} {
71 # Create the pane childsite.
73 itk_component add childsite {
74 frame $itk_interior.childsite
76 keep -background -cursor
78 pack $itk_component(childsite) -fill both -expand yes
81 # Set the itk_interior variable to be the childsite for derived
84 set itk_interior $itk_component(childsite)
86 eval itk_initialize $args
89 # ------------------------------------------------------------------
91 # ------------------------------------------------------------------
93 # ------------------------------------------------------------------
96 # Specifies the minimum size that the pane may reach.
97 # ------------------------------------------------------------------
98 configbody cyg::Pane::minimum {
99 set pixels [winfo pixels $itk_component(hull) $itk_option(-minimum)]
100 set $itk_option(-minimum) $pixels
103 # ------------------------------------------------------------------
106 # Specifies the maximum size that the pane may reach.
107 # ------------------------------------------------------------------
108 configbody cyg::Pane::maximum {
109 set pixels [winfo pixels $itk_component(hull) $itk_option(-maximum)]
110 set $itk_option(-maximum) $pixels
113 # ------------------------------------------------------------------
116 # Specifies the border distance between the pane and pane contents.
117 # This is done by setting the borderwidth of the pane to the margin.
118 # ------------------------------------------------------------------
119 configbody cyg::Pane::margin {
120 set pixels [winfo pixels $itk_component(hull) $itk_option(-margin)]
121 set itk_option(-margin) $pixels
122 $itk_component(childsite) configure -borderwidth $itk_option(-margin)
125 # ------------------------------------------------------------------
127 # ------------------------------------------------------------------
129 # ------------------------------------------------------------------
132 # Return the pane child site path name.
133 # ------------------------------------------------------------------
134 body cyg::Pane::childSite {} {
135 return $itk_component(childsite)