home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)represtobj.tcl /main/titanic/7
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)represtobj.tcl /main/titanic/7 21 Nov 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- require "repsubdirb.tcl"
- # End user added include file section
-
- require "represtdia.tcl"
-
- Class RepRestObjDialog : {RepRestDialog} {
- constructor
- method destructor
- method checkOverwrite
- method browseObjectDirectory
- method setDirectory
- attribute overwriteLabel
- attribute overwriteField
- attribute overwriteBrowse
- }
-
- constructor RepRestObjDialog {class this name view} {
- set this [RepRestDialog::constructor $class $this $name $view]
- # Start constructor user section
-
- interface Label [$this extraColumn].overwriteLabel {
- text "Overwrite Object"
- }
-
- interface DlgRow [$this extraColumn].o {
- spaceType NONE
- DlgColumn o {
- spaceType EVEN
- horStretchFactor 100
- SingleLineText overwrite {
- columnCount 30
- horStretchFactor 100
- editable 1
- }
- }
- DlgColumn b {
- spaceType EVEN
- horStretchFactor 0
- PushButton browse {
- horStretchFactor 0
- label "Browse..."
- }
- }
- }
-
- [$this dirField] text ""
- [$this dirField] editable 0
- [$this dirBrowse] activated "$this browseObjectDirectory"
-
- $this overwriteLabel [$this extraColumn].overwriteLabel
- $this overwriteField [$this extraColumn].o.o.overwrite
- $this overwriteBrowse [$this extraColumn].o.b.browse
- [$this nameField] textModified "$this checkOk; $this checkOverwrite new"
- [$this overwriteField] textModified "$this checkOverwrite old"
- [$this overwriteBrowse] activated "$this browseObjects"
-
- interface NamedGroup [$this dbColumn].g {
- label "Database"
- DlgColumn c {
- verStretchFactor 0
- }
- }
-
- if $win95 {
- $this createDbInterface [$this dbColumn].g.c 35
- } else {
- $this createDbInterface [$this dbColumn].g.c 30
- }
-
- $this setDbFields
- $this setupForPassword
-
- # End constructor user section
- return $this
- }
-
- method RepRestObjDialog::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this RepRestDialog::destructor
- }
-
- method RepRestObjDialog::checkOverwrite {this what} {
- if {$what == "new"} {
- set new [$this nameField]
- set old [$this overwriteField]
- } else {
- set new [$this overwriteField]
- set old [$this nameField]
- }
-
- if {[string length [$new text]] == 0} {
- $old editable 1
- if {$old == [$this overwriteField]} {
- [$this overwriteBrowse] sensitive 1
- }
- } else {
- $old editable 0
- if {$old == [$this overwriteField]} {
- [$this overwriteBrowse] sensitive 0
- }
- }
- }
-
- method RepRestObjDialog::browseObjectDirectory {this} {
- set rep [[$this view] rep]
- set repDir [$rep currentRepDir]
-
- set dlg [$this view].browse[$this objType]dir
- if ![isCommand $dlg] {
- RepSubDirBrowser new $dlg \
- -title "[$this objType] Directory Browser" \
- -message "Select a [$this objType] directory from\
- the repository directory:"
-
- $dlg okPressed "%this handleOk; $this setDirectory \
- \[lindex \[%this selectedSet] 0]"
- }
-
- $dlg selectedSet [list [[$this dirField] text]]
- $dlg directory $repDir
- $dlg popUp
- }
-
- method RepRestObjDialog::setDirectory {this dir} {
- $this RepRestDialog::setDirectory [file tail $dir]
- }
-
- # Do not delete this line -- regeneration end marker
-
-