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

FXTabBar.h
1 /********************************************************************************
2 * *
3 * T a b B a r W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1997,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 FXTABBAR_H
22 #define FXTABBAR_H
23 
24 #ifndef FXPACKER_H
25 #include "FXPacker.h"
26 #endif
27 
28 namespace FX {
29 
30 
32 enum {
33  TABBOOK_TOPTABS = 0,
34  TABBOOK_BOTTOMTABS = 0x00020000,
35  TABBOOK_SIDEWAYS = 0x00040000,
36  TABBOOK_LEFTTABS = TABBOOK_SIDEWAYS|TABBOOK_TOPTABS,
37  TABBOOK_RIGHTTABS = TABBOOK_SIDEWAYS|TABBOOK_BOTTOMTABS,
38  TABBOOK_NORMAL = TABBOOK_TOPTABS
39  };
40 
41 
53 class FXAPI FXTabBar : public FXPacker {
54  FXDECLARE(FXTabBar)
55 protected:
56  FXint current; // Current tab index
57  FXint shift; // Shift amount
58 protected:
59  FXTabBar(){}
60 private:
61  FXTabBar(const FXTabBar&);
62  FXTabBar& operator=(const FXTabBar&);
63 public:
64  long onPaint(FXObject*,FXSelector,void*);
65  long onFocusNext(FXObject*,FXSelector,void*);
66  long onFocusPrev(FXObject*,FXSelector,void*);
67  long onFocusUp(FXObject*,FXSelector,void*);
68  long onFocusDown(FXObject*,FXSelector,void*);
69  long onFocusLeft(FXObject*,FXSelector,void*);
70  long onFocusRight(FXObject*,FXSelector,void*);
71  long onCmdOpenItem(FXObject*,FXSelector,void*);
72  long onCmdSetValue(FXObject*,FXSelector,void*);
73  long onCmdSetIntValue(FXObject*,FXSelector,void*);
74  long onCmdGetIntValue(FXObject*,FXSelector,void*);
75  long onCmdOpen(FXObject*,FXSelector,void*);
76  long onUpdOpen(FXObject*,FXSelector,void*);
77 public:
78  enum {
79  ID_OPEN_ITEM=FXPacker::ID_LAST,
82  ID_OPEN_THIRD,
83  ID_OPEN_FOURTH,
84  ID_OPEN_FIFTH,
85  ID_OPEN_SIXTH,
86  ID_OPEN_SEVENTH,
87  ID_OPEN_EIGHTH,
88  ID_OPEN_NINETH,
89  ID_OPEN_TENTH,
90  ID_OPEN_LAST=ID_OPEN_FIRST+100,
91  ID_LAST
92  };
93 public:
94 
96  FXTabBar(FXComposite* p,FXObject* tgt=nullptr,FXSelector sel=0,FXuint opts=TABBOOK_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING);
97 
99  virtual FXint getDefaultWidth();
100 
102  virtual FXint getDefaultHeight();
103 
105  virtual void layout();
106 
113  virtual void setCurrent(FXint index,FXbool notify=false);
114 
116  FXint getCurrent() const { return current; }
117 
119  FXuint getTabStyle() const;
120 
122  void setTabStyle(FXuint style);
123 
125  virtual void save(FXStream& store) const;
126 
128  virtual void load(FXStream& store);
129  };
130 
131 }
132 
133 #endif
The tab bar layout manager arranges tab items side by side, and raises the active tab item above the ...
Definition: FXTabBar.h:53
FXint getCurrent() const
Return the currently active tab item.
Definition: FXTabBar.h:116
Base composite.
Definition: FXComposite.h:32
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
Switch to panel ID_OPEN_FIRST+i.
Definition: FXTabBar.h:81
Sent from one of the FXTabItems.
Definition: FXTabBar.h:80
Definition: FX4Splitter.h:28
Packer is a layout manager which automatically places child windows inside its area against the left...
Definition: FXPacker.h:48
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:134

Copyright © 1997-2022 Jeroen van der Zijp