![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
A menu button posts a popup menu when clicked. More...
#include <FXMenuButton.h>
Public Member Functions | |
| long | onPaint (FXObject *, FXSelector, void *) |
| long | onUpdate (FXObject *, FXSelector, void *) |
| long | onEnter (FXObject *, FXSelector, void *) |
| long | onLeave (FXObject *, FXSelector, void *) |
| long | onFocusIn (FXObject *, FXSelector, void *) |
| long | onFocusOut (FXObject *, FXSelector, void *) |
| long | onUngrabbed (FXObject *, FXSelector, void *) |
| long | onMotion (FXObject *, FXSelector, void *) |
| long | onButtonPress (FXObject *, FXSelector, void *) |
| long | onButtonRelease (FXObject *, FXSelector, void *) |
| long | onKeyPress (FXObject *, FXSelector, void *) |
| long | onKeyRelease (FXObject *, FXSelector, void *) |
| long | onHotKeyPress (FXObject *, FXSelector, void *) |
| long | onHotKeyRelease (FXObject *, FXSelector, void *) |
| long | onCmdPost (FXObject *, FXSelector, void *) |
| long | onCmdUnpost (FXObject *, FXSelector, void *) |
| 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) | |
| Constructor. | |
| virtual void | create () |
| Create server-side resources. | |
| virtual void | detach () |
| Detach server-side resources. | |
| virtual FXint | getDefaultWidth () |
| Return default width. | |
| virtual FXint | getDefaultHeight () |
| Return default height. | |
| virtual FXbool | canFocus () const |
| Returns true because a menu button can receive focus. | |
| virtual void | killFocus () |
| Remove the focus from this window. | |
| virtual FXbool | contains (FXint parentx, FXint parenty) const |
| Return true if window logically contains the given point. | |
| void | setMenu (FXPopup *pup) |
| Change the popup menu. | |
| FXPopup * | getMenu () const |
| Return current popup menu. | |
| void | showMenu (FXbool shw) |
| Show or hide menu. | |
| FXbool | isMenuShown () const |
| Is the pane shown. | |
| void | setXOffset (FXint offx) |
| Set X offset where menu pops up relative to button. | |
| FXint | getXOffset () const |
| Return current X offset. | |
| void | setYOffset (FXint offy) |
| Set Y offset where menu pops up relative to button. | |
| FXint | getYOffset () const |
| Return current Y offset. | |
| void | setButtonStyle (FXuint style) |
| Change menu button style. | |
| FXuint | getButtonStyle () const |
| Get menu button style. | |
| void | setPopupStyle (FXuint style) |
| Change popup style. | |
| FXuint | getPopupStyle () const |
| Get popup style. | |
| void | setAttachment (FXuint att) |
| Change attachment. | |
| FXuint | getAttachment () const |
| Get attachment. | |
| virtual void | save (FXStream &store) const |
| Save menu button to a stream. | |
| virtual void | load (FXStream &store) |
| Load menu button from a stream. | |
| virtual | ~FXMenuButton () |
| Destructor. | |
Protected Attributes | |
| FXPopup * | pane |
| FXint | offsetx |
| FXint | offsety |
| FXbool | state |
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.
|
|