home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)vbprintopt.tcl /main/titanic/2
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)vbprintopt.tcl /main/titanic/2 8 Oct 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
- require "printoptio.tcl"
-
- Class VBPrintOptionsDialog : {PrintOptionsDialog} {
- constructor
- method destructor
- method popUp
- method handleOk
- }
-
- constructor VBPrintOptionsDialog {class this name} {
- set this [PrintOptionsDialog::constructor $class $this $name]
- # Start constructor user section
- # End constructor user section
- return $this
- }
-
- method VBPrintOptionsDialog::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this PrintOptionsDialog::destructor
- }
-
- method VBPrintOptionsDialog::popUp {this} {
-
- if [isCommand $this.c.saved.c] {
- $this.c.saved delete
- $this.c.titleLabel delete
- $this.c.title delete
- }
-
- $this.c.scaleStrategy.c.autoScale state [m4_var get \
- M4_ps_auto_scale -context vb]
- if {[m4_var get M4_ps_mode -context vb] == "landscape"} {
- $this.c.landscape state 1
- } else {
- $this.c.landscape state 0
- }
-
- $this.c.printBox state [m4_var get M4_print_box -context vb]
-
- set strat $this.c.scaleStrategy.c
- $strat.scale text [m4_var get M4_ps_scale -context vb]
- $this autoScaleChanged
- $strat.horPages text [m4_var get M4_ps_columns -context vb]
- $strat.verPages text [m4_var get M4_ps_rows -context vb]
- $this TemplateDialog::popUp
- }
-
- method VBPrintOptionsDialog::handleOk {this} {
-
- set state [$this.c.landscape state]
- if $state {
- $this orientation "landscape"
- } else {
- $this orientation "portrait"
- }
- $this doPrintBox [$this.c.printBox state]
- $this autoScale [$this.c.scaleStrategy.c.autoScale state]
- set label ""
- if [$this autoScale] {
- $this horNumPages [$this numPages hor]
- $this verNumPages [$this numPages ver]
- $this scale ""
- if {[$this horNumPages] <= 0} {
- set label hor
- } elseif {[$this verNumPages] <= 0} {
- set label ver
- }
- } else {
- $this horNumPages ""
- $this verNumPages ""
- $this scale [$this scaleValue]
- if {[$this scale] <= 0} {
- set label scale
- }
- }
- if {"$label" != ""} {
- set fieldName [$this.c.scaleStrategy.c.${label}Label text]
- wmtkerror "$fieldName must be a positive value"
- return
- }
-
- if {"[m4_var get M4_ps_mode -context vb]" != "[$this orientation]"} {
- m4_var set M4_ps_mode [$this orientation] -context vb
- }
- if {"[m4_var get M4_print_box -context vb]" != "[$this doPrintBox]"} {
- m4_var set M4_print_box [$this doPrintBox] -context vb
- }
- if [$this autoScale] {
- if {[m4_var get M4_ps_auto_scale -context vb] != 1} {
- m4_var set M4_ps_auto_scale 1 -context vb
- }
- if {"[m4_var get M4_ps_columns -context vb]" != \
- "[$this horNumPages]"} {
- m4_var set M4_ps_columns [$this horNumPages] -context vb
- }
- if {"[m4_var get M4_ps_rows -context vb]" != \
- "[$this verNumPages]"} {
- m4_var set M4_ps_rows [$this verNumPages] -context vb
- }
- } else {
- if {[m4_var get M4_ps_auto_scale -context vb] != 0} {
- m4_var set M4_ps_auto_scale 0 -context vb
- }
- if {"[m4_var get M4_ps_scale -context vb]" != "[$this scale]"} {
- m4_var set M4_ps_scale [$this scale] -context vb
- }
- }
-
- $this popDown
- }
-
- # Do not delete this line -- regeneration end marker
-
-