Hello forum. |
What about removing the setForegroundColor and setBackgroundColor properties entirely and set the colour scheme as you want it in the WidgetPolicy for your entire application?
Michael
On 24 January 2011 01:41, Gruenewald, Tom <[hidden email]> wrote:
_______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Hello Michael.
What about removing the setForegroundColor and setBackgroundColor properties entirely and set the colour scheme as you want it in the WidgetPolicy for your entire application? Michael On 24 January 2011 01:41, Gruenewald, Tom <[hidden email]> wrote: Hello forum. The selection color settings in our application are a mess. My task is to unify the color settings for all windows (#windowSpec) in our system. So e.g. the LookPreferences of any InputFieldSpec #(#{UI.InputFieldSpec} *** #colors: #(#{UI.LookPreferences} #setForegroundColor: *** #setBackgroundColor: *** #setSelectionForegroundColor: *** #setSelectionBackgroundColor: *** ) *** ) has to be changed to the following specification. #(#{UI.InputFieldSpec} *** #colors: #(#{UI.LookPreferences} #setForegroundColor: #(#{Graphics.OMColorValue} #inputFieldText ) #setBackgroundColor: #(#{Graphics.OMColorValue} #inputField ) #setSelectionForegroundColor: #(#{Graphics.OMColorValue} #inputFieldSelectText ) #setSelectionBackgroundColor: #(#{Graphics.OMColorValue} #inputFieldSelect ) ) *** ) Of course this task should be done automatically. I was not able to get the rewrite tool working, because of the literal hash symbols. Are there other tools existing for this kind of task? Other suggestions? Thank you for your answers. Best regards, Tom Grünewald ________ Carl Zeiss Industrielle Messtechnik GmbH Softwareentwicklung/Software Development T o m G r ü n e w a l d 73446 Oberkochen, Germany tel: +49.7364.20-8541 fax: +49.7364.20-4800 email: [hidden email] http://www.zeiss.de/imt Carl Zeiss Industrielle Messtechnik GmbH Carl–Zeiss–Straße 22, 73447 Oberkochen Aufsichtsratsvorsitzender: Dr. Hermann Gerlinger Geschäftsführer: Dr. Rainer Ohnheiser, Felix Hoben, Axel Jaeger Sitz der Gesellschaft: 73446 Oberkochen, Deutschland Handelsregister: Amtsgericht Ulm, HRB 501561 USt–IdNr.: DE 811 515 346 ---------------------------------------- This message is intended for a particular addressee only and may contain business or company secrets. If you have received this email in error, please contact the sender and delete the message immediately. Any use of this email, including saving, publishing, copying, replication or forwarding of the message or the contents is not permitted.
---------------------------------------- This message is intended for a particular addressee only and may contain business or company secrets. If you have received this email in error, please contact the sender and delete the message immediately. Any use of this email, including saving, publishing, copying, replication or forwarding of the message or the contents is not permitted. _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc pic30721.gif (1K) Download Attachment |
In reply to this post by Gruenewald, Tom
The specs are just arrays, so just send the windowSpec method to get the array, iterate through it to find a #colors: element (recursing into Arrays), and replace the next element with an Array containing the desired look preferences. Then compile the new Array into a method: UISpecification store: myNewArray toClass: myClass class methodName: #windowSpec HTH, Steve From: [hidden email] [mailto:[hidden email]] On Behalf Of Gruenewald, Tom Hello forum. _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
brute-force-code, which needs some custom finetuning: - modify additional colors (here, only foregroundcolor is tweaked) - limit modifications to application specific packages (don't modify VW Tools ) ---- | mc specEnum changed | specEnum := FilteredSpecEnumerator new. specEnum block: [: each | | lookPreferences | ( each class = InputFieldSpec and: [( lookPreferences := each colors ) notNil ]) ifTrue: [ lookPreferences foregroundColor notNil ifTrue: [ lookPreferences setForegroundColor: #( #{Graphics.OMColorValue} #inputFieldText ). changed := true ] ]. true ]. mc := MethodCollector new. ( mc select: ( mc referencesTo: #InputFieldSpec )) do: [: methodDef | methodDef method ifNotNil: [: method | | specArray spec methodClass | method resourceType = #canvas ifTrue: [ changed := false. methodClass := methodDef implementingClass. specArray := methodClass soleInstance perform: methodDef selector. spec := specArray decodeAsLiteralArray. specEnum doSpec: spec. changed ifTrue: [ " avoid store confirmation dialogs " Policies packagePolicy forcePackage: methodDef package while: [ UISpecification store: spec toClass: methodClass methodName: methodDef selector ] ] ] ] ]. From: [hidden email] [mailto:[hidden email]] On Behalf Of Gruenewald, Tom Hello forum. _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Dear Mr. Kleinsorgen.
brute-force-code, which needs some custom finetuning: - modify additional colors (here, only foregroundcolor is tweaked) - limit modifications to application specific packages (don't modify VW Tools ) ---- | mc specEnum changed | specEnum := FilteredSpecEnumerator new. specEnum block: [: each | | lookPreferences | ( each class = InputFieldSpec and: [( lookPreferences := each colors ) notNil ]) ifTrue: [ lookPreferences foregroundColor notNil ifTrue: [ lookPreferences setForegroundColor: #( #{Graphics.OMColorValue} #inputFieldText ). changed := true ] ]. true ]. mc := MethodCollector new. ( mc select: ( mc referencesTo: #InputFieldSpec )) do: [: methodDef | methodDef method ifNotNil: [: method | | specArray spec methodClass | method resourceType = #canvas ifTrue: [ changed := false. methodClass := methodDef implementingClass. specArray := methodClass soleInstance perform: methodDef selector. spec := specArray decodeAsLiteralArray. specEnum doSpec: spec. changed ifTrue: [ " avoid store confirmation dialogs " Policies packagePolicy forcePackage: methodDef package while: [ UISpecification store: spec toClass: methodClass methodName: methodDef selector ] ] ] ] ]. From: [hidden email] [[hidden email]] On Behalf Of Gruenewald, Tom Sent: 24. tammikuuta 2011 11:42 To: VWNC List Subject: [vwnc] How can I change selection foreground and background color (LookPreferences) systemwide? Hello forum.
pic32621.gif (1K) Download Attachment |
Free forum by Nabble | Edit this page |