1 /*****************************************************************************/
2 /*                                                                           */
3 /*                                  ITEMLBL.H                                */
4 /*                                                                           */
5 /* (C) 1995     Ullrich von Bassewitz                                        */
6 /*              Zwehrenbuehlstrasse 33                                       */
7 /*              D-72070 Tuebingen                                            */
8 /* EMail:       uz@ibb.schwaben.com                                          */
9 /*                                                                           */
10 /*****************************************************************************/
11 
12 
13 
14 // $Id$
15 //
16 // $Log$
17 //
18 //
19 
20 
21 
22 // Class ItemLabel is a special window item that acts as a label for another
23 // window item.
24 
25 
26 
27 #ifndef __ITEMLBL_H
28 #define __ITEMLBL_H
29 
30 
31 
32 #include "itemwin.h"
33 
34 
35 
36 /*****************************************************************************/
37 /*                              class ItemLabel                              */
38 /*****************************************************************************/
39 
40 
41 class ItemLabel: public WindowItem {
42 
43     friend class ResEditApp;            // Resource editor is a friend
44 
45 protected:
46     i16                 CtrlID;         // ID of item that is controlled
47     i16                 CtrlChoice;     // Return code of Choose
48 
49 
50     WindowItem* GetCtrlItem ();
51     // Return a pointer to the controlled item or NULL
52 
53     ItemLabel (StreamableInit);
54     // Build constructor
55 
56 
57 public:
58     ItemLabel (const String& aItemText, i16 aID, i16 aCtrlID, WindowItem* NextItem);
59 
60     // Derived from class Streamable
61     virtual void Store (Stream&) const;
62     virtual void Load (Stream&);
63     virtual u16 StreamableID () const;
64     static Streamable* Build ();
65 
66     void SetCtrlID (i16 aCtrlID);
67     // Set the ID of the item that is controlled by the label
68 
69     i16 GetCtrlID () const;
70     // Get the ID of the item that is controlled by the label
71 
72     i16 GetCtrlChoice () const;
73     // Choose returns the ID of the label item if the controlled item's
74     // "Choose" returned a value other than 0. Use this function to retrieve
75     // the return code of the controlled items Choose function.
76 
77     // Change the status
78     virtual void Gray ();
79     virtual void Select ();
80     virtual void Deselect ();
81 
82     // Choose an entry
83     virtual i16 Choose ();
84 
85 };
86 
87 
88 
89 
ItemLabel(StreamableInit)90 inline ItemLabel::ItemLabel (StreamableInit):
91     WindowItem (Empty)
92 {
93 }
94 
95 
96 
SetCtrlID(i16 aCtrlID)97 inline void ItemLabel::SetCtrlID (i16 aCtrlID)
98 // Set the ID of the item that is controlled by the label
99 {
100     CtrlID = aCtrlID;
101 }
102 
103 
104 
GetCtrlID()105 inline i16 ItemLabel::GetCtrlID () const
106 // Get the ID of the item that is controlled by the label
107 {
108     return CtrlID;
109 }
110 
111 
112 
GetCtrlChoice()113 inline i16 ItemLabel::GetCtrlChoice () const
114 // Choose returns the ID of the label item if the controlled item's
115 // "Choose" returned a value other than 0. Use this function to retrieve
116 // the return code of the controlled items Choose function.
117 {
118     return CtrlChoice;
119 }
120 
121 
122 
123 // End of ITEMLBL.H
124 
125 #endif
126 
127