コード例 #1
0
ファイル: game_ingame.c プロジェクト: libcg/PSP_Bot
void controlUI()
{
  if (game.state == GAME)
  {
    if (intrp.running && testButton(PSP_CTRL_CROSS,1)) stopProgram();
  }

  if (game.state != GAME_FUNC_SETTING) return;
  // Function selector
  ui.func_selected += testButton(PSP_CTRL_RTRIGGER,1) -
                      testButton(PSP_CTRL_LTRIGGER,1);
  ui.func_selected += FUNC_NBR * ((ui.func_selected <  0) -
                                  (ui.func_selected >= FUNC_NBR));

  // Matrix selector
  ui.matrix_x += testButton(PSP_CTRL_RIGHT,1) - testButton(PSP_CTRL_LEFT,1);
  ui.matrix_y += testButton(PSP_CTRL_DOWN,1) - testButton(PSP_CTRL_UP,1);
  ui.matrix_x += MATRIX_W * ((ui.matrix_x <  0) - (ui.matrix_x >= MATRIX_W));
  ui.matrix_y += MATRIX_H * ((ui.matrix_y <  0) - (ui.matrix_y >= MATRIX_H));

  if (testButton(PSP_CTRL_CROSS,1))
  {
    game.func_matrix[ui.matrix_x][ui.matrix_y] = ui.func_selected + 1;
    nextInstruction();
  }
  else if (testButton(PSP_CTRL_CIRCLE,1))
    game.func_matrix[ui.matrix_x][ui.matrix_y] = 0;
  else if (testButton(PSP_CTRL_SELECT,1))
    clearFuncMatrix();
}
コード例 #2
0
ファイル: game_ingame.c プロジェクト: libcg/PSP_Bot
void gameInGame()
{
  if (testButton(PSP_CTRL_SQUARE,2))
  {
    if      (game.state == GAME) game.state = GAME_FUNC_SETTING;
    else if (game.state == GAME_FUNC_SETTING) game.state = GAME;
  }
  else if (testButton(PSP_CTRL_START,1))
    runProgram();

  controlUI();
  isLevelDone();
}
int main( int argc, char **argv )
{
	QApplication a( argc, argv);

	QPushButton testButton( "Test Me", 0 );
	testButton.resize(150, 50);

	testButton.show();
	return a.exec();

}
コード例 #4
0
ファイル: wtest.c プロジェクト: awmaker/awmaker
int main(int argc, char **argv)
{
	WMScreen *scr;
	WMPixmap *pixmap;

	/* Initialize the application */
	WMInitializeApplication("Test@eqweq_ewq$eqw", &argc, argv);

	testUD();

	/*
	 * Open connection to the X display.
	 */
	dpy = XOpenDisplay("");

	if (!dpy) {
		puts("could not open display");
		exit(1);
	}

	/* This is used to disable buffering of X protocol requests.
	 * Do NOT use it unless when debugging. It will cause a major
	 * slowdown in your application
	 */
#if 0
	XSynchronize(dpy, True);
#endif
	/*
	 * Create screen descriptor.
	 */
	scr = WMCreateScreen(dpy, DefaultScreen(dpy));

	/*
	 * Loads the logo of the application.
	 */
	pixmap = WMCreatePixmapFromFile(scr, "logo.xpm");

	/*
	 * Makes the logo be used in standard dialog panels.
	 */
	if (pixmap) {
		WMSetApplicationIconPixmap(scr, pixmap);
		WMReleasePixmap(pixmap);
	}

	/*
	 * Do some test stuff.
	 *
	 * Put the testSomething() function you want to test here.
	 */

	testText(scr);
	testFontPanel(scr);

	testColorPanel(scr);

	testTextField(scr);

#if 0

	testBox(scr);
	testButton(scr);
	testColorPanel(scr);
	testColorWell(scr);
	testDragAndDrop(scr);
	testFrame(scr);
	testGradientButtons(scr);
	testList(scr);
	testOpenFilePanel(scr);
	testProgressIndicator(scr);
	testPullDown(scr);
	testScrollView(scr);
	testSlider(scr);
	testSplitView(scr);
	testTabView(scr);
	testTextField(scr);
#endif
	/*
	 * The main event loop.
	 *
	 */
	WMScreenMainLoop(scr);

	return 0;
}