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

FXToolBarGrip.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * T o o l B a r G r i p W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
21 *********************************************************************************
22 * $Id: FXToolBarGrip.h,v 1.20 2006/01/22 17:58:11 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXTOOLBARGRIP_H
25 #define FXTOOLBARGRIP_H
26 
27 #ifndef FXDOCKHANDLER_H
28 #include "FXDockHandler.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 /// Tool Bar Grip styles
35 enum {
36  TOOLBARGRIP_SINGLE = 0, /// Single bar mode for movable toolbars
37  TOOLBARGRIP_DOUBLE = 0x00008000 /// Double bar mode for dockable toolbars
38  };
39 
40 
41 /**
42 * A toolbar grip is used to move its container, a dock bar.
43 * The grip draws either a single or double bar; it is customary
44 * to use the single bar grip for toolbar-rearrangements only,
45 * and use the double-bar when the toolbar needs to be floated
46 * or docked.
47 * The toolbar grip is automatically oriented properly by the
48 * the toolbar widget, similar to the FXSeparator widget.
49 * Holding the Control Key while dragging the grip will prevent
50 * the toolbar from docking when it is near a dock site.
51 */
52 class FXAPI FXToolBarGrip : public FXDockHandler {
54 protected:
55  FXColor activeColor; // Color when active
56 protected:
57  FXToolBarGrip();
58 private:
60  FXToolBarGrip& operator=(const FXToolBarGrip&);
61 public:
62  long onPaint(FXObject*,FXSelector,void*);
63  long onEnter(FXObject*,FXSelector,void*);
64  long onLeave(FXObject*,FXSelector,void*);
65 public:
66 
67  /// Construct toolbar grip
68  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);
69 
70  /// Return default width
71  virtual FXint getDefaultWidth();
72 
73  /// Return default height
74  virtual FXint getDefaultHeight();
75 
76  /// The grip can not receive the focus
77  virtual bool canFocus() const;
78 
79  /// Change toolbar grip to double
80  void setDoubleBar(FXbool dbl=TRUE);
81 
82  /// Return TRUE if toolbar grip is displayed as a double bar
83  FXbool isDoubleBar() const;
84 
85  /// Set the active color
86  void setActiveColor(FXColor clr);
87 
88  /// Get the active color
89  FXColor getActiveColor() const { return activeColor; }
90 
91  /// Save to stream
92  virtual void save(FXStream& store) const;
93 
94  /// Load from stream
95  virtual void load(FXStream& store);
96  };
97 
98 }
99 
100 #endif
Single bar mode for movable toolbars.
Definition: FXToolBarGrip.h:39
A toolbar grip is used to move its container, a dock bar.
Definition: FXToolBarGrip.h:59
#define TRUE
Definition: fxdefs.h:32
unsigned int FXuint
Definition: fxdefs.h:396
FXuint FXSelector
Association key.
Definition: FXObject.h:53
#define FXAPI
Definition: fxdefs.h:122
FXuchar FXbool
Definition: fxdefs.h:393
Base composite.
Definition: FXComposite.h:35
#define NULL
Definition: fxdefs.h:41
FXuint FXColor
Definition: fxdefs.h:454
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:99
int FXint
Definition: fxdefs.h:397
Double bar mode for dockable toolbars.
Definition: FXToolBarGrip.h:40
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:166
FXColor getActiveColor() const
Get the active color.
Definition: FXToolBarGrip.h:89
#define FXDECLARE(classname)
Macro to set up class declaration.
Definition: FXObject.h:92
The dock handler exists as a common base class for tool bar grip and dock title.
Definition: FXDockHandler.h:38

Copyright © 1997-2005 Jeroen van der Zijp