Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXMenuCommand Class Reference

The menu command widget is used to invoke a command in the application from a menu. More...

#include <FXMenuCommand.h>

Inheritance diagram for FX::FXMenuCommand:

FX::FXMenuCaption FX::FXWindow FX::FXDrawable FX::FXId FX::FXObject FX::FXMenuCheck FX::FXMenuRadio

List of all members.

Public Member Functions

 FXMenuCommand (FXComposite *p, const FXString &text, FXIcon *ic=NULL, FXObject *tgt=NULL, FXSelector sel=0, FXuint opts=0)
virtual FXint getDefaultWidth ()
virtual FXint getDefaultHeight ()
virtual FXbool canFocus () const
virtual void setFocus ()
virtual void killFocus ()
void setAccelText (const FXString &text, FXbool acc=false)
FXString getAccelText () const
virtual void save (FXStream &store) const
virtual void load (FXStream &store)
virtual ~FXMenuCommand ()


Detailed Description

The menu command widget is used to invoke a command in the application from a menu.

Menu commands may reflect the state of the application by graying out, or becoming hidden. When activated, a menu command sends a SEL_COMMAND to its target. When passing a tab-separated list of fields in the text parameters, the caption text is set to the first field, the accelerator to the second field, and the help text to the third field (see description of menu caption). If an accelerator string is given, the corresponding accelerator key combination is parsed out and installed into the menu pane's owner's accelerator table. Note that this means owners of menu panes should delete their menupanes properly upon destruction.


Constructor & Destructor Documentation

FX::FXMenuCommand::FXMenuCommand ( FXComposite p,
const FXString text,
FXIcon ic = NULL,
FXObject tgt = NULL,
FXSelector  sel = 0,
FXuint  opts = 0 
)

Construct a menu command.

virtual FX::FXMenuCommand::~FXMenuCommand (  )  [virtual]

Destructor.


Member Function Documentation

virtual FXint FX::FXMenuCommand::getDefaultWidth (  )  [virtual]

Return default width.

Reimplemented from FX::FXMenuCaption.

Reimplemented in FX::FXMenuCheck, and FX::FXMenuRadio.

virtual FXint FX::FXMenuCommand::getDefaultHeight (  )  [virtual]

Return default height.

Reimplemented from FX::FXMenuCaption.

Reimplemented in FX::FXMenuCheck, and FX::FXMenuRadio.

virtual FXbool FX::FXMenuCommand::canFocus (  )  const [virtual]

Yes it can receive the focus.

Reimplemented from FX::FXWindow.

virtual void FX::FXMenuCommand::setFocus (  )  [virtual]

Move the focus to this window.

Reimplemented from FX::FXWindow.

virtual void FX::FXMenuCommand::killFocus (  )  [virtual]

Remove the focus from this window.

Reimplemented from FX::FXWindow.

void FX::FXMenuCommand::setAccelText ( const FXString text,
FXbool  acc = false 
)

Set accelerator text; update accelerator if acc is true.

FXString FX::FXMenuCommand::getAccelText (  )  const [inline]

Return accelarator text.

virtual void FX::FXMenuCommand::save ( FXStream store  )  const [virtual]

Save menu to a stream.

Reimplemented from FX::FXMenuCaption.

Reimplemented in FX::FXMenuCheck, and FX::FXMenuRadio.

virtual void FX::FXMenuCommand::load ( FXStream store  )  [virtual]

Load menu from a stream.

Reimplemented from FX::FXMenuCaption.

Reimplemented in FX::FXMenuCheck, and FX::FXMenuRadio.

Copyright © 1997-2009 Jeroen van der Zijp