Subject: FVWM: Vector Buttons

From: "Thomas A. Gardiner" <[email-masked]>
Date: Thu, 13 Jan 2000 08:21:30 -0500 (EST)

Hi,

	I've got a few quick questions...

1) Is there a maximum number of allowable points which can be used in a
vector button?  Somewhere between 10 and 20 I get an error saying that it
was a "bad button style".

2) More is not necessarily better!  I wanted to draw a circle, so I wrote
a 5-line c-program to pick points on a circle at regularly spaced angular
increments.  This way I get, 3-> triangle, 4-> diamond or square, ... To
make a circle we want essentially a many sided polygoon.  As the number of
points increases for the same circle radius the button highlighting
becomes distorted.  That is the line becomes distorted.  It stands to
reason that if the input is higher resolution than can be displayed
nothing should happen; it should look just like the lower resolution
counterpart.

Without looking at the code I'd guess that this is caused by the
discretization error of using integers for what should really be a
floating point number (especially since it must be scaled to the titlebar
height).

( I can send examples if desired...)

The nicest circle I can come up with so far is 

#RoundButton: Limits 23-77, radius of 27
########################################
AddButtonStyle 6 \
	vector 9 69x31@0 77x50@0 69x69@0 50x77@0 31x69@0 \
	23x50@1 31x31@1 50x23@1 69x31@1

Pushing this up to a radius of 30 gives rise to funny dots in the
coordinate directions like this one.

#RoundButton: Limits 20-80, radius of 30
########################################
AddButtonStyle 6 \
	vector 9 71x29@0 80x50@0 71x71@0 50x80@0 29x71@0 \
	20x50@1 29x29@1 50x20@1 71x29@1

Manually editing the points to get rid of the points requires changing the
numbers to reflect the first round button like this before the points or
dots go away.

#RoundButton: Limits 20-80, radius of 30 (Manually edited...)
########################################
AddButtonStyle 6 \
	vector 9 71x29@0 77x50@0 71x71@0 50x77@0 29x71@0 \
	23x50@1 29x29@1 50x23@1 71x29@1

Any ideas??? The part which bothers me is that if I change the height of
the titlebar then the button appearance will most likely change so that
buttons which work good for me may not work well for others.

Finally one last question. (Wow, and I thought this was going to be
short...)  Is it possible to set the light and dark colors used for vector
buttons?  If not are they fixed or dependent on the button color.

Thanks,
Tom

_________________________________________________________________________
Thomas Gardiner
[email-masked]

University of Rochester
Department of Physics and Astronomy
P. O. Box 270171
Rochester, NY 14627-0171

(716) 275-9625 Office 2
(716) 275-0537 Office 1
(716) 275-8527 fax
__________________________________________________________________________

The scientist does not study nature because it is useful; he studies it
because he delights in it, and he delights in it because it is beautiful.
If nature were not beautiful, it would not be worth knowing, and if nature
were not worth knowing, life would not be worth living.- Henri Poincare
__________________________________________________________________________

--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dan Espen <[email-masked]>
Date: Thu, 13 Jan 2000 09:16:45 -0500

> was a "bad button style".

The limit is 20 in the 2.2.x series and 32 in the current CVS source.

> floating point number (especially since it must be scaled to the titlebar

How many pixels high are your title bar?

Even though the vector buttons are defined in units of 100, I'm guessing
that the button itself might be 20x20 pixels.

Given that a vector  is not a  pixel, but a instead  a line segment, I
think your going to find  it very difficult  to create a circle.  With
all  the  truncation going   on, even  if  there were  floating  point
calculations involved,  its  going  to be    pretty hard  to   get the
endpoints of the line segments in adjacent pixel locations.

> buttons which work good for me may not work well for others.

I think I agree.

> buttons?  If not are they fixed or dependent on the button color.

I don't think so, at least not in the 2.2.x. series.

Vector buttons are nice, but if you really want total control of the button
appearance, pixmaps are the way to go.  They don't resize, but you can
control every pixel, and use any color.

--
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: "Thomas A. Gardiner" <[email-masked]>
Date: Thu, 13 Jan 2000 10:07:14 -0500 (EST)

>How many pixels high are your title bar?

20

>endpoints of the line segments in adjacent pixel locations.

Actually, the button vector I described as working good for a circle is
not all that bad...  Maybe a little jagged, but I think I can live with
that.

>control every pixel, and use any color.

Yes, I know, it's just the last part which I don't like.  Right now, I
kinda' like the vector buttons because the lines are so simple and the
last setup I had was getting a bit too fancy (I took pixmaps from
Enlightenment's Shiny Metal theme).  Actually, what's so difficult about
resizing?  I wrote a little code to resize pgm's and it was pretty easy.
(certainly easier than the stuff I see in the source code for fvwm2!)  I'm
not familiar with the xpm format; is that the tricky part?

Tom

---

From: Tim Phipps <[email-masked]>
Date: Thu, 13 Jan 2000 15:31:51 +0000

"Thomas A. Gardiner" wrote:

> Actually, what's so difficult about

Probably the hardest part would be to come up with the syntax and
implement the parsing.  Fvwm already has code to resize pixmaps. 
Results vary on what is being resized and the scale. 

Shrinking icons usually gives bad results.  You can try it out easily if
you have some 64x64 or 48x48 icons and used xv to shrink them to 16x16.

Expanding can be OK as long as the scale is small. 16x16 to 20x20 is OK,
some diagonal lines look wobbly, circles look weird.

Cheers,
Tim.