📄 printdialog.tcl
字号:
# Copyright (c) 2000, Red Hat, Inc.# # This file is part of Source-Navigator.# # Source-Navigator is free software; you can redistribute it and/or# modify it under the terms of the GNU General Public License as published# by the Free Software Foundation; either version 2, or (at your option)# any later version.# # Source-Navigator is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU# General Public License for more details.# # You should have received a copy of the GNU General Public License along# with Source-Navigator; see the file COPYING. If not, write to# the Free Software Foundation, 59 Temple Place - Suite 330, Boston,# MA 02111-1307, USA.#itcl::class PrintDialog { inherit sourcenav::Dialog global sn_options constructor {args} { global sn_options global ${this}-wait global tcl_platform if {${init_withdraw}} { ${this} withdraw } set header_font $sn_options(def,layout-font) eval itk_initialize $args # $this configure -header_font $sn_options(def,layout-font) ${this} title [get_indep String SQLPname] frame $itk_component(hull).pageframe -relief {raised} -border {2} label $itk_component(hull).pageframe.label -relief {flat} -anchor w\ -text [get_indep String SQLPform] radiobutton $itk_component(hull).pageframe.landscape -relief {flat}\ -variable $rotate -value 1 -anchor w -text [get_indep String\ SQLPformland] radiobutton $itk_component(hull).pageframe.normal -relief {flat}\ -variable [itcl::scope rotate] -value 0 -anchor w -text [get_indep String\ SQLPformnorm] #print command frame $itk_component(hull).printerframe -relief {raised} -border {2} entry $itk_component(hull).printerframe.entry \ -textvariable [itcl::scope PrinterCmd] \ -relief {sunken} bind $itk_component(hull).printerframe.entry <1>\ "$itk_component(hull).printerframe.label select" bind $itk_component(hull).printerframe.entry <Return>\ "$itk_component(hull).actionframe.button_0 invoke" # Printer radiobutton $itk_component(hull).printerframe.label \ -variable [itcl::scope PrintTo] \ -value printer -relief {flat} -anchor w -text [get_indep String\ SQLPprintercmd] -command " $itk_component(hull).printerframe.entry config\ -state normal " frame $itk_component(hull).printfile -relief {raised} -border {2} # Printfile radiobutton $itk_component(hull).printfile.label \ -variable [itcl::scope PrintTo] \ -value file -relief {flat} -anchor w -text [get_indep String SQLPfile] #Page format frame $itk_component(hull).pageformat -relief {raised} -border {2} label $itk_component(hull).pageformat.label -relief {flat} -anchor w\ -text [get_indep String PrtPageFormat] set i 0 foreach n $sn_options(def,page-formats) { radiobutton $itk_component(hull).pageformat.frmt${i} -relief {flat}\ -variable sn_options(def,page-format) -value [lindex ${n} 0]\ -anchor w -text [lindex ${n} 0] -command " ${this} pageformat\ [lindex ${n} 0] " incr i } #Print into file entry $itk_component(hull).printfile.entry \ -textvariable [itcl::scope file] \ -relief {sunken} bind $itk_component(hull).printfile.entry <Return>\ "$itk_component(hull).actionframe.button_0 invoke" bind $itk_component(hull).printfile.entry <1>\ "$itk_component(hull).printfile.label invoke" frame $itk_component(hull).size -relief {raised} -border {2} label $itk_component(hull).size.label -relief {flat} -anchor w -text\ [get_indep String SQLPprintwidth] entry $itk_component(hull).size.width${entry_pars}\ -textvariable [itcl::scope pagewidth] -relief {sunken} -width {5} bind $itk_component(hull).size.width${entry_pars} <Return>\ "$itk_component(hull).actionframe.button_0 invoke" label $itk_component(hull).size.w_label -relief {flat} -anchor w\ -text [get_indep String SQLPprintheight] entry $itk_component(hull).size.height${entry_pars}\ -textvariable [itcl::scope pageheight] -relief {sunken} -width {5} bind $itk_component(hull).size.height${entry_pars} <Return>\ "$itk_component(hull).actionframe.button_0 invoke" label $itk_component(hull).size.unit -relief {flat} -anchor w\ -textvariable [itcl::scope unit] frame $itk_component(hull).coords -relief {raised} -border {2} label $itk_component(hull).coords.leftm_label -relief {flat} -anchor w\ -text [get_indep String SQLPprintleftm] entry $itk_component(hull).coords.leftm_entry${entry_pars}\ -textvariable [itcl::scope pagex] -relief sunken -width 4 bind $itk_component(hull).coords.leftm_entry${entry_pars} <Return>\ "$itk_component(hull).actionframe.button_0 invoke" label $itk_component(hull).coords.rightm_label -relief {flat} -anchor w\ -text [get_indep String ODDReportrightm] entry $itk_component(hull).coords.rightm_entry${entry_pars}\ -textvariable [itcl::scope pager] -relief sunken -width 4 bind $itk_component(hull).coords.rightm_entry${entry_pars} <Return>\ "$itk_component(hull).actionframe.button_0 invoke" label $itk_component(hull).coords.topm_label -relief {flat} -anchor w\ -text [get_indep String SQLPprinttopm] entry $itk_component(hull).coords.topm_entry${entry_pars}\ -textvariable [itcl::scope pagey] -relief {sunken} -width 4 bind $itk_component(hull).coords.topm_entry${entry_pars} <Return>\ "$itk_component(hull).actionframe.button_0 invoke" label $itk_component(hull).coords.botm_label -relief {flat} -anchor w\ -text [get_indep String ODDReportbotm] entry $itk_component(hull).coords.botm_entry${entry_pars}\ -textvariable [itcl::scope pageb] -relief {sunken} -width 4 bind $itk_component(hull).coords.botm_entry${entry_pars} <Return>\ "$itk_component(hull).actionframe.button_0 invoke" ########################################################### #PostScript Factor and PageCount ########################## ########################################################### frame $itk_component(hull).ps -relief {raised} -border {2} label $itk_component(hull).ps.label -relief {flat} -anchor w -text\ [get_indep String SQLPprintfactor] entry $itk_component(hull).ps.factor_entry \ -textvariable [itcl::scope factor_entry] \ -relief {sunken} -width 4 bind $itk_component(hull).ps.factor_entry <Leave> "${this} CalcPostScriptPages\ \[string trim \[%W get\]\]" bind $itk_component(hull).ps.factor_entry <Return>\ "$itk_component(hull).actionframe.button_0 invoke" label $itk_component(hull).ps.pagev_label -relief {flat} -anchor w\ -text [get_indep String SQLPprintPageV] entry $itk_component(hull).ps.pagev_entry \ -textvariable [itcl::scope pagev_entry] \ -relief {sunken} -width 4 label $itk_component(hull).ps.pageh_label -relief {flat} -anchor w\ -text [get_indep String SQLPprintPageH] entry $itk_component(hull).ps.pageh_entry \ -textvariable [itcl::scope pageh_entry]\ -relief {sunken} -width 4 checkbutton $itk_component(hull).ps.pr_pagenum -relief {flat}\ -variable [itcl::scope pr_pagenum] -anchor w -text [get_indep String\ SQLPPrintPageNum] ############################################################### #END ########################################################## ############################################################### frame $itk_component(hull).range_copy -relief {raised} -border {2} label $itk_component(hull).range_copy.range_label -relief {flat} -anchor w\ -text [get_indep String SQLPprintrange] entry $itk_component(hull).range_copy.range_entry \ -textvariable [itcl::scope range] \ -relief sunken -width 4 bind $itk_component(hull).range_copy.range_entry <Return>\ "$itk_component(hull).actionframe.button_0 invoke" label $itk_component(hull).range_copy.copy_label -relief {flat} -anchor w\ -text [get_indep String SQLPcopies] entry $itk_component(hull).range_copy.copy_entry%6_2_0\ -textvariable [itcl::scope copycount] -relief sunken -width 3 bind $itk_component(hull).range_copy.copy_entry%6_2_0 <Return>\ "$itk_component(hull).actionframe.button_0 invoke" frame $itk_component(hull).colorframe -relief {raised} -border {2} # Farbmodell label $itk_component(hull).colorframe.label -relief {flat} -anchor w\ -text [get_indep String SQLPcolormodell] radiobutton $itk_component(hull).colorframe.mono -relief {flat}\ -variable [itcl::scope colormode] -value mono -anchor w -text\ [get_indep String SQLPmono] radiobutton $itk_component(hull).colorframe.gray -relief {flat}\ -variable [itcl::scope colormode] -value gray -anchor w -text\ [get_indep String SQLPgrey] radiobutton $itk_component(hull).colorframe.color -relief {flat}\ -variable [itcl::scope colormode] -value color -anchor w -text\ [get_indep String SQLPcolor] frame $itk_component(hull).actionframe -relief {flat} -border {2} # Buttons sn_motif_buttons $itk_component(hull).actionframe bottom 0 [get_indep String\ SQLPprintit] [get_indep String cancel] if {${action} == ""} { if {${canvas} != ""} { $itk_component(hull).actionframe.button_0 configure -command " ${this}\ printit [itcl::code $this deactivate printed] " } else { $itk_component(hull).actionframe.button_0 configure -command " set\ [itcl::code $this deactivate printed]" } } else { $itk_component(hull).actionframe.button_0 configure -command " [itcl::code $this deactivate printed] ${action} ${this} " } $itk_component(hull).actionframe.button_1 configure -command " [itcl::code $this deactivate] " #no printer command on windows (using standard font dialog) if {$tcl_platform(platform) != "windows"} { pack append $itk_component(hull) $itk_component(hull).printerframe {top frame center\ fillx} $itk_component(hull).printfile {top frame center fillx} } pack append $itk_component(hull) $itk_component(hull).pageformat {top frame center fillx}\ $itk_component(hull).size {top frame center fillx} $itk_component(hull).coords\ {top frame center fillx} if {${canvas} != ""} { pack append $itk_component(hull) $itk_component(hull).ps {top frame center fillx} } pack append $itk_component(hull) $itk_component(hull).range_copy {top frame center fillx}\ $itk_component(hull).pageframe {top frame center fillx} if {${colormode} != "none"} { pack append $itk_component(hull) $itk_component(hull).colorframe {top frame center\ fillx} } pack append $itk_component(hull) $itk_component(hull).actionframe {bottom frame center\ fillx} #view radiobuttons for variable number of page formats pack append $itk_component(hull).pageformat $itk_component(hull).pageformat.label\ {left frame w} set i 0 foreach n $sn_options(def,page-formats) { pack append $itk_component(hull).pageformat $itk_component(hull).pageformat.frmt${i}\ {left frame w} incr i } pack append $itk_component(hull).pageframe $itk_component(hull).pageframe.label\ {left frame w} $itk_component(hull).pageframe.landscape {left frame w}\ $itk_component(hull).pageframe.normal {left frame w} pack append $itk_component(hull).printerframe $itk_component(hull).printerframe.label\ {left frame w} $itk_component(hull).printerframe.entry {left frame e fillx\ expand } pack append $itk_component(hull).printfile $itk_component(hull).printfile.label\ {left frame w} $itk_component(hull).printfile.entry {left frame e fillx expand} pack $itk_component(hull).size.label -side left -anchor w pack $itk_component(hull).size.width${entry_pars} -side left -anchor w pack $itk_component(hull).size.w_label -side left -anchor w pack $itk_component(hull).size.height${entry_pars} -side left -anchor w pack $itk_component(hull).size.unit -side left -anchor w pack $itk_component(hull).coords.leftm_label -side left -anchor w -padx 5 pack $itk_component(hull).coords.leftm_entry${entry_pars} -side left -anchor w pack $itk_component(hull).coords.rightm_label -side left -anchor w -padx 5 pack $itk_component(hull).coords.rightm_entry${entry_pars} -side left -anchor w pack $itk_component(hull).coords.topm_label -side left -anchor w -padx 5 pack $itk_component(hull).coords.topm_entry${entry_pars} -side left -anchor w pack $itk_component(hull).coords.botm_label -side left -anchor w -padx 5 pack $itk_component(hull).coords.botm_entry${entry_pars} -side left -anchor w pack append $itk_component(hull).ps $itk_component(hull).ps.label {left frame w}\ $itk_component(hull).ps.factor_entry {left frame w} $itk_component(hull).ps.pagev_label\ {left frame w} $itk_component(hull).ps.pagev_entry {left frame w}\ $itk_component(hull).ps.pageh_label {left frame w} $itk_component(hull).ps.pageh_entry\ {left frame w} $itk_component(hull).ps.pr_pagenum {left frame w} pack append $itk_component(hull).colorframe $itk_component(hull).colorframe.label { left\ frame w } $itk_component(hull).colorframe.mono { left frame w }\ $itk_component(hull).colorframe.gray { left frame w }\ $itk_component(hull).colorframe.color { left frame w }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -