home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
desk.tcl
< prev
next >
Wrap
Text File
|
1997-05-16
|
3KB
|
121 lines
#---------------------------------------------------------------------------
#
# (c) Westmount Technology 1995
#
# File: @(#)desk.tcl /main/hindenburg/9
# Author: Marcel Bancken
# Description: Instantiation of the desk
#---------------------------------------------------------------------------
# SccsId = @(#)desk.tcl /main/hindenburg/9 16 May 1997 Copyright 1995 Westmount Technology
OtkRegister::extGui
source [m4_path_name tcl libocl.tcl]
require platform.tcl
require "procs.tcl"
require "messagehdl.tcl"
require "browser.tcl"
proc usage {} {
error "Usage: otk desk.tcl -- \[-c caller\] ?objectId?"
}
set argc 0
set status INITIAL
set context ""
set caller ""
foreach arg $argv {
case $arg in {
{-c} {
if {$status != "INITIAL"} {
usage
}
set status CALLER
}
{default} {
case $status in {
{CALLER} {
set caller $arg
set status CONTEXT
}
{CONTEXT} {
append context " $arg"
}
{default} {
usage
}
}
}
}
incr argc 1
}
if {$status != "INITIAL" && $status != "CONTEXT"} {
usage
}
# Go one level up until the ClientContext is valid
set invalidContext [catch {set clientContext [ClientContext::global]} errorMsg]
if $invalidContext {
set clientContext [ClientContext::global]
for {set levelpath [m4_var get M4_levelpath]} \
{$invalidContext} \
{set invalidContext \
[catch {$clientContext setLevelPath $levelpath} errorMsg]} {
set slash [string last "/" $levelpath]
if {$slash <= 0} break
set levelpath [string range $levelpath 0 [expr $slash - 1]]
}
}
if $invalidContext {
wmtkfatal $errorMsg
return
}
# If the initial context is still empty then
# it is specified by M4_levelpath_ids
if {"$context" == ""} {
set levelpath_ids [m4_var get M4_levelpath_ids]
for {set slash [string last "/" $levelpath_ids]} \
{$slash >= 0} \
{set slash [string last "/" $levelpath_ids]} {
set context \
"[string range $levelpath_ids [expr $slash + 1] end] $context"
set levelpath_ids [string range $levelpath_ids 0 [expr $slash - 1]]
}
}
set rootIdList [list \
[list Corporate [[$clientContext currentCorporate] identity]] \
[list UCustFUiObj "${UCustFUiObj::uiClass}:0"] \
]
sourceOptional u_desk
# sport7 addition for vcm integrations
set corporate [$clientContext currentCorporate]
if [$corporate isA Corporate] {
if { [$corporate getPropertyValue vcmIntegrationList] != "" } {
require vsbr_procs.tcl
}
}
Browser new .main -closed {%this stop}
if [isCommand .main.error] {
.main.error okPressed "%this delete; .main stop"
return
}
.main config \
-title "ObjectTeam Browser" \
-iconTitle "ObjectTeam Browser" \
-initialContext $context \
-rootIdList $rootIdList \
-caller "$caller" \
-firstExposed {%this initView}
if {! $win95} {
.main icon desk_64
}
.main popUp