示例#1
0
void
AboutView::MessageReceived(BMessage* msg)
{
	switch (msg->what) {
		case SCROLL_CREDITS_VIEW:
		{
			BScrollBar* scrollBar =
				fCreditsView->ScrollBar(B_VERTICAL);
			if (scrollBar == NULL)
				break;
			float max, min;
			scrollBar->GetRange(&min, &max);
			if (scrollBar->Value() < max)
				fCreditsView->ScrollBy(0, 1);

			break;
		}

		case 'eegg':
		{
			printf("Easter egg\n");
			PickRandomHaiku();
			break;
		}

		default:
			BView::MessageReceived(msg);
			break;
	}
}
示例#2
0
void
AboutView::MouseDown(BPoint point)
{
	BRect r(92, 26, 105, 31);
	if (r.Contains(point)) {
		printf("Easter egg\n");
		PickRandomHaiku();
	}

	if (Bounds().Contains(point)) {
		fLastActionTime = system_time();
		delete fScrollRunner;
		fScrollRunner = NULL;
	}
}