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,2004 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.7 2004/02/08 17:17:34 fox Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXTOOLBARGRIP_H 00025 #define FXTOOLBARGRIP_H 00026 00027 #ifndef FXWINDOW_H 00028 #include "FXWindow.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 TOOLBARGRIP_SEPARATOR = 0x00010000 /// Separator mode 00039 }; 00040 00041 class FXToolBar; 00042 00043 00044 /** 00045 * A toolbar grip is used to move its parent [an FXToolBar]. 00046 * The grip draws either a single or double bar; it is customary 00047 * to use the single bar grip for toolbar-rearrangements only, 00048 * and use the double-bar when the toolbar needs to be floated 00049 * or docked. 00050 * The toolbar grip is automatically oriented properly by the 00051 * the toolbar widget. 00052 */ 00053 class FXAPI FXToolBarGrip : public FXWindow { 00054 FXDECLARE(FXToolBarGrip) 00055 protected: 00056 FXColor activeColor; // Color when active 00057 FXColor hiliteColor; // Highlight color 00058 FXColor shadowColor; // Shadow color 00059 protected: 00060 FXToolBarGrip(); 00061 private: 00062 FXToolBarGrip(const FXToolBarGrip&); 00063 FXToolBarGrip& operator=(const FXToolBarGrip&); 00064 public: 00065 long onPaint(FXObject*,FXSelector,void*); 00066 long onLeftBtnPress(FXObject*,FXSelector,void*); 00067 long onLeftBtnRelease(FXObject*,FXSelector,void*); 00068 long onMotion(FXObject*,FXSelector,void*); 00069 long onEnter(FXObject*,FXSelector,void*); 00070 long onLeave(FXObject*,FXSelector,void*); 00071 public: 00072 00073 /// Construct toolbar grip 00074 FXToolBarGrip(FXToolBar* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=TOOLBARGRIP_SINGLE,FXint x=0,FXint y=0,FXint w=0,FXint h=0); 00075 00076 /// Return default width 00077 virtual FXint getDefaultWidth(); 00078 00079 /// Return default height 00080 virtual FXint getDefaultHeight(); 00081 00082 /// Change toolbar grip to double 00083 void setDoubleBar(FXbool dbl=TRUE); 00084 00085 /// Return TRUE if toolbar grip is displayed as a double bar 00086 FXbool isDoubleBar() const; 00087 00088 /// Change highlight color 00089 void setHiliteColor(FXColor clr); 00090 00091 /// Get highlight color 00092 FXColor getHiliteColor() const { return hiliteColor; } 00093 00094 /// Change shadow color 00095 void setShadowColor(FXColor clr); 00096 00097 /// Get shadow color 00098 FXColor getShadowColor() const { return shadowColor; } 00099 00100 /// Set the active color 00101 void setActiveColor(FXColor clr); 00102 00103 /// Get the active color 00104 FXColor getActiveColor() const { return activeColor; } 00105 00106 /// Save to stream 00107 virtual void save(FXStream& store) const; 00108 00109 /// Load from stream 00110 virtual void load(FXStream& store); 00111 }; 00112 00113 } 00114 00115 #endif

Copyright © 1997-2004 Jeroen van der Zijp