Page 1 of 1

MenuItem Prompt

Posted: Wed Nov 28, 2007 8:49 pm
by Ken Wantz
I am trying to create several menu items. On the left is the menu item name and on the right is the accelerator key to use. I can approximate the position using spaces but the information on the right is not in a vertical line. I.E.

Code: Select all

 
      MENUITEM "Modification Log-On        Ctrl-P" ;
         ACTION LogOn () ACCELERATOR ACC_CONTROL, ASC("P")

      MENUITEM "E&xit                      Alt-X”;
         ACTION oWndMain:end() ACCELERATOR ACC_ALT, ASC("X")
As the text is positioned using a proportional pitch font, I have found nothing in my 7.04 version that will allow me to create 2 aligned columns. Does an ability such as this exist?

Posted: Wed Nov 28, 2007 9:44 pm
by Antonio Linares
Ken,

Try to use Tabs Chr( 9 ) instead of spaces

Posted: Thu Nov 29, 2007 12:30 am
by Ken Wantz
Antonio,

It was so simple, I didn't think of it. Unfortunately though, it did not work exactly as hoped.

Image

The format used was :

Code: Select all

      MENUITEM "Next Record" + CHR(9) + "PgDn" MESSAGE "Look at next member" ;
         ACTION Dn() ACCELERATOR 0, VK_NEXT
      MENUITEM "Previous Record" + CHR(9) + "PgUp" MESSAGE "Look at previous member" ;
         ACTION Up() ACCELERATOR 0, VK_PRIOR
      MENUITEM "Locate Record" + CHR(9) + "Alt-L" MESSAGE "Look for a specific member" ;
         ACTION What := Find_Fld() ACCELERATOR ACC_ALT, ASC("L")
Might there have been a problem with the 7.04 that has been since fixed?

Posted: Thu Nov 29, 2007 12:48 am
by Antonio Linares
Ken,

Try to add some spaces after the tabs

> Might there have been a problem with the 7.04 that has been since fixed?

Not specifically. In FWH 7.11 we have implemented 2007 office look menus, so we do all the painting

Posted: Thu Nov 29, 2007 2:23 am
by Ken Wantz
Antonio,


Tried spaces after the Tab with no luck. Spaces after the the shortcut text did shift the data to the left. Looks like data is placed to the left of the tab.
A close look shows that "Alt-H" is lined up slightly to the left of the two lines above.

For the disabled item I tried 2 Tabs but ended up with a square box before the shortcut as illustrated.
Then tried to see what happened if I enabled the menuitem after it was preset to DISABLED. The text remained in the same location.
If I removed DISABLED from the MenuItem command and recompiled, it shifted to the same position as the text above. I guess presetting the MenuItem to DISABLED affects any text positioning at the right hand side.


Image

Posted: Thu Nov 29, 2007 2:57 pm
by driessen
Ken,

I use CHR(9) for a long time and it is working fine in my application.

Could there be something wrong with your fonts ?

Posted: Thu Nov 29, 2007 3:27 pm
by Ken Wantz
As far as I am aware the font used in the menu is a system font.

One thing that is very wrong is if I set up the menuitem and use the DISABLED clause, the right hand margin moves to the left. I proved that by simply removing DISABLED.

Prior to using CHR9(9), movement of the right hand margin was not an issue.

Posted: Thu Nov 29, 2007 3:33 pm
by nageswaragunupudi
Working for me correctly whether disabled or not

Posted: Thu Nov 29, 2007 4:33 pm
by Antonio Linares
Ken,

What Windows version are you using ?

Posted: Thu Nov 29, 2007 6:20 pm
by Ken Wantz
Antonio

XP Pro sp2 + all updates up to the present

The problem is duplicated when I use Testmnu2 in the 7.04 FWH Samples and I change the following code:

Code: Select all

MENUITEM "Item 1" + CHR(9) +  "Sub 1" MESSAGE "Item 1 - Sub 1" ;
               ACTION MsgInfo( "any action" ) ;
               ACCELERATOR 0, VK_F2
MENUITEM "Item 1" + CHR(9) +  "Sub 2" MESSAGE "Item 1 - Sub 2" DISABLED
The second disabled item is offset to the left more than the first.

Posted: Thu Nov 29, 2007 8:13 pm
by James Bott
It is working fine for me under XP Pro SP2 and FWH 7.10, so I am guessing it was fixed after ver 7.04.

James