コード例 #1
0
void BankAccount::BankAccountChoice()
{
	switch (choice)
	{
	case 1:
		displayOwner();
		break;
	case 2:
		displayBalance();
		break;
	case 3:
		displayCreationDay();
		break;
	case 4:
		enterDeposit();
		break;
	case 5:
		enterWithdrawal();
		break;
	case 9: 
		cout << "\nYou have successfully logged out.\n\n";
		saveFile();
		system("cls");
		LogIn::mainMenu();
		break;
	}

	BankAccountMenu();
}
コード例 #2
0
ファイル: Forces.cpp プロジェクト: mdejean/Chkdraft
void ForcesWindow::RefreshWindow()
{
	HWND hWnd = getHandle();
	GuiMapPtr map = chkd.maps.curr;
	if ( map != nullptr )
	{
		for ( int force=0; force<4; force++ )
		{
			ChkdString forceName;
			bool allied = false, vision = false, random = false, av = false;
			map->getForceString(forceName, force);
			map->getForceInfo(force, allied, vision, random, av);

			SetWindowText(GetDlgItem(hWnd, EDIT_F1NAME+force), forceName.c_str());
			if ( allied ) SendMessage(GetDlgItem(hWnd, CHECK_F1ALLIED+force), BM_SETCHECK, BST_CHECKED  , 0);
			else		  SendMessage(GetDlgItem(hWnd, CHECK_F1ALLIED+force), BM_SETCHECK, BST_UNCHECKED, 0);
			if ( vision ) SendMessage(GetDlgItem(hWnd, CHECK_F1VISION+force), BM_SETCHECK, BST_CHECKED  , 0);
			else		  SendMessage(GetDlgItem(hWnd, CHECK_F1VISION+force), BM_SETCHECK, BST_UNCHECKED, 0);
			if ( random ) SendMessage(GetDlgItem(hWnd, CHECK_F1RANDOM+force), BM_SETCHECK, BST_CHECKED  , 0);
			else		  SendMessage(GetDlgItem(hWnd, CHECK_F1RANDOM+force), BM_SETCHECK, BST_UNCHECKED, 0);
			if ( av		) SendMessage(GetDlgItem(hWnd, CHECK_F1AV	 +force), BM_SETCHECK, BST_CHECKED  , 0);
			else		  SendMessage(GetDlgItem(hWnd, CHECK_F1AV	 +force), BM_SETCHECK, BST_UNCHECKED, 0);
		}

		for ( int i=0; i<4; i++ )
		{
			HWND hListBox = GetDlgItem(hWnd, LB_F1PLAYERS+i);
			if ( hListBox != NULL )
				while ( SendMessage(hListBox, LB_DELETESTRING, 0, 0) != LB_ERR );
		}

		for ( int player=0; player<8; player++ )
		{
			u8 force(0), color(0), race(0), displayOwner(map->getDisplayOwner(player));
			if ( map->getPlayerForce(player, force) )
			{
				map->getPlayerColor(player, color);
				map->getPlayerRace(player, race);
				std::stringstream ssplayer;
				ssplayer << "Player " << player+1 << " - " << playerColors.at(color) << " - "
						 << playerRaces.at(race) << " (" << playerOwners.at(displayOwner) << ")";
				HWND hListBox = GetDlgItem(hWnd, LB_F1PLAYERS+force);
				if ( hListBox != NULL )
					SendMessage(hListBox, LB_ADDSTRING, 0, (LPARAM)ssplayer.str().c_str());
			}
		}
	}
}
コード例 #3
0
ファイル: MapProperties.cpp プロジェクト: jjf28/Chkdraft
void MapPropertiesWindow::RefreshWindow()
{
    refreshing = true;
    if ( CM != nullptr )
    {
        ChkdString mapTitle, mapDescription;
        CM->getMapTitle(mapTitle);
        CM->getMapDescription(mapDescription);
        u16 tileset = CM->getTileset(),
            currWidth = CM->XSize(),
            currHeight = CM->YSize();

        std::string sCurrWidth(std::to_string(currWidth));
        std::string sCurrHeight(std::to_string(currHeight));
        
        editMapTitle.SetText(mapTitle.c_str());
        editMapDescription.SetText(mapDescription.c_str());
        possibleTitleUpdate = false;
        possibleDescriptionUpdate = false;
        dropMapTileset.SetSel(tileset);
        dropMapTileset.ClearEditSel();
        dropNewMapTerrain.SetSel(0);
        dropNewMapTerrain.ClearEditSel();
        editMapWidth.SetText(sCurrWidth.c_str());
        editMapHeight.SetText(sCurrHeight.c_str());
                    
        for ( int player=0; player<12; player++ )
        {
            u8 displayOwner(CM->GetPlayerOwnerStringIndex(player)), race(0), color(0);
            CM->getPlayerRace(player, race);
            dropPlayerOwner[player].SetSel(displayOwner);
            dropPlayerOwner[player].ClearEditSel();
            dropPlayerRaces[player].SetSel(race);
            dropPlayerRaces[player].ClearEditSel();

            if ( player < 8 )
            {
                CM->getPlayerColor(player, color);
                dropPlayerColor[player].SetSel(0);
                dropPlayerColor[player].ClearEditSel();
            }
        }
    }
    refreshing = false;
}