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

FXToolBarTab.h
1 /********************************************************************************
2 * *
3 * T o o l B a r T a b W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1999,2017 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 FXTOOLBARTAB_H
22 #define FXTOOLBARTAB_H
23 
24 #ifndef FXFRAME_H
25 #include "FXFrame.h"
26 #endif
27 
28 namespace FX {
29 
30 
32 enum {
33  TOOLBARTAB_HORIZONTAL = 0,
34  TOOLBARTAB_VERTICAL = 0x00008000
35  };
36 
37 
38 
45 class FXAPI FXToolBarTab : public FXFrame {
46  FXDECLARE(FXToolBarTab)
47 protected:
48  FXColor activeColor; // Color when active
49  FXString tip; // Tooltip
50  FXbool collapsed; // Is collapsed flat
51  FXbool down; // Button down
52 protected:
53  FXToolBarTab();
54  void drawUpArrow(FXDCWindow& dc);
55  void drawDownArrow(FXDCWindow& dc);
56  void drawRightArrow(FXDCWindow& dc);
57  void drawLeftArrow(FXDCWindow& dc);
58  void drawHSpeckles(FXDCWindow& dc,FXint x,FXint w);
59  void drawVSpeckles(FXDCWindow& dc,FXint y,FXint h);
60 private:
61  FXToolBarTab(const FXToolBarTab&);
62  FXToolBarTab& operator=(const FXToolBarTab&);
63 public:
64  long onPaint(FXObject*,FXSelector,void*);
65  long onUpdate(FXObject*,FXSelector,void*);
66  long onEnter(FXObject*,FXSelector,void*);
67  long onLeave(FXObject*,FXSelector,void*);
68  long onUngrabbed(FXObject*,FXSelector,void*);
69  long onLeftBtnPress(FXObject*,FXSelector,void*);
70  long onLeftBtnRelease(FXObject*,FXSelector,void*);
71  long onKeyPress(FXObject*,FXSelector,void*);
72  long onKeyRelease(FXObject*,FXSelector,void*);
73  long onCmdCollapse(FXObject*,FXSelector,void*);
74  long onUpdCollapse(FXObject*,FXSelector,void*);
75  long onCmdUncollapse(FXObject*,FXSelector,void*);
76  long onUpdUncollapse(FXObject*,FXSelector,void*);
77  long onCmdSetTip(FXObject*,FXSelector,void*);
78  long onCmdGetTip(FXObject*,FXSelector,void*);
79  long onQueryTip(FXObject*,FXSelector,void*);
80 public:
81  enum {
82  ID_COLLAPSE=FXFrame::ID_LAST,
83  ID_UNCOLLAPSE,
84  ID_LAST
85  };
86 public:
87 
89  FXToolBarTab(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_RAISED,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
90 
92  virtual FXbool canFocus() const;
93 
95  virtual FXint getDefaultWidth();
96 
98  virtual FXint getDefaultHeight();
99 
101  virtual void enable();
102 
104  virtual void disable();
105 
107  void collapse(FXbool fold,FXbool notify=false);
108 
110  FXbool isCollapsed() const { return collapsed; }
111 
113  void setTabStyle(FXuint style);
114 
116  FXuint getTabStyle() const;
117 
119  FXColor getActiveColor() const { return activeColor; }
120 
122  void setActiveColor(FXColor clr);
123 
125  void setTipText(const FXString& text){ tip=text; }
126 
128  const FXString& getTipText() const { return tip; }
129 
131  virtual void save(FXStream& store) const;
132 
134  virtual void load(FXStream& store);
135  };
136 
137 }
138 
139 #endif

Copyright © 1997-2016 Jeroen van der Zijp