Communitay de Humptay
Lots of jibba jabba

Where is "menu" font style?

rated by 0 users
This post has 6 Replies | 1 Follower

Top 25 Contributor
Posts 4
Duster Posted: Fri, May 16 2008 12:26 PM

Hi, Humpty.

  1. Here http://timothyhumphrey.name/thwc/mainmenu/rltext.aspx in the sample XML you are using tx:font="menu".  I want to make font bigger and bolder, but can't find that "menu" style. Where is it, or how could I use custom font styles?
  2. How could I change borders of each sub-menus? Now(by default?) it is darkgrey and looks like 1px thick. I need to make it thicker or to change the color.
  3. How to change cursor on items with actionURL? I read docs but stil don't get it.


PS: I don't use useEnvironmentUI attribute.

Top 10 Contributor
Posts 592
Humpty replied on Sat, May 17 2008 6:22 PM
  1. The "menu" font is a pre-defined CSS choice for the font attribute. Because it's set on the font attribute it applies settings to most other font choices, e.g. font-size, font-face, etc. You could try and set a style on the menu's tx:style attribute that replicates the font attribute and uses the other attributes you want, but I can't guarantee it'll work. It would look something like this: tx:style="font:menu;font-size:1.2em;font-weight:bold;".
  2. Since you're not using the useEnvironmentUI attribute there are a couple of ways to do what you want. You could use a <menuPropagator> element placed under your top-level <menu> element to set default attributes for all sub-menus. In a similar way you could set a tx:cssClass attribute on the <menuDefaults> element to give each element a CSS class and then use an external stylesheet to control sub-menu appearance. In that stylesheet the selector for sub-menus would look something like this ".submenu .submenu", where submenu is the value of the tx:cssClass attribute.
  3. I'm not sure what you mean by changing the cursor on items with an actionUrl set. If you want to change the cursor on items with a URL you can just use the cursor attribute, e.g. tx:cursor="pointer", on those items. If that didn't answer your question let me know.
Top 25 Contributor
Posts 4
Duster replied on Sun, May 18 2008 5:02 PM
  1. It works fine, only without font:menu (if I use font:menu or tx:font="menu" tx:style simply does not applies).  And tx:style applies for sub-menus only. To change a font-size for top-level-items I have to set it in MainMenu's <div>. Thank you, now it looks good :)
  2. Sorry for my stupidness in previous post, it should sound like "How to set different tx:border properties for top-level-menu and for sub-menus?" I've tryed this:
    1. I've added tx:cssClass=".menustyle" in <menuDefaults>, then I've added .menustyle { border: solid 2px white ; } into my stylesheet. Nothing happend :(
    2. I've added <menuPropagator> right after top-level <menu> and received an error.    My menudata.xml looks like this:

  <menu
        permanent="true"
        tx:showArrows="false"
        tx:showIcons="true"
    tx:orientation="Horizontal"
        tx:style="width:100%;"
        >
      <menuPropagator>
        tx:border="solid 2px white";
      </menuPropagator>

     What am I doing wrong?

3. Thank you, it works. But I thought that there is a special parameter, that sets tx:cursor="pointer" automaticaly for any Items with  a non-empty actionUrl property. Anyway, I've just copy-pasted tx:cursor="pointer" 15 times :)

Top 10 Contributor
Posts 592
Humpty replied on Mon, May 19 2008 7:49 AM
  1. Glad it works. I'm not surprised it didn't work with font:menu since that is a pre-defined CSS font and it usually overrides other font settings; nothing to do with the MainMenu control.
  2. Your tx:cssClass attribute doesn't need the period before the value. Try tx:cssClass="menustyle". BTW, the error with the XML you posted is that the tx:border text you have should actually be an attribute; the <menuPropagator> element doesn't support any content. Try this instead, <menuPropagator tx:border="solid 2px white" />.
  3. That might be a good option to have actually. :)

    Most menus don't change the cursor when over different items though so I never thought to include that. As a workaround in your case you could set the cursor to a pointer on the <itemDefaults> element and for those items you want to have the "default" cursor set those individually on <item> elements. The pointer in that case would actually be default, e.g. tx:cursor="default".
Top 25 Contributor
Posts 4
Duster replied on Tue, May 20 2008 7:16 AM

Thank you very much! You've helped me a lot! menuPropagator works.

I think I have the last question :)

I have an item with severeal <menu> inside. In Opera browser I can open only the first <menu>. If I move cursor on the next <menu>, it doesn't open.

In IE and FF there is no bug. What am I doing wrong?

 

Top 10 Contributor
Posts 592
Humpty replied on Wed, May 21 2008 8:45 PM

Opera is a tougher browser to develop Javascript for. The MainMenu actually works correctly in the latest beta version of Opera, version 9.5 beta 2. I tried version 9.27 and some submenus opened in the wrong location, in version 8.54 all submenus opened in the wrong location. So I guess my answer is to ensure you and your users are using the very latest version of Opera.

Top 25 Contributor
Posts 4
Duster replied on Thu, May 22 2008 4:12 AM

Strange thing is that menu in http://timothyhumphrey.name/thwc/mainmenu/ opens correctly (from the same Opera-browser).

I thought there is some opera-optimisation somewhere.

Anyway, very thanks for your help!

 

Page 1 of 1 (7 items) | RSS
Powered by Community Server (Non-Commercial Edition), by Telligent Systems