Ejemplo n.º 1
0
/*------------------------------------------------------------------------------*/
void WmCreateKeyConf( HWND hWnd, HINSTANCE hInst )
{
	/* Key Conf */
	for ( int i=0; i<21; i++ ){
		WCHAR *name = ButtonName[ButtonIndex[i]];
		int dik = 0;
		int x = 22 + (i/11)*165;
		int y = 40 + (i%11)*22;

		KeyConfTxt[i] = CreateWindow( L"STATIC",   name, WSD_TEXT,        x, y+5, 60,  21, hWnd, HMENU(i+200), hInst, NULL );
		KeyConfBox[i] = CreateWindow( L"BUTTON",   NULL, WSD_GROUPBOX,    x, y-9, 60,  31, hWnd, HMENU(i+220), hInst, NULL );
		KeyConfLst[i] = CreateWindow( L"COMBOBOX", NULL, WSD_COMBOBOX, x+70, y+1, 80, 300, hWnd, HMENU(i+240), hInst, NULL );

		if ( SettingData.KeyUse == 0 ){ EnableWindow( KeyConfLst[i], FALSE ); }
		SetFontNorm( KeyConfTxt[i] );
		SetFontNorm( KeyConfLst[i] );
		for ( int j=0; j<KEY_NAME_SIZE; j++ ){
			SendMessage( KeyConfLst[i], CB_ADDSTRING, 0, (LPARAM)KeyNameTable[j].name );
			if ( KeyNameTable[j].dik == SettingData.KeyConf[i] ){ dik = j; }
		}
		SendMessage( KeyConfLst[i], CB_SETCURSEL, dik, 0 );
	}
	/* Key Use */
	KeyConfUse = MyCreateWindow( &CWD_KeyConfUse, hWnd, hInst );
	if ( SettingData.KeyUse != 0 ){
		SendMessage( KeyConfUse, BM_SETCHECK, (WPARAM)BST_CHECKED, 0 );
	}

	WmCreateSaveButton( hWnd );
	InvalidateRect( hWnd, NULL, TRUE );
}
Ejemplo n.º 2
0
// ----------------------------------------------------------------------------------
bool cgWindow::Initialize( int nWidth, int nHeight, int nStyle, int nStyleEx, WNDPROC wndProc)
{
	MyRegisterClass(wndProc);

	if (!MyCreateWindow( nStyle, nStyleEx))
		return false;

	SetSize(nWidth, nHeight);

	return true;
}
Ejemplo n.º 3
0
/*------------------------------------------------------------------------------*/
void WmCreateJoyConf( HWND hWnd, HINSTANCE hInst )
{
	WCHAR buff[16];

	/* Button Conf */
	for ( int i=0; i<22; i++ ){
		WCHAR *name = ButtonName[ButtonIndex[i]];
		int x = 22 + (i/11)*113;
		int y = 40 + (i%11)*22;

		JoyConfBtn[i] = CreateWindow( L"BUTTON", name, WSD_BUTTON,      x,   y, 52, 21, hWnd, (HMENU)(i+100), hInst, NULL );
		JoyConfBox[i] = CreateWindow( L"BUTTON", NULL, WSD_GROUPBOX, x+56, y-9, 46, 31, hWnd, (HMENU)(i+125), hInst, NULL );
		JoyConfTxt[i] = CreateWindow( L"EDIT",   NULL, WSD_EDITBOX,  x+59, y+2, 41, 18, hWnd, (HMENU)(i+150), hInst, NULL );
		SetFontNorm( JoyConfBtn[i] );
		SetFontMini( JoyConfTxt[i] );
		SetJoyConfTxt( i );
	}
	/* Use Joy No */
	JoyIndexNo = MyCreateWindow( &CWD_JoyIndexNo, hWnd, hInst );
	for ( int i=0; i<JOY_MAX; i++ ){
		wsprintf( buff, L"Use Joy%02d", i );
		SendMessage( JoyIndexNo, CB_ADDSTRING, 0, (LPARAM)buff );
	}
	SendMessage( JoyIndexNo, CB_SETCURSEL, SettingData.JoyNo, 0 );
	/* Joy Status */
	JoyStatGrp  = MyCreateWindow( &CWD_JoyStatGrp,  hWnd, hInst );
	JoyStatInfo = MyCreateWindow( &CWD_JoyStatInfo, hWnd, hInst );
	/* Analog Conf */
	JoyAnaText = MyCreateWindow( &CWD_JoyAnaText, hWnd, hInst );
	JoyAnaCBox = MyCreateWindow( &CWD_JoyAnaCBox, hWnd, hInst );
	for ( int i=0; i<4; i++ ){
		SendMessage( JoyAnaCBox, CB_ADDSTRING, 0, (LPARAM)DirectName[i] );
	}
	SendMessage( JoyAnaCBox, CB_SETCURSEL, SettingData.JoyAnalog, 0 );
	/* Margin Conf */
	JoyMgnText = MyCreateWindow( &CWD_JoyMgnText, hWnd, hInst );
	JoyMgnCBox = MyCreateWindow( &CWD_JoyMgnCBox, hWnd, hInst );
	for ( int i=0; i<101; i++ ){
		wsprintf( buff, L"%3d%%", i-50 );
		SendMessage( JoyMgnCBox, CB_ADDSTRING, 0, (LPARAM)buff );
	}
	SendMessage( JoyMgnCBox, CB_SETCURSEL, SettingData.JoyMargin, 0 );

	WmCreateSaveButton( hWnd );
	InvalidateRect( hWnd, NULL, TRUE );
	JoyStatText[0] = 0;
}