UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QfTower.H
1 /* QfTower.H */
2 /* $Id: QfTower.H,v 1.7 2003/10/10 08:07:50 vlad Exp $ */
3 #ifndef __QfTower_H
4 #define __QfTower_H
5 
6 #include <zm/QfBuilding.H>
7 
8 
9 /***********************************************************************
10  * Container of vertically constrained objects with rich decoration
11  * features.
12  */
13 class QfTower: public QfBuilding
14 {
15 protected:
16 
17  /* Stored resource name */
18  char *resname;
19 
20  /* Form widget if frame is drawn as wSelf. */
21  Widget wForm;
22 
23  /* Temporal variable to store tower's decoration. */
24  QfDecoration decor;
25 
26  /* XmForm/{XmFrame,XmForm} creation. */
27  virtual void create_self (Widget wParent);
28 
29  /*
30  * Subobjects with internally predefined functionality.
31  */
32 
33  /* Separator. */
34  class QfHorSep : public QfBrick
35  {
36  protected:
37  /* Create XmSeparator with horizontal orientation. */
38  virtual void create_self (Widget wParent);
39  };
40 
41  /* Title and topic. */
42  class QfLabel : public QfBrick
43  {
44  protected:
45  char *label;
46  char *resname;
47  int alignment;
48  /* Create XmLabel with given alignment and resource name. */
49  virtual void create_self (Widget wParent);
50  public:
51  QfLabel (const char* szLabel, const char* szResName, int align);
52  };
53 
54  /* Cummulative indent value in pixels. */
55  int iIndent;
56 
57  /* Actual indent value in pixels. */
58  int iLeftOffset;
59 
60 public:
61 
62  /* Create general container that is main master. Phases 1-3 take
63  place here. */
64  QfTower (Widget wParent, QfDecoration eDecor = QfDECOR_NONE,
65  const char* szResName = QfKING_NAME);
66 
67  /* Create subcontrolled container to provide complicated form
68  structure. Only Phase 1 is here. */
69  QfTower (QfDecoration eDecor = QfDECOR_NONE,
70  const char* szResName = QfKING_NAME);
71 
72  /*
73  * Decoration.
74  */
75 
76  /* Separator. */
77  virtual QfBrick* sep ();
78 
79  /* Title. */
80  virtual QfBrick* title (const char* szLabel);
81 
82  /* Left aligned label. */
83  virtual QfBrick* topic (const char* szLabel);
84 
85  /*
86  * Adjustable features.
87  */
88 
89  /* Set current left offset in addition to usual behaviour. */
90  virtual void add (QfBrick* pBrick);
91 
92  /* Return Widget of container itself (XmForm). */
93  virtual Widget container () const;
94 
95  /* Manage tower and all bricks to display prepared GUI
96  during phase 3: Phase 4. */
97  virtual void manage ();
98 
99  /*
100  * Quick access features.
101  */
102 
103  /* Add brick in chain and provide chain facility. */
104  QfTower& operator << (QfBrick* pBrick)
105  {
106  iLeftOffset = iIndent;
107  add(pBrick);
108  iLeftOffset = 0;
109  return *this;
110  }
111 
112  /* Add topic. */
113  QfTower& operator << (const char* szLabel)
114  {
115  iLeftOffset = iIndent;
116  add(topic(szLabel));
117  iLeftOffset = 0;
118  return *this;
119  }
120 
121  /* Add indentation (see QfINDENT). */
122  QfTower& operator << (int iOffset)
123  {
124  if(iOffset + iIndent < 0)
125  iIndent = 0;
126  else
127  iIndent += iOffset;
128  return *this;
129  }
130 
131 };
132 
133 
134 #endif /* QfTower.H */
virtual void manage()
virtual void create_self(Widget wParent)
virtual void create_self(Widget wParent)
Definition: QfBrick.H:54
Definition: QfTower.H:13
Definition: QfTower.H:42
Definition: QfTower.H:34
Definition: QfBuilding.H:15
virtual void create_self(Widget wParent)