Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

CSMenuItem Class Reference

#include <CSMenuItem.h>

Inheritance diagram for CSMenuItem:

CSMenu CSButton CSGrafikElement CSMessageDispatchable CSMessageListener

Public Member Functions

virtual std::string getType ()
 CSMenuItem (const std::string &itemName)
 ~CSMenuItem ()
void reactOnMessageMenuItem (CSMessage *message)
virtual void reactOnMessage (CSMessage *message)
 to be overloaded

virtual void layoutSetup ()

Static Public Attributes

const char * CLASS = "CSMenuItem"
 static element, name of this class (introsepection)


Protected Member Functions

void layoutSetupMenuItem ()

Constructor & Destructor Documentation

CSMenuItem::CSMenuItem const std::string &  itemName  ) 
 

Definition at line 10 of file CSMenuItem.cpp.

References LOG_ENTER, LOG_EXIT, MENUITEM_ACTIVATED_MESSAGE, CSGrafikElement::setFocusable(), and CSMessage::setSubtype().

00010                                                 : CSMenu(itemName)
00011 {
00012     static char *functionName="CSMenuItem";
00013     LOG_ENTER 
00014     MESSAGE_MENUITEM_ACTIVATED.setSubtype(MENUITEM_ACTIVATED_MESSAGE);
00015     setFocusable(false);
00016     LOG_EXIT
00017 }

Here is the call graph for this function:

CSMenuItem::~CSMenuItem  )  [inline]
 

Definition at line 29 of file CSMenuItem.h.

00029 {}


Member Function Documentation

void CSMenuItem::layoutSetupMenuItem  )  [protected]
 

Definition at line 91 of file CSMenuItem.cpp.

References CSMenu::layoutSetupMenu(), LOG_ENTER, and LOG_EXIT.

Referenced by layoutSetup().

00092 {
00093     static char *functionName="layoutSetupMenuItem";
00094     LOG_ENTER 
00095     layoutSetupMenu();
00096     LOG_EXIT
00097 }

Here is the call graph for this function:

virtual std::string CSMenuItem::getType  )  [inline, virtual]
 

Reimplemented from CSMenu.

Definition at line 27 of file CSMenuItem.h.

References CLASS.

00027 {return (std::string) CLASS;}

void CSMenuItem::reactOnMessageMenuItem CSMessage message  ) 
 

Definition at line 24 of file CSMenuItem.cpp.

References GuiMessage::actionId, BUTTON_DEFAULT, BUTTON_HOVERING, BUTTON_PRESSED, BUTTON_VISIBLE, GuiMessage::downReceiver, CSGrafikElement::getDesktop(), CSMessage::getSubtype(), CSMessage::getType(), GUI_MESSAGE, CSGrafikElement::isChild(), CSMessage::mIsHandled, MOUSE_BUTTON_PRESSED_MESSAGE, MOUSE_BUTTON_RELEASED_MESSAGE, MOUSE_MOTION_LOST_MESSAGE, MOUSE_MOTION_MESSAGE, CSMenu::reactOnMessageMenu(), GuiMessage::receiver, CSMessageDispatchable::sendMessage(), and CSDesktop::setFocusedComponent().

Referenced by reactOnMessage().

00025 {
00026     static char *functionName="reactOnMessage";
00027     if (message->mIsHandled)
00028     {
00029         reactOnMessageMenu(message);
00030         return;
00031     }
00032     if (message->getType() == GUI_MESSAGE)
00033     {
00034         GuiMessage *gm = (GuiMessage *) message;
00035         if (isChild(gm->receiver))
00036         //else // receiver == this
00037         {
00038             switch (message->getSubtype())
00039             {
00040                 case MOUSE_MOTION_LOST_MESSAGE:
00041                 {
00042                     mBorderState = mBorderState & (~BUTTON_VISIBLE);
00043                     gm->mIsHandled = true;
00044                     break;
00045                 }
00046                 case MOUSE_MOTION_MESSAGE:
00047                 {
00048                     mBorderState = mBorderState | BUTTON_VISIBLE;
00049                     mBorderState = mBorderState | BUTTON_HOVERING;
00050                     gm->mIsHandled = true;
00051                     break;
00052                 }
00053                 case MOUSE_BUTTON_PRESSED_MESSAGE:
00054                 {
00055                     mBorderState = mBorderState | BUTTON_PRESSED;
00056                     gm->mIsHandled = true;
00057                     break;
00058                 }
00059 
00060                 case MOUSE_BUTTON_RELEASED_MESSAGE:
00061                 {
00062                     mBorderState = BUTTON_DEFAULT;
00063                     if (isChild(gm->downReceiver))
00064                     {
00065                         CSDesktop *desktop = getDesktop();
00066                         if (desktop == 0)
00067                         {
00068                             break;
00069                         }
00070                         desktop->setFocusedComponent(0);
00071                         MESSAGE_MENUITEM_ACTIVATED.actionId = mActionId;
00072                         MESSAGE_MENUITEM_ACTIVATED.mIsHandled = false;
00073                         sendMessage(MESSAGE_MENUITEM_ACTIVATED);
00074                     }
00075                     gm->mIsHandled = true;
00076                     break;
00077                 }
00078             }
00079         }
00080         else
00081         //if (gm->receiver != this)
00082         {
00083             if (message->getSubtype() == MOUSE_BUTTON_RELEASED_MESSAGE)
00084             {
00085                 mBorderState = BUTTON_DEFAULT;
00086             }
00087         }
00088     }
00089 }

Here is the call graph for this function:

void CSMenuItem::reactOnMessage CSMessage message  )  [virtual]
 

to be overloaded

Reimplemented from CSMenu.

Definition at line 19 of file CSMenuItem.cpp.

References reactOnMessageMenuItem().

00020 {
00021     reactOnMessageMenuItem(message);
00022 }

Here is the call graph for this function:

virtual void CSMenuItem::layoutSetup  )  [inline, virtual]
 

Reimplemented from CSMenu.

Definition at line 33 of file CSMenuItem.h.

References layoutSetupMenuItem().

Here is the call graph for this function:


Field Documentation

const char * CSMenuItem::CLASS = "CSMenuItem" [static]
 

static element, name of this class (introsepection)

Reimplemented from CSMenu.

Definition at line 8 of file CSMenuItem.cpp.

Referenced by CSLAF::getBackgroundColorEnabledInternal(), CSLAF::getBorderInternal(), CSLAF::getHorizontalElementSpacingInternal(), CSLAF::getTextColorDisabledInternal(), CSLAF::getTextColorEnabledInternal(), getType(), and CSLAF::getVerticalElementSpacingInternal().


Generated on Wed Jul 14 00:44:53 2004 for CSLib by doxygen 1.3.6