2 * Copyright 2004-2011, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Mike Berg <mike@berg-net.us>
7 * Julun <host.haiku@gmx.de>
8 * Hamish Morrison <hamish@lavabit.com>
10 #ifndef _SECTION_EDIT_H
11 #define _SECTION_EDIT_H
21 class TSectionEdit
: public BControl
{
23 TSectionEdit(const char* name
,
25 virtual ~TSectionEdit();
27 virtual void AttachedToWindow();
28 virtual void Draw(BRect updateRect
);
29 virtual void MouseDown(BPoint point
);
30 virtual void MakeFocus(bool focused
= true);
31 virtual void KeyDown(const char* bytes
, int32 numBytes
);
35 BSize
PreferredSize();
37 uint32
CountSections() const;
38 int32
FocusIndex() const;
39 BRect
SectionArea() const;
42 virtual void DrawBorder(const BRect
& updateRect
);
43 virtual void DrawSection(uint32 index
, BRect bounds
,
45 virtual void DrawSeparator(uint32 index
, BRect bounds
) {}
47 BRect
FrameForSection(uint32 index
);
48 BRect
FrameForSeparator(uint32 index
);
50 virtual void SectionFocus(uint32 index
) {}
51 virtual void SectionChange(uint32 index
, uint32 value
) {}
52 virtual void SetSections(BRect area
) {}
54 virtual float SeparatorWidth() = 0;
55 virtual float MinSectionWidth() = 0;
56 virtual float PreferredHeight() = 0;
58 virtual void DoUpPress() {}
59 virtual void DoDownPress() {}
61 virtual void DispatchMessage();
62 virtual void BuildDispatch(BMessage
* message
) = 0;
73 #endif // _SECTION_EDIT_H