MenuItem Prompt

Post Reply
Ken Wantz
Posts: 45
Joined: Wed Nov 29, 2006 7:48 pm
Location: Toronto Canada

MenuItem Prompt

Post 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?
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Ken,

Try to use Tabs Chr( 9 ) instead of spaces
regards, saludos

Antonio Linares
www.fivetechsoft.com
Ken Wantz
Posts: 45
Joined: Wed Nov 29, 2006 7:48 pm
Location: Toronto Canada

Post 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?
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Ken Wantz
Posts: 45
Joined: Wed Nov 29, 2006 7:48 pm
Location: Toronto Canada

Post 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
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Post 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 ?
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Ken Wantz
Posts: 45
Joined: Wed Nov 29, 2006 7:48 pm
Location: Toronto Canada

Post 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.
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

Working for me correctly whether disabled or not
Regards

G. N. Rao.
Hyderabad, India
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Ken,

What Windows version are you using ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Ken Wantz
Posts: 45
Joined: Wed Nov 29, 2006 7:48 pm
Location: Toronto Canada

Post 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.
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

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