# IMFTextPopupPart Struct Reference
[MCFrame]

Inheritance diagram for IMFTextPopupPart:

List of all members.

## Public Member Functions
virtual void MCCOMAPI | AppendMenuItem (const TMCString &inItemText)=0
virtual void MCCOMAPI | InsertMenuItem (const TMCString &inItemText, uint32 inBeforeItem)=0
virtual void MCCOMAPI | DeleteMenuItem (uint32 inIndex)=0
virtual void MCCOMAPI | RemoveAll ()=0
virtual void MCCOMAPI | AppendSeparator ()=0
virtual void MCCOMAPI | InsertSeparator (uint32 inIndex)=0
virtual void MCCOMAPI | AppendSeparator (const TMCString &inItemText)=0
virtual void MCCOMAPI | InsertSeparator (const TMCString &inItemText, uint32 inIndex)=0
virtual void MCCOMAPI | SetArrowImageId (ResourceID arrowId)=0
virtual void MCCOMAPI | SetItemActionNumber (uint32 inItem, ActionNumber inActionNumber)=0
virtual void MCCOMAPI | SetItemChecked (uint32 inItem, boolean check)=0
virtual void MCCOMAPI | SetItemEnabled (uint32 inItem, boolean enable)=0
virtual void MCCOMAPI | SetItemText (uint32 inItem, const TMCString &inItemText)=0
virtual void MCCOMAPI | SetSelectedAction (ActionNumber inAction, boolean inNotify=true)=0
virtual void MCCOMAPI | SetSelectedItem (uint32 inMenuItem, boolean inNotify=true)=0
virtual uint32 MCCOMAPI | GetMenuItemsCount () const =0
virtual void MCCOMAPI | GetItemText (uint32 inItem, TMCString &outItemText) const =0
virtual uint32 MCCOMAPI | GetSelectedItem () const =0
virtual IMFPart *MCCOMAPI | GetThisPart ()=0
virtual IMFMenu *MCCOMAPI | GetPopupMenu (void)=0
virtual void MCCOMAPI | SetPopupBuilder (ITextPopupBuilder *builder)=0
virtual void MCCOMAPI | InvalidatePopup (boolean removeAll=true)=0

## Detailed Description

Interface for Text Popups. These are pick boxes which, when clicked, pop up to present a list of choices for selection. Member functions allow you to choose whether or not to have checkmarks next to items, whether to enable items for selection, etc.

To use a text popup inside your user interface, you can create the part in MCSketch from "Plugin Group #7" in the MFWindow menu. To fill the popup with menu items, you would either add them manually from your code (by finding the part and then using AppendMenuItem() etc, or you can define a fixed set of menu items in a CMNU resource in MCSketch, and then set the Popup's context menu ID property to the ID of the CMNU resource.

There may be times when you need to update a large list of menu items frequently to correspond to changes in the scene, and the updates could be very wasteful and time-consuming. In these cases, it can be useful to delegate the task of rebuilding the menu to another object that implements the ITextPopupBuilder interface, by using the SetPopupBuilder() function. This object will be called to build the menu when the popup is invalid and needs to be displayed. This way, the menu only gets rebuilt once, when it's about to be displayed, rather than every time anything in the scene changes.

See also:
  ITextPopupBuilder

## Member Function Documentation

virtual void MCCOMAPI IMFTextPopupPart::AppendMenuItem | ( | const TMCString & | inItemText | ) | `[pure virtual]`

virtual void MCCOMAPI IMFTextPopupPart::AppendSeparator | ( | const TMCString & | inItemText | ) | `[pure virtual]`

virtual void MCCOMAPI IMFTextPopupPart::AppendSeparator | ( |  | ) | `[pure virtual]`

virtual void MCCOMAPI IMFTextPopupPart::DeleteMenuItem | ( | uint32 | inIndex | ) | `[pure virtual]`

virtual void MCCOMAPI IMFTextPopupPart::GetItemText | ( | uint32 | inItem,
|  | TMCString & | outItemText |
| ) |  |  | const`[pure virtual]`

virtual uint32 MCCOMAPI IMFTextPopupPart::GetMenuItemsCount | ( |  | ) | const`[pure virtual]`

virtual IMFMenu* MCCOMAPI IMFTextPopupPart::GetPopupMenu | ( | void |  | ) | `[pure virtual]`

virtual uint32 MCCOMAPI IMFTextPopupPart::GetSelectedItem | ( |  | ) | const`[pure virtual]`

virtual IMFPart* MCCOMAPI IMFTextPopupPart::GetThisPart | ( |  | ) | `[pure virtual]`

virtual void MCCOMAPI IMFTextPopupPart::InsertMenuItem | ( | const TMCString & | inItemText,
|  | uint32 | inBeforeItem |
| ) |  |  | `[pure virtual]`

virtual void MCCOMAPI IMFTextPopupPart::InsertSeparator | ( | const TMCString & | inItemText,
|  | uint32 | inIndex |
| ) |  |  | `[pure virtual]`

virtual void MCCOMAPI IMFTextPopupPart::InsertSeparator | ( | uint32 | inIndex | ) | `[pure virtual]`

virtual void MCCOMAPI IMFTextPopupPart::InvalidatePopup | ( | boolean | removeAll = `true` | ) | `[pure virtual]`

Empties the menu and flags it as invalid (so that the BuildPopup method of the menu's builder will be called when needed).

virtual void MCCOMAPI IMFTextPopupPart::RemoveAll | ( |  | ) | `[pure virtual]`

virtual void MCCOMAPI IMFTextPopupPart::SetArrowImageId | ( | ResourceID | arrowId | ) | `[pure virtual]`

virtual void MCCOMAPI IMFTextPopupPart::SetItemActionNumber | ( | uint32 | inItem,
|  | ActionNumber | inActionNumber |
| ) |  |  | `[pure virtual]`

virtual void MCCOMAPI IMFTextPopupPart::SetItemChecked | ( | uint32 | inItem,
|  | boolean | check |
| ) |  |  | `[pure virtual]`

virtual void MCCOMAPI IMFTextPopupPart::SetItemEnabled | ( | uint32 | inItem,
|  | boolean | enable |
| ) |  |  | `[pure virtual]`

virtual void MCCOMAPI IMFTextPopupPart::SetItemText | ( | uint32 | inItem,
|  | const TMCString & | inItemText |
| ) |  |  | `[pure virtual]`

virtual void MCCOMAPI IMFTextPopupPart::SetPopupBuilder | ( | ITextPopupBuilder * | builder | ) | `[pure virtual]`

Enables deferred filling for big dynamic popup menus that change often (like the Find menu in Carrara).

Parameters:

  | builder | The object that will be called to fill the menu, when the popup is invalid and needs to be displayed, as on mousedown.

Note:
  The builder is assumed to own this popup menu, so the internal pointer to the builder is not counted. Therefore, it is a good idea to call SetPopupBuilder(NULL) when you don't need it any more (eg in a SelfPrepareToDestroy function)

virtual void MCCOMAPI IMFTextPopupPart::SetSelectedAction | ( | ActionNumber | inAction,
|  | boolean | inNotify = `true` |
| ) |  |  | `[pure virtual]`

virtual void MCCOMAPI IMFTextPopupPart::SetSelectedItem | ( | uint32 | inMenuItem,
|  | boolean | inNotify = `true` |
| ) |  |  | `[pure virtual]`

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

- IMFTextPopupPart.h