Questions tagged [cmenu]

CMenu is a MFC encapsulation of Windows HMENU.

CMenu provides member functions for creating, tracking, updating, and destroying a menu.

Official documentation

42 questions
12
votes
1 answer

Adding a tooltip to CMenu item(s)

A while ago, I have tried to add a tooltip for testing purposes on a CMenu item. Now I would need it, and I'm facing the same issue again. This question and answer(s): MFC : How to add tooltip in Cmenu items? doesn't help me at all, as this "newline…
Blacktempel
  • 3,935
  • 3
  • 29
  • 53
11
votes
2 answers

MFC CMenu tooltip not being displayed

I tried using something like this to set the tool tip of a CMenu item (as described here) but it is just being displayed in a single line and the line break is not visible. // read control id UINT id = menu->GetMenuItemID(1235); // modify caption…
Norman
  • 123
  • 5
11
votes
3 answers

How to add raw HTML in Yii CMenu label

I create a menu like a Twitter Bootstrap navbar with CMenu widget: widget( 'zii.widgets.CMenu', array( 'items' => array( array( 'label' => 'Home', 'url' => array( '/site/index' ), ), …
doktorgradus
  • 627
  • 1
  • 5
  • 13
8
votes
2 answers

Why can't I disable/gray out menuitem? (MFC)

I'm trying to disable/gray out menu items using the CMenu::EnableMenuItem() method. I have a CMenu* variable pMenu which references the top menu of the dialog. I can get the submenu using pMenu->GetSubMenu(int) and using submenu->GetMenuStringA(),…
Amre
  • 1,630
  • 8
  • 29
  • 41
6
votes
3 answers

MFC : How to add tooltip in Cmenu items?

How do you add tooltips for CMenu Items? I couldn't find any straightforward and helpful resource. Please help. Thanks...
Owen
  • 4,063
  • 17
  • 58
  • 78
2
votes
2 answers

How to show menu bitmaps with transparent background

I am using this code: m_bmpSwap.LoadBitmap(IDB_BITMAP2); pMnuPopup->SetMenuItemBitmaps(0, MF_BYPOSITION, &m_bmpSwap, &m_bmpSwap); It looks like: It was only a test image: How exactly do I get my image to look as if it has a transparent…
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
2
votes
1 answer

Handling dynamically populated CMenu messages

I'm implementing a right click menu in an MFC app whose contents are not known until runtime. While it's simple enough to add menu items to a CMenu object, I haven't figured out a way to handle the messages sent by each menu item. One technique I…
ericc
  • 334
  • 1
  • 14
2
votes
1 answer

How to append a dynamic menu item after call CMenu::LoadMenu?

In my project, there is a menu that need to be appended an item dynamically. In original code, items in the menu are stationary. So the menu is defined in the resource file: IDM_SERVER_OPTIONS MENU DISCARDABLE BEGIN POPUP "" BEGIN …
yw5643
  • 189
  • 1
  • 12
2
votes
4 answers

Yii CMenu Widget - How to Get Home Page

I've put together a menu in Yii (my first project using it) like this: $this->widget('zii.widgets.CMenu',array( 'items'=>array( array('label'=>'Home', 'url'=>array('/')), array('label'=>'Examples', 'url'=>array('/examples')), …
Jeremy Harris
  • 24,318
  • 13
  • 79
  • 133
2
votes
1 answer

Yii CMenu active class not showing - why?

I'm rendering this Cmenu but the active class isn't showing on the li element when we are active on that menu page. $this->widget('zii.widgets.CMenu', array('items'=>array( array( 'label'=>'Foo', …
MEM
  • 30,529
  • 42
  • 121
  • 191
2
votes
1 answer

CMenu URL attribute usage when dynamicaly adding menu items?

Not sure if it's a best practice, but we wish to have a menu on a layout view and pass as URL parameter a value that should retrieve some data. The menu would be something like:
MEM
  • 30,529
  • 42
  • 121
  • 191
1
vote
2 answers

What is the tag used for in Yii framework CMenu?

In the following codes, you see there is a tag new for the product/new route and a tag popular for the product/index route. I can't figure out what these tags are used for, and I can't see any difference in the html output even I remove…
bobo
  • 8,439
  • 11
  • 57
  • 81
1
vote
1 answer

MFC: How to detect right-click on popup menu item?

In a CMenu menu, WM_MENURBUTTONUP is only fired when the right mouse button is released while the mouse pointer is over a normal menu item (MF_STRING), but not if it's over a popup menu item (MF_POPUP). How can right-clicks on a popup menu item be…
stbi
  • 19
  • 2
1
vote
0 answers

Removing top level Menu item (in MFC). .

1> I could remove top level menu item (along with its sub-menus) in MFC MDI application using below code. void CMainFrame::OnRemoveMyMenu() { //////////////////////////////////////////////////////////////////////// CString sMenuText =…
KA.Mumbai
  • 11
  • 2
1
vote
1 answer

C++ - MFC - Set height of CMenu

Is there any option to set the height if a CMenu? I know one can draw a custom menu item and use a custom size there CMenu::MeasureItem, but is there a way to set/change the height of the menu(bar) itself? Thanks.
dab0bby
  • 2,951
  • 1
  • 31
  • 35
1
2 3