Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXMenuTitle.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                      M e n u   T i t l e   W i d g e t                        *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1997,2010 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 #ifndef FXMENUTITLE_H
00022 #define FXMENUTITLE_H
00023 
00024 #ifndef FXMENUCAPTION_H
00025 #include "FXMenuCaption.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00031 class FXPopup;
00032 
00033 
00034 /**
00035 * A menu title is a child of a menu bar which is responsible
00036 * for popping up a pulldown menu.
00037 */
00038 class FXAPI FXMenuTitle : public FXMenuCaption {
00039   FXDECLARE(FXMenuTitle)
00040 protected:
00041   FXPopup *pane;        // Pane to pop up
00042 protected:
00043   FXMenuTitle(){}
00044 private:
00045   FXMenuTitle(const FXMenuTitle&);
00046   FXMenuTitle &operator=(const FXMenuTitle&);
00047 public:
00048   long onPaint(FXObject*,FXSelector,void*);
00049   long onEnter(FXObject*,FXSelector,void*);
00050   long onLeave(FXObject*,FXSelector,void*);
00051   long onLeftBtnPress(FXObject*,FXSelector,void*);
00052   long onLeftBtnRelease(FXObject*,FXSelector,void*);
00053   long onKeyPress(FXObject*,FXSelector,void*);
00054   long onKeyRelease(FXObject*,FXSelector,void*);
00055   long onHotKeyPress(FXObject*,FXSelector,void*);
00056   long onHotKeyRelease(FXObject*,FXSelector,void*);
00057   long onFocusUp(FXObject*,FXSelector,void*);
00058   long onFocusDown(FXObject*,FXSelector,void*);
00059   long onFocusIn(FXObject*,FXSelector,void*);
00060   long onFocusOut(FXObject*,FXSelector,void*);
00061   long onCmdPost(FXObject*,FXSelector,void*);
00062   long onCmdUnpost(FXObject*,FXSelector,void*);
00063 public:
00064 
00065   /// Constructor
00066   FXMenuTitle(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXPopup* pup=NULL,FXuint opts=0);
00067 
00068   /// Create server-side resources
00069   virtual void create();
00070 
00071   /// Detach server-side resources
00072   virtual void detach();
00073 
00074   /// Return default width
00075   virtual FXint getDefaultWidth();
00076 
00077   /// Return default height
00078   virtual FXint getDefaultHeight();
00079 
00080   /// Yes it can receive the focus
00081   virtual FXbool canFocus() const;
00082 
00083   /// Move the focus to this window
00084   virtual void setFocus();
00085 
00086   /// Remove the focus from this window
00087   virtual void killFocus();
00088 
00089   /// Set popup menu to pop up
00090   void setMenu(FXPopup *menu);
00091 
00092   /// Return popup menu
00093   FXPopup* getMenu() const { return pane; }
00094 
00095   /// True if this menu or is popup logically contains the mouse
00096   virtual FXbool contains(FXint parentx,FXint parenty) const;
00097 
00098   /// Save menu to a stream
00099   virtual void save(FXStream& store) const;
00100 
00101   /// Load menu from a stream
00102   virtual void load(FXStream& store);
00103 
00104   /// Destructor
00105   virtual ~FXMenuTitle();
00106   };
00107 
00108 }
00109 
00110 #endif

Copyright © 1997-2010 Jeroen van der Zijp