![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
00001 /******************************************************************************** 00002 * * 00003 * M e n u T i t l e W i d g e t * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 1997,2009 by Jeroen van der Zijp. All Rights Reserved. * 00007 ********************************************************************************* 00008 * This library is free software; you can redistribute it and/or modify * 00009 * it under the terms of the GNU Lesser General Public License as published by * 00010 * the Free Software Foundation; either version 3 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00016 * GNU Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public License * 00019 * along with this program. If not, see <http://www.gnu.org/licenses/> * 00020 ********************************************************************************* 00021 * $Id: FXMenuTitle.h,v 1.27 2009/01/06 13:07:26 fox Exp $ * 00022 ********************************************************************************/ 00023 #ifndef FXMENUTITLE_H 00024 #define FXMENUTITLE_H 00025 00026 #ifndef FXMENUCAPTION_H 00027 #include "FXMenuCaption.h" 00028 #endif 00029 00030 namespace FX { 00031 00032 00033 class FXPopup; 00034 00035 00036 /** 00037 * A menu title is a child of a menu bar which is responsible 00038 * for popping up a pulldown menu. 00039 */ 00040 class FXAPI FXMenuTitle : public FXMenuCaption { 00041 FXDECLARE(FXMenuTitle) 00042 protected: 00043 FXPopup *pane; // Pane to pop up 00044 protected: 00045 FXMenuTitle(){} 00046 private: 00047 FXMenuTitle(const FXMenuTitle&); 00048 FXMenuTitle &operator=(const FXMenuTitle&); 00049 public: 00050 long onPaint(FXObject*,FXSelector,void*); 00051 long onEnter(FXObject*,FXSelector,void*); 00052 long onLeave(FXObject*,FXSelector,void*); 00053 long onLeftBtnPress(FXObject*,FXSelector,void*); 00054 long onLeftBtnRelease(FXObject*,FXSelector,void*); 00055 long onKeyPress(FXObject*,FXSelector,void*); 00056 long onKeyRelease(FXObject*,FXSelector,void*); 00057 long onHotKeyPress(FXObject*,FXSelector,void*); 00058 long onHotKeyRelease(FXObject*,FXSelector,void*); 00059 long onFocusUp(FXObject*,FXSelector,void*); 00060 long onFocusDown(FXObject*,FXSelector,void*); 00061 long onFocusIn(FXObject*,FXSelector,void*); 00062 long onFocusOut(FXObject*,FXSelector,void*); 00063 long onCmdPost(FXObject*,FXSelector,void*); 00064 long onCmdUnpost(FXObject*,FXSelector,void*); 00065 public: 00066 00067 /// Constructor 00068 FXMenuTitle(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXPopup* pup=NULL,FXuint opts=0); 00069 00070 /// Create server-side resources 00071 virtual void create(); 00072 00073 /// Detach server-side resources 00074 virtual void detach(); 00075 00076 /// Return default width 00077 virtual FXint getDefaultWidth(); 00078 00079 /// Return default height 00080 virtual FXint getDefaultHeight(); 00081 00082 /// Yes it can receive the focus 00083 virtual FXbool canFocus() const; 00084 00085 /// Move the focus to this window 00086 virtual void setFocus(); 00087 00088 /// Remove the focus from this window 00089 virtual void killFocus(); 00090 00091 /// Set popup menu to pop up 00092 void setMenu(FXPopup *menu); 00093 00094 /// Return popup menu 00095 FXPopup* getMenu() const { return pane; } 00096 00097 /// True if this menu or is popup logically contains the mouse 00098 virtual FXbool contains(FXint parentx,FXint parenty) const; 00099 00100 /// Save menu to a stream 00101 virtual void save(FXStream& store) const; 00102 00103 /// Load menu from a stream 00104 virtual void load(FXStream& store); 00105 00106 /// Destructor 00107 virtual ~FXMenuTitle(); 00108 }; 00109 00110 } 00111 00112 #endif
![]() |