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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXToolBarTab.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                       T o o l   B a r   T a b   W i d g e t                   *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1999,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 FXTOOLBARTAB_H
00022 #define FXTOOLBARTAB_H
00023 
00024 #ifndef FXFRAME_H
00025 #include "FXFrame.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00032 enum {
00033   TOOLBARTAB_HORIZONTAL = 0,              
00034   TOOLBARTAB_VERTICAL   = 0x00008000      
00035   };
00036 
00037 
00038 
00045 class FXAPI FXToolBarTab : public FXFrame {
00046   FXDECLARE(FXToolBarTab)
00047 protected:
00048   FXColor  activeColor; // Color when active
00049   FXString tip;         // Tooltip
00050   FXbool   collapsed;   // Is collapsed flat
00051   FXbool   down;        // Button down
00052 protected:
00053   FXToolBarTab();
00054   void drawUpArrow(FXDCWindow& dc);
00055   void drawDownArrow(FXDCWindow& dc);
00056   void drawRightArrow(FXDCWindow& dc);
00057   void drawLeftArrow(FXDCWindow& dc);
00058   void drawHSpeckles(FXDCWindow& dc,FXint x,FXint w);
00059   void drawVSpeckles(FXDCWindow& dc,FXint y,FXint h);
00060 private:
00061   FXToolBarTab(const FXToolBarTab&);
00062   FXToolBarTab& operator=(const FXToolBarTab&);
00063 public:
00064   long onPaint(FXObject*,FXSelector,void*);
00065   long onUpdate(FXObject*,FXSelector,void*);
00066   long onEnter(FXObject*,FXSelector,void*);
00067   long onLeave(FXObject*,FXSelector,void*);
00068   long onUngrabbed(FXObject*,FXSelector,void*);
00069   long onLeftBtnPress(FXObject*,FXSelector,void*);
00070   long onLeftBtnRelease(FXObject*,FXSelector,void*);
00071   long onKeyPress(FXObject*,FXSelector,void*);
00072   long onKeyRelease(FXObject*,FXSelector,void*);
00073   long onCmdCollapse(FXObject*,FXSelector,void*);
00074   long onUpdCollapse(FXObject*,FXSelector,void*);
00075   long onCmdUncollapse(FXObject*,FXSelector,void*);
00076   long onUpdUncollapse(FXObject*,FXSelector,void*);
00077   long onCmdSetTip(FXObject*,FXSelector,void*);
00078   long onCmdGetTip(FXObject*,FXSelector,void*);
00079   long onQueryTip(FXObject*,FXSelector,void*);
00080 public:
00081   enum {
00082     ID_COLLAPSE=FXFrame::ID_LAST,
00083     ID_UNCOLLAPSE,
00084     ID_LAST
00085     };
00086 public:
00087 
00089   FXToolBarTab(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_RAISED,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00090 
00092   virtual FXbool canFocus() const;
00093 
00095   virtual FXint getDefaultWidth();
00096 
00098   virtual FXint getDefaultHeight();
00099 
00101   virtual void enable();
00102 
00104   virtual void disable();
00105 
00107   void collapse(FXbool fold,FXbool notify=false);
00108 
00110   FXbool isCollapsed() const { return collapsed; }
00111 
00113   void setTabStyle(FXuint style);
00114 
00116   FXuint getTabStyle() const;
00117 
00119   FXColor getActiveColor() const { return activeColor; }
00120 
00122   void setActiveColor(FXColor clr);
00123 
00125   void setTipText(const FXString& text){ tip=text; }
00126 
00128   const FXString& getTipText() const { return tip; }
00129 
00131   virtual void save(FXStream& store) const;
00132 
00134   virtual void load(FXStream& store);
00135   };
00136 
00137 }
00138 
00139 #endif

Copyright © 1997-2011 Jeroen van der Zijp