xref: /haiku/src/apps/cortex/ValControl/ValControl.h (revision 19ae20e67e91fc09cc9fc5c0e60e21e24e7a53eb)
1*c284bb0fSMatt Madia /*
2*c284bb0fSMatt Madia  * Copyright (c) 1999-2000, Eric Moon.
3*c284bb0fSMatt Madia  * All rights reserved.
4*c284bb0fSMatt Madia  *
5*c284bb0fSMatt Madia  * Redistribution and use in source and binary forms, with or without
6*c284bb0fSMatt Madia  * modification, are permitted provided that the following conditions
7*c284bb0fSMatt Madia  * are met:
8*c284bb0fSMatt Madia  *
9*c284bb0fSMatt Madia  * 1. Redistributions of source code must retain the above copyright
10*c284bb0fSMatt Madia  *    notice, this list of conditions, and the following disclaimer.
11*c284bb0fSMatt Madia  *
12*c284bb0fSMatt Madia  * 2. Redistributions in binary form must reproduce the above copyright
13*c284bb0fSMatt Madia  *    notice, this list of conditions, and the following disclaimer in the
14*c284bb0fSMatt Madia  *    documentation and/or other materials provided with the distribution.
15*c284bb0fSMatt Madia  *
16*c284bb0fSMatt Madia  * 3. The name of the author may not be used to endorse or promote products
17*c284bb0fSMatt Madia  *    derived from this software without specific prior written permission.
18*c284bb0fSMatt Madia  *
19*c284bb0fSMatt Madia  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
20*c284bb0fSMatt Madia  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21*c284bb0fSMatt Madia  * OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22*c284bb0fSMatt Madia  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
23*c284bb0fSMatt Madia  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24*c284bb0fSMatt Madia  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25*c284bb0fSMatt Madia  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26*c284bb0fSMatt Madia  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
27*c284bb0fSMatt Madia  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28*c284bb0fSMatt Madia  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29*c284bb0fSMatt Madia  */
30*c284bb0fSMatt Madia 
31*c284bb0fSMatt Madia 
32a0795c6fSMarcus Overhagen // ValControl.h
33a0795c6fSMarcus Overhagen // +++++ cortex integration 23aug99:
34a0795c6fSMarcus Overhagen //       - way too many protected members
35a0795c6fSMarcus Overhagen //       - config'able font
36a0795c6fSMarcus Overhagen //       - implement GetPreferredSize() (should work before the view is attached
37a0795c6fSMarcus Overhagen //         to a window -- doable?)
38a0795c6fSMarcus Overhagen //       - keyboard entry (pop-up text field)
39a0795c6fSMarcus Overhagen //       - 'spin' mode: value changes based on vertical distance of pointer
40a0795c6fSMarcus Overhagen //         (configurable; set buttons/modifiers to activate either mode?)
41a0795c6fSMarcus Overhagen //
42a0795c6fSMarcus Overhagen //       - should parameter binding happen at this level?
43a0795c6fSMarcus Overhagen //       +++++ how about a ValControlFactory?  give it a BParameter, get back a
44a0795c6fSMarcus Overhagen //             ValControl subclass... +++++
45a0795c6fSMarcus Overhagen //
46a0795c6fSMarcus Overhagen // e.moon 16jan99
47a0795c6fSMarcus Overhagen //
48a0795c6fSMarcus Overhagen // ABSTRACT CLASS: ValControl
49a0795c6fSMarcus Overhagen // An abstract base class for 'value controls' -- interface
50a0795c6fSMarcus Overhagen // components that display a value that may be modified via
51a0795c6fSMarcus Overhagen // click-drag.  Other editing methods (such as 'click, then
52a0795c6fSMarcus Overhagen // type') may be supported by subclasses.
53a0795c6fSMarcus Overhagen //
54a0795c6fSMarcus Overhagen // IMPLEMENT
55a0795c6fSMarcus Overhagen //   getValue() and setValue(), for raw (BParameter-style) value access
56a0795c6fSMarcus Overhagen //   MessageReceived(), to handle:
57a0795c6fSMarcus Overhagen //     M_SET_VALUE
58a0795c6fSMarcus Overhagen //     M_GET_VALUE
59a0795c6fSMarcus Overhagen //     M_OFFSET_VALUE		(May be sent by segments during mouse action,
60a0795c6fSMarcus Overhagen //                       +++++ is a faster method needed?)
61a0795c6fSMarcus Overhagen //
62a0795c6fSMarcus Overhagen // NOTES
63a0795c6fSMarcus Overhagen // The control view consists of:
64a0795c6fSMarcus Overhagen //
65a0795c6fSMarcus Overhagen // - One or more segments.  Each segment is individually
66595c89bcSAxel Dörfler //   draggable.  Subclasses may mix segment types, or Add
67a0795c6fSMarcus Overhagen //   and remove segments dynamically.
68a0795c6fSMarcus Overhagen //
69a0795c6fSMarcus Overhagen // - A manipulator region, to which subcontrols (such as 'spin
70a0795c6fSMarcus Overhagen //   arrows') may be added.
71a0795c6fSMarcus Overhagen //
72a0795c6fSMarcus Overhagen // Views/segments may be aligned flush left or flush right.  The
73a0795c6fSMarcus Overhagen // side towards which views are aligned may be referred to as
74a0795c6fSMarcus Overhagen // the 'anchor' side.
75a0795c6fSMarcus Overhagen //
76a0795c6fSMarcus Overhagen // Quickie interface guidelines:
77a0795c6fSMarcus Overhagen //
78a0795c6fSMarcus Overhagen // - Value controls are always underlined, indicating that the
79a0795c6fSMarcus Overhagen //   value is editable.  (+++++ possible extension: dotted-underline
80a0795c6fSMarcus Overhagen //   for continuous variation, and solid for discrete/step variation)
81a0795c6fSMarcus Overhagen //
82a0795c6fSMarcus Overhagen // - When a value control's 'click action' is to pop down a menu of
83a0795c6fSMarcus Overhagen //   available choices (or pop up any sort of non-typable display)
84a0795c6fSMarcus Overhagen //   this should be indicated by a small right triangle in the
85a0795c6fSMarcus Overhagen //   manipulator area.
86a0795c6fSMarcus Overhagen //   +++++ this may need some clarification; pop-down sliders, for example?
87a0795c6fSMarcus Overhagen //
88a0795c6fSMarcus Overhagen // * HISTORY
89a0795c6fSMarcus Overhagen //   e.moon		19sep99		Cleanup
90a0795c6fSMarcus Overhagen //   e.moon		23aug99		begun Cortex integration
91a0795c6fSMarcus Overhagen //   e.moon		17jan99		started
92595c89bcSAxel Dörfler #ifndef VAL_CONTROL_H
93595c89bcSAxel Dörfler #define VAL_CONTROL_H
94a0795c6fSMarcus Overhagen 
95a0795c6fSMarcus Overhagen 
96595c89bcSAxel Dörfler #include "cortex_defs.h"
97a0795c6fSMarcus Overhagen 
98a0795c6fSMarcus Overhagen #include "ValCtrlLayoutEntry.h"
99a0795c6fSMarcus Overhagen 
100595c89bcSAxel Dörfler #include <Bitmap.h>
101595c89bcSAxel Dörfler #include <Control.h>
102595c89bcSAxel Dörfler #include <Font.h>
103595c89bcSAxel Dörfler #include <Message.h>
104595c89bcSAxel Dörfler #include <View.h>
105595c89bcSAxel Dörfler 
106595c89bcSAxel Dörfler #include <vector>
107595c89bcSAxel Dörfler 
108a0795c6fSMarcus Overhagen __BEGIN_CORTEX_NAMESPACE
109a0795c6fSMarcus Overhagen 
110a0795c6fSMarcus Overhagen class ValControlSegment;
111a0795c6fSMarcus Overhagen 
112a0795c6fSMarcus Overhagen 
113a0795c6fSMarcus Overhagen /* abstract */
114a0795c6fSMarcus Overhagen class ValControl : public BControl {
115595c89bcSAxel Dörfler 	public:
116595c89bcSAxel Dörfler 		typedef BControl _Inherited;
117a0795c6fSMarcus Overhagen 
118a0795c6fSMarcus Overhagen 	public:													// types & constants
119a0795c6fSMarcus Overhagen 		// child-view alignment options:
120a0795c6fSMarcus Overhagen 		enum align_mode {
121a0795c6fSMarcus Overhagen 			ALIGN_FLUSH_LEFT,
122a0795c6fSMarcus Overhagen 			ALIGN_FLUSH_RIGHT
123a0795c6fSMarcus Overhagen 		};
124a0795c6fSMarcus Overhagen 
125a0795c6fSMarcus Overhagen 		// alignment flags +++++ 23aug99: not implemented -- should they be?
126a0795c6fSMarcus Overhagen 		enum align_flags {
127a0795c6fSMarcus Overhagen 			ALIGN_NONE = 0,
128a0795c6fSMarcus Overhagen 			ALIGN_GROW = 1
129a0795c6fSMarcus Overhagen 		};
130a0795c6fSMarcus Overhagen 
131a0795c6fSMarcus Overhagen 		// should value update messages be sent asynchronously (during
132a0795c6fSMarcus Overhagen 		// a mouse operation) or synchronously (after the mouse is
133a0795c6fSMarcus Overhagen 		// released)?
134a0795c6fSMarcus Overhagen 		enum update_mode {
135a0795c6fSMarcus Overhagen 			UPDATE_ASYNC,
136a0795c6fSMarcus Overhagen 			UPDATE_SYNC
137a0795c6fSMarcus Overhagen 		};
138a0795c6fSMarcus Overhagen 
139a0795c6fSMarcus Overhagen 		enum entry_location {
140a0795c6fSMarcus Overhagen 			LEFT_MOST = 0,
141a0795c6fSMarcus Overhagen 			FROM_LEFT = 0,
142a0795c6fSMarcus Overhagen 			RIGHT_MOST = 1,
143a0795c6fSMarcus Overhagen 			FROM_RIGHT = 1
144a0795c6fSMarcus Overhagen 		};
145a0795c6fSMarcus Overhagen 
146a0795c6fSMarcus Overhagen 		// layout system state +++++
147a0795c6fSMarcus Overhagen 
148a0795c6fSMarcus Overhagen 	public:													// types
149a0795c6fSMarcus Overhagen 
150a0795c6fSMarcus Overhagen 	public:	// messages (all ValControl-related messages go here!)
151a0795c6fSMarcus Overhagen 		enum message_t {
152a0795c6fSMarcus Overhagen 
153a0795c6fSMarcus Overhagen 			// Set value of a control or segment:
154a0795c6fSMarcus Overhagen 			// [your value field(s)] or "_value" (string)
155a0795c6fSMarcus Overhagen 			M_SET_VALUE					= ValControl_message_base,
156a0795c6fSMarcus Overhagen 
157a0795c6fSMarcus Overhagen 			// Request for value of control/segment:
158a0795c6fSMarcus Overhagen 			// [your value field(s)]
159a0795c6fSMarcus Overhagen 			M_GET_VALUE,
160a0795c6fSMarcus Overhagen 
161a0795c6fSMarcus Overhagen 			// ... reply to M_GET_VALUE with this:
162a0795c6fSMarcus Overhagen 			// [your value field(s)]
163a0795c6fSMarcus Overhagen 			M_VALUE
164a0795c6fSMarcus Overhagen 		};
165a0795c6fSMarcus Overhagen 
166a0795c6fSMarcus Overhagen 	public: // hooks
167a0795c6fSMarcus Overhagen 
168a0795c6fSMarcus Overhagen 		// * parameter-mode value access
169a0795c6fSMarcus Overhagen 
170a0795c6fSMarcus Overhagen 		// called to set the control's value from raw BParameter data
171595c89bcSAxel Dörfler 		virtual void setValue(const void* data, size_t size) = 0;
172a0795c6fSMarcus Overhagen 
173a0795c6fSMarcus Overhagen 		// called to request the control's value in raw form
174595c89bcSAxel Dörfler 		virtual void getValue(void* data, size_t* ioSize) = 0;
175a0795c6fSMarcus Overhagen 
176a0795c6fSMarcus Overhagen 		// * string value access
177a0795c6fSMarcus Overhagen 
178595c89bcSAxel Dörfler 		virtual status_t setValueFrom(const char* text) = 0;
179a0795c6fSMarcus Overhagen 
180595c89bcSAxel Dörfler 		virtual status_t getString(BString& buffer) = 0;
181a0795c6fSMarcus Overhagen 
182a0795c6fSMarcus Overhagen 		// called when a child view's preferred size has changed;
183a0795c6fSMarcus Overhagen 		// it's up to the ValControl to grant the resize request.
184a0795c6fSMarcus Overhagen 		// Return true to notify the child that the request has
185a0795c6fSMarcus Overhagen 		// been granted, or false if denied (the default.)
186a0795c6fSMarcus Overhagen 
childResizeRequest(BView * child)187595c89bcSAxel Dörfler 		virtual bool childResizeRequest(BView* child) { return false; }
188a0795c6fSMarcus Overhagen 
189a0795c6fSMarcus Overhagen 	public:													// ctor/dtor/accessors
190a0795c6fSMarcus Overhagen 		virtual ~ValControl();
191a0795c6fSMarcus Overhagen 
192a0795c6fSMarcus Overhagen 		// value-access methods are left up to the subclasses,
193a0795c6fSMarcus Overhagen 		//   since they'll take varying types of arguments.
194a0795c6fSMarcus Overhagen 		//  (M_SET_VALUE and M_GET_VALUE should always behave
195a0795c6fSMarcus Overhagen 		//   as you'd expect, with a 'value' field of the appropriate
196a0795c6fSMarcus Overhagen 		//   type replacing or returning the current value.) +++++ decrepit
197a0795c6fSMarcus Overhagen 		//
198a0795c6fSMarcus Overhagen 		// Note that all implementations offering pop-up keyboard entry
199a0795c6fSMarcus Overhagen 		// must accept an M_SET_VALUE with a value of B_STRING_TYPE.
200a0795c6fSMarcus Overhagen 
201a0795c6fSMarcus Overhagen 		// get/set update mode (determines whether value updates are
202a0795c6fSMarcus Overhagen 		// sent to the target during mouse operations, or only on
203a0795c6fSMarcus Overhagen 		// mouse-up)
204a0795c6fSMarcus Overhagen 		update_mode updateMode() const;
205595c89bcSAxel Dörfler 		void setUpdateMode(update_mode mode);
206a0795c6fSMarcus Overhagen 
207a0795c6fSMarcus Overhagen 		// +++++ get/set font used by segments
208a0795c6fSMarcus Overhagen 		// (would separate 'value' and 'label' fonts be a good move?)
209a0795c6fSMarcus Overhagen 		//	const BFont* font() const;
210a0795c6fSMarcus Overhagen 
211a0795c6fSMarcus Overhagen 		const BFont* labelFont() const; //nyi
212595c89bcSAxel Dörfler 		void setLabelFont(const BFont* labelFont); //nyi
213a0795c6fSMarcus Overhagen 
214a0795c6fSMarcus Overhagen 		const BFont* valueFont() const; //nyi
215595c89bcSAxel Dörfler 		void setValueFont(const BFont* valueFont); //nyi
216a0795c6fSMarcus Overhagen 
217a0795c6fSMarcus Overhagen 		// get baseline y offset: this is measured relative to the top of the
218a0795c6fSMarcus Overhagen 		// view
219a0795c6fSMarcus Overhagen 		float baselineOffset() const;
220a0795c6fSMarcus Overhagen 
221a0795c6fSMarcus Overhagen 		// segment padding: this amount of padding is added to the
222a0795c6fSMarcus Overhagen 		// right of each segment bounds-rectangle
223a0795c6fSMarcus Overhagen 		float segmentPadding() const;
224a0795c6fSMarcus Overhagen 
225a0795c6fSMarcus Overhagen 		// fast drag rate: returns ratio of pixels:units for fast
226a0795c6fSMarcus Overhagen 		// (left-button) dragging
227a0795c6fSMarcus Overhagen 		float fastDragRate() const; //nyi
228a0795c6fSMarcus Overhagen 
229a0795c6fSMarcus Overhagen 		// slow drag rate: returns ratio for precise (both/middle-button)
230a0795c6fSMarcus Overhagen 		// dragging
231a0795c6fSMarcus Overhagen 		float slowDragRate() const; //nyi
232a0795c6fSMarcus Overhagen 
233a0795c6fSMarcus Overhagen 		// fetch back-buffer
234a0795c6fSMarcus Overhagen 		BView* backBufferView() const; //nyi
235a0795c6fSMarcus Overhagen 		BBitmap* backBuffer() const; //nyi
236a0795c6fSMarcus Overhagen 
237a0795c6fSMarcus Overhagen 		// pop up keyboard input field
238a0795c6fSMarcus Overhagen 		// +++++ should this turn into a message?
239a0795c6fSMarcus Overhagen 		virtual void showEditField();
240a0795c6fSMarcus Overhagen 
241a0795c6fSMarcus Overhagen 	public: // debugging [23aug99]
242a0795c6fSMarcus Overhagen 		virtual void dump();
243a0795c6fSMarcus Overhagen 
244a0795c6fSMarcus Overhagen 	public: // BControl impl.
245a0795c6fSMarcus Overhagen 		// SetValue(), Value() aren't defined, since they only support
246a0795c6fSMarcus Overhagen 		//   32-bit integer values.  TextControl provides a precedent for
247a0795c6fSMarcus Overhagen 		//   this kind of naughtiness.
248a0795c6fSMarcus Overhagen 
249a0795c6fSMarcus Overhagen 		// empty implementation (hands off to BControl)
250595c89bcSAxel Dörfler 		virtual void SetEnabled(bool enabled);
251a0795c6fSMarcus Overhagen 
252a0795c6fSMarcus Overhagen 	public: // BView impl.
253a0795c6fSMarcus Overhagen 
254a0795c6fSMarcus Overhagen 		// handle initial layout stuff:
255a0795c6fSMarcus Overhagen 		virtual void AttachedToWindow();
256a0795c6fSMarcus Overhagen 		virtual void AllAttached();
257a0795c6fSMarcus Overhagen 
258a0795c6fSMarcus Overhagen 		// paint decorations (& decimal point)
259595c89bcSAxel Dörfler 		virtual void Draw(BRect updateRect);
260a0795c6fSMarcus Overhagen 
261595c89bcSAxel Dörfler 		virtual void drawDecimalPoint(ValCtrlLayoutEntry& entry);
262a0795c6fSMarcus Overhagen 
263a0795c6fSMarcus Overhagen 		// handle frame resize (grow backbuffer if need be)
264595c89bcSAxel Dörfler 		virtual void FrameResized(float width, float height);
265a0795c6fSMarcus Overhagen 
266a0795c6fSMarcus Overhagen 		// calculate minimum size
267595c89bcSAxel Dörfler 		virtual void GetPreferredSize(float* outWidth, float* outHeight);
268a0795c6fSMarcus Overhagen 
269595c89bcSAxel Dörfler 		virtual void MakeFocus(bool focused = true);
270a0795c6fSMarcus Overhagen 
271595c89bcSAxel Dörfler 		virtual void MouseDown(BPoint where);
272a0795c6fSMarcus Overhagen 
273595c89bcSAxel Dörfler 	public:
274595c89bcSAxel Dörfler 		virtual void MessageReceived(BMessage* message);
275a0795c6fSMarcus Overhagen 
276a0795c6fSMarcus Overhagen 	public:						// archiving/instantiation
277595c89bcSAxel Dörfler 		ValControl(BMessage* archive);
278a0795c6fSMarcus Overhagen 
279595c89bcSAxel Dörfler 		status_t Archive(BMessage* archive, bool deep = true) const;
280a0795c6fSMarcus Overhagen 
281a0795c6fSMarcus Overhagen 	protected: // internal ctor/operations
282595c89bcSAxel Dörfler 		ValControl(BRect frame, const char* name, const char* label,
283595c89bcSAxel Dörfler 			BMessage* message, align_mode alignMode, align_flags alignFlags,
284595c89bcSAxel Dörfler 			update_mode updateMode = UPDATE_ASYNC, bool backBuffer = true);
285a0795c6fSMarcus Overhagen 
286595c89bcSAxel Dörfler 		// Add segment view (which is responsible for generating its
287a0795c6fSMarcus Overhagen 		// own ValCtrlLayoutEntry)
288595c89bcSAxel Dörfler 		void _Add(ValControlSegment* segment, entry_location from,
289a0795c6fSMarcus Overhagen 			uint16 distance = 0);
290a0795c6fSMarcus Overhagen 
291595c89bcSAxel Dörfler 		// Add general view (manipulator, label, etc.)
292a0795c6fSMarcus Overhagen 		// (the entry's frame rectangle will be filled in)
293a0795c6fSMarcus Overhagen 		// covers ValCtrlLayoutEntry ctor:
294595c89bcSAxel Dörfler 		void _Add(ValCtrlLayoutEntry& entry, entry_location from);
295a0795c6fSMarcus Overhagen 
296a0795c6fSMarcus Overhagen 		// access child-view ValCtrlLayoutEntry
297595c89bcSAxel Dörfler 		// (_IndexOf returns index from left)
298595c89bcSAxel Dörfler 		const ValCtrlLayoutEntry& _EntryAt(uint16 offset) const;
299a0795c6fSMarcus Overhagen 
300595c89bcSAxel Dörfler 		const ValCtrlLayoutEntry& _EntryAt(entry_location from,
301a0795c6fSMarcus Overhagen 			uint16 distance = 0) const;
302a0795c6fSMarcus Overhagen 
303595c89bcSAxel Dörfler 		uint16 _IndexOf(BView* child) const;
304a0795c6fSMarcus Overhagen 
305595c89bcSAxel Dörfler 		uint16 CountEntries() const;
306a0795c6fSMarcus Overhagen 
307a0795c6fSMarcus Overhagen 	private: // steaming entrails
308a0795c6fSMarcus Overhagen 		// (re-)initialize the backbuffer
309595c89bcSAxel Dörfler 		void _AllocBackBuffer(float width, float height);
310a0795c6fSMarcus Overhagen 
311a0795c6fSMarcus Overhagen 		// insert a layout entry in ordered position (doesn't call
312a0795c6fSMarcus Overhagen 		// AddChild())
313595c89bcSAxel Dörfler 		void _InsertEntry(ValCtrlLayoutEntry& entry, uint16 index);
314a0795c6fSMarcus Overhagen 
315a0795c6fSMarcus Overhagen 		// move given entry horizontally (update child view's position
316a0795c6fSMarcus Overhagen 		// and size as well, if any)
317595c89bcSAxel Dörfler 		void _SlideEntry(int index, float delta);
318a0795c6fSMarcus Overhagen 
319a0795c6fSMarcus Overhagen 		// turn entry_location/offset into an index:
320595c89bcSAxel Dörfler 		uint16 _LocationToIndex(entry_location from, uint16 distance = 0) const;
321a0795c6fSMarcus Overhagen 
322595c89bcSAxel Dörfler 		void _GetDefaultEntrySize(ValCtrlLayoutEntry::entry_type type,
323595c89bcSAxel Dörfler 			float* outWidth, float* outHeight);
324a0795c6fSMarcus Overhagen 
325595c89bcSAxel Dörfler 		void _InvalidateAll();
326a0795c6fSMarcus Overhagen 
327595c89bcSAxel Dörfler 	private:
328a0795c6fSMarcus Overhagen 		// the set of visible segments and other child views,
329a0795c6fSMarcus Overhagen 		// in left-to-right. top-to-bottom order
33023e67806SIthamar R. Adema 		typedef std::vector<ValCtrlLayoutEntry>		layout_set;
331595c89bcSAxel Dörfler 		layout_set			fLayoutSet;
332a0795c6fSMarcus Overhagen 
333a0795c6fSMarcus Overhagen 		// true if value has been changed since last request
334a0795c6fSMarcus Overhagen 		// (allows caching of value)
335595c89bcSAxel Dörfler 		bool				fDirty;
336a0795c6fSMarcus Overhagen 
337a0795c6fSMarcus Overhagen 		// when should messages be sent to the target?
338595c89bcSAxel Dörfler 		update_mode			fUpdateMode;
339a0795c6fSMarcus Overhagen 
340595c89bcSAxel Dörfler 		BFont				fLabelFont;
341595c89bcSAxel Dörfler 		BFont				fValueFont;
342a0795c6fSMarcus Overhagen 
343595c89bcSAxel Dörfler 		align_mode			fAlignMode;
344595c89bcSAxel Dörfler 		align_flags			fAlignFlags;
345a0795c6fSMarcus Overhagen 
346a0795c6fSMarcus Overhagen 		// the bounds rectangle requested upon construction.
347a0795c6fSMarcus Overhagen 		// if the ALIGN_GROW flag is set, the real bounds
348a0795c6fSMarcus Overhagen 		// rectangle may be wider
349595c89bcSAxel Dörfler 		BRect				fOrigBounds;
350a0795c6fSMarcus Overhagen 
351a0795c6fSMarcus Overhagen 		// backbuffer (made available to segments for flicker-free
352a0795c6fSMarcus Overhagen 		// drawing)
353595c89bcSAxel Dörfler 		bool				fHaveBackBuffer;
354595c89bcSAxel Dörfler 		BBitmap*			fBackBuffer;
355595c89bcSAxel Dörfler 		BView*				fBackBufferView;
356a0795c6fSMarcus Overhagen 
357595c89bcSAxel Dörfler 		static const float	fSegmentPadding;
358a0795c6fSMarcus Overhagen 
359595c89bcSAxel Dörfler 		static const float	fDecimalPointWidth;
360595c89bcSAxel Dörfler 		static const float	fDecimalPointHeight;
361a0795c6fSMarcus Overhagen 
362595c89bcSAxel Dörfler 	private:
363a0795c6fSMarcus Overhagen 		class fnInitChild;
364a0795c6fSMarcus Overhagen };
365a0795c6fSMarcus Overhagen 
366a0795c6fSMarcus Overhagen __END_CORTEX_NAMESPACE
367595c89bcSAxel Dörfler #endif	// VAL_CONTROL_H
368