home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cadre Technologies Inc. 1996
- #
- # File: @(#)setlockdia.tcl /main/hindenburg/11
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)setlockdia.tcl /main/hindenburg/11 18 Oct 1996 Copyright 1996 Cadre Technologies Inc.
-
- # Start user added include file section
- require "lockbrtabl.tcl"
- # End user added include file section
-
- require "reptooldia.tcl"
-
- Class SetLockDialog : {RepToolDialog} {
- constructor
- method destructor
- method setObject
- method setClient
- method ok
- method cancel
- }
-
- constructor SetLockDialog {class this name view} {
- set this [RepToolDialog::constructor $class $this $name $view]
- # Start constructor user section
-
- interface DlgColumn $this.gui {
- DlgRow type {
- Label l { text "Lock Type" }
- OptionMenu type {
- horStretchFactor 100
- entrySet {
- writeLock
- readLock
- }
- }
- }
- DlgRow attr {
- DlgColumn attr {
- DlgRow object {
- Label l { text "Object Id" }
- SingleLineText object {
- columnCount 35
- }
- }
- DlgRow host {
- Label l { text "Host" }
- SingleLineText host {
- columnCount 35
- }
- }
- DlgRow user {
- Label l { text "User" }
- SingleLineText user {
- columnCount 35
- }
- }
- DlgRow pid {
- Label l { text "Process Id" }
- IntField pid {
- intValue -1
- columnCount 35
- }
- }
- DlgRow reason {
- Label l { text "Reason" }
- SingleLineText reason {
- columnCount 35
- }
- }
- }
- LockBrTable dropZone {
- mode ICON
- selectionPolicy BROWSE
- selectionChanged { %this selectedSet {} }
-
- BrowsObject o {
- largeIcon rep_lock_32
- label "Drop\nbrowser\nor client\nobjects\nhere."
- }
- }
- }
- }
-
- $this.gui.attr.dropZone view [$this view]
- if $win95 {
- $this.gui.attr.dropZone columnCount 15
- }
-
- $this config \
- -title "New Lock" \
- -okPressed { %this ok } \
- -cancelPressed { %this cancel } \
- -helpPressed { [%this view] helpOnName newLock }
-
- # End constructor user section
- return $this
- }
-
- method SetLockDialog::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this RepToolDialog::destructor
- }
-
- method SetLockDialog::setObject {this objId} {
- $this.gui.attr.attr.object.object text $objId
- }
-
- method SetLockDialog::setClient {this context} {
- $this.gui.attr.attr.host.host text [lindex $context 0]
- $this.gui.attr.attr.pid.pid intValue [lindex $context 1]
- $this.gui.attr.attr.user.user text [lindex $context 2]
- }
-
- method SetLockDialog::ok {this} {
- [$this view] setLockPoppedUp 0
-
- set new [LockDescription new]
-
- # Only set those fields of the description that have been entered in
- # the dialog. Let setLock give error if description is incomplete.
- #
-
- set objId [$this.gui.attr.attr.object.object text]
- if {$objId != "" && $objId != [[ORB::nil] identity]} {
- $new setObject $objId
- }
-
- $new addType [LockFilter::lock2descType \
- [$this.gui.type.type selected]]
-
- set host [$this.gui.attr.attr.host.host text]
- if {$host != ""} {
- $new setHost $host
- }
-
- set user [$this.gui.attr.attr.user.user text]
- if {$user != ""} {
- $new setUser $user
- }
-
- set pid [$this.gui.attr.attr.pid.pid intValue]
- if {$pid != "" && $pid != -1} {
- $new setPid $pid
- }
-
- set reason [$this.gui.attr.attr.reason.reason text]
- if {$reason != ""} {
- $new setReason $reason
- }
-
- [[$this view] rep] setLock $new
- [$this view] update
- }
-
- method SetLockDialog::cancel {this} {
- [$this view] setLockPoppedUp 0
- }
-
- # Do not delete this line -- regeneration end marker
-
-