[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

VFP Menu and Tree

Posted on 2010-08-15
7
Medium Priority
?
2,151 Views
Last Modified: 2012-05-10
Hi All,

I'm in process of doing a final minute change to my project. Due to complexity of the menu/sub-menus, I would need to know if it is possible to create a Tree for the menus/submenus?

As an example:

   Menu1
      Submenu1
      SubMenu2
   Menu2
      SubMenu1
      SubMenu2

I can import the menus/submenus in a table and then create a Tree View but question is how?

Thanks in advance!
SP

     
0
Comment
Question by:Nirmal Sharma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 30

Expert Comment

by:Olaf Doschke
ID: 33440717
Menu generator: generate a submenu, generate an item within the submenu ans choose it to be a submenu. You can nest this as often as you like and need.

Treeview control: You can use MS treeview ActiveX control ond others: http://fox.wikis.com/wc.dll?Wiki~TreeView

Bye, Olaf.
0
 
LVL 35

Author Comment

by:Nirmal Sharma
ID: 33441168
I have gone through the above example but it doesn't elaborate more on executing a procedure or command on selection of submenu in a tree.

Can you please give a working example on how to create a menu from records in a table and it should be tree?

Thanks!
SP
0
 
LVL 30

Expert Comment

by:Olaf Doschke
ID: 33441859
Are you talking about a context menu? In a treeview control? Please be more specific.

Bye, Olaf.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Author Comment

by:Nirmal Sharma
ID: 33448245
Yes, that's what I'm after. A Table with the following data in it:

   Field1     Field2     Tag
   Dep1      Data1     D1
   Dep1      Data2     D1
   Dep2      Data1     D2
   Dep2      Data2     D2

Hence, there are two menus (Dep1 and Dep2 and submenu are Data1 and Data2 for each menu)

How would I show them in a TreeView and on selection of Data1 or Data2 a command or procedure should run?

Thanks!
SP
0
 
LVL 30

Accepted Solution

by:
Olaf Doschke earned 2000 total points
ID: 33457899
A menu is a menu and a treeview is a treeview. Okay, so you want to use a treeview as a menu.

DO HOME(2) + '\Solution\Solution.App'
expand the root node "ActiveX"
expand the node "ActiveX controls"
double click on "Add and remove items in a treeview control"

In fact you now already used what you want: a menu in the form of a treeview control which calls something on a doubleclick. The solution.app source code is included in foxpro.

But aside of that the sample you started now has a button "Load DBF" click it and then choose the "solution.dbf" from the file open dialog. OK. Now here you are, the sample displays the same treeview as the solution.app itself does.

Now Close, then in solution.app click on "See Code". Now you can see the code behind the treeview sample.

Bye, Olaf.
0
 
LVL 35

Author Closing Comment

by:Nirmal Sharma
ID: 33465783
Excellent!!!
Thanks for the suggestions!

When I click on See Code it shows me the Form and properties, etc.. Is there any way to actually look at the Code (I meant PRG file)?

Thanks!
SP
0
 
LVL 30

Expert Comment

by:Olaf Doschke
ID: 33550259
This is the code. click on a button and you get to the (method) editor showing you the click event etc. You can take a look at the whole code, if you open the form in the class browse and use the viewcode button from the toolbar, but the code is rather for an overview. You could also set a breakpoint at some click to see what happens by debugging and singlestep through the code.

Bye, Olaf.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Ransomware, the malware that locks down its victim’s files until they pay up, has always been a frustrating issue to deal with. However, a recent mobile ransomware will make the issue a little more personal… by sharing the victim’s mobile browsing h…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question