A 3D Dynamic Geometry Software

Calques 3D C++



CAmbiguityList Class Reference

Inheritance diagram for CAmbiguityList:

Inheritance graph
Collaboration diagram for CAmbiguityList:

Collaboration graph

List of all members.


Detailed Description

A custom-made pop-up menu containing the name of objects in an ambiguous designation.

Todo:
The pop-up menu is in fact generic. It may be a good idea to merge it with the list of selected objects and get rid of the item-by-item construction of the menu items.

Public Member Functions

 CAmbiguityList (const char far *title, CWnd *parent)
 CAmbiguityList.
 CAmbiguityList (UINT sid, CWnd *parent)
 CAmbiguityList.
virtual ~CAmbiguityList ()
 CAmbiguityList.
int AddString (CString str, BOOL dis=FALSE, BOOL checked=FALSE)
 CAmbiguityList.
int AddString (UINT sid=0, BOOL dis=FALSE, BOOL checked=FALSE)
 CAmbiguityList.
int Execute ()
 Execute the popup menu and get the index of the selected object (if any).
void AddHelper (int n, CString mstr)
 CAmbiguityList.
virtual void OnUpdateCmdUI (CFrameWnd *, BOOL bDisableIfNoHndler)
 Override for special enabling/disabling of user-interface items associated with the toolbar.
virtual BOOL AllowShowOnList () const
 Called by the framework to receive permission from a CBCGPBaseToolBar-derived object to display (or not) the object in the list box on the toolbar customization page.

Constructor & Destructor Documentation

CAmbiguityList ( const char far *  title,
CWnd parent 
)

CAmbiguityList.

Parameters:
title The string containing the title of the menu
parent A pointer to the window owning the menu

CAmbiguityList ( UINT  sid,
CWnd parent 
)

CAmbiguityList.

Parameters:
sid The identifier of the string resource containing the title of the menu
parent A pointer to the window owning the menu

~CAmbiguityList (  )  [virtual]


Member Function Documentation

int AddString ( CString  str,
BOOL  dis = FALSE,
BOOL  checked = FALSE 
)

int AddString ( UINT  sid = 0,
BOOL  dis = FALSE,
BOOL  checked = FALSE 
)

int Execute (  ) 

Execute the popup menu and get the index of the selected object (if any).

Warning:
The popup menu containing the ambiguous objects starts with a title AND a separator, so the first object in the list starts at index 2.
Todo:
There is a problem with the TrackPopupMenu's handling of status bar message: it assumes the index to be the command ID, so look for such a resource ID. I don't think there is any way out of this issue.
Returns:
The zero-based index of the selected object, -1 if none

void AddHelper ( int  n,
CString  mstr 
)

CAmbiguityList.

Parameters:
n The zero-based index of the menu item.
mstr The string containing the contextual help.

virtual void OnUpdateCmdUI ( CFrameWnd ,
BOOL  bDisableIfNoHndler 
) [inline, virtual]

Override for special enabling/disabling of user-interface items associated with the toolbar.

Parameters:
bDisableIfNoHndler Specifies whether the user-interface item should be disabled if there is no handler defined in message map

virtual BOOL AllowShowOnList (  )  const [inline, virtual]

Called by the framework to receive permission from a CBCGPBaseToolBar-derived object to display (or not) the object in the list box on the toolbar customization page.