SavvyUI C++ UI Library
Loading...
Searching...
No Matches
PopupMenu Class Reference

Represents a popup (context) menu. More...

#include <PopupMenu.h>

Public Member Functions

 PopupMenu ()
 Constructs an empty PopupMenu.
virtual ~PopupMenu ()
 Virtual destructor to clean up resources.
void addItem (long actionId, const wstring &text)
 Adds a regular menu item.
void addSeparator ()
 Adds a separator item to the menu.
long showMenu (WinHandle hWnd, long x, long y)
 Displays the popup menu at the specified screen coordinates.

Detailed Description

Represents a popup (context) menu.

Constructor & Destructor Documentation

◆ PopupMenu()

PopupMenu::PopupMenu ( )

Constructs an empty PopupMenu.

◆ ~PopupMenu()

virtual PopupMenu::~PopupMenu ( )
virtual

Virtual destructor to clean up resources.

Member Function Documentation

◆ addItem()

void PopupMenu::addItem ( long actionId,
const wstring & text )

Adds a regular menu item.

Parameters
actionIdAction identifier associated with this menu item.
textDisplay text for the menu item.

◆ addSeparator()

void PopupMenu::addSeparator ( )

Adds a separator item to the menu.

◆ showMenu()

long PopupMenu::showMenu ( WinHandle hWnd,
long x,
long y )

Displays the popup menu at the specified screen coordinates.

Parameters
hWndHandle to the owner window.
xX coordinate (screen pixels) where the menu should appear.
yY coordinate (screen pixels) where the menu should appear.
Returns
long The actionId of the selected menu item, or -1 if no selection.

The documentation for this class was generated from the following file: