2 * Copyright 2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
8 #include <LayoutItem.h>
9 #include <StringView.h>
11 #include "StringView.h"
14 StringView::StringView(const char* label
, const char* text
)
17 fLabel(new BStringView(NULL
, label
)),
19 fText(new BStringView(NULL
, text
)),
26 StringView::SetLabel(const char* label
)
28 fLabel
->SetText(label
);
33 StringView::SetText(const char* text
)
40 StringView::GetLabelLayoutItem()
47 StringView::LabelView()
52 StringView::GetTextLayoutItem()
59 StringView::TextView()
64 StringView::SetEnabled(bool enabled
)
71 ui_color(B_PANEL_BACKGROUND_COLOR
), B_DISABLED_LABEL_TINT
);
73 color
= ui_color(B_CONTROL_TEXT_COLOR
);
75 fLabel
->SetHighColor(color
);
76 fText
->SetHighColor(color
);
82 //cast operator BView*
83 StringView::operator BView
*()
87 fView
= new BGroupView(B_HORIZONTAL
);
88 BLayout
* layout
= fView
->GroupLayout();
89 fLabelItem
= layout
->AddView(fLabel
);
90 fTextItem
= layout
->AddView(fText
);
96 StringView::Label() const
98 return fLabel
->Text();
103 StringView::Text() const
105 return fText
->Text();