Subject: menus rewrite complete

From: Dominik Vogt <[email-masked]>
Date: Fri, 4 Jun 1999 03:39:53 +0200

I'm done with the menu drawing code rewrite now. Initially all
I wanted was to get left and right aligned columns in the
menu items, but in the end it has become a lot more:

New menu style options:

 BorderWidth:

   menu border width (0 - 50)

 Hilight3DThickness:

  like Hilight3D... but takes a number as an argument (0 - 50).

 SubmenusLeft:

  Reverses the whole menu logic from using submenus on the
  right to using submenus on the left. All aspects of menus
  are affected (layout, popup offset, ...), except the position
  hints.

 ItemFormat:

  Takes a printf-like string to format the layout of the menu
  items. Labels, mini icon, submenu triangle, side picture and
  the hilight area can be placed freely.

Furthermore I removed all constant values from the file. Nearly
all of the layout parameters can be configured dynamically or
be changed by a #define now. I tried to duplicate layout exactly
(except a few bugs). If you notice something strange or unusual
with menus, please tell me.

Bye

Dominik ^_^

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

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 5 Jun 1999 00:29:53 +0300 (IDT)

> menu items, but in the end it has become a lot more:

Wow. It's fantastic! Congratulations, Dominik!
I have just played via FvwmTalk with new commands MenuStyle *. Almost full
power to the menu look. And it is extendable. I am very excited.

There are still some small bugs in menus. For example, for large menus
produced by BuildXLockMenu (with More... menu item), when I use "%r%r"
the first column is randomly adjusted (close to the center).

SubmenusLeft option does not do what is stated in a man page - when
ItemFormat is defined, it only places submenus at the left (and I think
this is the only its function, at least, by its name); when ItemFormat is
not defined it also reverts submenu triangle to be in the oposite side,
but does not affects other item elements (the icon, labels, etc.) and
probably must not (even triangle), see my next letter for some suggestions.

Also, once I got a partial item highlighting (top without bottom).

If I understand right, there is a limit to one menu icon, one submenu
triangle, one side picture, three labels and a lot of gaps.
How hard is to change these limits? Not that I want to.

Again, the new additions are very nice!

Regards,
Mikhael.

---

From: Dominik Vogt <[email-masked]>
Date: Sat, 5 Jun 1999 16:51:17 +0200

> the first column is randomly adjusted (close to the center).

Although it looks a bit different for me I can confirm there is a problem.
I'm working on it.

> probably must not (even triangle), see my next letter for some suggestions.

I forgot to state what it does with the item format in the man page.
If you use the default, uses a different string for left/right submenus
(the ones mentioned in the man page). But if you define your own
item format, the string is left untouched, i.e. you have to reverse the
string yourself.

> Also, once I got a partial item highlighting (top without bottom).

Already fixed.

> How hard is to change these limits? Not that I want to.

Trivial for the labels, but every additional label costs 8 bytes per
menu item (assuming pointers use 4 bytes and shorts use 2 bytes). It's
a define already: in menus.c: '#define MAX_ITEM_LABELS 3'.

The other parts are more diffucult because the code isn't prepared
to handle with arrays of these elements.

For the triangles it's fairly easy to change, but not very useful. It
would simply require to handle an array of triangles and to parse
them from the ItemFormat string.

Multiple mini icons are considerably more work since the parsing of the
menu items has to be changed too.

For the side pictures I don't think I will ever write code that allows
to use more than two: one to the left and one to the right.

Bye

Dominik ^_^

---

From: Dominik Vogt <[email-masked]>
Date: Sat, 5 Jun 1999 22:36:38 +0200

> the first column is randomly adjusted (close to the center).

Nope, further analysis shows that this is not a bug. The menu
labels generated by your BuildXLockMenu script contain trailing
spaces. E.g. the first entry I get in the menu is "ant      ",
not "ant" as it should be (strlen("ant      ") is 9). The bug
must be in the perl script.

Bye

Dominik ^_^

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 16 Jun 1999 23:51:20 +0200

> must be in the perl script.

fixed.

Bye

Dominik ^_^