### Copyright (C) 1995, 1996, 1997 Jeppe Buk (buk@imada.ou.dk) ### This program 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 of the License, or ### (at your option) any later version. ### ### This program 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 this program; if not, write to the Free Software ### Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ### ### Mon Feb 23 1998 Japanized by Mashio Motoyama ### proc decorations {} { # 装飾 Desc "装飾オプションを設定します" ShortDesc "装飾" Header h -text "装飾" -frame:relief flat \ -help "このページではウインドウの装飾を設定します。" Line l Entry decorName -text "装飾名:" \ -help "装飾の名前を入力します。これは\"ウインドウのスタイル\"ページで使われます。" Label index -text "Desc:" -label:relief groove -packLabel:ipadx 5 ###################################################################### # Decoration type # Line typeL Menu decorType -text "装飾の種類:" \ -entries { "タイトル" "境界線" "ボタン" "ハイライトカラー" }\ -help "定義する装飾の種類を選択します。" Command hiFore \ -text "テキスト" \ -default [list "#FFFFFF" 0] \ -setvalue { \ $widget configure -bg [lindex $hiFore 0] -text " "} \ -invoke {ColorWidget $colorList [lindex $hiFore 0] \ [lindex $hiFore 1]} \ -disable {$widget configure -relief flat } \ -enable {$widget configure -relief raised } \ -packFrame:expand no Command hiBack \ -text "背景" \ -default [list "#000000" 0] \ -setvalue { \ $widget configure -bg [lindex $hiBack 0] -text " "} \ -invoke {ColorWidget $colorList [lindex $hiBack 0] \ [lindex $hiBack 1]} \ -disable {$widget configure -relief flat } \ -enable {$widget configure -relief raised } \ -packFrame:expand no Frame decorTypeFrame -entries { decorType hiFore hiBack } Menu buttonNo -text "装飾するボタン:" \ -entries { All Left Right 1 2 3 4 5 6 7 8 9 0 } \ -help "装飾するボタンを選択します。'All' は全てのボタンで 'Left'" \ "は左、'Right' は右です。番号はボタンの番号になります。" Menu state -text "装飾する状況:" \ -entryhelp { All "全てのウインドウの全ての状況で装飾する" ActiveUp "アクティブな触れられていないウインドウを装飾する。境界線の場合にはアクティブな境界線のみになります。" ActiveDown "アクティブなプレスされていないウインドウを装飾する。境界線の場合にはアクティブな境界線のみになります。" Inactive "アクティブでないウインドウを装飾する" } Frame decorTypeF -orient top \ -entries { typeL decorTypeFrame buttonNo state } # ###################################################################### ###################################################################### # Styles # Line stylesL Header stylesH -text Styles: -frame:relief flat ###################################################################### # Solid color CheckBox solidColorB -text "ソリッドカラーを設定" \ -help "ソリッドカラーを指定する場合に選択します。" Command solidColor \ -default [list "#000000" 0] \ -setvalue { \ $widget configure -bg [lindex $solidColor 0] -text " "} \ -invoke {ColorWidget $colorList [lindex $solidColor 0] \ [lindex $solidColor 1]} \ -disable {$widget configure -relief flat } \ -enable {$widget configure -relief raised } \ -packFrame:expand no Frame solidColorF -entries { solidColorB solidColor } # ###################################################################### ###################################################################### # Window font CheckBox windowFontB\ -text "ウインドウのタイトルフォント" \ -help "この装飾で使うフォントを指定する場合に選択します。" Command windowFontAscii \ -default "a14" \ -setvalue {buttonSetText $widget Ascii $windowFontAscii ascii} \ -invoke {FontWidget $windowFontAscii 0 ascii} \ -disable {$widget configure -text "Not set"} \ -enable {buttonSetText $widget Ascii $windowFontAscii ascii} Command windowFontKanji \ -default "k14" \ -setvalue {buttonSetText $widget 漢字 $windowFontKanji kanji} \ -invoke {FontWidget $windowFontKanji 0 kanji} \ -disable {$widget configure -text "未設定"} \ -enable {buttonSetText $widget 漢字 $windowFontKanji kanji} Command windowFontKana \ -default "r14" \ -setvalue {buttonSetText $widget "1Byte Kana" $windowFontKana kana} \ -invoke {FontWidget $windowFontKana 0 kana}\ -disable {$widget configure -text "Not set"}\ -enable {buttonSetText $widget "1Byte Kana" $windowFontKana kana} Frame windowFontF\ -entries { windowFontB windowFontAscii windowFontKanji windowFontKana } # ###################################################################### ###################################################################### # Title justification / Height CheckBox titleJustB -text "タイトルの属性" \ -help "タイトルの属性を指定したい場合に選択します。" Radio titleJust -entryhelp { "左詰め" "タイトルは左詰めで表示されます。" "中央" "タイトルは中央に表示されます。" "右詰め" "タイトルは右詰めで表示されます。" } Int titleHeight -text "高さ" -help "タイトルバーの高さをピクセル単位で指定できます。フォントを指定するとそれに合わせて値がセットされるため、フォントの設定を済ませたあとに行って下さい。" Frame titleJustF -entries { titleJustB titleJust titleHeight } # ###################################################################### ###################################################################### # Vector (button) # CheckBox vectorB -text "ベクターボタンを設定" \ -help "ベクターボタンを指定したい場合にチェックします。" Header coordH -text "ボタンの装飾座標を入力して下さい" \ -frame:relief flat Line coordL Int coordX -text "X 座標" Int coordY -text "Y 座標" Radio shade -entries { shadow highlight } ExtEntry coord -entries { coordX coordY shade } Window butW -text "座標" -entries { coordH coordL coord } Frame vectorF -entries { vectorB butW } # ###################################################################### ###################################################################### # Gradient H/V # CheckBox gradientB -text "線の勾配" \ -help "勾配を指定したい場合に選択します。" Menu gradientHV -entries {Horizontal Vertical} \ -help "'Horizontal' は水平勾配、'Vertical' は垂直勾配です。" Command gradientC1 \ -text "開始色" \ -default [list "#FFFFFF" 0] \ -setvalue { \ $widget configure -bg [lindex $gradientC1 0] -text " "} \ -invoke {ColorWidget $colorList [lindex $gradientC1 0] \ [lindex $gradientC1 1]} \ -disable {$widget configure -relief flat } \ -enable {$widget configure -relief raised } \ -packFrame:expand no Command gradientC2 \ -text "終了色" \ -default [list "#000000" 0] \ -setvalue { \ $widget configure -bg [lindex $gradientC2 0] -text " "} \ -invoke {ColorWidget $colorList [lindex $gradientC2 0] \ [lindex $gradientC2 1]} \ -disable {$widget configure -relief flat } \ -enable {$widget configure -relief raised } \ -packFrame:expand no Frame gradientF -entries { gradientB gradientHV gradientC1 gradientC2 } # ###################################################################### ###################################################################### # Pixmap # CheckBox pixmapB -text "ピックスマップを設定" \ -help "あるピックスマップを指定したい場合に選択します。" Label tiledLbef -text "( タイル" CheckBox tiledPixmap -help "境界のあるピックスマップにするかタイルにするか指定します。" Label tiledLaf -text ")" Entry pixmap -help "ピックスマップのファイル名を入力します。" Frame pixmapF -entries { pixmapB tiledLbef tiledPixmap tiledLaf pixmap } # ###################################################################### ###################################################################### # Flags # Line flagsL Header flagsH -text Flags: -frame:relief flat Radio flagRFS -text "レリーフ:" -packLabel:side left \ -help "ボタンとタイトルはレリーフ指定を得る事ができます。'Sunk'"\ "は窪んだ形になり、'Raised' は浮き上がり、'Flat' は平になります。"\ -entryhelp { "標準" "レリーフを指定しない場合い選択します。" "Raised" "浮き上がった表示になります。" "Flat" "平に表示されます。" "Sunk" "窪んだ形で表示されます。" } Radio flagUS -text "装飾の受け継ぎ:" -packLabel:side left \ -help "ボタンはタイトルや境界線の装飾を受け継ぐことができます。" \ -entryhelp { "No" "受け継がない" "タイトルから受け継ぐ" "タイトルの装飾を受け継ぎます" "境界線から受け継ぐ" "境界線の装飾を受け継ぎます" } Radio flagBorder -text "境界のフラグ:" -packLabel:side left \ -help "境界線の描画方法を指定できます。" \ -entryhelp { "標準" "標準の概観にする場合に選択します。" "ハンドルを隠す" "描画前にハンドルを隠す場合に選択します。" "挿入しない" "Windows95 の様な表現方法です。" } # ###################################################################### ###################################################################### # ExtEntries # ExtEntry decorEntry -orient top -count 1 -index index \ -packFrame:expand yes -packFrame:fill x \ -entries { index decorTypeF stylesL stylesH solidColorF windowFontF titleJustF vectorF gradientF pixmapF flagsL flagsH flagRFS flagUS flagBorder } ExtEntry decor -orient top -count 1 -index decorName \ -entries { decorName decorEntry } # ###################################################################### ###################################################################### # Change # Change { # Decor type if {$changeElm == "decorType"} { switch $decorType(name) { "タイトル" { Disable hiFore hiBack buttonNo vectorF Disable flagUS flagBorder set vectorB 0 set flagUS(name) "No" set flagBorder(name) "標準" Enable state solidColorF windowFontF titleJustF gradientF pixmapF if {$windowFontB == 1 || $titleJustB == 1} { Disable flagRFS set flagRFS(name) "標準" } else { Enable flagRFS } } "境界線" { Disable hiFore hiBack buttonNo solidColorF windowFontF titleJustF \ vectorF gradientF Disable flagRFS flagUS set solidColorB 0 set windowFontB 0 set titleJustB 0 set vectorB 0 set gragientB 0 set flagRFS(name) "標準" set flagUS(name) "No" Enable state pixmapF Enable flagBorder } "ボタン" { Disable hiFore hiBack windowFontF titleJustF Disable flagBorder set windowFontB 0 set titleJustB 0 set flagBorder(name) "標準" Enable buttonNo state solidColorF vectorF gradientF pixmapF Enable flagRFS flagUS } "ハイライトカラー" { Disable buttonNo state solidColorF windowFontF titleJustF \ vectorF gradientF pixmapF Disable flagRFS flagUS flagBorder set solidColorB 0 set windowFontB 0 set titleJustB 0 set vectorB 0 set gradientB 0 set pixmapB 0 set flagRFS(name) "標準" set flagUS(name) "No" set flagBorder(name) "標準" Enable hiFore hiBack } } } # Checkboxes if {$changeElm == "solidColorB" && $solidColorB == 1} { set windowFontB 0 set titleJustB 0 set vectorB 0 set gradientB 0 set pixmapB 0 } elseif {$changeElm == "windowFontB" && $windowFontB == 1} { set state(name) "All" set solidColorB 0 set titleJustB 0 set vectorB 0 set gradientB 0 set pixmapB 0 } elseif {$changeElm == "titleJustB" && $titleJustB == 1} { set state(name) "All" set solidColorB 0 set windowFontB 0 set vectorB 0 set gradientB 0 set pixmapB 0 } elseif {$changeElm == "vectorB" && $vectorB == 1} { set solidColorB 0 set windowFontB 0 set titleJustB 0 set gradientB 0 set pixmapB 0 } elseif {$changeElm == "gradientB" && $gradientB == 1} { set solidColorB 0 set windowFontB 0 set titleJustB 0 set vectorB 0 set pixmapB 0 } elseif {$changeElm == "pixmapB" && $pixmapB == 1} { set solidColorB 0 set windowFontB 0 set titleJustB 0 set vectorB 0 set gradientB 0 } if {$changeElm != "decorType" && ($changeElm == "solidColorB" || $changeElm == "windowFontB" || $changeElm == "titleJustB" || $changeElm == "vectorB" || $changeElm == "gradientB" || $changeElm == "pixmapB")} { # Check flagRFS if {$decorType(name) == "タイトル"} { if {$windowFontB == 1 || $titleJustB == 1} { Disable flagRFS set flagRFS(name) "標準" } else { Enable flagRFS } } } # Index if {$changeElm == "decorType" || $changeElm == "solidColorB" || $changeElm == "windowFontB" || $changeElm == "titleJustB" || $changeElm == "vectorB" || $changeElm == "gradientB" || $changeElm == "pixmapB"} { set index "$decorType(name)" switch $decorType(name) { "タイトル" {append index ", $state(name)"} "境界線" {append index ", $state(name)"} "ボタン" {append index " ($buttonNo(name)), $state(name)"} "ハイライトカラー" {append index ""} } if {$solidColorB == 1} {append index " - Solid color"} if {$windowFontB == 1} {append index " - Title font"} if {$titleJustB == 1} {append index " - Title attributes"} if {$vectorB == 1} {append index " - Vector"} if {$gradientB == 1} {append index " - Gradient"} if {$pixmapB == 1} {append index " - Pixmap"} } } # ###################################################################### Save { forevery decor { if {$decorName != {}} { print "AddToDecor \"$decorName\"" set startedTypes {} forevery decorEntry { set decorCmd {} if {$decorType(name) == "ハイライトカラー"} { append decorCmd "HilightColor" append decorCmd " [hash2rgb [lindex $hiFore 0]]" append decorCmd " [hash2rgb [lindex $hiBack 0]]" print "+ $decorCmd" continue } switch $decorType(name) { "タイトル" {append decorCmd "AddTitleStyle"} "境界線" {append decorCmd "AddBorderStyle"} "ボタン" {append decorCmd "AddButtonStyle $buttonNo(name)"} } if {$state(name) != "All"} {append decorCmd " $state(name)"} # flag to check if a decor is specified set noDecors 0 if {$solidColorB == 1} { # Solid color append decorCmd " Solid [hash2rgb [lindex $solidColor 0]]" } elseif {$windowFontB == 1} { # Window font - reset decorCmd! set decorCmd "WindowFont $windowFontAscii,$windowFontKanji,$windowFontKana" } elseif {$titleJustB == 1} { # Title attributes - reset decorCmd! set decorCmd "TitleStyle " switch $titleJust(name) { "左詰め" {append decorCmd "LeftJustified"} "中央" {append decorCmd "Centered"} "右詰め" {append decorCmd "RightJustified"} } if {$titleHeight != ""} {append decorCmd " Height $titleHeight"} } elseif {$vectorB == 1} { # Vector buttons set coords 0 set buttonStyle "" forevery coord { if { $coordX != "" && $coordY != "" } { append buttonStyle " ${coordX}x${coordY}@$shade(index)" incr coords } } if { $coords > 0 } { append decorCmd " Vector $coords$buttonStyle" } else { error "No vector coordinates set in decor \"$decorName\"" } } elseif {$gradientB == 1} { append decorCmd " [string index $gradientHV(name) 0]Gradient 16" append decorCmd " [hash2rgb [lindex $gradientC1 0]]" append decorCmd " [hash2rgb [lindex $gradientC2 0]]" } elseif {$pixmapB == 1} { if {$tiledPixmap == 1 || $decorType(name) == "境界線"} { append decorCmd " Tiled" } else { append decorCmd " " } if {$pixmap == ""} { error "No pixmap specified in decor \"$decorName\"" } else { append decorCmd "Pixmap \"$pixmap\"" } } else { set noDecors 1 } # flag to check if a flag is specified :) set noFlags 0 set flags {} if {$flagRFS(name) != "標準" && \ ($decorType(name) == "タイトル" \ || $decorType(name) == "ボタン")} { append flags " $flagRFS(name)" } elseif {$flagUS(name) != "No" && \ $decorType(name) == "ボタン"} { if {$flagUS(name) == "タイトルから受け継ぐ"} { append flags " UseTitleStyle" } else { append flags " UseBorderStyle" } } elseif {$flagBorder(name) != "標準" && \ $decorType(name) == "境界線"} { append flags " HiddenHandles" if {$flagBorder(name) == "挿入しない"} {append flags " NoInset"} } else { set noFlags 1 } if {$noDecors == 1 && $noFlags == 1} { tk_dialog .__decorwarning "Warning" "装飾またはフラグが設定されていません。この装飾は無視されます。" warning 0 OK } else { if {$noFlags == 0} {append decorCmd " --$flags"} print "+ $decorCmd" } } } } } }