Пример #1
0
// Calendar render creation routines
void createCalendar()
{
	clearControls();
	
	registerScreenUpdate(calendarUpdateScreen, NULL);
	registerHelpScreen("calendar.html", true);
	
	addHome(l_home, exitCalendar);
	addDefaultButtons(l_editreminder, calendarForward, l_viewday, calendarBack);
	addDefaultLR(l_prev, calendarPreviousDay, l_next, calendarNextDay);
	
	newControl(0xFF, 23, 57, 233, 160, CT_HITBOX, NULL);
	setControlCallbacks(0xFF, calendarClick, NULL, NULL);
	
	// for dpad
	addHotKey(0, KEY_UP, calendarMoveCursor, 0, NULL);
	addHotKey(1, KEY_DOWN, calendarMoveCursor, 0, NULL);
	addHotKey(2, KEY_LEFT, calendarMoveCursor, 0, NULL);
	addHotKey(3, KEY_RIGHT, calendarMoveCursor, 0, NULL);
}
Пример #2
0
//To avoid recursion as Mickey's constructor uses GUI too
void MickeyGUI::init()
{
  mickey = new Mickey();

  settings.beginGroup(QString::fromUtf8("HotKeys"));
  
  ui.HotkeyStack->addWidget(new QLabel(QString::fromUtf8("Hotkey setup")), 1, 1);
  toggleHotKey = addHotKey(QString::fromUtf8("Start/Stop tracking:"), QString::fromUtf8("tracking_toggle"),
			   0, this, mickey, ui.HotkeyStack, &settings, 2, 1);
  recenterHotKey = addHotKey(QString::fromUtf8("Quick recenter:"), QString::fromUtf8("quick_recenter"),
			   3, this, mickey, ui.HotkeyStack, &settings, 2, 2);
  ui.HotkeyStack->addWidget(new QLabel(QString::fromUtf8("Mouse button emulation")), 3, 1);
  lmbHotKey = addHotKey(QString::fromUtf8("Left:"), QString::fromUtf8("l_mouse"), 
			   1, this, mickey, ui.HotkeyStack, &settings, 4, 1);
  mmbHotKey = addHotKey(QString::fromUtf8("Middle:"), QString::fromUtf8("m_mouse"), 
			   2, this, mickey, ui.HotkeyStack, &settings, 4, 2);
  settings.endGroup();
  ui.ApplyButton->setEnabled(false);
  mickey->setRelative(ui.RelativeCB->isChecked());
  changed = false;
}
Пример #3
0
void createEditCalendar()
{
	clearControls();
	
	registerScreenUpdate(editReminderUpdateScreen, NULL);
	registerHelpScreen("edit.html", true);
	
	addHome(l_swap, toggleKeyboard);
	addDefaultButtons(l_save, editCalendarForward, l_back, editCalendarBack);
	addKeyboard(0, 0, true, false, SCREEN_BG, editReminderAction, NULL);
	
	// for dpad
	addHotKey(4, KEY_UP, calendarMoveCursor, KEY_UP, NULL);
	addHotKey(5, KEY_DOWN, calendarMoveCursor, KEY_DOWN, NULL);
	addHotKey(6, KEY_LEFT, calendarMoveCursor, KEY_LEFT, NULL);
	addHotKey(7, KEY_RIGHT, calendarMoveCursor, KEY_RIGHT, NULL);

	setControlRepeat(4, 15, 4);
	setControlRepeat(5, 15, 4);
	setControlRepeat(6, 15, 4);
	setControlRepeat(7, 15, 4);
}
Пример #4
0
void initAbout()
{
	setEncoding(CHARSET_ASCII, &aboutData);
	setHTMLWidth(ABOUT_HELP_WIDTH, &aboutData);
	setContent(TYPE_HTML, &aboutData);
	
	abScreen = (char *)trackMalloc(strlen((char *)about_html)+1, "temp about");
	memcpy(abScreen, about_html, strlen((char *)about_html)+1);
	
	loadHTMLFromMemory(abScreen, &aboutData);
	
	clearControls();
	
	registerScreenUpdate(drawAboutScreen, freeAbout);
	registerHelpScreen(NULL, true);
	
	newControl(0xFF, 32, 70, 244, 79, CT_HITBOX, NULL);
	setControlCallbacks(0xFF, loadBrowser, NULL, NULL);
	addHotKey(0xF0, KEY_START, exitAbout, 0, NULL);
}
Пример #5
0
void initSound()
{
	firstTime = true;
	soundLoaded = false;
	
	if(getFileType(getFileName()) == SOUNDFILE)
	{
		addToRandomList(getFileName(), getCursor());
	}
	
	clearControls();
	
	registerScreenUpdate(soundUpdateScreen, NULL);
	registerHelpScreen("sound.html", true);
	
	addHome(l_hold, toggleHold);
	setControlGrayed(CONTROL_HOME, !hold);
	
	addDefaultLR(NULL, getPrevSound, NULL, getNextSound);	
	addHotKey(0xF0, KEY_L, getPrevSound, 0, NULL);
	addHotKey(0xF1, KEY_R, getNextSound, 0, NULL);
	
	addDefaultButtons(l_pause, togglePause, l_back, exitSound);
	
	// for dpad
	addHotKey(0, KEY_UP, volumeUp, 0, NULL);
	addHotKey(1, KEY_DOWN, volumeDown, 0, NULL);
	addHotKey(2, KEY_LEFT, soundPrevTrack, 0, NULL);
	addHotKey(3, KEY_RIGHT, soundNextTrack, 0, NULL);
	
	addHotKey(4, KEY_X, switchSoundMode, 0, NULL);
	
	// for seek bar
	newControl(0xFF, 10, 20, 244, 40, CT_HITBOX, NULL);
	setControlCallbacks(0xFF, seekSound, NULL, NULL);
	setControlAbsoluteCoords(0xFF, true);
}