UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QfParam.H
1 /* QfParam.H */
2 /* $Id: QfParam.H,v 1.1 2001/11/21 16:27:33 vlad Exp $ */
3 #ifndef __QfParam_H
4 #define __QfParam_H
5 
6 #include <zm/qvfcdefs.h>
7 #include <zm/QfBrick.H>
8 #include <zm/Qmisc.H>
9 
10 
11 /***********************************************************************
12  * Not really a brick but a parameter for it. Does not create widget
13  * directly, but contains technique to provide identification of
14  * different parameter descendants.
15  */
16 class QfParam: public QfBrick
17 {
18 protected:
19 
20  /* Indentifier of the parameter */
21  QfParamId id;
22 
23  /* Empty - assign NULL to wSelf */
24  virtual void create_self (Widget wParent);
25 
26 public:
27 
28  /* Create parameter with given id. */
29  QfParam (QfParamId eParId);
30 
31  /* General RTTI. */
32  virtual QfType type () const;
33 
34  /* Additional RTTI feature.
35  Return actual state identifier (don't touch GUI sync state). */
36  virtual QfParamId param_id () const;
37 
38 };
39 
40 
41 /***********************************************************************
42  * Template way to create array of parameters.
43  */
45 {
46 public:
47 
48  unsigned index; /* index of the next brick */
49  QfBrick *brick; /* the next brick (or NULL if parameter is set
50  after the last brick) */
51  QfParam *param; /* pointer to the parameter */
52 
53  QfParamItem (unsigned iIndex, QfBrick* pParam)
54  : index(iIndex), brick(NULL), param((QfParam*)pParam) {};
55 };
56 
57 #define AnyType QfParamItem
58 #define AnyAr ParamsAr
59 #define AnyCmp(x,y) COMPAR(x.index, y.index)
60 #define AnyFormatSpec "\n%d: index=%d, brick=%p, param=%p (id=%d)"
61 #define AnyPrintList i, item.index, item.brick, item.param, \
62  item.param->param_id()
63 #include <mix/AnyAr.H>
64 
65 
66 #endif /* QfParam.H */
Definition: QfParam.H:16
virtual QfType type() const
virtual void create_self(Widget wParent)
Definition: QfBrick.H:54
Definition: QfParam.H:44