1 # This script is free software; you can redistribute it and/or modify
2 # it under the terms of the GNU General Public License as published by
3 # the Free Software Foundation; either version 2 of the License, or
4 # (at your option) any later version.
6 # This program is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 # GNU General Public License for more details.
11 # You should have received a copy of the GNU General Public License
12 # along with this program; if not, write to the Free Software
13 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 #-----------------------------------------------------------------------------
17 # Copyright 2000, Olivier Chapuis
18 #-----------------------------------------------------------------------------
21 WindowTitle {FVWM Themes: Component Properties}
23 Font -adobe-helvetica-bold-r-*-*-12-*
28 # --------------------------------------- Arguments
31 Set $arg = (GetScriptArgument $i)
35 If $arg == {--session} Then
36 Set $Session = (GetScriptArgument $j)
37 If $arg == {--viewer-colorset} Then
38 Set $ViewerColorset = (GetScriptArgument $j)
39 If $arg == {--text-colorset} Then
40 Set $TextColorset = (GetScriptArgument $j)
41 If $arg == {--icon-colorset} Then
42 Set $IconColorset = (GetScriptArgument $j)
43 If $arg == {--com-pid} Then
44 Set $pid = (GetScriptArgument $j)
45 If $arg == {--component} Then
46 Set $MainComponent = (GetScriptArgument $j)
47 If $arg == {--theme} Then
48 Set $MainTheme = (GetScriptArgument $j)
49 If $arg == {--lang} Then
50 Set $Lang = (GetScriptArgument $j)
51 If $arg == {--id} Then
52 Set $ID = (GetScriptArgument $j)
54 Set $arg = (GetScriptArgument $i)
57 If $TextColorset <> {} Then
59 ChangeColorset 5 $TextColorset
64 # ------------------------------- Internationalization.
67 Set $cmd = {echo "$LANG" | cut -c1-2}
68 Set $Lang = (GetOutput $cmd 1 -1)
75 Set $cmd = {fvwm-themes-script --get-msg FvwmScript-ComponentProperties --lang }$Lang
76 Set $MSG = (GetOutput $cmd 1 -1)
79 While $notdone == 1 Do
81 Set $index = (Add $index 1)
82 Set $id = (StrCopy $MSG $index (Add $index 11))
83 Set $index = (Add $index 12)
84 Set $tmp = (StrCopy $MSG $index (Add $index 3))
85 Set $index = (Add $index 4)
86 Set $pos = (Add $index $tmp)
87 Set $msg = (StrCopy $MSG $index $pos)
88 Set $index = (Add $index $tmp)
89 #Do {Echo id:}$id{:msg:}$msg{:}
98 If $id == {SendModif } Then
100 If $id == {Set } Then
102 If $id == {SetQuit } Then
104 If $id == {Quit } Then
106 If $id == {for } Then
108 If $id == {ChangeFont } Then
109 Set $ChangeFont = $msg
110 If $id == {SelFont } Then
112 If $id == {ShadeFont } Then
113 Set $ShadeFont = $msg
114 If $id == {FixedFont } Then
115 Set $FixedFont = $msg
118 If $ChangeFont == 1 Then
120 ChangeFont 1 $SelFont
121 ChangeFont 2 $SelFont
122 ChangeFont 3 $SelFont
123 ChangeFont 5 $FixedFont
124 ChangeFont 6 $SelFont
125 ChangeFont 97 $SelFont
126 ChangeFont 98 $SelFont
127 ChangeFont 99 $SelFont
130 # ------------------------------------- com and init
131 Set $ComName = {config-}$pid
132 # Get all the options and the first list
133 Set $cmd = {options }$MainComponent{ }$MainTheme{ 0|}
134 Set $MSG = (SendMsgAndGet $ComName $cmd 1)
135 Set $NbrOfOptions= (Parse $MSG 1)
136 Set $Type = (Parse $MSG 2)
137 Set $tmp = $Type{ }$l_for{ }$MainComponent{@}$MainTheme
139 Set $Options = (Parse $MSG 3)
140 Set $CurrentVariants = (Parse $MSG 4)
141 ChangeTitle 5 $CurrentVariants
143 If $NbrOfOptions == 1 Then
146 ChangeTitle 2 $Options
151 ChangeTitle 3 $Options
154 # Get the "current" options List
155 Set $CurrentOptionsIndex = 1
158 # the selected option
161 Set $SendUpdateMsg = 0
164 Set $myPid = (GetPid)
165 Set $cmd = {add-to-pid-list }$ID{ }$myPid{|}
166 Set $dummy = (SendMsgAndGet $ComName $cmd 0)
169 # ---------------------------------------------------------------------------
173 # ---------------------------------------------------------------------------
177 Flags NoReliefString NoFocus
189 # message from FvwmScript-ThemesCenter
192 Set $str = (LastString)
193 If $str == {exit} Then
197 If $str == {update} Then
208 Set $cmd = {options-variants }$MainComponent{ }$MainTheme{ }$CurrentOptionsIndex{|}
213 Set $tmp = (SendMsgAndGet $ComName $cmd 1)
214 Set $count = (Add $count 1)
221 Set $CurrentVariants = $tmp
222 ChangeTitle 5 $CurrentVariants
228 If $SendUpdateMsg == 1 Then
230 Set $SendUpdateMsg = 0
231 Set $str = $ID{update}
232 Do {SendToModule FvwmScript-ThemesCenter SendString 1 1 }$str
234 If $SendUpdateQuit == 1 Then
236 Set $SendUpdateQuit = 0
237 Set $str = $ID{updatequit}
238 Do {SendToModule FvwmScript-ThemesCenter SendString 1 1 }$str
239 Set $cmd = {remove-to-pid-list }$ID{ }$myPid{|}
240 Set $dummy = (SendMsgAndGet $ComName $cmd 0)
243 If $SendQuit == 1 Then
247 Do {SendToModule FvwmScript-ThemesCenter SendString 1 1 }$str
248 Set $cmd = {remove-to-pid-list }$ID{ }$myPid{|}
249 Set $dummy = (SendMsgAndGet $ComName $cmd 0)
258 Flags NoReliefString NoFocus
281 Set $value = (GetValue 3)
282 If $value <> $CurrentOptionsIndex Then
284 Set $CurrentOptionsIndex = $value
299 Font -*-fixed-medium-r-semicondensed-*-13-*
311 Flags NoReliefString NoFocus
334 Set $OptionIndex = (GetValue 5)
335 If $OptionIndex <> 0 Then
337 Set $cmd = {set-options }$MainComponent{ }$MainTheme{ }$CurrentOptionsIndex{ }$OptionIndex{|}
338 Set $dummy = (SendMsgAndGet $ComName $cmd 1)
341 Set $SendUpdateMsg = 1
359 Set $OptionIndex = (GetValue 5)
360 If $OptionIndex <> 0 Then
362 Set $cmd = {set-options }$MainComponent{ }$MainTheme{ }$CurrentOptionsIndex{ }$OptionIndex{|}
363 Set $dummy = (SendMsgAndGet $ComName $cmd 1)
365 Set $SendUpdateQuit = 1