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

FX::FXMenuButton Class Reference

A menu button posts a popup menu when clicked. More...

#include <FXMenuButton.h>

Inheritance diagram for FX::FXMenuButton:

FX::FXLabel FX::FXFrame FX::FXWindow FX::FXDrawable FX::FXId FX::FXObject FX::FXMDIWindowButton List of all members.

Public Member Functions

 FXMenuButton (FXComposite *p, const FXString &text, FXIcon *ic=NULL, FXPopup *pup=NULL, FXuint opts=JUSTIFY_NORMAL|ICON_BEFORE_TEXT|MENUBUTTON_DOWN, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
virtual void create ()
virtual void detach ()
virtual FXint getDefaultWidth ()
virtual FXint getDefaultHeight ()
virtual FXbool canFocus () const
virtual void killFocus ()
virtual FXbool contains (FXint parentx, FXint parenty) const
void setMenu (FXPopup *pup)
FXPopupgetMenu () const
void setXOffset (FXint offx)
FXint getXOffset () const
void setYOffset (FXint offy)
FXint getYOffset () const
void setButtonStyle (FXuint style)
FXuint getButtonStyle () const
void setPopupStyle (FXuint style)
FXuint getPopupStyle () const
void setAttachment (FXuint att)
FXuint getAttachment () const
virtual void save (FXStream &store) const
virtual void load (FXStream &store)
virtual ~FXMenuButton ()

Detailed Description

A menu button posts a popup menu when clicked.

There are many ways to control the placement where the popup will appear; first, the popup may be placed on either of the four sides relative to the menu button; this is controlled by the flags MENUBUTTON_DOWN, etc. Next, there are several attachment modes; the popup's left/bottom edge may attach to the menu button's left/top edge, or the popup's right/top edge may attach to the menu button's right/bottom edge, or both. Also, the popup may apear centered relative to the menu button. Finally, a small offset may be specified to displace the location of the popup by a few pixels so as to account for borders and so on. Normally, the menu button shows an arrow pointing to the direction where the popup is set to appear; this can be turned off by passing the option MENUBUTTON_NOARROWS.

See also:

Constructor & Destructor Documentation

FX::FXMenuButton::FXMenuButton FXComposite p,
const FXString text,
FXIcon ic = NULL,
FXPopup pup = NULL,
FXint  x = 0,
FXint  y = 0,
FXint  w = 0,
FXint  h = 0,
FXint  pl = DEFAULT_PAD,
FXint  pr = DEFAULT_PAD,
FXint  pt = DEFAULT_PAD,


virtual FX::FXMenuButton::~FXMenuButton  )  [virtual]


Member Function Documentation

virtual void FX::FXMenuButton::create  )  [virtual]

Create server-side resources.

Reimplemented from FX::FXLabel.

virtual void FX::FXMenuButton::detach  )  [virtual]

Detach server-side resources.

Reimplemented from FX::FXLabel.

virtual FXint FX::FXMenuButton::getDefaultWidth  )  [virtual]

Return default width.

Reimplemented from FX::FXLabel.

Reimplemented in FX::FXMDIWindowButton.

virtual FXint FX::FXMenuButton::getDefaultHeight  )  [virtual]

Return default height.

Reimplemented from FX::FXLabel.

Reimplemented in FX::FXMDIWindowButton.

virtual FXbool FX::FXMenuButton::canFocus  )  const [virtual]

Returns true because a menu button can receive focus.

Reimplemented from FX::FXWindow.

virtual void FX::FXMenuButton::killFocus  )  [virtual]

Remove the focus from this window.

Reimplemented from FX::FXWindow.

virtual FXbool FX::FXMenuButton::contains FXint  parentx,
FXint  parenty
const [virtual]

Return true if window logically contains the given point.

Reimplemented from FX::FXWindow.

void FX::FXMenuButton::setMenu FXPopup pup  )  [inline]

Change the popup menu.

FXPopup* FX::FXMenuButton::getMenu  )  const [inline]

Return current popup menu.

void FX::FXMenuButton::setXOffset FXint  offx  )  [inline]

Set X offset where menu pops up relative to button.

FXint FX::FXMenuButton::getXOffset  )  const [inline]

Return current X offset.

void FX::FXMenuButton::setYOffset FXint  offy  )  [inline]

Set Y offset where menu pops up relative to button.

FXint FX::FXMenuButton::getYOffset  )  const [inline]

Return current Y offset.

void FX::FXMenuButton::setButtonStyle FXuint  style  ) 

Change menu button style.

FXuint FX::FXMenuButton::getButtonStyle  )  const

Get menu button style.

void FX::FXMenuButton::setPopupStyle FXuint  style  ) 

Change popup style.

FXuint FX::FXMenuButton::getPopupStyle  )  const

Get popup style.

void FX::FXMenuButton::setAttachment FXuint  att  ) 

Change attachment.

FXuint FX::FXMenuButton::getAttachment  )  const

Get attachment.

virtual void FX::FXMenuButton::save FXStream store  )  const [virtual]

Save menu button to a stream.

Reimplemented from FX::FXLabel.

virtual void FX::FXMenuButton::load FXStream store  )  [virtual]

Load menu button from a stream.

Reimplemented from FX::FXLabel.

Copyright © 1997-2004 Jeroen van der Zijp