Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Main Menu

Status
Not open for further replies.

alisaif

ISP
Apr 6, 2013
418
AE
Hi,

Is it possible to use CSS Menu in VFP?

Thanks

Saif
 
I don't think you can directly, but you could read in the CSS code and build VFP menus from that.

What the advantage would be I'm not sure - are you trying to mimic an existing web menu?

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
The basic answer is No. VFP does not directly support CSS in any form. In any case, it's not clear what you mean by a "CSS menu". CSS has got nothing to do with creating menus - at least, not in the usual meaning of the word.

What exactly are you trying to achieve? If you want to create some sort of drop-down menu containing "styles", such as different colours or fonts, you can do that easily with native VFP code.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I was thinking perhaps the OP already had some menus in CSS on a web site and he wanted to read them as a one off or perhaps on a dynamic basis.

Sounds like a bad idea, but then many things seem thus, until you know all the context.



Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
If you want to create some sort of drop-down menu containing "styles", such as different colours or fonts, you can do that easily with native VFP code.

Yes, I was looking for some stylish menu.

Thanks

Saif
 
Ah, do you mean visually stylish - as opposed to the perhaps 'workmanlike' VFP ones?

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Yes, I was looking for some stylish menu.

OK. Basically, you have two choices:

1. Create a traditional pull-down menu system, either in code (DEFINE PAD, DEFINE POPUP, DEFINE BAR, etc.) or using the menu designer. Either way, you can use clauses such as COLOR, FONT, STYLE, PICTURE, PICTRES and MARK to make it look a bit fancy. But you are limited to the basic shape and layout of the standard Windows menu system.

2. Create a form that serves as the menu. The labels on the form would be the menu prompts (that is, they would perform some action when the user clicks on them). In this case, you can make the menu as fancy as you like. You have complete control over colours and fonts; you can customise the position of the prompts in relation to each other; you can add lines, shapes, 3D effects and images; you could even make it play a tune when you open it (your users would love you for that).

But whichever of these options you prefer, forget about CSS. CSS has got nothing to do with VFP, and including it in your question has only served to confuse the issue.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks for the suggestion, I will try on it.

Saif
 
Code:
Yes, I was looking for some stylish menu.

CSS - cascading style sheets . is mostly about styles, and indirectly of course also about design and layout, but not about being "stylish". That's always an artistric and never a technical aspect. The most technical important part of CSS is the c, the cascading of styles in a class and sibclasses, in objects and sub onjects. To NOT use direct properties or better spoken in terme of HTML the tag aatributes, but use style attrtibutes on a series of tags applied to all tags. The most CSS like part of VFP therefore is the SetAll() method on the one side and inheritance, which is of course also about inheritance of property values.

To be able to make use of OOP therefore an interesting alternative to the menu designer is VFPXs OOP Menu Project

Bye, Olaf.
 
In addition to my previous suggestions, I have successfully created a ribbon-style menu, along the lines of the ones used in Microsoft Office applications. This is essentially a toolbar hosting a pageframe. Each of the pages on the pageframe holds a series of buttons, but it can also contain almost any other control.

This arrangement gives a great deal of flexibility in organising the menu options, and it can also be very "stylish". I've used it now in several applications, and the users are generally happy with it.

I wrote an article about my ribbon menu class in FoxPro Advisor a few years ago, but unfortunately no longer have a copy I can share.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,

An Office Style menu is indeed something much more sofisticated than the default menu as created with the VFP menu designer. I am sure your office menu is working fantastic. Sorry to learn the article is not present anymore, would have loved to see your solution. There are several classes to produce such kind of menus, e.g. Sedna and the classes produced by Emerson or 'OnyToo', me too I have constructed such a class. You can either host a toolbar or host a topcontainer to populate your menu.

However they all simulate the Office, by lost op users, hated MS Ribbon.
Yousfi, in mentioned blog, produces a real CSS-style menu. I admit the whole coding is a bit overdone and most important your whole VFP environment gets, sorry, 'f*cked', but when you correct these bugs you do have a nice CSS style menu. It is surely worthwhile to have a look at.
download.aspx


Regards,

Jockey
 
 http://files.engineering.com/getfile.aspx?folder=c1cea45d-a11e-4e02-a0e6-74346a4a0d2e&file=Naamloos.png
Jockey,

Yes, it is a pity that all those FoxPro Advisor articles are no longer available. I know that Tamar and Doug Hennig have made their own articles available on line, but I was never that well organised.

It's actually not that difficult to create an Office-style ribbon menu, although there are several issues you have to watch out for. The trick is to place a container in the toolbar, and to place all the controls inside the container. I place a pageframe in the container, with all the buttons, etc. on the various pages. I hide the pageframe's tabs and use large labels instead to select the top-level menu choices.

The link below shows an example. The layout is very much simpler and less cluttered than the ribbons in the Office apps. I think that's the main reason users seem to like it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
 http://files.engineering.com/getfile.aspx?folder=da4106e8-97eb-4439-8097-6467c38f0f66&file=ribbon.jpg
I haven't looked in detail, but browsed the code and as it is a real HTML/CSS menu, it surely will be hosted in a webbrowser control, maybe in an unusual ribbon format. I think popup windows are able to drop down and bee seen outside of the web browser control container and thus this ActiveX control can live side by side with normal VFP controls on a form. It's an idea to do so, but goes into the direction of going webapp, if just with the menu. You leave the UX of Windows, but the normal sysmenu is a dying species anyway. Even not talking of Office Ribbon as extended toolbar, most browsers hide their text sysmenu and only show the address bar and favorites bar to maximize the canvas for the websites. I still think the menu is a helpful tool, because you really can define VFP code executed within and assign hotkeys to menu items. As Mike points out you don't have to stay with default font and coloring and you can add icons for menu items.

If you want something else than a menu, I wouldn't go for CSS/HTML but for VFP controls, you want a fancier toolbar, then take a VFP form and design your interface as you like, this gives the maximum freedom to style it as you like and let it have much more complex functionality than pickable menuu items or clickable toolbar buttons. The only difference such things have is being real forms, they take the focus away and inactivate a form, whereas a menu or toolbar let the focus stay on the active form and its active control. A cheap price, as you mostly can live with that effect, but it may cause problems due to valid events, rule checks and validations when leaving focus of controls.

Bye, Olaf.
 
myself said:
I haven't looked in detail...

Well, the webbrowser control is used ("shell.explorer.2") and covers most part of the form, so it's rather a hosted web application than just the menu for a VFP application. You can do that, but that means leaving VFP and going web app.

Bye, Olaf.

 
Please take a look to a new project I just released that facilitates VFP+HTML integration.

It implements a html event sink using js, although it is still on beta ( function parameters and specs may(will) change ).

It allows to easily implement the html events class and make vfp respond to any event on the web page.

Just run nfWebBrowserSink_demo , check the code , and change to try any URL you like.

Download :

You can follow the project at github and get automatic changes & discussions notifications.


I included a html scaffolding program you can use to render basic html form from a open table.
Menus , image carrousels and any other html/js component can be implemented as vfp UI.
( For example, TeamViewer & FoxitPdf reader use the webbrowsercontrol )


Marco

demo_wf3tsb.jpg



Marco Plaza
@vfp2nofox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top