예제 #1
0
PairsView::PairsView(BRect frame, const char* name, int width, int height,
		uint32 resizingMode)
	:
	BView(frame, name, resizingMode, B_WILL_DRAW),
	fWidth(width),
	fHeight(height),
	fNumOfCards(width * height),
	fRandPos(new int[fNumOfCards]),
	fPosX(new int[fNumOfCards]),
	fPosY(new int[fNumOfCards])
{
	CreateGameBoard();
	_SetPairsBoard();
}
예제 #2
0
PairsView::PairsView(BRect frame, const char* name, uint8 rows, uint8 cols,
	uint8 iconSize)
	:
	BView(frame, name, B_FOLLOW_ALL_SIDES, B_WILL_DRAW | B_FRAME_EVENTS),
	fRows(rows),
	fCols(cols),
	fIconSize(iconSize),
	fButtonsCount(rows * cols),
	fCardsCount(fButtonsCount / 2),
	fPairsButtonList(new BObjectList<PairsButton>(fButtonsCount)),
	fSmallBitmapsList(new BObjectList<BBitmap>(fCardsCount)),
	fMediumBitmapsList(new BObjectList<BBitmap>(fCardsCount)),
	fLargeBitmapsList(new BObjectList<BBitmap>(fCardsCount)),
	fRandomPosition(new int32[fButtonsCount]),
	fPositionX(new int32[fButtonsCount]),
	fPositionY(new int32[fButtonsCount])
{
	SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
	CreateGameBoard();
	_SetPairsBoard();
}