2 * Copyright (c) 2005-2010, Haiku, Inc.
3 * Distributed under the terms of the MIT license.
6 * DarkWyrm <darkwyrm@gmail.com>
8 #ifndef INTERNALEDITORS_H
9 #define INTERNALEDITORS_H
12 #include <TextControl.h>
13 #include <StringView.h>
18 class StringEditView
: public BView
21 StringEditView(const BRect
&frame
);
22 ~StringEditView(void);
24 void AttachedToWindow(void);
26 const char * GetID(void) const { return fIDBox
->Text(); }
27 void SetID(const char *idstring
) { fIDBox
->SetText(idstring
); }
29 const char * GetName(void) const { return fNameBox
->Text(); }
30 void SetName(const char *name
) { fNameBox
->SetText(name
); }
32 const char * GetValue(void) const { return fValueView
->Text(); }
33 void SetValue(const char *value
) { fValueView
->SetText(value
); }
35 void EnableID(const bool &value
) { fIDBox
->SetEnabled(value
); }
36 bool IsIDEnabled(void) const { return fIDBox
->IsEnabled(); }
38 float GetPreferredWidth(void) const;
39 float GetPreferredHeight(void) const;
44 BTextView
*fValueView
;
50 class DoubleEditor
: public Editor
53 DoubleEditor(const BRect
&frame
, ResourceData
*data
,
55 void MessageReceived(BMessage
*msg
);
58 StringEditView
*fView
;
61 class StringEditor
: public Editor
64 StringEditor(const BRect
&frame
, ResourceData
*data
,
66 void MessageReceived(BMessage
*msg
);
69 StringEditView
*fView
;
74 class ImageEditor
: public Editor
77 ImageEditor(const BRect
&frame
, ResourceData
*data
,
80 void MessageReceived(BMessage
*msg
);
81 void FrameResized(float w
, float h
);
85 BTextControl
*fNameBox
;
91 BitmapView
*fImageView
;