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

FXTabBar.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * T a b B a r W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1997,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: FXTabBar.h,v 1.15 2006/01/22 17:58:10 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXTABBAR_H
25 #define FXTABBAR_H
26 
27 #ifndef FXPACKER_H
28 #include "FXPacker.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 /// Tab Book options
35 enum {
36  TABBOOK_TOPTABS = 0, /// Tabs on top (default)
37  TABBOOK_BOTTOMTABS = 0x00020000, /// Tabs on bottom
38  TABBOOK_SIDEWAYS = 0x00040000, /// Tabs on left
41  TABBOOK_NORMAL = TABBOOK_TOPTABS /// Normal tabs
42  };
43 
44 
45 
46 /**
47 * The tab bar layout manager arranges tab items side by side,
48 * and raises the active tab item above the neighboring tab items.
49 * In a the horizontal arrangement, the tab bar can have the tab
50 * items on the top or on the bottom. In the vertical arrangement,
51 * the tabs can be on the left or on the right.
52 * When one of the tab items is pressed, the tab bar's setCurrent()
53 * is called with notify=TRUE. Thus causes the tab bar to send a
54 * SEL_COMMAND message to its target.
55 */
56 class FXAPI FXTabBar : public FXPacker {
58 protected:
59  FXint current; // Current tab index
60  FXint shift; // Shift amount
61 protected:
62  FXTabBar(){}
63 private:
64  FXTabBar(const FXTabBar&);
65  FXTabBar& operator=(const FXTabBar&);
66 public:
67  long onPaint(FXObject*,FXSelector,void*);
68  long onFocusNext(FXObject*,FXSelector,void*);
69  long onFocusPrev(FXObject*,FXSelector,void*);
70  long onFocusUp(FXObject*,FXSelector,void*);
71  long onFocusDown(FXObject*,FXSelector,void*);
72  long onFocusLeft(FXObject*,FXSelector,void*);
73  long onFocusRight(FXObject*,FXSelector,void*);
74  long onCmdOpenItem(FXObject*,FXSelector,void*);
75  long onCmdSetValue(FXObject*,FXSelector,void*);
76  long onCmdSetIntValue(FXObject*,FXSelector,void*);
77  long onCmdGetIntValue(FXObject*,FXSelector,void*);
78  long onCmdOpen(FXObject*,FXSelector,void*);
79  long onUpdOpen(FXObject*,FXSelector,void*);
80 public:
81  enum {
82  ID_OPEN_ITEM=FXPacker::ID_LAST, /// Sent from one of the FXTabItems
83  ID_OPEN_FIRST, /// Switch to panel ID_OPEN_FIRST+i
84  ID_OPEN_SECOND,
85  ID_OPEN_THIRD,
86  ID_OPEN_FOURTH,
87  ID_OPEN_FIFTH,
88  ID_OPEN_SIXTH,
89  ID_OPEN_SEVENTH,
90  ID_OPEN_EIGHTH,
91  ID_OPEN_NINETH,
92  ID_OPEN_TENTH,
93  ID_OPEN_LAST=ID_OPEN_FIRST+100,
94  ID_LAST
95  };
96 public:
97 
98  /// Construct a tab bar
100 
101  /// Return default width
102  virtual FXint getDefaultWidth();
103 
104  /// Return default height
105  virtual FXint getDefaultHeight();
106 
107  /// Perform layout
108  virtual void layout();
109 
110  /**
111  * Change currently active tab item; this raises the active tab item
112  * slightly above the neighboring tab items. If notify=TRUE then the
113  * tab bar will also send a SEL_COMMAND message to its target.
114  */
115  virtual void setCurrent(FXint panel,FXbool notify=FALSE);
116 
117  /// Return the currently active tab item
118  FXint getCurrent() const { return current; }
119 
120  /// Return tab bar style
121  FXuint getTabStyle() const;
122 
123  /// Change tab tab style
124  void setTabStyle(FXuint style);
125 
126  /// Save to stream
127  virtual void save(FXStream& store) const;
128 
129  /// Load from stream
130  virtual void load(FXStream& store);
131  };
132 
133 }
134 
135 #endif
Tabs on top (default)
Definition: FXTabBar.h:39
Definition: FXWindow.h:241
unsigned int FXuint
Definition: fxdefs.h:396
FXuint FXSelector
Association key.
Definition: FXObject.h:53
#define FXAPI
Definition: fxdefs.h:122
The tab bar layout manager arranges tab items side by side, and raises the active tab item above the ...
Definition: FXTabBar.h:63
FXuchar FXbool
Definition: fxdefs.h:393
Base composite.
Definition: FXComposite.h:35
#define NULL
Definition: fxdefs.h:41
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:99
Tabs on left.
Definition: FXTabBar.h:41
Tabs on right.
Definition: FXTabBar.h:43
Normal tabs.
Definition: FXTabBar.h:44
Tabs on left.
Definition: FXTabBar.h:42
int FXint
Definition: fxdefs.h:397
Packer is a layout manager which automatically places child windows inside its area against the left...
Definition: FXPacker.h:58
#define FALSE
Definition: fxdefs.h:35
Definition: FXPacker.h:38
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:166
Tabs on bottom.
Definition: FXTabBar.h:40
#define FXDECLARE(classname)
Macro to set up class declaration.
Definition: FXObject.h:92

Copyright © 1997-2005 Jeroen van der Zijp