Solved

VFP Menu and Tree

Posted on 2010-08-15
7
1,997 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
  • 4
  • 3
7 Comments
 
LVL 29

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 29

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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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 29

Accepted Solution

by:
Olaf Doschke earned 500 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 29

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to automatize a VFP exe download to the more recent version? 16 1,039
TSWEB on windows 7 1 1,105
Translate dll vb.net code to VFP 9 10 711
How can i delete a , space in VFP9 4 79
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…
With the rapid rise in mobile usage, mobile devices are here to stay and have become an integral part of doing business. Here are 9 great apps for your BYOD environment.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

863 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now