home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1996
- #
- # File: @(#)il60docedi.tcl /main/hindenburg/2
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)il60docedi.tcl /main/hindenburg/2 29 Oct 1996 Copyright 1996 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
- require "doceditor.tcl"
-
- Class Il60DocEditor : {DocEditor} {
- constructor
- method destructor
- method configDirectory
- method edit
- method show
- method print
- method getPrinterName
- method findPrinterName
- }
-
- constructor Il60DocEditor {class this name_1} {
- set this [DocEditor::constructor $class $this $name_1]
- # Start constructor user section
- $this printsIncluded y
- $this name Il
- $this version 60
- $this localSectionTypes "[$this localSectionTypes] Str Cat Doc Toc"
- $this dirExtension boo
- # End constructor user section
- return $this
- }
-
- method Il60DocEditor::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this DocEditor::destructor
- }
-
- method Il60DocEditor::configDirectory {this directory} {
- set error [DocEditor::configDirectory $this $directory]
- if {$error != ""} {
- return $error
- }
-
- # check if clipboard dir exists, if not create one
- set desktop [[[ClientContext::global] currentPhase] path]
- set desktop [path_name concat $desktop clipboard.clp]
- set crntPath [pwd]
- if [catch {cd $desktop}] {
- catch {mkdir -path [list $desktop]} error
- } else {
- cd $crntPath
- }
- return $error
- }
-
- method Il60DocEditor::edit {this docSection} {
-
- wmtkmessage "Starting edit for section '[$docSection name]'"
- set desktop [[[ClientContext::global] currentPhase] path]
- set cmd [list \
- "ileaf6 -desktop $desktop -quiet [$docSection docLocation] &" \
- [$docSection uiName] \
- ]
- $docSection execute "$cmd"
- wmtkmessage ""
- }
-
- method Il60DocEditor::show {this docSection} {
-
- wmtkmessage "Starting show for section '[$docSection name]'"
- set desktop [[[ClientContext::global] currentPhase] path]
- set cmd [list \
- "ileaf6 -desktop $desktop -quiet [$docSection docLocation] &" \
- [$docSection uiName] \
- ]
- $docSection execute "$cmd"
- wmtkmessage ""
- }
-
- method Il60DocEditor::print {this docSection} {
-
- set printerName [$this getPrinterName]
- if {$printerName == ""} {
- set printerName postscript
- }
-
- set desktop [[[ClientContext::global] currentPhase] path]
- set cmd [list "ileaf6 -desktop $desktop -print :printer $printerName \
- [$docSection docLocation] " [$docSection uiName] ]
- $docSection execute "$cmd"
- }
-
- method Il60DocEditor::getPrinterName {this} {
-
- set printerName [m4_var get M4_ps_printer]
-
- set foundName [$this findPrinterName $printerName -P]
- if {$foundName != ""} {
- return $foundName
- }
-
- catch {
- set foundName $env(PRINTER)
- if {$foundName != ""} {
- return $foundName
- }
- }
-
- set foundName [$this findPrinterName $printerName -d]
- if {$foundName != ""} {
- return $foundName
- }
-
- catch {
- set foundName $env(LPDEST)
- if {$foundName != ""} {
- return $foundName
- }
- }
-
- return ""
- }
-
- method Il60DocEditor::findPrinterName {this printerName searchString} {
-
- set start [string first $searchString $printerName]
- if {$start == -1} {
- return ""
- }
- incr start [string length $searchString]
- set printerName [string range $printerName $start end]
- set end [string first " " $printerName]
- if {$end != -1} {
- set printerName [string range $printerName 0 $end]
- } else {
- set printerName [string range $printerName 0 end]
- }
-
- return $printerName
- }
-
- # Do not delete this line -- regeneration end marker
-
-