FXMenuCaption.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                         M e n u C a p t i o n   W i d g e t                   *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1997,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (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 GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXMenuCaption.h,v 1.33 2006/01/22 17:58:06 fox Exp $                     *
00023 ********************************************************************************/
00024 #ifndef FX_DISABLEMENUS
00025 
00026 #ifndef FXMENUCAPTION_H
00027 #define FXMENUCAPTION_H
00028 
00029 #ifndef FXWINDOW_H
00030 #include "FXWindow.h"
00031 #endif
00032 
00033 namespace FX {
00034 
00035 
00037 enum {
00038   MENU_AUTOGRAY = 0x00008000,   
00039   MENU_AUTOHIDE = 0x00010000    
00040   };
00041 
00042 
00043 class FXIcon;
00044 class FXFont;
00045 
00046 
00051 class FXAPI FXMenuCaption : public FXWindow {
00052   FXDECLARE(FXMenuCaption)
00053 protected:
00054   FXString     label;
00055   FXString     help;
00056   FXString     tip;
00057   FXIcon      *icon;
00058   FXFont      *font;
00059   FXint        hotoff;
00060   FXHotKey     hotkey;
00061   FXColor      textColor;
00062   FXColor      selbackColor;
00063   FXColor      seltextColor;
00064   FXColor      hiliteColor;
00065   FXColor      shadowColor;
00066 protected:
00067   FXMenuCaption();
00068 private:
00069   FXMenuCaption(const FXMenuCaption&);
00070   FXMenuCaption &operator=(const FXMenuCaption&);
00071 public:
00072   long onPaint(FXObject*,FXSelector,void*);
00073   long onUpdate(FXObject*,FXSelector,void*);
00074   long onCmdGetStringValue(FXObject*,FXSelector,void*);
00075   long onCmdSetStringValue(FXObject*,FXSelector,void*);
00076   long onCmdSetIconValue(FXObject*,FXSelector,void*);
00077   long onCmdGetIconValue(FXObject*,FXSelector,void*);
00078   long onCmdSetHelp(FXObject*,FXSelector,void*);
00079   long onCmdGetHelp(FXObject*,FXSelector,void*);
00080   long onCmdSetTip(FXObject*,FXSelector,void*);
00081   long onCmdGetTip(FXObject*,FXSelector,void*);
00082   long onQueryHelp(FXObject*,FXSelector,void*);
00083   long onQueryTip(FXObject*,FXSelector,void*);
00084 public:
00085 
00087   FXMenuCaption(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXuint opts=0);
00088 
00090   virtual void create();
00091 
00093   virtual void detach();
00094 
00096   virtual void enable();
00097 
00099   virtual void disable();
00100 
00102   virtual FXint getDefaultWidth();
00103 
00105   virtual FXint getDefaultHeight();
00106 
00108   void setText(const FXString& text);
00109 
00111   FXString getText() const { return label; }
00112 
00114   void setIcon(FXIcon* ic);
00115 
00117   FXIcon* getIcon() const { return icon; }
00118 
00120   void setFont(FXFont* fnt);
00121 
00123   FXFont* getFont() const { return font; }
00124 
00126   void setMenuStyle(FXuint style);
00127 
00129   FXuint getMenuStyle() const;
00130 
00132   void setTextColor(FXColor clr);
00133 
00135   FXColor getTextColor() const { return textColor; }
00136 
00138   void setSelBackColor(FXColor clr);
00139 
00141   FXColor getSelBackColor() const { return selbackColor; }
00142 
00144   void setSelTextColor(FXColor clr);
00145 
00147   FXColor getSelTextColor() const { return seltextColor; }
00148 
00150   void setHiliteColor(FXColor clr);
00151 
00153   FXColor getHiliteColor() const { return hiliteColor; }
00154 
00156   void setShadowColor(FXColor clr);
00157 
00159   FXColor getShadowColor() const { return shadowColor; }
00160 
00162   void setHelpText(const FXString& text);
00163 
00165   const FXString& getHelpText() const { return help; }
00166 
00168   void setTipText(const FXString& text){ tip=text; }
00169 
00171   const FXString& getTipText() const { return tip; }
00172 
00174   virtual void save(FXStream& store) const;
00175 
00177   virtual void load(FXStream& store);
00178 
00180   virtual ~FXMenuCaption();
00181   };
00182 
00183 }
00184 
00185 #endif
00186 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:23 2009 for TnFOX by doxygen v1.4.7