void PopUpDialog::setSelection(int item) {
	if (item != _selection) {
		// Undraw old selection
		if (_selection >= 0)
			drawMenuEntry(_selection, false);

		// Change selection
		_selection = item;

		// Draw new selection
		if (item >= 0)
			drawMenuEntry(item, true);
	}
}
Beispiel #2
0
void drawMenu(menu_s* m)
{
	if(!m)return;

	if(!m->numEntries)
	{
		drawError(GFX_BOTTOM,
			"Error",
			"    It seems you don't have any homebrew applications installed on your\n"
			"SD card.\n"
			"    Please take out your SD card, create a folder named \"3ds\" at the root of\n"
			"your card and place homebrew there.\n"
			"    Then, simply insert your SD card back into your 3DS !\n"
			"    The homebrew launcher will take it from there.",
			0);
	}else{
		menuEntry_s* me=m->entries;
		int i=0;
		int h=0;
		while(me)
		{
			h+=drawMenuEntry(me, GFX_BOTTOM, getEntryLocationPx(m,h), 9, i==m->selectedEntry);
			me=me->next;
			i++;
		}
	}

	drawScrollBar(m);
}
void PopUpDialog::drawDialog() {
	// Draw the menu border
	g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x+_w, _y+_h), THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND | THEME_HINT_USE_SHADOW);

	/*if (_twoColumns)
		g_gui.vLine(_x + _w / 2, _y, _y + _h - 2, g_gui._color);*/

	// Draw the entries
	int count = _popUpBoss->_entries.size();
	for (int i = 0; i < count; i++) {
		drawMenuEntry(i, i == _selection);
	}

	// The last entry may be empty. Fill it with black.
	/*if (_twoColumns && (count & 1)) {
		g_gui.fillRect(_x + 1 + _w / 2, _y + 1 + kLineHeight * (_entriesPerColumn - 1), _w / 2 - 1, kLineHeight, g_gui._bgcolor);
	}*/
}