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

FXSplitter.h
1 /********************************************************************************
2 * *
3 * S p l i t t e r W i n d o w W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1997,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 FXSPLITTER_H
22 #define FXSPLITTER_H
23 
24 #ifndef FXCOMPOSITE_H
25 #include "FXComposite.h"
26 #endif
27 
28 namespace FX {
29 
30 
32 enum {
33  SPLITTER_HORIZONTAL = 0,
34  SPLITTER_VERTICAL = 0x00008000,
35  SPLITTER_REVERSED = 0x00010000,
36  SPLITTER_TRACKING = 0x00020000,
37  SPLITTER_NORMAL = SPLITTER_HORIZONTAL
38  };
39 
40 
41 
62 class FXAPI FXSplitter : public FXComposite {
63  FXDECLARE(FXSplitter)
64 private:
65  FXWindow *window; // Window being resized
66  FXint split; // Split value
67  FXint offset; // Mouse offset
68  FXint barsize; // Size of the splitter bar
69 protected:
70  FXSplitter();
71  void adjustHLayout();
72  void adjustVLayout();
73  void moveHSplit(FXint amount);
74  void moveVSplit(FXint amount);
75  void drawHSplit(FXint pos);
76  void drawVSplit(FXint pos);
77  FXWindow* findHSplit(FXint pos);
78  FXWindow* findVSplit(FXint pos);
79 private:
80  FXSplitter(const FXSplitter&);
81  FXSplitter& operator=(const FXSplitter&);
82 public:
83  long onLeftBtnPress(FXObject*,FXSelector,void*);
84  long onLeftBtnRelease(FXObject*,FXSelector,void*);
85  long onMotion(FXObject*,FXSelector,void*);
86  long onFocusNext(FXObject*,FXSelector,void*);
87  long onFocusPrev(FXObject*,FXSelector,void*);
88  long onFocusUp(FXObject*,FXSelector,void*);
89  long onFocusDown(FXObject*,FXSelector,void*);
90  long onFocusLeft(FXObject*,FXSelector,void*);
91  long onFocusRight(FXObject*,FXSelector,void*);
92 public:
93 
95  FXSplitter(FXComposite* p,FXuint opts=SPLITTER_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
96 
98  FXSplitter(FXComposite* p,FXObject* tgt,FXSelector sel,FXuint opts=SPLITTER_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
99 
101  virtual FXint getDefaultWidth();
102 
104  virtual FXint getDefaultHeight();
105 
107  virtual void layout();
108 
110  FXint getSplit(FXint index) const;
111 
113  void setSplit(FXint index,FXint size);
114 
116  void setSplitterStyle(FXuint style);
117 
119  FXuint getSplitterStyle() const;
120 
122  void setBarSize(FXint bs);
123 
125  FXint getBarSize() const { return barsize; }
126 
128  virtual void save(FXStream& store) const;
129 
131  virtual void load(FXStream& store);
132 
134  virtual ~FXSplitter();
135  };
136 
137 }
138 
139 #endif

Copyright © 1997-2016 Jeroen van der Zijp