Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Headings in Menus
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Titre:
Headings in Menus
Divers
Thread ID:
00492587
Message ID:
00492587
Vues:
57

Hello People.

Here is the trick behind the menus with the heading.

It's a simple trick cos there is no heading !

Read on ...

Here is what the Define Bar is all about !

DEFINE BAR nMenuItemNumber1 | SystemItemName
OF MenuName PROMPT cMenuItemText
[BEFORE nMenuItemNumber2 | AFTER nMenuItemNumber3]
[FONT cFontName [, nFontSize]]
[STYLE cFontStyle]
[KEY KeyLabel [, cKeyText]]
[MARK cMarkCharacter]
[MESSAGE cMessageText]
[SKIP [FOR lExpression]]
[COLOR SCHEME nSchemeNumber
| COLOR ColorPairList]

Of this, I have used just 2 directives ....
FONT cFontName [, nFontSize] and COLOR ColorPairList

Ok here's the technique.

Create a shortcut menu and add to it the following prompts ..
As it is including inverted commas !
( use my included Sample since wordwrap may not show the prompts properly)

1 > " + "Your Headding" color
,rgb(0,0,0,255,255,255),,,,rgb(0,0,0,255,255,255)
font "tahoma" style "B
2 > \-
3 > Option 1
4 > Option 2

Note the 1st Prompt is missing a closing inverted comma .. let
it be
!

Ok Now how and y it works ..

The promp field in the menu designer accepts the above prompts.
The Menu Generator program intercepts these without any
processing so in the final .mpr file they end up as follows ...

DEFINE BAR 1 OF shortcut PROMPT "" + "Your
Headding" color ,rgb(0,0,0,255,255,255),,,,rgb(0,0,0,255,255,255)
font "tahoma" style "B"


Also note the formating .

The 2 rgb values set in the color. They are for the foreground
and background color of the normal prompt and the same pair for
the highlighted prompt. So when the User moves the mouse over the
heading prompt, he wont see any changes as both the highlight and
normal colors are the same. It creates an illusion of a heading !

This is a very very clumsy way of defining yor prompts in the
menu designer !

A better sugestion would be to use a Public domain Menu Generator
called GenMenuX which is a much advanced menu
generator than the normal VFP generator.

I am including a link to a sample that should work with the
normal VFP menu generator.

http://www14.brinkster.com/hitenkm/HeadMenu.zip

Here is a screenshot of that menu

http://www14.brinkster.com/hitenkm/HeadMenu.gif

Please dont make any
damage claims over this article, as it is just a trick on making
your apps more user friendly.
Also I assume no responsability for any damage caused by the use
of this article.

And thanx to all you people who lead me to write this article !

Please direct all your e-mails to

kment_1@hotmail.com

Regards
Hiten K M

( The best and the worst are yet to come .. keep coding ! )

My Resume >>
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform