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

FXToolBarShell.h
1 /********************************************************************************
2 * *
3 * T o o l B a r S h e l l W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2000,2022 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (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 *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXTOOLBARSHELL_H
22 #define FXTOOLBARSHELL_H
23 
24 #ifndef FXTOPWINDOW_H
25 #include "FXTopWindow.h"
26 #endif
27 
28 namespace FX {
29 
30 
44 class FXAPI FXToolBarShell : public FXTopWindow {
45  FXDECLARE(FXToolBarShell)
46 protected:
47  FXColor baseColor; // Base color
48  FXColor hiliteColor; // Highlight color
49  FXColor shadowColor; // Shadow color
50  FXColor borderColor; // Border color
51  FXint border; // Border width
52  FXint gripx; // Grip offset x
53  FXint gripy; // Grip offset y
54  FXint xopp; // Opposite x
55  FXint yopp; // Opposite y
56  FXuchar mode; // Dragging mode
57 protected:
58  static const FXDefaultCursor cursorType[16];
59 private:
61  FXToolBarShell &operator=(const FXToolBarShell&);
62 protected:
64  FXuchar where(FXint x,FXint y) const;
65  void drawBorderRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
66  void drawRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
67  void drawSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
68  void drawRidgeRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
69  void drawGrooveRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
70  void drawDoubleRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
71  void drawDoubleSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
72  void drawFrame(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
73 protected:
74  enum {
75  DRAG_NONE = 0,
76  DRAG_TOP = 1,
77  DRAG_BOTTOM = 2,
78  DRAG_LEFT = 4,
79  DRAG_RIGHT = 8,
80  DRAG_TOPLEFT = (DRAG_TOP|DRAG_LEFT),
81  DRAG_TOPRIGHT = (DRAG_TOP|DRAG_RIGHT),
82  DRAG_BOTTOMLEFT = (DRAG_BOTTOM|DRAG_LEFT),
83  DRAG_BOTTOMRIGHT = (DRAG_BOTTOM|DRAG_RIGHT),
84  DRAG_WHOLE = (DRAG_TOP|DRAG_BOTTOM|DRAG_LEFT|DRAG_RIGHT)
85  };
86 public:
87  long onPaint(FXObject*,FXSelector,void*);
88  long onEnter(FXObject*,FXSelector,void*);
89  long onLeave(FXObject*,FXSelector,void*);
90  long onMotion(FXObject*,FXSelector,void*);
91  long onLeftBtnPress(FXObject*,FXSelector,void*);
92  long onLeftBtnRelease(FXObject*,FXSelector,void*);
93  long onLayout(FXObject*,FXSelector,void*);
94 public:
95 
97  FXToolBarShell(FXWindow* owner,FXuint opts=FRAME_RAISED|FRAME_THICK,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint hs=4,FXint vs=4);
98 
100  virtual void create();
101 
103  virtual void layout();
104 
106  virtual FXint getDefaultWidth();
107 
109  virtual FXint getDefaultHeight();
110 
112  void setFrameStyle(FXuint style);
113 
115  FXuint getFrameStyle() const;
116 
118  FXint getBorderWidth() const { return border; }
119 
121  void setHiliteColor(FXColor clr);
122 
124  FXColor getHiliteColor() const { return hiliteColor; }
125 
127  void setShadowColor(FXColor clr);
128 
130  FXColor getShadowColor() const { return shadowColor; }
131 
133  void setBorderColor(FXColor clr);
134 
136  FXColor getBorderColor() const { return borderColor; }
137 
139  void setBaseColor(FXColor clr);
140 
142  FXColor getBaseColor() const { return baseColor; }
143 
145  virtual void save(FXStream& store) const;
146 
148  virtual void load(FXStream& store);
149  };
150 
151 }
152 
153 #endif
Window is the base class for all widgets in FOX.
Definition: FXWindow.h:130
FXColor getBaseColor() const
Get base gui color.
Definition: FXToolBarShell.h:142
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
Definition: FX4Splitter.h:28
FXColor getBorderColor() const
Get border color.
Definition: FXToolBarShell.h:136
Abstract base class for all top-level windows.
Definition: FXTopWindow.h:97
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:134
Window Device Context.
Definition: FXDCWindow.h:48
FXColor getHiliteColor() const
Get highlight color.
Definition: FXToolBarShell.h:124
A Toolbar shell is a widget floating around over the Main Window.
Definition: FXToolBarShell.h:44
FXColor getShadowColor() const
Get shadow color.
Definition: FXToolBarShell.h:130
FXint getBorderWidth() const
Get border width.
Definition: FXToolBarShell.h:118

Copyright © 1997-2022 Jeroen van der Zijp