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

FXMatrix.h
1 /********************************************************************************
2 * *
3 * M a t r i x 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 FXMATRIX_H
22 #define FXMATRIX_H
23 
24 #ifndef FXPACKER_H
25 #include "FXPacker.h"
26 #endif
27 
28 namespace FX {
29 
30 
32 enum {
33  MATRIX_BY_ROWS = 0,
34  MATRIX_BY_COLUMNS = 0x00020000
35  };
36 
37 
38 
56 class FXAPI FXMatrix : public FXPacker {
57  FXDECLARE(FXMatrix)
58 protected:
59  FXint num;
60 protected:
61  FXMatrix(){}
62 private:
63  FXMatrix(const FXMatrix&);
64  FXMatrix &operator=(const FXMatrix&);
65 public:
66  long onFocusUp(FXObject*,FXSelector,void*);
67  long onFocusDown(FXObject*,FXSelector,void*);
68  long onFocusLeft(FXObject*,FXSelector,void*);
69  long onFocusRight(FXObject*,FXSelector,void*);
70 public:
71 
73  FXMatrix(FXComposite *p,FXint n=1,FXuint opts=MATRIX_BY_ROWS,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,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
74 
76  virtual void layout();
77 
79  virtual FXint getDefaultWidth();
80 
82  virtual FXint getDefaultHeight();
83 
85  FXWindow* childAtRowCol(FXint r,FXint c) const;
86 
88  FXint rowOfChild(const FXWindow* child) const;
89 
91  FXint colOfChild(const FXWindow* child) const;
92 
94  void setMatrixStyle(FXuint ph);
95 
97  FXuint getMatrixStyle() const;
98 
100  void setNumRows(FXint nr);
101 
103  FXint getNumRows() const;
104 
106  void setNumColumns(FXint nc);
107 
109  FXint getNumColumns() const;
110  };
111 
112 }
113 
114 #endif
Window is the base class for all widgets in FOX.
Definition: FXWindow.h:130
The Matrix layout manager automatically arranges its child windows in rows and columns.
Definition: FXMatrix.h:56
Base composite.
Definition: FXComposite.h:32
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