![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
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,2002 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.16 2002/01/18 22:42:55 jeroen Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXTOOLBARGRIP_H 00025 #define FXTOOLBARGRIP_H 00026 00027 #ifndef FXWINDOW_H 00028 #include "FXWindow.h" 00029 #endif 00030 00031 00032 00033 /// Toolbar Grip styles 00034 enum { 00035 TOOLBARGRIP_SINGLE = 0, /// Single bar mode for movable toolbars 00036 TOOLBARGRIP_DOUBLE = 0x00008000, /// Double bar mode for dockable toolbars 00037 TOOLBARGRIP_SEPARATOR = 0x00010000 /// Separator mode 00038 }; 00039 00040 class FXToolbar; 00041 00042 00043 /** 00044 * A toolbar grip is used to move its parent [an FXToolbar]. 00045 * The grip draws either a single or double bar; it is customary 00046 * to use the single bar grip for toolbar-rearrangements only, 00047 * and use the double-bar when the toolbar needs to be floated 00048 * or docked. 00049 * The toolbar grip is automatically oriented properly by the 00050 * the toolbar widget. 00051 */ 00052 class FXAPI FXToolbarGrip : public FXWindow { 00053 FXDECLARE(FXToolbarGrip) 00054 protected: 00055 FXColor activeColor; // Color when active 00056 FXColor hiliteColor; // Highlight color 00057 FXColor shadowColor; // Shadow color 00058 protected: 00059 FXToolbarGrip(); 00060 private: 00061 FXToolbarGrip(const FXToolbarGrip&); 00062 FXToolbarGrip& operator=(const FXToolbarGrip&); 00063 public: 00064 long onPaint(FXObject*,FXSelector,void*); 00065 long onLeftBtnPress(FXObject*,FXSelector,void*); 00066 long onLeftBtnRelease(FXObject*,FXSelector,void*); 00067 long onMotion(FXObject*,FXSelector,void*); 00068 long onEnter(FXObject*,FXSelector,void*); 00069 long onLeave(FXObject*,FXSelector,void*); 00070 public: 00071 00072 /// Construct toolbar grip 00073 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); 00074 00075 /// Return default width 00076 virtual FXint getDefaultWidth(); 00077 00078 /// Return default height 00079 virtual FXint getDefaultHeight(); 00080 00081 /// Change toolbar grip to double 00082 void setDoubleBar(FXbool dbl=TRUE); 00083 00084 /// Return toolbar grip to double 00085 FXuint getDoubleBar() const; 00086 00087 /// Change highlight color 00088 void setHiliteColor(FXColor clr); 00089 00090 /// Get highlight color 00091 FXColor getHiliteColor() const { return hiliteColor; } 00092 00093 /// Change shadow color 00094 void setShadowColor(FXColor clr); 00095 00096 /// Get shadow color 00097 FXColor getShadowColor() const { return shadowColor; } 00098 00099 /// Set the active color 00100 void setActiveColor(FXColor clr); 00101 00102 /// Get the active color 00103 FXColor getActiveColor() const { return activeColor; } 00104 00105 /// Save to stream 00106 virtual void save(FXStream& store) const; 00107 00108 /// Load from stream 00109 virtual void load(FXStream& store); 00110 }; 00111 00112 00113 #endif