ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Changing the colors of a button
@ 2011-07-05 12:11 Cecil Westerhof
  2011-07-05 12:17 ` Wolfgang Schuster
  2011-07-05 12:21 ` luigi scarso
  0 siblings, 2 replies; 13+ messages in thread
From: Cecil Westerhof @ 2011-07-05 12:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 419 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 462 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Changing the colors of a button
  2011-07-05 12:11 Changing the colors of a button Cecil Westerhof
@ 2011-07-05 12:17 ` Wolfgang Schuster
  2011-07-05 12:47   ` Cecil Westerhof
  2011-07-05 12:21 ` luigi scarso
  1 sibling, 1 reply; 13+ messages in thread
From: Wolfgang Schuster @ 2011-07-05 12:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Changing the colors of a button
  2011-07-05 12:11 Changing the colors of a button Cecil Westerhof
  2011-07-05 12:17 ` Wolfgang Schuster
@ 2011-07-05 12:21 ` luigi scarso
  2011-07-05 13:23   ` Cecil Westerhof
  1 sibling, 1 reply; 13+ messages in thread
From: luigi scarso @ 2011-07-05 12:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, Jul 5, 2011 at 2:11 PM, Cecil Westerhof <cldwesterhof@gmail.com> wrote:
> 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
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Changing the colors of a button
  2011-07-05 12:17 ` Wolfgang Schuster
@ 2011-07-05 12:47   ` Cecil Westerhof
  2011-07-05 12:57     ` Wolfgang Schuster
  0 siblings, 1 reply; 13+ messages in thread
From: Cecil Westerhof @ 2011-07-05 12:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 783 bytes --]

2011/7/5 Wolfgang Schuster <schuster.wolfgang@googlemail.com>

> > 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

[-- Attachment #1.2: Type: text/html, Size: 1137 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Changing the colors of a button
  2011-07-05 12:47   ` Cecil Westerhof
@ 2011-07-05 12:57     ` Wolfgang Schuster
  2011-07-05 13:09       ` Cecil Westerhof
  0 siblings, 1 reply; 13+ messages in thread
From: Wolfgang Schuster @ 2011-07-05 12:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 05.07.2011 um 14:47 schrieb Cecil Westerhof:

> One slight problem. The backgroundcolor is a rectangle en goes out of the rounded button.

Add “backgroundcorner=round”.

Wolfgang

___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Changing the colors of a button
  2011-07-05 12:57     ` Wolfgang Schuster
@ 2011-07-05 13:09       ` Cecil Westerhof
  2011-07-05 13:26         ` Willi Egger
  2011-07-05 13:28         ` Wolfgang Schuster
  0 siblings, 2 replies; 13+ messages in thread
From: Cecil Westerhof @ 2011-07-05 13:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 626 bytes --]

2011/7/5 Wolfgang Schuster <schuster.wolfgang@googlemail.com>

> > 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

[-- Attachment #1.2: Type: text/html, Size: 902 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Changing the colors of a button
  2011-07-05 12:21 ` luigi scarso
@ 2011-07-05 13:23   ` Cecil Westerhof
  2011-07-05 13:29     ` Wolfgang Schuster
  2011-07-05 13:32     ` Willi Egger
  0 siblings, 2 replies; 13+ messages in thread
From: Cecil Westerhof @ 2011-07-05 13:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 417 bytes --]

2011/7/5 luigi scarso <luigi.scarso@gmail.com>

> 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

[-- Attachment #1.2: Type: text/html, Size: 701 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Changing the colors of a button
  2011-07-05 13:09       ` Cecil Westerhof
@ 2011-07-05 13:26         ` Willi Egger
  2011-07-05 13:30           ` Cecil Westerhof
  2011-07-05 13:28         ` Wolfgang Schuster
  1 sibling, 1 reply; 13+ messages in thread
From: Willi Egger @ 2011-07-05 13:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

You might set click off: \setupinteraction[click=no]

Willi
On 5 Jul 2011, at 15:09, Cecil Westerhof wrote:

> 2011/7/5 Wolfgang Schuster <schuster.wolfgang@googlemail.com>
> > 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
> ___________________________________________________________________________________

___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Changing the colors of a button
  2011-07-05 13:09       ` Cecil Westerhof
  2011-07-05 13:26         ` Willi Egger
@ 2011-07-05 13:28         ` Wolfgang Schuster
  2011-07-05 20:33           ` Hans Hagen
  1 sibling, 1 reply; 13+ messages in thread
From: Wolfgang Schuster @ 2011-07-05 13:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 812 bytes --]


Am 05.07.2011 um 15:09 schrieb Cecil Westerhof:

> 2011/7/5 Wolfgang Schuster <schuster.wolfgang@googlemail.com>
> > 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


[-- Attachment #1.2: Type: text/html, Size: 1516 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Changing the colors of a button
  2011-07-05 13:23   ` Cecil Westerhof
@ 2011-07-05 13:29     ` Wolfgang Schuster
  2011-07-05 13:32     ` Willi Egger
  1 sibling, 0 replies; 13+ messages in thread
From: Wolfgang Schuster @ 2011-07-05 13:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 355 bytes --]


Am 05.07.2011 um 15:23 schrieb Cecil Westerhof:

> 2011/7/5 luigi scarso <luigi.scarso@gmail.com>
> 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



[-- Attachment #1.2: Type: text/html, Size: 900 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Changing the colors of a button
  2011-07-05 13:26         ` Willi Egger
@ 2011-07-05 13:30           ` Cecil Westerhof
  0 siblings, 0 replies; 13+ messages in thread
From: Cecil Westerhof @ 2011-07-05 13:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 201 bytes --]

2011/7/5 Willi Egger <w.egger@boede.nl>

> You might set click off: \setupinteraction[click=no]
>

But then I would loose the visual feed back. I have to decide what I find
worse.

-- 
Cecil Westerhof

[-- Attachment #1.2: Type: text/html, Size: 456 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Changing the colors of a button
  2011-07-05 13:23   ` Cecil Westerhof
  2011-07-05 13:29     ` Wolfgang Schuster
@ 2011-07-05 13:32     ` Willi Egger
  1 sibling, 0 replies; 13+ messages in thread
From: Willi Egger @ 2011-07-05 13:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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 <luigi.scarso@gmail.com>
> 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
> ___________________________________________________________________________________

___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Changing the colors of a button
  2011-07-05 13:28         ` Wolfgang Schuster
@ 2011-07-05 20:33           ` Hans Hagen
  0 siblings, 0 replies; 13+ messages in thread
From: Hans Hagen @ 2011-07-05 20:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 5-7-2011 3:28, Wolfgang Schuster wrote:
>
> Am 05.07.2011 um 15:09 schrieb Cecil Westerhof:
>
>> 2011/7/5 Wolfgang Schuster<schuster.wolfgang@googlemail.com>
>>> 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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-07-05 20:33 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-05 12:11 Changing the colors of a button Cecil Westerhof
2011-07-05 12:17 ` Wolfgang Schuster
2011-07-05 12:47   ` Cecil Westerhof
2011-07-05 12:57     ` Wolfgang Schuster
2011-07-05 13:09       ` Cecil Westerhof
2011-07-05 13:26         ` Willi Egger
2011-07-05 13:30           ` Cecil Westerhof
2011-07-05 13:28         ` Wolfgang Schuster
2011-07-05 20:33           ` Hans Hagen
2011-07-05 12:21 ` luigi scarso
2011-07-05 13:23   ` Cecil Westerhof
2011-07-05 13:29     ` Wolfgang Schuster
2011-07-05 13:32     ` Willi Egger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).