#include <CSMenu.h>
Inheritance diagram for CSMenu:
Public Member Functions | |
virtual std::string | getType () |
CSMenu (const std::string &menuTitle) | |
virtual | ~CSMenu () |
std::string | getTitle () |
void | reactOnMessageMenu (CSMessage *message) |
virtual void | reactOnMessage (CSMessage *message) |
to be overloaded | |
virtual void | layoutSetup () |
virtual void | addMenuItem (CSMenuItem *item) |
virtual void | removeMenuItem (CSMenuItem *item) |
virtual void | openMenu () |
virtual void | closeMenu () |
virtual CSMenuBar * | getMenuBar () |
void | setMenuBar (CSMenuBar *bar) |
virtual int | getButtonState () |
Static Public Attributes | |
const char * | CLASS = "CSMenu" |
static element, name of this class (introsepection) | |
Protected Member Functions | |
void | layoutSetupMenu () |
Protected Attributes | |
CSMenuBar * | mMenuBar |
|
Here is the call graph for this function:
|
Definition at line 40 of file CSMenu.cpp.
00041 { 00042 static char *functionName="~CSMenu"; 00043 if (mMenuPanel != 0) 00044 { 00045 delete (mMenuPanel); 00046 mMenuPanel = 0; 00047 } 00048 } |
|
Definition at line 252 of file CSMenu.cpp. References CSButton::layoutSetupButton(), LOG_ENTER, and LOG_EXIT. Referenced by layoutSetup(), and CSMenuItem::layoutSetupMenuItem().
00253 { 00254 static char *functionName="layoutSetupMenu"; 00255 LOG_ENTER 00256 layoutSetupButton(); 00257 LOG_EXIT 00258 } |
Here is the call graph for this function:
|
Reimplemented from CSButton. Reimplemented in CSMenuItem. Definition at line 39 of file CSMenu.h. References CLASS.
00039 {return (std::string) CLASS;} |
|
Definition at line 43 of file CSMenu.h.
00043 {return mTitle;}
|
|
Definition at line 55 of file CSMenu.cpp. References BUTTON_HOVERING, BUTTON_PRESSED, BUTTON_VISIBLE, CSMenuBar::closeLastMenu(), closeMenu(), FOCUS_LOST_MESSAGE, CSMenuBar::getActiveMenu(), CSMenuBar::getLastActiveMenu(), getMenuBar(), CSMenuBar::getMenuState(), CSMessage::getSubtype(), CSMessage::getType(), GUI_MESSAGE, CSGrafikElement::isChild(), CSMessage::mIsHandled, mMenuPanel, MOUSE_BUTTON_PRESSED_MESSAGE, MOUSE_MOTION_LOST_MESSAGE, MOUSE_MOTION_MESSAGE, openMenu(), CSButton::reactOnMessageButton(), GuiMessage::receiver, CSMenuBar::resetMenu(), CSMenuBar::setActiveMenu(), and CSMenuBar::setMenuState(). Referenced by reactOnMessage(), and CSMenuItem::reactOnMessageMenuItem().
00056 { 00057 static char *functionName="reactOnMessage"; 00058 if (message->mIsHandled) 00059 { 00060 reactOnMessageButton(message); 00061 return; 00062 } 00063 if (message->getType() == GUI_MESSAGE) 00064 { 00065 GuiMessage *gm = (GuiMessage *) message; 00066 if (isChild(gm->receiver)) 00067 { 00068 switch (message->getSubtype()) 00069 { 00070 case MOUSE_MOTION_LOST_MESSAGE: 00071 { 00072 mBorderState = mBorderState & (~BUTTON_VISIBLE); 00073 gm->mIsHandled = true; 00074 break; 00075 } 00076 case MOUSE_MOTION_MESSAGE: 00077 { 00078 mBorderState = mBorderState | BUTTON_VISIBLE; 00079 mBorderState = mBorderState | BUTTON_HOVERING; 00080 if (getMenuBar() != 0) 00081 { 00082 if ((getMenuBar()->getMenuState(this) & BUTTON_PRESSED) == BUTTON_PRESSED) 00083 { 00084 if (getMenuBar()->getActiveMenu() != this) 00085 { 00086 mBorderState = mBorderState | BUTTON_PRESSED; 00087 getMenuBar()->setActiveMenu(this); 00088 getMenuBar()->closeLastMenu(); 00089 openMenu(); 00090 } 00091 } 00092 } 00093 gm->mIsHandled = true; 00094 break; 00095 } 00096 case MOUSE_BUTTON_PRESSED_MESSAGE: 00097 { 00098 mBorderState = mBorderState | BUTTON_PRESSED; 00099 if (getMenuBar() != 0) 00100 { 00101 getMenuBar()->setMenuState(mBorderState); 00102 getMenuBar()->setActiveMenu(this); 00103 openMenu(); 00104 } 00105 gm->mIsHandled = true; 00106 break; 00107 } 00108 } 00109 } 00110 else // receiver is not a child 00111 { 00112 switch (message->getSubtype()) 00113 { 00114 case FOCUS_LOST_MESSAGE: 00115 { 00116 if (getMenuBar() != 0) 00117 { 00118 CSGrafikElement *lastActiveMenu = 0; 00119 // check whether we just switched menus in the same menuBar 00120 // if the lastActiveMenu was ourselfs AND the component that lost 00121 // the focus was we ourself too -> than there was just a switch 00122 // in menus (if another outsider component had received the focus 00123 // we would still be the active menu!) 00124 if (getMenuBar()->getLastActiveMenu()) 00125 { 00126 lastActiveMenu = getMenuBar()->getLastActiveMenu()->mMenuPanel; 00127 } 00128 CSGrafikElement *lastFocusedComponent = gm->receiver; 00129 if (lastActiveMenu != lastFocusedComponent) 00130 { 00131 getMenuBar()->resetMenu(); 00132 mBorderState = mBorderState & (~BUTTON_VISIBLE); 00133 mBorderState = mBorderState & (~(BUTTON_PRESSED | BUTTON_HOVERING)); 00134 } 00135 00136 getMenuBar()->setMenuState(mBorderState); 00137 getMenuBar()->setActiveMenu(0); 00138 } 00139 closeMenu(); 00140 00141 gm->mIsHandled = true; 00142 } 00143 } 00144 } 00145 } 00146 } |
Here is the call graph for this function:
|
to be overloaded
Reimplemented from CSButton. Reimplemented in CSMenuItem. Definition at line 50 of file CSMenu.cpp. References reactOnMessageMenu().
00051 { 00052 reactOnMessageMenu(message); 00053 } |
Here is the call graph for this function:
|
Reimplemented from CSButton. Reimplemented in CSMenuItem. Definition at line 48 of file CSMenu.h. References layoutSetupMenu().
00048 {layoutSetupMenu();} |
Here is the call graph for this function:
|
Definition at line 158 of file CSMenu.cpp. References CSGrafikElement::addElement(), POSITION_ORDER_TOP, CSGrafikElement::setGUIType(), CSGrafikElement::setLayoutData(), CSLayoutData::setStretchedHorizontal(), and CSLayoutData::setStretchedVertical().
00159 { 00160 item->setGUIType("Menu"); 00161 CSLayoutData layoutData(POSITION_ORDER_TOP); 00162 layoutData.setStretchedHorizontal(true); 00163 layoutData.setStretchedVertical(true); 00164 item->setLayoutData(layoutData); 00165 mMenuPanel->addElement(item); 00166 } |
Here is the call graph for this function:
|
Definition at line 168 of file CSMenu.cpp. References CSGrafikElement::removeElement().
00169 { 00170 mMenuPanel->removeElement(item); 00171 } |
Here is the call graph for this function:
|
Here is the call graph for this function:
|
Definition at line 173 of file CSMenu.cpp. References CSGrafikElement::getDesktop(), and CSGrafikElement::removeFrontElement(). Referenced by CSMenuBar::closeLastMenu(), reactOnMessageMenu(), and CSMenuBar::resetMenu().
00174 { 00175 CSDesktop *desktop = getDesktop(); 00176 if (desktop == 0) 00177 { 00178 return; 00179 } 00180 // desktop->removeElement(mMenuPanel); 00181 desktop->removeFrontElement(mMenuPanel); 00182 mMenuIsOpen = false; 00183 } |
Here is the call graph for this function:
|
Definition at line 227 of file CSMenu.cpp. References CSMenuBar::CLASS, CSGrafikElement::getParent(), CSGrafikElement::getType(), LOG_ENTER, LOG_EXIT, mMenuBar, and CSMenuBar::setMenuState(). Referenced by getButtonState(), openMenu(), and reactOnMessageMenu().
00228 { 00229 static char *functionName="setParent"; 00230 LOG_ENTER 00231 if (mMenuBar != 0) 00232 { 00233 return mMenuBar; 00234 } 00235 00236 CSGrafikElement *parent = getParent(); 00237 while (parent != 0) 00238 { 00239 std::string type = parent->getType(); 00240 if (type.compare(CSMenuBar::CLASS) == 0) 00241 { 00242 mMenuBar = (CSMenuBar *) parent; 00243 mMenuBar->setMenuState(mBorderState); 00244 break; 00245 } 00246 parent = parent->getParent(); 00247 } 00248 LOG_EXIT 00249 return mMenuBar; 00250 } |
Here is the call graph for this function:
|
Definition at line 222 of file CSMenu.cpp. References mMenuBar.
00223 { 00224 mMenuBar=bar; 00225 } |
|
Reimplemented from CSButton. Definition at line 148 of file CSMenu.cpp. References getMenuBar(), and CSMenuBar::getMenuState().
00149 { 00150 if (getMenuBar() != 0) 00151 { 00152 return getMenuBar()->getMenuState(this); 00153 } 00154 return mBorderState; 00155 } |
Here is the call graph for this function:
|
Definition at line 34 of file CSMenu.h. Referenced by CSMenu(), getMenuBar(), and setMenuBar(). |
|
static element, name of this class (introsepection)
Reimplemented from CSButton. Reimplemented in CSMenuItem. Definition at line 16 of file CSMenu.cpp. Referenced by CSLAF::getBackgroundColorEnabledInternal(), CSLAF::getBorderInternal(), CSLAF::getHorizontalElementSpacingInternal(), CSLAF::getTextColorDisabledInternal(), CSLAF::getTextColorEnabledInternal(), getType(), and CSLAF::getVerticalElementSpacingInternal(). |