Changing the colors of a button
I am trying the following: \button[backgroundcolor=darkgray,framecolor=black,framecorner=round]{Go Back}[PreviousJump] The parameter framecolor works (I tried it with green). Framecorner works also, but backgroundcolor not. How can I change the background and text color of the button? Also would it not be better when clicking on this button, the highlighting also works with rounded corners? -- Cecil Westerhof
Am 05.07.2011 um 14:11 schrieb Cecil Westerhof:
I am trying the following: \button[backgroundcolor=darkgray,framecolor=black,framecorner=round]{Go Back}[PreviousJump]
The parameter framecolor works (I tried it with green). Framecorner works also, but backgroundcolor not. How can I change the background and text color of the button?
...,background=color,backgroundcolor=darkgray,color=<NAME>,... Wolfgang
2011/7/5 Wolfgang Schuster
I am trying the following: \button[backgroundcolor=darkgray,framecolor=black,framecorner=round]{Go Back}[PreviousJump]
The parameter framecolor works (I tried it with green). Framecorner works also, but backgroundcolor not. How can I change the background and text
color of the button?
...,background=color,backgroundcolor=darkgray,color=<NAME>,...
Works. I now have: \button[ background=color, backgroundcolor=darkgray, color=white, framecolor=black, framecorner=round, rulethickness=2pt] {Go Back} [PreviousJump] and this does what I want. One slight problem. The backgroundcolor is a rectangle en goes out of the rounded button. -- Cecil Westerhof
2011/7/5 Wolfgang Schuster
One slight problem. The backgroundcolor is a rectangle en goes out of the rounded button.
Add “backgroundcorner=round”.
Overlooked it. Now added. But did not solve my problem. What I mend is that when I click on the button, the inversion is done for the rectangle. So the button is displayed correctly with rounded corners, but when clicking on the button, the inversion goes out of the button because the complete rectangle is inverted. I would like to have the part outside of the rounded button not inverted. -- Cecil Westerhof
You might set click off: \setupinteraction[click=no] Willi On 5 Jul 2011, at 15:09, Cecil Westerhof wrote:
2011/7/5 Wolfgang Schuster
One slight problem. The backgroundcolor is a rectangle en goes out of the rounded button.
Add “backgroundcorner=round”.
Overlooked it. Now added. But did not solve my problem. What I mend is that when I click on the button, the inversion is done for the rectangle. So the button is displayed correctly with rounded corners, but when clicking on the button, the inversion goes out of the button because the complete rectangle is inverted. I would like to have the part outside of the rounded button not inverted.
-- Cecil Westerhof ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
Am 05.07.2011 um 15:09 schrieb Cecil Westerhof:
2011/7/5 Wolfgang Schuster
One slight problem. The backgroundcolor is a rectangle en goes out of the rounded button.
Add “backgroundcorner=round”.
Overlooked it. Now added. But did not solve my problem. What I mend is that when I click on the button, the inversion is done for the rectangle. So the button is displayed correctly with rounded corners, but when clicking on the button, the inversion goes out of the button because the complete rectangle is inverted. I would like to have the part outside of the rounded button not inverted.
I don’t think this is supported but when you’re not satisfied with the result you can disable the visual effect with \setupinteraction[click=no]. Wolfgang
On 5-7-2011 3:28, Wolfgang Schuster wrote:
Am 05.07.2011 um 15:09 schrieb Cecil Westerhof:
2011/7/5 Wolfgang Schuster
One slight problem. The backgroundcolor is a rectangle en goes out of the rounded button.
Add “backgroundcorner=round”.
Overlooked it. Now added. But did not solve my problem. What I mend is that when I click on the button, the inversion is done for the rectangle. So the button is displayed correctly with rounded corners, but when clicking on the button, the inversion goes out of the button because the complete rectangle is inverted. I would like to have the part outside of the rounded button not inverted.
I don’t think this is supported but when you’re not satisfied with the result you can disable the visual effect with \setupinteraction[click=no].
Wolfgang: (1) uncomment the first \protect \endinput in scrn-fld.mkvi (2) fix the \appendtoks at the end of the file Then this seems to work (converted mkii code but untested): \setupinteraction[state=start] \definepushbutton [reset] \startuniqueMPgraphic{whatever}{color} fill fullcircle xysized (OverlayWidth,OverlayHeight) withcolor \MPvar{color} ; \stopuniqueMPgraphic \definepushsymbol [reset] [n] [\uniqueMPgraphic{whatever}{color=red}] \definepushsymbol [reset] [r] [\uniqueMPgraphic{whatever}{color=green}] \definepushsymbol [reset] [d] [\uniqueMPgraphic{whatever}{color=blue}] \starttext \startTEXpage \pushbutton [reset] [page(2)] \stopTEXpage \startTEXpage \pushbutton [reset] [page(1)] \stopTEXpage \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Tue, Jul 5, 2011 at 2:11 PM, Cecil Westerhof
I am trying the following: \button[backgroundcolor=darkgray,framecolor=black,framecorner=round]{Go Back}[PreviousJump]
The parameter framecolor works (I tried it with green). Framecorner works also, but backgroundcolor not. How can I change the background and text color of the button?
As wolfgang said this works with mkii and mkiv \setupcolors[state=start] \setupinteraction[state=start] \starttext \button[background=color,backgroundcolor=darkgray,framecolor=black,framecorner=round]{Go Back}[PreviousJump] \stoptext Search for \setupinteraction for the color of the link
Also would it not be better when clicking on this button, the highlighting also works with rounded corners? with mkiv it is --- but not the background.
-- luigi
2011/7/5 luigi scarso
Search for \setupinteraction for the color of the link
I know I want a lot ;-} but would it be possible to have another color for the highlighting as 'normal' links? At the moment 'normal' links are blue and I do not mind that in the buttons they are blue also, but when in the future this changes, it would be nice to know how to change it. -- Cecil Westerhof
Am 05.07.2011 um 15:23 schrieb Cecil Westerhof:
2011/7/5 luigi scarso
Search for \setupinteraction for the color of the link I know I want a lot ;-} but would it be possible to have another color for the highlighting as 'normal' links?
\setupinteraction [color=..., constrastcolor=...] Wolfgang
Probably you will have to group the buttons in order to be able to use \setupinteraction[color=yourcolor] You could think about using setups: \startsetups XX \bgroup \setupinteraction[color=yourcolor] \button ... \egroup \stopsetups I used this recently. Okay I used a layer for the buttons, so it is convenient to use setups to organize things. In my case I placed the buttons in the footer area so I could use the \setupfootertexts[background=TheLayer] and the buttons placed with \setlayerframed.... I hope this might help Willi On 5 Jul 2011, at 15:23, Cecil Westerhof wrote:
2011/7/5 luigi scarso
Search for \setupinteraction for the color of the link I know I want a lot ;-} but would it be possible to have another color for the highlighting as 'normal' links? At the moment 'normal' links are blue and I do not mind that in the buttons they are blue also, but when in the future this changes, it would be nice to know how to change it.
-- Cecil Westerhof ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
participants (5)
-
Cecil Westerhof
-
Hans Hagen
-
luigi scarso
-
Willi Egger
-
Wolfgang Schuster