Public Member Functions | Protected Attributes

PopupMenu Struct Reference

Popup Menus. More...

#include <utility.h>

Collaboration diagram for PopupMenu:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PopupMenu ()
 ~PopupMenu ()
 PopupMenu (UINT nid)
 operator HMENU ()
void Append (UINT id, LPCTSTR str, UINT flags=MF_STRING)
int TrackPopupMenu (HWND hwnd, const POINT &pt, UINT flags=TPM_LEFTBUTTON|TPM_RIGHTBUTTON, LPTPMPARAMS tpm=NULL)
int PopupContextMenu (HWND hwnd, POINTS pos, UINT flags=TPM_LEFTBUTTON|TPM_RIGHTBUTTON)
int TrackPopupMenu (HWND hwnd, POINTS pos, UINT flags=TPM_LEFTBUTTON|TPM_RIGHTBUTTON)
int TrackPopupMenuAtCursor (HWND hwnd, UINT flags=TPM_LEFTBUTTON)
int TrackPopupMenuAtPos (HWND hwnd, DWORD pos, UINT flags=TPM_LEFTBUTTON)

Protected Attributes

HMENU _hmenu

Detailed Description

Popup Menus.

Definition at line 659 of file utility.h.


Constructor & Destructor Documentation

PopupMenu::PopupMenu (  ) [inline]

Definition at line 661 of file utility.h.

     :  _hmenu(CreatePopupMenu())
    {
    }
PopupMenu::~PopupMenu (  ) [inline]

Definition at line 666 of file utility.h.

    {
        DestroyMenu(_hmenu);
    }
PopupMenu::PopupMenu ( UINT  nid )

Definition at line 854 of file explorer.cpp.

References ExplorerGlobals::_hInstance, and _hmenu.

{
    HMENU hMenu = LoadMenu(g_Globals._hInstance, MAKEINTRESOURCE(nid));
    _hmenu = GetSubMenu(hMenu, 0);
    RemoveMenu(hMenu, 0, MF_BYPOSITION);
    DestroyMenu(hMenu);
}

Member Function Documentation

void PopupMenu::Append ( UINT  id,
LPCTSTR  str,
UINT  flags = MF_STRING 
) [inline]

Definition at line 675 of file utility.h.

    {
        AppendMenu(_hmenu, flags, id, str);
    }
PopupMenu::operator HMENU (  ) [inline]

Definition at line 673 of file utility.h.

{return _hmenu;}
int PopupMenu::PopupContextMenu ( HWND  hwnd,
POINTS  pos,
UINT  flags = TPM_LEFTBUTTON|TPM_RIGHTBUTTON 
) [inline]

Definition at line 684 of file utility.h.

                                                                                           {
     POINT pt;
     pt.x = pos.x;
     pt.y = pos.y;
     return TrackPopupMenuEx(_hmenu, flags, pt.x, pt.y, hwnd, NULL);
    }
int PopupMenu::TrackPopupMenu ( HWND  hwnd,
POINTS  pos,
UINT  flags = TPM_LEFTBUTTON|TPM_RIGHTBUTTON 
) [inline]

Definition at line 691 of file utility.h.

References ClientToScreen().

                                                                                         {
     POINT pt;
     pt.x = pos.x;
     pt.y = pos.y;
     ClientToScreen(hwnd, &pt);
     return TrackPopupMenuEx(_hmenu, flags, pt.x, pt.y, hwnd, NULL);
    }

Here is the call graph for this function:

int PopupMenu::TrackPopupMenu ( HWND  hwnd,
const POINT &  pt,
UINT  flags = TPM_LEFTBUTTON|TPM_RIGHTBUTTON,
LPTPMPARAMS  tpm = NULL 
) [inline]

Definition at line 680 of file utility.h.

Referenced by NotifyArea::WndProc(), and DesktopBar::WndProc().

                                                                                                                    {
     return TrackPopupMenuEx(_hmenu, flags, pt.x, pt.y, hwnd, tpm);
    }

Here is the caller graph for this function:

int PopupMenu::TrackPopupMenuAtCursor ( HWND  hwnd,
UINT  flags = TPM_LEFTBUTTON 
) [inline]

Definition at line 699 of file utility.h.

                                                                     {
     POINT pt; GetCursorPos(&pt);
     return TrackPopupMenuEx(_hmenu, flags, pt.x, pt.y, hwnd, NULL);
    }
int PopupMenu::TrackPopupMenuAtPos ( HWND  hwnd,
DWORD  pos,
UINT  flags = TPM_LEFTBUTTON 
) [inline]

Definition at line 704 of file utility.h.

                                                                             {
     return TrackPopupMenuEx(_hmenu, flags, GET_X_LPARAM(pos), GET_Y_LPARAM(pos), hwnd, NULL);
    }

Member Data Documentation

HMENU PopupMenu::_hmenu [protected]

Definition at line 709 of file utility.h.

Referenced by PopupMenu().


The documentation for this struct was generated from the following files:

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage