mirror of
https://review.haiku-os.org/haiku
synced 2025-02-23 05:58:31 +01:00
I don't know what I've done but I've stuffed something up and it doesnt compile with the subclass of ListItem, so I removed it and took it back to the plain boring ListItem.
Might have to leave it like this as I've spent way too much time on this as it is. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2827 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
de34217176
commit
faf47df33f
@ -49,12 +49,11 @@ MediaListItem::MediaListItem(const char *label, int32 MediaName, BBitmap *bitmap
|
||||
//MediaListItem - DrawItem
|
||||
void MediaListItem::DrawItem(BView *owner, BRect frame, bool complete)
|
||||
{
|
||||
rgb_color kHighlight = { 220,220,220,0 };
|
||||
rgb_color kHighlight = { 140,140,140,0 };
|
||||
rgb_color kBlackColor = { 0,0,0,0 };
|
||||
rgb_color kMedGray = { 140,140,140,0 };
|
||||
|
||||
BRect r;
|
||||
|
||||
r.top = frame.top;
|
||||
r.left = frame.left-10;
|
||||
r.right = frame.right;
|
||||
@ -70,10 +69,11 @@ void MediaListItem::DrawItem(BView *owner, BRect frame, bool complete)
|
||||
color = owner->ViewColor();
|
||||
}
|
||||
owner->SetHighColor(color);
|
||||
owner->SetLowColor(color);
|
||||
owner->FillRect(r);
|
||||
}
|
||||
|
||||
owner->MovePenTo(frame.left-10,frame.bottom-13);
|
||||
owner->MovePenTo(frame.left-10,frame.top);
|
||||
owner->DrawBitmap(icon);
|
||||
|
||||
owner->MovePenTo(frame.left+10, frame.bottom-2);
|
||||
@ -83,8 +83,9 @@ void MediaListItem::DrawItem(BView *owner, BRect frame, bool complete)
|
||||
} else {
|
||||
owner->SetHighColor(kMedGray);
|
||||
}
|
||||
|
||||
owner->DrawString(media_names[kMediaName]);
|
||||
|
||||
owner->AttachedToWindow();
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
|
@ -46,7 +46,9 @@ Media - MediaWindow by Sikosis
|
||||
#include "mixer.h"
|
||||
#include "tv.h"
|
||||
|
||||
const uint32 NEW_MSG = 'nwm';
|
||||
const uint32 ML_AUDIO_SETTINGS = 'MlAS';
|
||||
const uint32 ML_AUDIO_MIXER = 'MlAM';
|
||||
const uint32 NEW_MSG = 'nmsg';
|
||||
|
||||
// CenterWindowOnScreen -- Centers the BWindow to the Current Screen
|
||||
static void CenterWindowOnScreen(BWindow* w)
|
||||
@ -101,20 +103,23 @@ void MediaWindow::InitWindow(void)
|
||||
BRect AvailableRect(r.left+160,r.top+12,r.right-10,r.bottom-10);
|
||||
BRect TitleRect(0,0,140,16);
|
||||
BRect AudioMixerRect(0,30,470,400);
|
||||
|
||||
BOutlineListView *outline;
|
||||
MediaListItem *topmenu;
|
||||
MediaListItem *submenu;
|
||||
BScrollView *outlinesv;
|
||||
BStringView *stvAudioSettings;
|
||||
BStringView *stvAudioMixer;
|
||||
//MediaListItem *topmenu;
|
||||
//MediaListItem *submenu;
|
||||
BListItem *topmenu;
|
||||
BListItem *submenu;
|
||||
BScrollView *outlinesv;
|
||||
BStringView *stvAudioSettings;
|
||||
BStringView *stvAudioMixer;
|
||||
|
||||
outline = new BOutlineListView(outlinerect,"audio_list", B_SINGLE_SELECTION_LIST);
|
||||
/*outline->AddItem(topmenu = new BStringItem("Audio Settings"));
|
||||
outline->AddItem(topmenu = new BStringItem("Audio Settings"));
|
||||
outline->AddUnder(submenu = new BStringItem("Audio Mixer"), topmenu);
|
||||
outline->AddUnder(new BStringItem("None Out"), submenu);
|
||||
outline->AddUnder(new BStringItem("None In"), submenu);
|
||||
outline->AddItem(topmenu = new BStringItem("Video Settings"));
|
||||
outline->AddUnder(submenu = new BStringItem("Video Window Consumer"), topmenu);*/
|
||||
outline->AddUnder(submenu = new BStringItem("Video Window Consumer"), topmenu);
|
||||
|
||||
// Bitmaps
|
||||
BRect BitmapFrame(0,0,15,15);
|
||||
@ -125,14 +130,16 @@ void MediaWindow::InitWindow(void)
|
||||
BBitmap *TVIcon = new BBitmap(BitmapFrame,B_RGB32);
|
||||
TVIcon->SetBits(tvicon,768,0,B_RGB32);
|
||||
|
||||
outline->AddItem(topmenu = new MediaListItem("Audio Settings", MediaListItem::AS, DevicesIcon, new BMessage(NEW_MSG)));
|
||||
topmenu->SetHeight(30);
|
||||
outline->AddItem(submenu = new MediaListItem("Audio Mixer", MediaListItem::AM, MixerIcon, new BMessage(NEW_MSG)));
|
||||
/*outline->AddItem(topmenu = new MediaListItem("Audio Settings", MediaListItem::AS, DevicesIcon, new BMessage(ML_AUDIO_SETTINGS)));
|
||||
outline->AddItem(submenu = new MediaListItem("Audio Mixer", MediaListItem::AM, MixerIcon, new BMessage(ML_AUDIO_MIXER)));
|
||||
outline->AddUnder(new BStringItem("None Out"), submenu);
|
||||
outline->AddUnder(new BStringItem("None In"), submenu);
|
||||
outline->AddItem(topmenu = new MediaListItem("Video Settings", MediaListItem::VS, DevicesIcon, new BMessage(NEW_MSG)));
|
||||
outline->AddItem(submenu = new MediaListItem("Video Window Consumer", MediaListItem::VWC, TVIcon, new BMessage(NEW_MSG)));
|
||||
|
||||
outline->AddItem(submenu = new MediaListItem("Video Window Consumer", MediaListItem::VWC, TVIcon, new BMessage(NEW_MSG)));*/
|
||||
|
||||
topmenu->SetHeight(18);
|
||||
submenu->SetHeight(18);
|
||||
|
||||
// Add ScrollView to Media Menu
|
||||
outlinesv = new BScrollView("scroll_audio", outline, B_FOLLOW_LEFT|B_FOLLOW_TOP, 0, false, false, B_FANCY_BORDER);
|
||||
|
||||
@ -148,6 +155,7 @@ void MediaWindow::InitWindow(void)
|
||||
stvAudioMixer->SetHighColor(TitleFontColor);
|
||||
|
||||
// Setup the OutlineView
|
||||
outline->AllAttached();
|
||||
outlinesv->SetBorderHighlighted(true);
|
||||
|
||||
// Back and Fore ground Colours
|
||||
@ -203,7 +211,7 @@ void ErrorAlert(char* errorMessage) {
|
||||
printf("%s\n", errorMessage);
|
||||
BAlert *alert = new BAlert("BAlert", errorMessage, "OK", NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
|
||||
alert->Go();
|
||||
//exit(1);
|
||||
exit(1);
|
||||
}
|
||||
// ---------------------------------------------------------------------------------------------------------- //
|
||||
|
||||
@ -213,10 +221,9 @@ void MediaWindow::MessageReceived (BMessage *message)
|
||||
{
|
||||
switch(message->what)
|
||||
{
|
||||
char* myerror;
|
||||
sprintf(myerror,"%s",message->what);
|
||||
ErrorAlert(myerror);
|
||||
|
||||
case ML_AUDIO_SETTINGS:
|
||||
exit(1); // debug of course ;)
|
||||
break;
|
||||
default:
|
||||
BWindow::MessageReceived(message);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user