DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Public Member Functions | Protected Attributes
GUI::Menubar Class Reference

A menu bar at the top of a ToplevelWindow. More...

#include <gui_tk.h>

Inheritance diagram for GUI::Menubar:
GUI::Window GUI::ActionEventSource GUI::ActionEventSource_Callback GUI::Refcount

List of all members.

Public Member Functions

 Menubar (Window *parent, int x, int y, int w)
 Create a menubar with given position and size.
template<typename STR >
void addMenu (const STR name)
 Add a Menu.
template<typename STR >
void addItem (int index, const STR name)
 Add a Menuitem.
template<typename STR >
void removeItem (int index, const STR name)
 Remove a Menuitem.
virtual void paint (Drawable &d) const
 Paint menubar.
virtual bool mouseDown (int x, int y, MouseButton button)
 Open menu.
virtual bool keyDown (const Key &key)
 Handle keyboard input.
virtual bool keyUp (const Key &key)
 Handle keyboard input.
virtual void actionExecuted (ActionEventSource *src, const String &arg)
 Handler with optional String argument.

Protected Attributes

int selected
 Currently activated menu index.
int lastx
 Horizontal position of next menu.
std::vector< Menu * > menus
 List of Menus.

Detailed Description

A menu bar at the top of a ToplevelWindow.

Menu bars aggregate several Menus. They have a simple border at the bottom. If your application has a work area with 3D sunken look, place it so that it overlaps the menu by one row.

As with Menus, avoid the character '&' in Menu names as it may have a special meaning in future versions. Menubars use the Font named "menu".

Definition at line 2324 of file gui_tk.h.


Constructor & Destructor Documentation

GUI::Menubar::Menubar ( Window parent,
int  x,
int  y,
int  w 
) [inline]

Create a menubar with given position and size.

Height is autocalculated from font size

Definition at line 2338 of file gui_tk.h.

References GUI::Window::tabbable.


Member Function Documentation

virtual void GUI::Menubar::actionExecuted ( ActionEventSource source,
const String arg 
) [inline, virtual]

Handler with optional String argument.

If the event source doesn't provide an additional argument, the name will be used.

Implements GUI::ActionEventSource_Callback.

Definition at line 2387 of file gui_tk.h.

References GUI::ActionEventSource_Callback::actionExecuted(), and GUI::ActionEventSource::actionHandlers.


The documentation for this class was generated from the following files: