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

FXSwitcher.h
1 /********************************************************************************
2 * *
3 * S w i t c h C o n t a i n e r W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1997,2024 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 FXSWITCHER_H
22 #define FXSWITCHER_H
23 
24 #ifndef FXPACKER_H
25 #include "FXPacker.h"
26 #endif
27 
28 namespace FX {
29 
31 enum {
32  SWITCHER_HCOLLAPSE = 0x00020000,
33  SWITCHER_VCOLLAPSE = 0x00040000
34  };
35 
36 
52 class FXAPI FXSwitcher : public FXPacker {
53  FXDECLARE(FXSwitcher)
54 protected:
55  FXint current;
56 protected:
57  FXSwitcher();
58 private:
59  FXSwitcher(const FXSwitcher&);
60  FXSwitcher& operator=(const FXSwitcher&);
61 public:
62  long onPaint(FXObject*,FXSelector,void*);
63  long onCmdSetValue(FXObject*,FXSelector,void*);
64  long onCmdSetIntValue(FXObject*,FXSelector,void*);
65  long onCmdGetIntValue(FXObject*,FXSelector,void*);
66  long onCmdOpen(FXObject*,FXSelector,void*);
67  long onUpdOpen(FXObject*,FXSelector,void*);
68 public:
69  enum {
70  ID_OPEN_FIRST=FXPacker::ID_LAST,
71  ID_OPEN_SECOND,
72  ID_OPEN_THIRD,
73  ID_OPEN_FOURTH,
74  ID_OPEN_FIFTH,
75  ID_OPEN_SIXTH,
76  ID_OPEN_SEVENTH,
77  ID_OPEN_EIGHTH,
78  ID_OPEN_NINETH,
79  ID_OPEN_TENTH,
80  ID_OPEN_LAST=ID_OPEN_FIRST+100,
81  ID_LAST
82  };
83 public:
84 
86  FXSwitcher(FXComposite *p,FXuint opts=0,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);
87 
89  virtual FXint getDefaultWidth();
90 
92  virtual FXint getDefaultHeight();
93 
95  virtual void layout();
96 
98  void setCurrent(FXint index,FXbool notify=false);
99 
101  FXint getCurrent() const { return current; }
102 
104  void setSwitcherStyle(FXuint style);
105 
107  FXuint getSwitcherStyle() const;
108 
110  virtual void save(FXStream& store) const;
111 
113  virtual void load(FXStream& store);
114  };
115 
116 }
117 
118 #endif
Base composite.
Definition: FXComposite.h:32
FXint getCurrent() const
Return the index of the child window currently on top.
Definition: FXSwitcher.h:101
The Switcher layout manager automatically arranges its child windows such that one of them is placed ...
Definition: FXSwitcher.h:52
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
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:138

Copyright © 1997-2022 Jeroen van der Zijp