2 * Copyright 2005, Jérôme Duval. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Inspired by SoundCapture from Be newsletter (Media Kit Basics: Consumers
12 #include "SoundListView.h"
15 #undef B_TRANSLATION_CONTEXT
16 #define B_TRANSLATION_CONTEXT "SoundListView"
19 SoundListView::SoundListView(
23 BListView(area
, name
, B_SINGLE_SELECTION_LIST
, resize
)
28 SoundListView::~SoundListView()
34 SoundListView::Draw(BRect updateRect
)
37 SetLowColor(ViewColor());
38 FillRect(Bounds(), B_SOLID_LOW
);
40 SetHighColor(ui_color(B_PANEL_TEXT_COLOR
));
41 BFont
font(be_bold_font
);
44 font
.GetHeight(&height
);
45 float width
= font
.StringWidth(B_TRANSLATE("Drop files here"));
48 pt
.x
= (Bounds().Width() - width
) / 2;
49 pt
.y
= (Bounds().Height() + height
.ascent
+ height
.descent
)/ 2;
50 DrawString(B_TRANSLATE("Drop files here"), pt
);
52 BListView::Draw(updateRect
);
57 SoundListView::AttachedToWindow()
59 BListView::AttachedToWindow();
60 SetViewColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR
),
65 SoundListItem::SoundListItem(
78 SoundListItem::~SoundListItem()