Exemplo n.º 1
0
void ClientWindowDock::MessageReceived(BMessage* msg)
{
	switch (msg->what) {
	case M_NOTIFYLIST_RESIZE: {
		if (fNotifyExpanded) {
			fNotifyAgent->ResizeTo(fNotifyAgent->Bounds().Width(), label_height() - 2);
			fNotifyAgent->MoveTo(0.0, Bounds().bottom - label_height() + 2);
			fWinListAgent->ResizeBy(
				0.0, (fNotifyAgent->Frame().top - fWinListAgent->Frame().bottom - 1.0));
			fNotifyExpanded = false;
		} else {
			fWinListAgent->ResizeBy(0.0, -1.0 * (fWinListAgent->Bounds().Height() / 3.0));
			fNotifyAgent->MoveTo(0.0, fWinListAgent->Frame().bottom + 1.0);
			fNotifyAgent->ResizeBy(0.0, Bounds().bottom - fNotifyAgent->Frame().bottom);
			fNotifyExpanded = true;
		}
		vision_app->SetBool("notifyExpanded", fNotifyExpanded);
		break;
	}

	default:
		BView::MessageReceived(msg);
		break;
	}
}
Exemplo n.º 2
0
AgentDockNotifyList::AgentDockNotifyList (BRect frame_)
	: BView (
		frame_,
		"agentDockNotifyList",
		B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM,
		B_WILL_DRAW)
{

	SetViewColor (vision_app->GetColor (B_PANEL_BACKGROUND_COLOR));
	BRect frame (frame_);
	
	BRect headerFrame (frame);
	headerFrame.top = 0;
	headerFrame.bottom = label_height() - 1;
	fAHeader = new AgentDockHeader (headerFrame, B_TRANSLATE("Notify List"),
		B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
	headerFrame.top = headerFrame.bottom + 1;
	// BScrollView in R5 has an odd bug where if you initialize it too small,
	// it never draws its scrollbar arrows correctly
	frame.top = headerFrame.bottom + 1;
	frame.right -= B_V_SCROLL_BAR_WIDTH + 1;
	frame.bottom = frame.bottom - 1; // room for "plain" border
	fNotifyList = new NotifyList (frame);
	fNotifyScroll = new BScrollView ("fNotifyListScroll",
																	 fNotifyList,
																	 B_FOLLOW_ALL,
																	 0,
																	 false,
																	 true,
																	 B_PLAIN_BORDER);
	AddChild (fAHeader);
	AddChild (fNotifyScroll);
}
Exemplo n.º 3
0
void AgentDockNotifyList::AllAttached(void)
{
	// hack to deal with some R5 scrollbar drawing bugs
	fNotifyScroll->ResizeBy(0.0, Bounds().Height() - fNotifyScroll->Bounds().Height() -
									 label_height() + 2);
	BView::AllAttached();
}
Exemplo n.º 4
0
AgentDockWinList::AgentDockWinList (BRect frame_)
	: BView (
		frame_,
		"agentDockWinList",
		B_FOLLOW_ALL,
		B_WILL_DRAW)
{
	SetViewColor (vision_app->GetColor (C_WINLIST_BACKGROUND));
	BRect frame (frame_);
	
	BRect headerFrame (frame);
	headerFrame.bottom = label_height() - 1;
	fAHeader = new AgentDockHeader (headerFrame, B_TRANSLATE("Window List"), B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
	AddChild (fAHeader);
	 
	frame.top = headerFrame.bottom + 1;
	frame.right = frame.right - B_V_SCROLL_BAR_WIDTH - 1; // scrollbar
	frame.bottom = frame.bottom - 1; // room for "plain" border

	fWinList = new WindowList (frame);

	fWinListScroll = new BScrollView (
		"fWinListScroll",
		fWinList,
		B_FOLLOW_ALL,
		0,
		false,
		true,
		B_PLAIN_BORDER);
	AddChild (fWinListScroll);
}
Exemplo n.º 5
0
void ClientWindowDock::AddNotifyList(void)
{
	BRect notifyFrame(fWorkingFrame);
	notifyFrame.top = fWorkingFrame.bottom - label_height() + 2;

	fWorkingFrame.bottom = fWorkingFrame.bottom - (notifyFrame.Height() + 1);

	fNotifyAgent = new AgentDockNotifyList(notifyFrame);
	AddChild(fNotifyAgent);
}