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

FXToolBarGrip.h

00001 /******************************************************************************** 00002 * * 00003 * T o o l B a r G r i p W i d g e t * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 2000,2005 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: FXToolBarGrip.h,v 1.17 2005/02/04 03:41:00 fox Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXTOOLBARGRIP_H 00025 #define FXTOOLBARGRIP_H 00026 00027 #ifndef FXDOCKHANDLER_H 00028 #include "FXDockHandler.h" 00029 #endif 00030 00031 namespace FX { 00032 00033 00034 /// Tool Bar Grip styles 00035 enum { 00036 TOOLBARGRIP_SINGLE = 0, /// Single bar mode for movable toolbars 00037 TOOLBARGRIP_DOUBLE = 0x00008000 /// Double bar mode for dockable toolbars 00038 }; 00039 00040 00041 /** 00042 * A toolbar grip is used to move its container, a dock bar. 00043 * The grip draws either a single or double bar; it is customary 00044 * to use the single bar grip for toolbar-rearrangements only, 00045 * and use the double-bar when the toolbar needs to be floated 00046 * or docked. 00047 * The toolbar grip is automatically oriented properly by the 00048 * the toolbar widget, similar to the FXSeparator widget. 00049 * Holding the Control Key while dragging the grip will prevent 00050 * the toolbar from docking when it is near a dock site. 00051 */ 00052 class FXAPI FXToolBarGrip : public FXDockHandler { 00053 FXDECLARE(FXToolBarGrip) 00054 protected: 00055 FXColor activeColor; // Color when active 00056 protected: 00057 FXToolBarGrip(); 00058 private: 00059 FXToolBarGrip(const FXToolBarGrip&); 00060 FXToolBarGrip& operator=(const FXToolBarGrip&); 00061 public: 00062 long onPaint(FXObject*,FXSelector,void*); 00063 long onEnter(FXObject*,FXSelector,void*); 00064 long onLeave(FXObject*,FXSelector,void*); 00065 public: 00066 00067 /// Construct toolbar grip 00068 FXToolBarGrip(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=TOOLBARGRIP_SINGLE,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=0,FXint pr=0,FXint pt=0,FXint pb=0); 00069 00070 /// Return default width 00071 virtual FXint getDefaultWidth(); 00072 00073 /// Return default height 00074 virtual FXint getDefaultHeight(); 00075 00076 /// Change toolbar grip to double 00077 void setDoubleBar(FXbool dbl=TRUE); 00078 00079 /// Return TRUE if toolbar grip is displayed as a double bar 00080 FXbool isDoubleBar() const; 00081 00082 /// Set the active color 00083 void setActiveColor(FXColor clr); 00084 00085 /// Get the active color 00086 FXColor getActiveColor() const { return activeColor; } 00087 00088 /// Save to stream 00089 virtual void save(FXStream& store) const; 00090 00091 /// Load from stream 00092 virtual void load(FXStream& store); 00093 }; 00094 00095 } 00096 00097 #endif

Copyright © 1997-2005 Jeroen van der Zijp