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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXArrowButton.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                     A r r o w   B u t t o n   W i d g e t                     *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1998,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 FXARROWBUTTON_H
00022 #define FXARROWBUTTON_H
00023 
00024 #ifndef FXFRAME_H
00025 #include "FXFrame.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00031 // Arrow style options
00032 enum {
00033   ARROW_NONE     = 0,   // No arrow
00034   ARROW_UP       = 0x00080000,  // Arrow points up
00035   ARROW_DOWN     = 0x00100000,  // Arrow points down
00036   ARROW_LEFT     = 0x00200000,  // Arrow points left
00037   ARROW_RIGHT    = 0x00400000,  // Arrow points right
00038   ARROW_AUTO     = 0x00800000,  // Automatically fire when hovering mouse over button
00039   ARROW_REPEAT   = 0x01000000,  // Button repeats if held down
00040   ARROW_AUTOGRAY = 0x02000000,  // Automatically gray out when not updated
00041   ARROW_AUTOHIDE = 0x04000000,  // Automatically hide when not updated
00042   ARROW_TOOLBAR  = 0x08000000,  // Button is toolbar-style
00043   ARROW_NORMAL   = FRAME_RAISED|FRAME_THICK|ARROW_UP
00044   };
00045 
00046 
00055 class FXAPI FXArrowButton : public FXFrame {
00056   FXDECLARE(FXArrowButton)
00057 protected:
00058   FXColor   arrowColor;     // Arrow color
00059   FXint     arrowSize;      // Arrow size
00060   FXString  tip;            // Tooltip value
00061   FXString  help;           // Help value
00062   FXbool    state;          // State of button
00063   FXbool    fired;          // Timer has fired
00064 protected:
00065   FXArrowButton();
00066 private:
00067   FXArrowButton(const FXArrowButton&);
00068   FXArrowButton &operator=(const FXArrowButton&);
00069 public:
00070   long onPaint(FXObject*,FXSelector,void*);
00071   long onUpdate(FXObject*,FXSelector,void*);
00072   long onEnter(FXObject*,FXSelector,void*);
00073   long onLeave(FXObject*,FXSelector,void*);
00074   long onLeftBtnPress(FXObject*,FXSelector,void*);
00075   long onLeftBtnRelease(FXObject*,FXSelector,void*);
00076   long onUngrabbed(FXObject*,FXSelector,void*);
00077   long onRepeat(FXObject*,FXSelector,void*);
00078   long onAuto(FXObject*,FXSelector,void*);
00079   long onKeyPress(FXObject*,FXSelector,void*);
00080   long onKeyRelease(FXObject*,FXSelector,void*);
00081   long onHotKeyPress(FXObject*,FXSelector,void*);
00082   long onHotKeyRelease(FXObject*,FXSelector,void*);
00083   long onCmdSetHelp(FXObject*,FXSelector,void*);
00084   long onCmdGetHelp(FXObject*,FXSelector,void*);
00085   long onCmdSetTip(FXObject*,FXSelector,void*);
00086   long onCmdGetTip(FXObject*,FXSelector,void*);
00087   long onQueryHelp(FXObject*,FXSelector,void*);
00088   long onQueryTip(FXObject*,FXSelector,void*);
00089 public:
00090   enum {
00091     ID_REPEAT=FXFrame::ID_LAST,
00092     ID_AUTO,
00093     ID_LAST
00094     };
00095 public:
00096 
00098   FXArrowButton(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=ARROW_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
00099 
00101   virtual FXint getDefaultWidth();
00102 
00104   virtual FXint getDefaultHeight();
00105 
00107   virtual void enable();
00108 
00110   virtual void disable();
00111 
00113   virtual FXbool canFocus() const;
00114 
00116   void setState(FXbool s);
00117 
00119   FXbool getState() const { return state; }
00120 
00122   void setHelpText(const FXString& text){ help=text; }
00123 
00125   const FXString& getHelpText() const { return help; }
00126 
00128   void setTipText(const FXString& text){ tip=text; }
00129 
00131   const FXString& getTipText() const { return tip; }
00132 
00134   void setArrowStyle(FXuint style);
00135 
00137   FXuint getArrowStyle() const;
00138 
00140   void setArrowSize(FXint size);
00141 
00143   FXint getArrowSize() const { return arrowSize; }
00144 
00146   void setJustify(FXuint mode);
00147 
00149   FXuint getJustify() const;
00150 
00152   FXColor getArrowColor() const { return arrowColor; }
00153 
00155   void setArrowColor(FXColor clr);
00156 
00158   virtual void save(FXStream& store) const;
00159 
00161   virtual void load(FXStream& store);
00162 
00164   virtual ~FXArrowButton();
00165   };
00166 
00167 }
00168 
00169 #endif

Copyright © 1997-2011 Jeroen van der Zijp