FXToolBarTab.h

Go to the documentation of this file.
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,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: FXToolBarTab.h,v 1.11 2006/01/22 17:58:11 fox Exp $                      *
00023 ********************************************************************************/
00024 #ifndef FXTOOLBARTAB_H
00025 #define FXTOOLBARTAB_H
00026 
00027 #ifndef FXFRAME_H
00028 #include "FXFrame.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00035 enum {
00036   TOOLBARTAB_HORIZONTAL = 0,              
00037   TOOLBARTAB_VERTICAL   = 0x00008000      
00038   };
00039 
00040 
00041 
00048 class FXAPI FXToolBarTab : public FXFrame {
00049   FXDECLARE(FXToolBarTab)
00050 protected:
00051   FXColor  activeColor; // Color when active
00052   FXString tip;         // Tooltip
00053   FXbool   collapsed;   // Is collapsed flat
00054   FXbool   down;        // Button down
00055 protected:
00056   FXToolBarTab();
00057   void drawUpArrow(FXDCWindow& dc);
00058   void drawDownArrow(FXDCWindow& dc);
00059   void drawRightArrow(FXDCWindow& dc);
00060   void drawLeftArrow(FXDCWindow& dc);
00061   void drawHSpeckles(FXDCWindow& dc,FXint x,FXint w);
00062   void drawVSpeckles(FXDCWindow& dc,FXint y,FXint h);
00063 private:
00064   FXToolBarTab(const FXToolBarTab&);
00065   FXToolBarTab& operator=(const FXToolBarTab&);
00066 public:
00067   long onPaint(FXObject*,FXSelector,void*);
00068   long onUpdate(FXObject*,FXSelector,void*);
00069   long onEnter(FXObject*,FXSelector,void*);
00070   long onLeave(FXObject*,FXSelector,void*);
00071   long onUngrabbed(FXObject*,FXSelector,void*);
00072   long onLeftBtnPress(FXObject*,FXSelector,void*);
00073   long onLeftBtnRelease(FXObject*,FXSelector,void*);
00074   long onKeyPress(FXObject*,FXSelector,void*);
00075   long onKeyRelease(FXObject*,FXSelector,void*);
00076   long onCmdCollapse(FXObject*,FXSelector,void*);
00077   long onUpdCollapse(FXObject*,FXSelector,void*);
00078   long onCmdUncollapse(FXObject*,FXSelector,void*);
00079   long onUpdUncollapse(FXObject*,FXSelector,void*);
00080   long onCmdSetTip(FXObject*,FXSelector,void*);
00081   long onCmdGetTip(FXObject*,FXSelector,void*);
00082   long onQueryTip(FXObject*,FXSelector,void*);
00083 public:
00084   enum {
00085     ID_COLLAPSE=FXFrame::ID_LAST,
00086     ID_UNCOLLAPSE,
00087     ID_LAST
00088     };
00089 public:
00090 
00092   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);
00093 
00095   virtual bool canFocus() const;
00096 
00098   virtual FXint getDefaultWidth();
00099 
00101   virtual FXint getDefaultHeight();
00102 
00104   virtual void enable();
00105 
00107   virtual void disable();
00108 
00110   void collapse(FXbool fold,FXbool notify=FALSE);
00111 
00113   FXbool isCollapsed() const { return collapsed; }
00114 
00116   void setTabStyle(FXuint style);
00117 
00119   FXuint getTabStyle() const;
00120 
00122   FXColor getActiveColor() const { return activeColor; }
00123 
00125   void setActiveColor(FXColor clr);
00126 
00128   void setTipText(const FXString& text){ tip=text; }
00129 
00131   const FXString& getTipText() const { return tip; }
00132 
00134   virtual void save(FXStream& store) const;
00135 
00137   virtual void load(FXStream& store);
00138   };
00139 
00140 }
00141 
00142 #endif

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