Class: TTextMenu

Declaration: TextMenusCore.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

TDocumentTextMenu

Purpose:

Used by the Text Editing Framework to define a set of standard text menus. Text menu objects can be associated with text views, providing an interface to the end user for applying commands on text.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Deriving classes can override the various menu creation member functions. However, you must call the inherited functions first before adding any additional menu items. Similarly, you can override the AddTextMenus and RemoveTextMenus member functions. You must call the inherited functions, but, you can add/remove additional submenus to the main text menu. At present, neither text controls or text components can be customized to use a derived class of TTextMenu. However, it is possible to use a TTextMenu derived class with a TSimpleTextView or a class derived from TSimpleTextView. This involves instantiating your TTextMenu derived class and adopting it into the window group that contains your TSimpleTextView or TSimpleTextView derived class.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TTextMenu::TTextMenu

TTextMenu (TTextView * view)

Interface Category:

API.

Purpose:

Constructs a text menu object for a specified text view.

Calling Context:

May be called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::~TTextMenu

virtual ~ TTextMenu ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object. Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::AddTextMenus

virtual void AddTextMenus (TMenu & menu)

Interface Category:

API.

Purpose:

Adds text-related menus to a menu object.

Calling Context:

May be called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateCharacterMenu

virtual MMenuItem * CreateCharacterMenu ()

Interface Category:

API.

Purpose:

Creates a character menu. The character menu contains options for applying commands to change character attributes. Examples are size and color. The submenus associated with different attributes are grouped into separate member functions like and CreateSizeMenu CreateColorMenu.

Calling Context:

May be called directly by clients.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateFontMenu

virtual MMenuItem * CreateFontMenu ()

Interface Category:

API.

Purpose:

Creates a font menu. The contents of the font menu reflect the fonts, or typefaces, available to the system. Examples of fonts are TaligentSans and Monaco.

Calling Context:

Typically called from CreateCharacterMenu member function.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateSizeMenu

virtual MMenuItem * CreateSizeMenu ()

Interface Category:

API.

Purpose:

Creates a size menu. The contents of the size menu reflect the various point sizes the user may assign to text characters. Examples of sizes are 10, 12, and 18.

Calling Context:

Typically called from CreateCharacterMenu member function.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateColorMenu

virtual MMenuItem * CreateColorMenu ()

Interface Category:

API.

Purpose:

Creates a color menu. The contents of the color menu reflect the colors that may be applied to text characters. Examples of colors are red and blue.

Calling Context:

Typically called from CreateCharacterMenu member function.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateLineMenu

virtual MMenuItem * CreateLineMenu ()

Interface Category:

API.

Purpose:

Creates a line menu. The contents of the line menu reflect the various line styles that may be applied to text characters. Examples of line styles are strike-through and underline.

Calling Context:

Typically called from CreateCharacterMenu member function.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreatePostureMenu

virtual MMenuItem * CreatePostureMenu ()

Interface Category:

API.

Purpose:

Creates a posture menu. Examples of postures are Backslant and Italic.

Calling Context:

Typically called from CreateCharacterMenu member function.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateWeightMenu

virtual MMenuItem * CreateWeightMenu ()

Interface Category:

API.

Purpose:

Creates a weight menu. Examples of weights are Light and Bold.

Calling Context:

Typically called from CreateCharacterMenu member function.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateWidthMenu

virtual MMenuItem * CreateWidthMenu ()

Interface Category:

API.

Purpose:

Creates a width menu. Examples of widths are Condensed and Expanded.

Calling Context:

Typically called from CreateCharacterMenu member function.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateTransformsMenu

virtual MMenuItem * CreateTransformsMenu ()

Interface Category:

API.

Purpose:

Creates a transforms menu. Examples of transforms are skews and rotations.

Calling Context:

Typically called from CreateCharacterMenu member function.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreatePositioningMenu

virtual MMenuItem * CreatePositioningMenu ()

Interface Category:

API.

Purpose:

Creates a positioning menu. Examples of positioning include Superscript and Subscript.

Calling Context:

Typically called from CreateCharacterMenu member function.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateLetterSpacingMenu

virtual MMenuItem * CreateLetterSpacingMenu ()

Interface Category:

API.

Purpose:

Creates a spacing menu. Spacing is represented by percentages.

Calling Context:

Typically called from CreateCharacterMenu member function.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateTypingMenu

virtual MMenuItem * CreateTypingMenu ()

Interface Category:

API.

Purpose:

Creates a Typing menu based on the available typing configurations.

Calling Context:

Typically called from Text Editing Framework classes. May be called directly by clients.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateToolMenu

virtual MMenuItem * CreateToolMenu ()

Interface Category:

API.

Purpose:

Creates a tool menu. Tools allow users to apply commands to text they have not selected yet. For example, a user might select a bold tool, using it to specify the first line of text. The first line will become bold, even though a selection had not explicitly been set first.

Calling Context:

Typically called from Text Editing Framework classes. May be called directly by clients.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateParagraphMenu

virtual MMenuItem * CreateParagraphMenu ()

Interface Category:

API.

Purpose:

Creates a paragraph menu. The paragraph menu specifies commands that may be applied to paragraph styles. Paragraph style commands are applied to all paragraphs intersecting the user's text selection. Paragraph spacing is an example of a paragraph style.

Calling Context:

Typically called from Text Editing Framework classes. May be called directly by clients.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateSpacingMenu

virtual MMenuItem * CreateSpacingMenu ()

Interface Category:

API.

Purpose:

Creates a text spacing menu. Examples of spacing attributes are justification and margin.

Calling Context:

Typically called from Text Editing Framework. May be called directly by clients.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateFlushMenu

virtual MMenuItem * CreateFlushMenu ()

Interface Category:

API.

Purpose:

Creates a paragraph flush menu. Examples of flush are flush right and left.

Calling Context:

Typically called from CreateParagraphMenu member function.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateJustifyMenu

virtual MMenuItem * CreateJustifyMenu ()

Interface Category:

API.

Purpose:

Creates a text justification menu. Examples of justification are none and all.

Calling Context:

Typically called from CreateSpacingMenu member function.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateMarginMenu

virtual MMenuItem * CreateMarginMenu ()

Interface Category:

API.

Purpose:

Creates a text margin menu. Margin amounts, specified by points, determine how much space is blank around the text.

Calling Context:

Typically called from CreateSpacingMenu member function.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateIndentMenu

virtual MMenuItem * CreateIndentMenu ()

Interface Category:

API.

Purpose:

Creates a text indent menu. Indent values are specified in points.

Calling Context:

Typically called from Text Editing Framework. May be called directly by clients.

Parameters:

Return Value:

Return pointer to MMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateSubMenuItem

virtual TSubMenuItem * CreateSubMenuItem (TMenu * subMenuToAdopt, const TText & labelText)

Interface Category:

API.

Purpose:

Creates a submenu item with the specified label text. If localization archives are present, this member function will return localized labels.

Calling Context:

Called by Text Editing Framework classes.

Parameters:

Return Value:

Returns TSubMenuItem object with submenu added.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateCommandMenuItem

virtual TMomentaryMenuItem * CreateCommandMenuItem (const TText & itemLabel, TCommandOn < MTextSelection > * command, TTextLabel * adoptCommandLabel =NIL, MMenuItem :: ESeparatorType =MMenuItem :: kNone, bool updateSelection =false)

Interface Category:

API.

Purpose:

Creates a menu item associated with a command.

Calling Context:

Typically called by Text Editing Framework. May be called directly by clients.

Parameters:

Return Value:

Pointer to TMomentaryMenuItem object created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateTextColorMenuItem

virtual TMomentaryMenuItem * CreateTextColorMenuItem (const int colorTableIndex, MMenuItem :: ESeparatorType =MMenuItem :: kNone)

Interface Category:

API.

Purpose:

Creates a menu item representing a color that could be applied to text.

Calling Context:

Typically called by Text Editing Framework. May be called directly by clients.

Parameters:

Return Value:

Returns pointer to TMomentaryMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::CreateFillColorMenuItem

virtual TMomentaryMenuItem * CreateFillColorMenuItem (const int colorTableIndex, MMenuItem :: ESeparatorType =MMenuItem :: kNone)

Interface Category:

API.

Purpose:

Creates a menu item representing a color that could be applied to text.

Calling Context:

Typically called by Text Editing Framework. May be called directly by clients.

Parameters:

Return Value:

Returns pointer to TMomentaryMenuItem created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextMenu::RemoveTextMenus

virtual void RemoveTextMenus (TMenu & menu)

Interface Category:

API.

Purpose:

Deletes text-related menus to a menu object.

Calling Context:

Called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.