Rhino C++ API  8.13
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
CRhinoUiPopupMenu Class Reference

#include <RhinoSdkUiPopUpMenu.h>

Public Member Functions

 CRhinoUiPopupMenu (LPCTSTR lpsResourceID, HINSTANCE hInst=NULL)
 
 CRhinoUiPopupMenu (UINT nResourceID=0, HINSTANCE hInst=NULL)
 
virtual ~CRhinoUiPopupMenu (void)
 
int AddItem (const char *)
 Add items in order you want them to display. More...
 
int AddItem (const wchar_t *)
 
void AddSeporator ()
 Add seportaor (this will not have an index) More...
 
void EnableItem (int nItem, bool bEnable=true)
 
HMENU GetMenuHandle ()
 
MSG * LastMessage ()
 return NULL if left or right button picked is not true otherwise return pointer to message structure for message. More...
 
bool LeftButtonPicked ()
 returns true if menu dismissed with left button More...
 
virtual void OnInitMenu (HWND hWnd, HMENU hMenu)
 Called when WM_INITMENU message received for context menu. More...
 
virtual void OnMenuSelect (HWND hWnd, HMENU hMenu, int index)
 Called when the menu selection changes, returns index of selected item or -1 if nothing is selected. More...
 
const ON_2iPointPointPicked ()
 return NULL if LeftButtonPicked() and RightButtonPicked() are false otherwise returns point where mouse went down. More...
 
virtual int PopUp (CWnd *, const ON_2iPoint &, const ON_2iPoint &)
 Display popup menu, returns -1 on error or if escape pressed otherwise returns index of added item. More...
 
int PopUpEx (CWnd *, const ON_2iPoint &, const ON_2iPoint &, int)
 the menu below the window. More...
 
void PopupWndProcOnInitMenu (HWND hWnd, HMENU hMenu)
 For internal use only. More...
 
bool RightButtonPicked ()
 returns true if menu dismissed with right button More...
 
LRESULT CALLBACK WindowProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 

Public Attributes

class CRhinoUiPopupMenuExtension * m__RhinoUiPopupMenu_extension
 For internal use only. More...
 
bool m_menu_char
 
int m_menu_select
 

Protected Member Functions

bool CheckDefaults (LPCTSTR nResourceID, HINSTANCE hInst)
 
void Init ()
 

Protected Attributes

bool m_bLeft
 
bool m_bRight
 
HMENU m_hMenu
 
HWND m_hWndParent
 
CStringArray m_item_array
 
MSG m_msg
 
CUIntArray m_nEnabledList
 
ON_2iPoint m_point
 

Detailed Description

NoKeywords

/ / Copyright (c) 1993-2007 Robert McNeel & Associates. All rights reserved. / Rhinoceros is a registered trademark of Robert McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
/ For complete Rhino SDK copyright information see http://www.rhino3d.com/developer. / ////////////////////////////////////////////////////////////// RhinoSdkPopUpMenu.h CRhinoUiPopupMenu

Constructor & Destructor Documentation

◆ CRhinoUiPopupMenu() [1/2]

CRhinoUiPopupMenu::CRhinoUiPopupMenu ( UINT  nResourceID = 0,
HINSTANCE  hInst = NULL 
)

◆ CRhinoUiPopupMenu() [2/2]

CRhinoUiPopupMenu::CRhinoUiPopupMenu ( LPCTSTR  lpsResourceID,
HINSTANCE  hInst = NULL 
)

◆ ~CRhinoUiPopupMenu()

virtual CRhinoUiPopupMenu::~CRhinoUiPopupMenu ( void  )
virtual

Member Function Documentation

◆ AddItem() [1/2]

int CRhinoUiPopupMenu::AddItem ( const char *  )

Add items in order you want them to display.

◆ AddItem() [2/2]

int CRhinoUiPopupMenu::AddItem ( const wchar_t *  )

◆ AddSeporator()

void CRhinoUiPopupMenu::AddSeporator ( )

Add seportaor (this will not have an index)

◆ CheckDefaults()

bool CRhinoUiPopupMenu::CheckDefaults ( LPCTSTR  nResourceID,
HINSTANCE  hInst 
)
protected

◆ EnableItem()

void CRhinoUiPopupMenu::EnableItem ( int  nItem,
bool  bEnable = true 
)

Call using index returned by AddItem to enable/disable a menu item. The default behavior is to enable everything.

◆ GetMenuHandle()

HMENU CRhinoUiPopupMenu::GetMenuHandle ( )

◆ Init()

void CRhinoUiPopupMenu::Init ( )
protected

◆ LastMessage()

MSG* CRhinoUiPopupMenu::LastMessage ( )

return NULL if left or right button picked is not true otherwise return pointer to message structure for message.

◆ LeftButtonPicked()

bool CRhinoUiPopupMenu::LeftButtonPicked ( )

returns true if menu dismissed with left button

◆ OnInitMenu()

virtual void CRhinoUiPopupMenu::OnInitMenu ( HWND  hWnd,
HMENU  hMenu 
)
virtual

Called when WM_INITMENU message received for context menu.

◆ OnMenuSelect()

virtual void CRhinoUiPopupMenu::OnMenuSelect ( HWND  hWnd,
HMENU  hMenu,
int  index 
)
virtual

Called when the menu selection changes, returns index of selected item or -1 if nothing is selected.

◆ PointPicked()

const ON_2iPoint* CRhinoUiPopupMenu::PointPicked ( )

return NULL if LeftButtonPicked() and RightButtonPicked() are false otherwise returns point where mouse went down.

◆ PopUp()

virtual int CRhinoUiPopupMenu::PopUp ( CWnd *  ,
const ON_2iPoint ,
const ON_2iPoint  
)
virtual

Display popup menu, returns -1 on error or if escape pressed otherwise returns index of added item.

Top point. Bottom left corner of the poupup. This is used if there is not enough space to display

◆ PopUpEx()

int CRhinoUiPopupMenu::PopUpEx ( CWnd *  ,
const ON_2iPoint ,
const ON_2iPoint ,
int   
)

the menu below the window.

Display popup menu, returns -1 on error or if escape pressed otherwise returns index of added item. 0 = Not transparent, 1 to 100 = percentage of tranparency.

◆ PopupWndProcOnInitMenu()

void CRhinoUiPopupMenu::PopupWndProcOnInitMenu ( HWND  hWnd,
HMENU  hMenu 
)

For internal use only.

◆ RightButtonPicked()

bool CRhinoUiPopupMenu::RightButtonPicked ( )

returns true if menu dismissed with right button

◆ WindowProc()

LRESULT CALLBACK CRhinoUiPopupMenu::WindowProc ( HWND  hWnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Member Data Documentation

◆ m__RhinoUiPopupMenu_extension

class CRhinoUiPopupMenuExtension* CRhinoUiPopupMenu::m__RhinoUiPopupMenu_extension

For internal use only.

◆ m_bLeft

bool CRhinoUiPopupMenu::m_bLeft
protected

◆ m_bRight

bool CRhinoUiPopupMenu::m_bRight
protected

◆ m_hMenu

HMENU CRhinoUiPopupMenu::m_hMenu
protected

◆ m_hWndParent

HWND CRhinoUiPopupMenu::m_hWndParent
protected

◆ m_item_array

CStringArray CRhinoUiPopupMenu::m_item_array
protected

◆ m_menu_char

bool CRhinoUiPopupMenu::m_menu_char

◆ m_menu_select

int CRhinoUiPopupMenu::m_menu_select

◆ m_msg

MSG CRhinoUiPopupMenu::m_msg
protected

◆ m_nEnabledList

CUIntArray CRhinoUiPopupMenu::m_nEnabledList
protected

◆ m_point

ON_2iPoint CRhinoUiPopupMenu::m_point
protected