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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXMenuCommand.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                       M e n u C o m m a n d   W i d g e t                     *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1997,2012 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 FXMENUCOMMAND_H
00022 #define FXMENUCOMMAND_H
00023 
00024 #ifndef FXMENUCAPTION_H
00025 #include "FXMenuCaption.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00044 class FXAPI FXMenuCommand : public FXMenuCaption {
00045   FXDECLARE(FXMenuCommand)
00046 protected:
00047   FXString     accel;       // Accelerator string
00048   FXHotKey     acckey;      // Accelerator key
00049 protected:
00050   FXMenuCommand();
00051 private:
00052   FXMenuCommand(const FXMenuCommand&);
00053   FXMenuCommand &operator=(const FXMenuCommand&);
00054 public:
00055   long onPaint(FXObject*,FXSelector,void*);
00056   long onEnter(FXObject*,FXSelector,void*);
00057   long onLeave(FXObject*,FXSelector,void*);
00058   long onButtonPress(FXObject*,FXSelector,void*);
00059   long onButtonRelease(FXObject*,FXSelector,void*);
00060   long onKeyPress(FXObject*,FXSelector,void*);
00061   long onKeyRelease(FXObject*,FXSelector,void*);
00062   long onHotKeyPress(FXObject*,FXSelector,void*);
00063   long onHotKeyRelease(FXObject*,FXSelector,void*);
00064   long onCmdAccel(FXObject*,FXSelector,void*);
00065 public:
00066 
00068   FXMenuCommand(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0);
00069 
00071   virtual FXint getDefaultWidth();
00072 
00074   virtual FXint getDefaultHeight();
00075 
00077   virtual FXbool canFocus() const;
00078 
00080   virtual void setFocus();
00081 
00083   virtual void killFocus();
00084 
00086   void setAccelText(const FXString& text,FXbool acc=false);
00087 
00089   FXString getAccelText() const { return accel; }
00090 
00092   virtual void save(FXStream& store) const;
00093 
00095   virtual void load(FXStream& store);
00096 
00098   virtual ~FXMenuCommand();
00099   };
00100 
00101 }
00102 
00103 #endif

Copyright © 1997-2011 Jeroen van der Zijp