class XtMenu: public XObject

Pull-down menu

Inheritance:

XtMenu - XObject - XEventBroker


Public Methods

[more] XtMenu(XRect __r, unsigned long __Flags, MenuItem *__Items = 0)
Constructs a new XtMenu.
[more] ~XtMenu()
Destructs the object's instance
[more]virtual void Draw()
Draws the object
[more]virtual XtContextualHelp* GetHelp()
Returns the current contextual help
[more]virtual MenuItem* GetValue()
Returns the menu content
[more]virtual long AddMenuItem(const char *__Text, const char *__KeyText, int __Key, int __Command)
add new menu item
[more]virtual long AddMenuSubItem(const char *__Text, const char *__KeyText, int __Key, int __Command, long __Id)
add new sub menu item to given menu item
[more]virtual long AddNewLine(long __Id)
add line separator to menu item
[more]virtual void DeleteAllItem(MenuItem *__Menu)
Deletes all menu items
[more]virtual void DeleteMenuItem(long __Id)
Deletes menu item upon given id and all subitems, if available
[more]virtual bool ProcessEvent(XEvent *__Event)
Process incoming events by calling XObjectEventListener's ProcessEvent()
[more]virtual bool ProcessCommand(XMessage *__Event)
Process commands
[more]virtual bool ProcessKeyboardEvent(XKeyboardEvent *__Event)
Process keyboard events
[more]virtual bool ProcessMessage(XMessage *__Event)
Process messages
[more]virtual bool ProcessMouseEvent(XMouseEvent *__Event)
Process mouse events
[more]virtual void SetHelp(XRect __r, unsigned __Alignment, unsigned long __Flags)
Setup a contextual help for menu items
[more]virtual void SetValue(MenuItem *__Items)
Change the menu content


Inherited from XObject:

Public Methods

ovirtual void CalculateBounds()
oXRect GetBounds()
ovirtual XEvent* GetEvent()
ounsigned long GetId()
ochar* GetObjClass()
oXPoint GetOrigin()
ovirtual char* GetPalette()
ovirtual unsigned GetPalEntry(unsigned __Index)
oXPoint GetSize()
ounsigned long GetState()
ovirtual bool GetState(unsigned long __Mask)
ovirtual void HandleEvent(XEvent *__Event)
ovirtual void MoveTo(XPoint __p)
ovirtual void RegisterClient(XObject *__Client)
ovirtual void Resize(XPoint __delta)
ovirtual void SetPalette(char *__Pal, unsigned __PalLen)
ovirtual void SetState(unsigned long __Mask, bool __BoolValue)
ovirtual void UnregisterClient(XObject *__Client)

Protected Fields

ounsigned long Id
ounsigned long State
oXPoint Origin
oXPoint Size
oXPoint Cursor
oXRect Bounds
ochar ObjClass[40]
ochar Pal[80]
ounsigned PalLen
oXObject* Server
oClientList Clients

Protected Methods

obool SendMessage(unsigned long __Receiver, unsigned long __Class, long __Message)
obool SendMessage(unsigned long __Receiver, unsigned long __Class, void *__Body, unsigned long __Size)


Inherited from XEventBroker:

Public Methods

ovirtual void AddListener(unsigned long __Listener, unsigned __Class)
ovirtual void DelListener(unsigned long __Listener, unsigned __Class)
ovirtual void DelListener(unsigned long __Listener)

Protected Fields

oMap __map


Inherited from XObjectEventListener:

Public Methods

ovirtual bool ProcessSignal(XEvent *__Event)
ovirtual bool ProcessBroadcast(XEvent *__Event)


Inherited from XEventListener:


Documentation

Pull-down menu
o XtMenu(XRect __r, unsigned long __Flags, MenuItem *__Items = 0)
Constructs a new XtMenu.
Parameters:
__r - menu bounds
__Flags - options, which can be:

VERTICAL_MENU - to position the menu vertically

HIDE_DISABLED_ITEMS - to hide the disabled items
__Items - linked list of menu items:

struct MenuItem {
char *Text;
char *KeyText;
int Key, Command;
unsigned Value;
XtWindow *ChildWindow;
MenuItem *Child, *Parent;
MenuItem *Next;
};

This list can be constructed using the following 2 functions:

MenuItem *NewMenuItem(char *__Text, char *__KeyText, int __Key, int __Command, MenuItem *__Child, MenuItem *__ANextItem) which builds the entire list, and:

MenuItem *NewLine(MenuItem *__ANextItem) which builds a line separator

o ~XtMenu()
Destructs the object's instance

ovirtual void Draw()
Draws the object

ovirtual XtContextualHelp* GetHelp()
Returns the current contextual help

ovirtual MenuItem* GetValue()
Returns the menu content

ovirtual long AddMenuItem(const char *__Text, const char *__KeyText, int __Key, int __Command)
add new menu item

ovirtual long AddMenuSubItem(const char *__Text, const char *__KeyText, int __Key, int __Command, long __Id)
add new sub menu item to given menu item

ovirtual long AddNewLine(long __Id)
add line separator to menu item

ovirtual void DeleteAllItem(MenuItem *__Menu)
Deletes all menu items

ovirtual void DeleteMenuItem(long __Id)
Deletes menu item upon given id and all subitems, if available

ovirtual bool ProcessEvent(XEvent *__Event)
Process incoming events by calling XObjectEventListener's ProcessEvent()

ovirtual bool ProcessCommand(XMessage *__Event)
Process commands

ovirtual bool ProcessKeyboardEvent(XKeyboardEvent *__Event)
Process keyboard events

ovirtual bool ProcessMessage(XMessage *__Event)
Process messages

ovirtual bool ProcessMouseEvent(XMouseEvent *__Event)
Process mouse events

ovirtual void SetHelp(XRect __r, unsigned __Alignment, unsigned long __Flags)
Setup a contextual help for menu items

ovirtual void SetValue(MenuItem *__Items)
Change the menu content


This class has no child classes.

Go to the
hierarchy of classes.


Copyright ©1998-2001 Dragos Acostachioaie
Last update on October 27, 2001

This page was generated with the help of DOC++.