Add submenu using controls/toolbox items or any other way? - c++

I have a menu with 4 menu items. The 4th menu item is to be having upto 3 sub-menu items.
Im working in VS2010.I'm looking for adding a submenu to an already existing menu in VS 2010. Is there a way I can do it using controls/toolbox items or in any other alternative in VS?

Related

How to Retrieve Main Menu Items from Drupal 7

I am trying to get Main Menu Names in Drupal 7, I have used below query but seems its not matching with Menu which are displaying on website.
SELECT * FROM menu_links where menu_name='main-menu' and hidden=0
and mlid=p1 order by weight
Any suggestion? how to get Menu names from Druapl 7?
Note : Druapl 7 based site has used TB Mega Menu for Menu.
You have a menu_get_names function in the Drupal API. It returns an entire list of menu names.

Tkinter - Changing the list in Option Menu

Is there a way to manipulate the List displayed by the OptionMenu in respect to what the user has currently selected?
For example, let's say I have a list - ["A","B","C"].
If the user currently selected A then if he clicks the optionmenu with A currently selected, what he will see in the list is not the original list but only B and C.
If he switches his answer from, let's say, A to B, then now, he will only see A and C in the OptionMenu.
And the same will follow if he chose B or C.
Thanks!
The OptionMenu widget is a button that shows a dropdown menu when pressed. You might do better to use a ttk.Combobox instead as that is a more modern UI element and you can very simply configure the values configuration item.
You can configure the attached menu at runtime. You access the menu using optionmenu['menu'] and you can then query items on the menu optionmenu['menu'].entrycget(0, 'label') or use entryconfigure to modify the items. Or you can delete items optionmenu['menu'].delete(index) and add new items. See the menu documentation for hints on manipulating the menu entries.

Can I add multiple columns in MFC CListBox?

I have a dialog with a CListBox .I have to add 3 Columns in this list box.
Is there any way to have several different columns in CListBox ?
Or Can CListCtrl help in this regard?
Listbox has list of items in 1 column, a list-control can have zero or more columns.
Natively, listbox does not have icon attached to it, list control has.
List control has "header control" on top of it, which can be used to arrange and/or sort the items in columns.
List Control (also know as report control) can have 4 or more view types (depending on OS) - icon, small icon, details/report, list and thumbnail.
The windows explorer file view (right side) is list control, fonts in Fonts dialog box is listbox.
Source : http://forums.codeguru.com/showthread.php?358739-CListBox-and-CListCtrl.
use CListCtrl::InsertColumn to add new column.
here is the reference
here is a example

How to display a menu based on another menu's submenu items (Joomla 2.5)

This is probably really easy to do and I'm probably missing the wood for the trees but I'm trying to display a menu on a selection of pages which contains the sub menu items from the equivalent main menu item.
For example, the main menu has 'Products' (parent item) listed with 'Product 1', 'Product 2' and 'Product 3' as sub menu items (child items). Is it possible (without creating duplicate articles) to create a submenu which only shows the child items but which links to the same articles as from the main menu?
I've read about using menu-alias but none of the documentation I've found gives a clear message on this.
Thanks.
1) Go to Menus -> Menu Manager -> Add Menu.
2) Add a new menu item in it, choose for type Menu Item Alias and on the right side under Menu Item choose which Menu you want it to be the copy of (not a real copy, but an alias).
3) Repeat 2) for all menu items you want to display
4) In Module Manager, add new Menu module, choose your newly created Menu, assign it to some position and publish.
#Marko D's solution works well and can be customised to suit many variations.
There's another option in this case where you don't event need to create another menu or menu aliases.
1) In module manager, add a new menu module, name it, position it, apply it to the relevant pages, then under Basic Options choose the main menu in question and a start level of 2 and publish
2) No number 2 ;)
It's always good to have more than 1 option!

Getting value of the selected submenu item

I have developed a menu, submenu using MFC in C++. The submenu is dynamic and keeps changing.
Upon selection of the dynamic submenu, how do I get its value?
I am really stuck here. I would be thankful!
Reserve a range of contiguous resource IDs that you assign to each submenu item. Then use ON_COMMAND_RANGE to respond to the item selection.