コード例 #1
0
ファイル: rafdiary.cpp プロジェクト: xor2003/bob-flight-sim
void RAFDiary::Refresh()
{
	
	CRCombo* combo;

	combo=GETDLGITEM(IDC_RCOMBOGROUP);
	combo->Clear()->RESCOMBO(10,6)->
					SetIndex(group);

	combo=GETDLGITEM(IDC_RCOMBOSQUAD);
	combo->Clear();
	
	int index = 0;
	for (int i = 0; i < maxsquads; i++)
	{
		combo->AddString(Node_Data.squadron[Squadron[i]].SubName());
		if(sqnum == Node_Data.squadron[Squadron[i]].squadron)
			index = i;

	}

	combo->SetIndex(index);



}
コード例 #2
0
ファイル: quickpar.cpp プロジェクト: xor2003/bob-flight-sim
void	QuickParameters::ReinitCombo()
{
	CRCombo* combo;
	targtype=0,targentry=0;
	for (int t=0;t<4;t++)
		for (int e=0;e<4;e++)
			if(CSQuick1::quickdef.targets[t][e]==CSQuick1::quickdef.target)
				targtype=t,targentry=e;

	combo=GETDLGITEM(IDC_TARGTYPE);
	combo->Clear();
	combo->AddString(LoadResString(CSQuick1::quickdef.targtypeIDs[0]));
	if (CSQuick1::quickdef.targtypeIDs[1])
		combo->AddString(LoadResString(CSQuick1::quickdef.targtypeIDs[1]));
	if (CSQuick1::quickdef.targtypeIDs[2])
		combo->AddString(LoadResString(CSQuick1::quickdef.targtypeIDs[2]));
	if (CSQuick1::quickdef.targtypeIDs[3])
		combo->AddString(LoadResString(CSQuick1::quickdef.targtypeIDs[3]));
	if (CSQuick1::quickdef.targtypeIDs[0])
		combo->SetIndex(targtype);

	TargNameCombo();


	SWord Latitude = 51;												//RDH 25/02/00
	MMC.Sky.SetMissionDawnDusk(Latitude, MMC.currdate, MMC.dawntime, MMC.dusktime);

	int timeindex = CSQuick1::quickdef.time;
	SetTime(timeindex);
	

	combo=GETDLGITEM(IDC_TIME);
	combo->Clear();
	combo->RESCOMBO(DAWN,4)->SetIndex(timeindex);

	int weatherindex = CSQuick1::quickdef.weather;
	SetWeather(weatherindex);


	combo=GETDLGITEM(IDC_CLOUD);
	combo->Clear();
	combo->RESCOMBO(CLEARSKY,4)->SetIndex(weatherindex);

}
コード例 #3
0
ファイル: quickpar.cpp プロジェクト: xor2003/bob-flight-sim
void	QuickParameters::TargNameCombo()
{
	CRCombo* combo;

	combo=GETDLGITEM(IDC_TARGNAME);
	combo->Clear();
	combo->AddString(GetTargName(CSQuick1::quickdef.targets[targtype][0]));
	if (CSQuick1::quickdef.targets[targtype][1])
	combo->AddString(GetTargName(CSQuick1::quickdef.targets[targtype][1]));
	if (CSQuick1::quickdef.targets[targtype][2])
		combo->AddString(GetTargName(CSQuick1::quickdef.targets[targtype][2]));
	if (CSQuick1::quickdef.targets[targtype][3])
		combo->AddString(GetTargName(CSQuick1::quickdef.targets[targtype][3]));
	combo->SetIndex(targentry);
}
コード例 #4
0
ファイル: seltrg.cpp プロジェクト: xor2003/bob-flight-sim
BOOL SelectTarget::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	CRCombo* combo;
	CRButton*	but = GETDLGITEM(IDC_RBUTTONRESET);


	combo=GETDLGITEM(IDC_RCOMBOTARGET);
	if  (	(currtab == -1)
		||	(RFullPanelDial::gameside != RFullPanelDial::SIDE_LW)
		)

	{
		but->ShowWindow(false);
		combo->ShowWindow(false);
		currindex = 0;
	}else
	{

		but->ShowWindow(true);
		combo->ShowWindow(true);
		combo->Clear();
		Profile& pk = Todays_Packages.pack[Todays_Packages.hipack];
		int ti= pk[currsquad].targetindex;
		if (ti<0) ti=0;
		TargetGroup* trg;
		trg = Node_Data[pk.packagetarget[ti].currentid];
 		combo->AddString(GetTargName(trg->uid));

		for (int i=0; i < TargetGroup::MAXSECONDARIES;i++)
		{
			if	(	(trg)	&&	(trg->secondaries[i]))
				combo->AddString(GetTargName(trg->secondaries[i]));
		}
		combo->SetIndex(0);
		currindex = 0;
	}
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
コード例 #5
0
ファイル: DIRECTS2.CPP プロジェクト: gondur/mig_src
void CDirects2::Redraw()
{
		char buffer[10];

	CDialog::OnInitDialog();
	CRCombo* combo;
	CREdtBt* b;
	b=GETDLGITEM(IDC_DIRECTIVEBUTTON);
	CRStatic*   s=GETDLGITEM(IDC_RESTING);

	
	int index;
	int string = IDS_L_AIRSUP + CComit_e::This->dir_ctrl.directives[linenum].type;
	if (CComit_e::This->dir_ctrl.directives[linenum].type != SupplyTree::D_RESTING)
	{
		b->ShowWindow(SW_SHOW);
		s->ShowWindow(SW_HIDE);
		b->SetCaption(LoadResString(string));
	}else
	{
		b->ShowWindow(SW_HIDE);
		s->ShowWindow(SW_SHOW);
		s->SetString(LoadResString(string));
	}
	int combosteps;
	combo=GETDLGITEM(IDC_COMBO_STRIKEAC);
	s=GETDLGITEM(IDC_BLANK2);
	if (CComit_e::This->dir_ctrl.directives[linenum].type == SupplyTree::D_AIRSUPERIORITY)
	{
		s->ShowWindow(SW_SHOW);
		combo->ShowWindow(SW_HIDE);
	}else
	{
		combo->ShowWindow(SW_SHOW);
		s->ShowWindow(SW_HIDE);
		combosteps = (CComit_e::This->dir_ctrl.TotalStrikeAc/4)+1;
		if ((combosteps*4-1) < CComit_e::This->dir_ctrl.directives[linenum].strikeac)
			index = combosteps-1;
		else
			index = CComit_e::This->dir_ctrl.directives[linenum].strikeac/4;
		combo->Clear()->MakeNumList(combosteps,0,4)->SetIndex(index);
	}
	combo=GETDLGITEM(IDC_COMBO_FIGHTERAC);
	combosteps = (CComit_e::This->dir_ctrl.TotalFighterAC/4)+1;
	if ((combosteps*4-1) < CComit_e::This->dir_ctrl.directives[linenum].fighterac)
		index = combosteps-1;
	else
		index = CComit_e::This->dir_ctrl.directives[linenum].fighterac/4;
 	combo->Clear()->MakeNumList(combosteps,0,4)->SetIndex(index);


	if (CComit_e::This->dir_ctrl.directives[linenum].type != SupplyTree::D_RESTING)
	{
	 	int x = CComit_e::This->dir_ctrl.directives[linenum].targets;
		_itoa(x,buffer,10);
		CRStatic*   s=GETDLGITEM(IDC_TARGETS);
		s->SetString(buffer);
		x = CComit_e::This->dir_ctrl.directives[linenum].missionsset;
		_itoa(x,buffer,10);
		s=GETDLGITEM(IDC_MISSIONS);
		s->SetString(buffer);
	}else
	{
		CRStatic*   s=GETDLGITEM(IDC_TARGETS);
		s->ShowWindow(SW_HIDE);
		s=GETDLGITEM(IDC_MISSIONS);
		s->ShowWindow(SW_HIDE);

	}

}
コード例 #6
0
ファイル: lwtaskfr.cpp プロジェクト: xor2003/bob-flight-sim
void LWTaskFighter::Refresh()
{
		CRStatic*   s;


	PackageList::AMType*	amtype;

	switch	(attackmethod)
	{
		case	Profile::AM_DETACHED:
		{
			amtype = &Todays_Packages.taskdata.detached;
			tab = 3;
			break;
		}
		case	Profile::AM_ATTACHED:
		{
			amtype = &Todays_Packages.taskdata.attached;
			tab = 2;
			break;
		}
		case	Profile::AM_RETURNESCORT:
		{
			amtype = &Todays_Packages.taskdata.returned;
			tab = 4;
			break;
		}
		default_neverreferenced; 
		
	}



	s=GETDLGITEM(IDC_RSTATICFIGHTERSALLOCATED);
	CString string = RESSTRING(AIRCRAFT);
	int acnum;
	if (amtype->acnum == 1)
		acnum = 1;
	else if (amtype->acnum > 1)
	{
		acnum = amtype->acnum;
		string = RESSTRING(AIRCRAFT_PLURAL);
	}else
	{
		acnum = amtype->squadnum;
		if (acnum < 2)
			string = RESSTRING(STAFFEL);
		else if (acnum <3)
			string = RESSTRING(L_STAFFELN);
		else if (acnum <6)
		{
			acnum = acnum/3;
			string = RESSTRING(GRUPPE);
		}else if (acnum <18)
		{
			acnum = acnum/3;
			string = RESSTRING(GRUPPEN);
		}else
		{
			acnum = acnum/9;
			string = RESSTRING(GESCHWADER);
		}
	}
	s->SetString(CSprintf("%i %s", acnum, string));








	CRCombo* combo;
	int form = (amtype->formtype & FORMTYPE_SQUAD)>>FORMTYPE_SQUAD_SH;
	if (form > 6) form = 6;
	if (form < 0) form = 0;
	combo=GETDLGITEM(IDC_RCOMBOFORMATION);
	combo->Clear()->RESCOMBO(AUTO,1)-> SetIndex(0);

//DeadCode JIM 14Nov00 	combo->Clear()->RESCOMBO(ECHELONL,7)-> SetIndex(form);


	  	combo=GETDLGITEM(IDC_RCOMBOUNITTYPE);
	combo->Clear()->RESCOMBO(GESCHWADER,3)->
					SetIndex(unitdisplaylevel);




	CRListBox* rlistbox;
	rlistbox=GETDLGITEM(IDC_RLISTBOXCTRL1);
	rlistbox->Clear();
	rlistbox->AddColumn(120);
	rlistbox->AddColumn(TARGETFIELDWIDTH);										  //RDH 02/06/99
	rlistbox->AddColumn(80);
	rlistbox->AddString(RESSTRING(UNIT),0);
	rlistbox->AddString(RESSTRING(TARGET),1);
	rlistbox->AddString(RESSTRING(STATUS),2);

	
	if (attackmethod == Profile::AM_DETACHED)
	{
		GETDLGITEM(IDC_RSTATICCTRL00)->SetString(RESSTRING(L_CEILING));
 		GETDLGITEM(IDC_RSTATICCTRL01)->SetString(RESSTRING(LHIGH));
		GETDLGITEM(IDC_RSTATICCTRL02)->SetString(RESSTRING(FORWARDHIGH));
		GETDLGITEM(IDC_RSTATICCTRL03)->SetString(RESSTRING(FORWARD));
		GETDLGITEM(IDC_RSTATICCTRL04)->SetString(RESSTRING(FORWARDLOW));
		GETDLGITEM(IDC_RSTATICCTRL05)->SetString(RESSTRING(LATE));
	}else
	{
		GETDLGITEM(IDC_RSTATICCTRL00)->SetString(RESSTRING(BEHIND));
 		GETDLGITEM(IDC_RSTATICCTRL01)->SetString(RESSTRING(INFRONT));
		GETDLGITEM(IDC_RSTATICCTRL02)->SetString(RESSTRING(PORT));
		GETDLGITEM(IDC_RSTATICCTRL03)->SetString(RESSTRING(STARBOARD));
		GETDLGITEM(IDC_RSTATICCTRL04)->SetString(RESSTRING(ABOVE));
		GETDLGITEM(IDC_RSTATICCTRL05)->SetString(RESSTRING(BELOW));
	}

	{
		for (int i=1; i< PackageList::MAX_METHODS-1;i++)
		{
			CRButton* b = GETDLGITEM(IDC_TICK1+i-1);
			b->SetPressed(amtype->attackmethods[i]);
		}
	}


	

	
	Profile& pk = Todays_Packages.pack[Todays_Packages.hipack];

	CRButton* b = GETDLGITEM(IDC_STRAFTARGET);

//DEADCODE RDH 02/04/00 	straf = false;
//DEADCODE RDH 02/04/00 	for (int num=pk.squadlist.Max()-1;num>=0;num--)
//DEADCODE RDH 02/04/00 		if  (	((pk.squadlist[num].method&Profile::AM_GROUPMASK)==attackmethod)
//DEADCODE RDH 02/04/00 			&&	(pk.squadlist[num].submethod == Profile::SM_DOSTRAFFEGROUND)
//DEADCODE RDH 02/04/00 			)
//DEADCODE RDH 02/04/00 			straf = true;
//DEADCODE RDH 02/04/00 	b->SetPressed(straf);
//DEADCODE RDH 02/04/00 
	b->SetPressed(pk.StraffRequired(attackmethod));		

	int i=0;

//DEADCODE  15/02/00 	maxunits = 0;
//DEADCODE  15/02/00 	while (i < pk.squadlist)
//DEADCODE  15/02/00 	{
//DEADCODE  15/02/00 		int am = pk[i].method;
//DEADCODE  15/02/00 
//DEADCODE  15/02/00 		if (pk[i].method == attackmethod)
//DEADCODE  15/02/00 		{
//DEADCODE  15/02/00 			Squadron* sq = Node_Data[(SquadNum)pk[i].squadnum];
//DEADCODE  15/02/00  			CString name = sq->ShortName() + "/";
//DEADCODE  15/02/00 			name = name + sq->SubName();
//DEADCODE  15/02/00 			rlistbox->AddString(name,0);
//DEADCODE  15/02/00 			rlistbox->AddString(GetTargName(pk.packagetarget[pk[i].targetindex].currentid),1);
//DEADCODE  15/02/00 			rlistbox->AddString(RESLIST(PS_SPARE,pk.packagestatus),2);
//DEADCODE  15/02/00 			maxunits++;
//DEADCODE  15/02/00 		}
//DEADCODE  15/02/00 		i++;
//DEADCODE  15/02/00 	}

	FillList();
	if ((UnitList[0] >= 0)	&&	(maxunits > 0))
	{
		i = 0;
		UByte		gruppennum;
		Gruppen* sq = Node_Data[(SquadNum)pk[UnitList[0]].squadnum];
 		gruppennum = (SquadNum)pk[UnitList[0]].squadnum;
		int staffel = 0;

		while (i < maxunits)
		{
			Gruppen* sq = Node_Data[(SquadNum)pk[UnitList[i]].squadnum];
			CString name = sq->ShortName();
			if (unitdisplaylevel != PackageList::DISPLAY_GESCHWADER)
			{
				name =   name + "/" + sq->SubName();
			}

			if (unitdisplaylevel == PackageList::DISPLAY_STAFFEL)
			{
				if (gruppennum == (SquadNum)pk[UnitList[i]].squadnum)
					staffel++;
				else
				{
					gruppennum = (SquadNum)pk[UnitList[i]].squadnum;
					staffel =1;
				}
				name = name + CSprintf(" (%i)", staffel + (sq->gruppennum*3));
			}
			rlistbox->AddString(name,0);
			int ti=pk[UnitList[i]].targetindex;
			if (ti<0)
				ti=0;
			rlistbox->AddString(GetTargName(pk.packagetarget[ti].currentid),1);
			rlistbox->AddString(RESLIST(PS_SPARE,pk.packagestatus),2);
			i++;
		}
	}
	int maxsquad = Todays_Packages.SquadronsPlanned(NAT_LUF);
	if	(	(Todays_Packages.taskdata.attached.maxac != -1)
			||
			(
			 (maxsquad < 93)
			)
		)
		rlistbox->AddString(RESSTRING(NEXTAVAILABLE),0);

}
コード例 #7
0
ファイル: squick1.cpp プロジェクト: xor2003/bob-flight-sim
void	CSQuick1::RefreshMissionCombo()
{
	CRCombo* combo;
	combo=GETDLGITEM(IDC_MISSLISTS);
	combo->Clear();

//	combo->RESCOMBO(QUICK_1,20)->SetIndex(currquickmiss);
//DeadCode AMM 12May99 	char i = 0;
//DeadCode AMM 12May99 	while (quickmissions[i].missionname !=NULL)
//DeadCode AMM 12May99 	{
//DeadCode AMM 12May99 		combo->AddString(LoadResString(quickmissions[i].missionname));
//DeadCode AMM 12May99 		i++;
//DeadCode AMM 12May99 	}
//DeadCode AMM 12May99 	combo->SetIndex(currquickmiss);

	int i,j=0;
	i = missionfamily[currquickfamily];
	bool		currmissionfound = false;

	while (		(quickmissions[i].missionname !=NULL)
		&&	(i < missionfamily[currquickfamily+1])
	   )
	{
		if 	(currquickmiss == i)
			currmissionfound = true;
		i++;

	}
	if (!currmissionfound)
	 	currquickmiss = missionfamily[currquickfamily];


	i = missionfamily[currquickfamily];
	j=0;
	while (		(quickmissions[i].missionname !=NULL)
			&&	(i < missionfamily[currquickfamily+1])
		   )
	{
		if (MissionAllowed(i))
		{
			misslistbackindex[i]=j;
			misslistindex[j]=i;
			j++;
			combo->AddString(LoadResString(quickmissions[i].missionname));
		}
		else
			misslistbackindex[i]=255;
		i++;
	}
	if (misslistbackindex[currquickmiss]!=255)
	{
//DeadCode JIM 20Oct00  		for (int t=0; t<20;t++)
//DeadCode JIM 20Oct00 		{
//DeadCode JIM 20Oct00 			int r = misslistbackindex[t];
//DeadCode JIM 20Oct00 		}
		combo->SetIndex(misslistbackindex[currquickmiss]);
	}
	else
	{
		currquickmiss=misslistindex[0];
		quickdef=quickmissions[currquickmiss];
		combo->SetIndex(0);
	}
}
コード例 #8
0
ファイル: lwtasksm.cpp プロジェクト: xor2003/bob-flight-sim
void LWTaskSummary::Refresh()
{
//DeadCode JIM 30Oct00 	MakeFighterSpinLists(false);
	CRSpinBut* spinbut;
//DEADCODE RDH 12/01/00 	spinbut=GETDLGITEM(IDC_RSPINBUT_TARGETS);
//DEADCODE RDH 12/01/00 	spinbut->Clear()->MakeNumList(10,1,1)->SetIndex(Todays_Packages.taskdata.targetnum-1);
//DEADCODE RDH 12/01/00  
//DEADCODE RDH 12/01/00 	spinbut=GETDLGITEM(IDC_RSPINBUT_PERCENTFIGHTERS);
//DEADCODE RDH 12/01/00 	int fighters = Todays_Packages.taskdata.acttached_no + Todays_Packages.taskdata.detached_no;
//DEADCODE RDH 12/01/00 	int percent =  fighters/(fighters+Todays_Packages.taskdata.strike_no);
//DEADCODE RDH 12/01/00 	spinbut->Clear()->MakeNumList(100,0,1)->SetIndex(percent);

	CRStatic*   s;
	s=GETDLGITEM(IDC_TARGETS);
	s->SetString(CSprintf("%i",	Todays_Packages.taskdata.targetnum));

	int fighters = Todays_Packages.taskdata.totalfighter.acnum;
	int fightersquads = Todays_Packages.taskdata.totalfighter.squadnum;
//DEADCODE RDH 24/03/00 	bool squads = false;
//DEADCODE RDH 24/03/00 		
//DEADCODE RDH 24/03/00 	if (Todays_Packages.taskdata.returned.acnum == -1)
//DEADCODE RDH 24/03/00 	{
//DEADCODE RDH 24/03/00 		fightersquads +=Todays_Packages.taskdata.returned.squadnum;
//DEADCODE RDH 24/03/00 		squads = true;
//DEADCODE RDH 24/03/00 	}else
//DEADCODE RDH 24/03/00 		fighters +=Todays_Packages.taskdata.returned.acnum;
//DEADCODE RDH 24/03/00 
//DEADCODE RDH 24/03/00 	if (Todays_Packages.taskdata.attached.acnum == -1)
//DEADCODE RDH 24/03/00 	{
//DEADCODE RDH 24/03/00 		fightersquads +=Todays_Packages.taskdata.attached.squadnum;
//DEADCODE RDH 24/03/00 		squads = true;
//DEADCODE RDH 24/03/00 	}else
//DEADCODE RDH 24/03/00 		fighters +=Todays_Packages.taskdata.attached.acnum;
//DEADCODE RDH 24/03/00 
//DEADCODE RDH 24/03/00 	if (Todays_Packages.taskdata.detached.acnum == -1)
//DEADCODE RDH 24/03/00 	{
//DEADCODE RDH 24/03/00 		fightersquads +=Todays_Packages.taskdata.detached.squadnum;
//DEADCODE RDH 24/03/00 		squads = true;
//DEADCODE RDH 24/03/00 	}else
//DEADCODE RDH 24/03/00 		fighters +=Todays_Packages.taskdata.detached.acnum;
//DEADCODE RDH 24/03/00 
//DEADCODE RDH 24/03/00 	if (squads)
//DEADCODE RDH 24/03/00 	{
//DEADCODE RDH 24/03/00 		fighters = -1;
//DEADCODE RDH 24/03/00 		if (Todays_Packages.taskdata.returned.acnum > 0)
//DEADCODE RDH 24/03/00 			fightersquads ++;
//DEADCODE RDH 24/03/00 
//DEADCODE RDH 24/03/00 		if (Todays_Packages.taskdata.attached.acnum > 0)
//DEADCODE RDH 24/03/00 			fightersquads ++;
//DEADCODE RDH 24/03/00 
//DEADCODE RDH 24/03/00 		if (Todays_Packages.taskdata.detached.acnum > 0)
//DEADCODE RDH 24/03/00 			fightersquads ++;
//DEADCODE RDH 24/03/00 	}

//DEADCODE RDH 04/04/00 	int strikeac = Todays_Packages.taskdata.strike.realacnum;
//DEADCODE RDH 04/04/00 	int fighter_pc = fighters;
//DEADCODE RDH 04/04/00 	if ((strikeac == -1) || (fighters == -1))
//DEADCODE RDH 04/04/00 	{
//DEADCODE RDH 04/04/00 		if (fightersquads <= 0)
//DEADCODE RDH 04/04/00 			fightersquads = 1;
//DEADCODE RDH 04/04/00 		if (strikesquads <= 0 )
//DEADCODE RDH 04/04/00 			strikesquads = 1;
//DEADCODE RDH 04/04/00 		strike_pc = strikesquads;
//DEADCODE RDH 04/04/00 		fighter_pc = fightersquads; 
//DEADCODE RDH 04/04/00 	}
//DEADCODE RDH 04/04/00 
		
	int percent =  100* Todays_Packages.taskdata.totalfighter.realacnum
						/(Todays_Packages.taskdata.totalfighter.realacnum+Todays_Packages.taskdata.strike.realacnum);

	s=GETDLGITEM(IDC_PC_FIGHTERS);
	s->SetString(CSprintf("%i",	percent));

//DeadCode JIM 30Oct00 	if (fighters)
//DeadCode JIM 30Oct00 	{
//DeadCode JIM 30Oct00 		s=GETDLGITEM(IDC_PC_ATTACHED);
//DeadCode JIM 30Oct00 		s->SetString(CSprintf("%i",	100 * Todays_Packages.taskdata.attached.realacnum
//DeadCode JIM 30Oct00 					/Todays_Packages.taskdata.totalfighter.realacnum ));
//DeadCode JIM 30Oct00 
//DeadCode JIM 30Oct00 		s=GETDLGITEM(IDC_PC_DETACHED);
//DeadCode JIM 30Oct00 		s->SetString(CSprintf("%i",	100 * Todays_Packages.taskdata.detached.realacnum
//DeadCode JIM 30Oct00 					/Todays_Packages.taskdata.totalfighter.realacnum ));
//DeadCode JIM 30Oct00 
//DeadCode JIM 30Oct00 		s=GETDLGITEM(IDC_PC_RETURNING);
//DeadCode JIM 30Oct00 		s->SetString(CSprintf("%i",	100 * Todays_Packages.taskdata.returned.realacnum
//DeadCode JIM 30Oct00 					/Todays_Packages.taskdata.totalfighter.realacnum ));
//DeadCode JIM 30Oct00 	}else
//DeadCode JIM 30Oct00 	{
//DeadCode JIM 30Oct00 		s=GETDLGITEM(IDC_PC_ATTACHED);
//DeadCode JIM 30Oct00 		s->SetString(RESSTRING(NA));
//DeadCode JIM 30Oct00 
//DeadCode JIM 30Oct00 		s=GETDLGITEM(IDC_PC_DETACHED);
//DeadCode JIM 30Oct00 		s->SetString(RESSTRING(NA));
//DeadCode JIM 30Oct00 
//DeadCode JIM 30Oct00 		s=GETDLGITEM(IDC_PC_RETURNING);
//DeadCode JIM 30Oct00 		s->SetString(RESSTRING(NA));
//DeadCode JIM 30Oct00 
//DeadCode JIM 30Oct00 	}

  	spinbut=GETDLGITEM(IDC_RSPINBUT_BOMBERS);
	spinbut->Clear();

	int maxac =12;
	//..strike.maxac should either be <12 or -1. -1 means that we are counting in squads
	if (Todays_Packages.taskdata.strike.maxac != -1)
		maxac = Todays_Packages.taskdata.strike.maxac;
//DeadCode JIM 16Oct00 	if (maxac>12*3*3*5)
//DeadCode JIM 16Oct00 		maxac=12*3*3*5;
	int index = 0;
	int entry = 0;
	while (AcSpin[entry] <= maxac)
	{
		spinbut->AddString(CSprintf("%i %s", AcSpin[entry], RESSTRING(AIRCRAFT)));
		if  (	(Todays_Packages.taskdata.strike.acnum != -1)
			&&	(Todays_Packages.taskdata.strike.acnum >= AcSpin[entry])
			)
			spinbut->SetIndex(index);
		index++;
		entry++;
	}

	if  (Todays_Packages.taskdata.strike.maxac == -1)
	{
		entry = 0;
		if (Todays_Packages.taskdata.strike.maxsquad>3*3*5)		//JIM 16Oct00
			Todays_Packages.taskdata.strike.maxsquad=3*3*5;
		while (squadinfo[entry].numofsquads <= Todays_Packages.taskdata.strike.maxsquad)
		{
			spinbut->AddString(CSprintf("%i %s", squadinfo[entry].number, LoadResString(squadinfo[entry].name)));
			if  (	(Todays_Packages.taskdata.strike.acnum == -1)
				&&	(Todays_Packages.taskdata.strike.squadnum >= squadinfo[entry].numofsquads)
				)
				spinbut->SetIndex(index);

			entry++;
			index++;
		}
	}
 
  	spinbut=GETDLGITEM(IDC_RSPINBUT_FIGHTERS);
	spinbut->Clear();
	

	 maxac =12;
	if (Todays_Packages.taskdata.attached.maxac != -1)
		maxac = Todays_Packages.taskdata.attached.maxac;


	index = 0;
	entry = 0;
	while (FighterSpin[entry] <= maxac)
	{
		spinbut->AddString(CSprintf("%i %s", FighterSpin[entry], RESSTRING(AIRCRAFT)));
		if  (	(fighters != -1)
			&&	(fighters >= FighterSpin[entry])
			)
		{
			spinbut->SetIndex(index);
			oldindex = index;
		}
		index++;
		entry++;
	}

	if  (Todays_Packages.taskdata.attached.maxac == -1)
	{
		entry = 0;
		while (squadinfo[entry].numofsquads <= Todays_Packages.taskdata.attached.maxsquad)
		{
			spinbut->AddString(CSprintf("%i %s", squadinfo[entry].number, LoadResString(squadinfo[entry].name)));
			if  (	(fighters == -1)
				&&	(fightersquads >= squadinfo[entry].numofsquads)
				)
			{
				spinbut->SetIndex(index);
	 			oldindex = index;
			}

			entry++;
			index++;
		}
	}




	CRCombo* combo;
	combo=GETDLGITEM(IDC_RCOMBOBOMBERTYPE);
	combo->Clear();
	int i = 0;
	while	( i < PackageList::STRIKEOPTIONS)
	{	
		if (Todays_Packages.taskdata.strikeactypes[i] != PackageList::NOTDEFINED)
		{
			if (Todays_Packages.taskdata.strikeactypes[i] == PackageList::MIXED)
				combo->AddString(RESSTRING(MIXED));
			else
				combo->AddString(RESLIST(SPIT_A, Todays_Packages.taskdata.strikeactypes[i]));
		}
		i++;
	};
	combo->SetIndex(0);

 	combo=GETDLGITEM(IDC_RCOMBOFIGHTERTYPE);
	if (fighters)
	{
		combo->Clear();
		int i = 0;
		while	(		( i < PackageList::ESCORTOPTIONS)
				&&	(Todays_Packages.taskdata.escortactypes[i] != PackageList::NOTDEFINED)
			)
		{	
			if (Todays_Packages.taskdata.escortactypes[i] == PackageList::MIXED)
				combo->AddString(RESSTRING(MIXED));
			else
				combo->AddString(RESLIST(SPIT_A, Todays_Packages.taskdata.escortactypes[i]));
			i++;
		};
		combo->SetIndex(0);

	}else
	{
		combo->Clear()->SetList(IDS_NO_AIRCRAFT,1)->
					SetIndex(0);

	}



}
コード例 #9
0
ファイル: SSOUND.CPP プロジェクト: gondur/BOB_Src
BOOL CSSound::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	if (_DPlay.PlayerCreated)									//AMM 12Jul99
	{															//AMM 12Jul99
		_DPlay.SendStatusChange(DPlay::CPS_PREFS);
	}															//AMM 12Jul99

	OthersPref_Timer=SetTimer(DPlay::TIMER_PREFSOTHERS,0,NULL);

//DEADCODE RDH 25/11/99 	CRCombo* combo;
//DEADCODE RDH 25/11/99 	if	(		(RFullPanelDial::incomms)
//DEADCODE RDH 25/11/99 			&&	(_DPlay.UIPlayerType==PLAYER_GUEST)
//DEADCODE RDH 25/11/99 		)
//DEADCODE RDH 25/11/99 	{
//DEADCODE RDH 25/11/99 		combo=GETDLGITEM(IDC_CBO_GEFFECTS);
//DEADCODE RDH 25/11/99 		combo->SetEnabled(false);
//DEADCODE RDH 25/11/99 		combo=GETDLGITEM(IDC_CBO_INJURYEFFECTS);
//DEADCODE RDH 25/11/99 		combo->SetEnabled(false);
//DEADCODE RDH 25/11/99 		combo=GETDLGITEM(IDC_CBO_WHITEOUTS);
//DEADCODE RDH 25/11/99 		combo->SetEnabled(false);
//DEADCODE RDH 25/11/99 		combo=GETDLGITEM(IDC_CBO_AUTOVECTORING);
//DEADCODE RDH 25/11/99 		combo->SetEnabled(false);
//DEADCODE RDH 25/11/99 	}else
//DEADCODE RDH 25/11/99 	{
//DEADCODE RDH 25/11/99 		combo=GETDLGITEM(IDC_CBO_GEFFECTS);
//DEADCODE RDH 25/11/99 		combo->SetEnabled(true);
//DEADCODE RDH 25/11/99 		combo=GETDLGITEM(IDC_CBO_INJURYEFFECTS);
//DEADCODE RDH 25/11/99 		combo->SetEnabled(true);
//DEADCODE RDH 25/11/99 		combo=GETDLGITEM(IDC_CBO_WHITEOUTS);
//DEADCODE RDH 25/11/99 		combo->SetEnabled(true);
//DEADCODE RDH 25/11/99 		combo=GETDLGITEM(IDC_CBO_AUTOVECTORING);
//DEADCODE RDH 25/11/99 		combo->SetEnabled(true);
//DEADCODE RDH 25/11/99 	}
//DEADCODE RDH 25/11/99 


	CRCombo* combo;
	combo=GETDLGITEM(IDC_CBO_SOUNDDRIVER);
	combo->Clear();

	LPDSPORTINFO dstemp=NULL;
	ULong index=0;

	if (_Miles.dig && _Miles.dig->DIG_valid())
	{
		dstemp=_Miles.dig->PortInfo;
	}

	if (!dstemp)
	{
		combo->AddString(RESSTRING(NOTAVAILABLE));
	}
	else
	{
		ULong n=0;

		while (dstemp)
		{
			combo->AddString(dstemp->device);
			if (dstemp->port==Save_Data.SFXDevice)
				index=n;

			n++;
			dstemp=dstemp->next;
		}
	}

	combo->SetIndex(index);

//DEADCODE RDH 07/03/00 	combo=GETDLGITEM(IDC_CBO_MUSICDRIVER);
//DEADCODE RDH 07/03/00 	combo->Clear();
//DEADCODE RDH 07/03/00 
//DEADCODE RDH 07/03/00 	LPDMPORTINFO temp=NULL;
//DEADCODE RDH 07/03/00 
//DEADCODE RDH 07/03/00 	index=0;
//DEADCODE RDH 07/03/00 	
//DEADCODE RDH 07/03/00 	if (_Miles.mdi && _Miles.mdi->MDI_valid())
//DEADCODE RDH 07/03/00 	{
//DEADCODE RDH 07/03/00 		temp=_Miles.mdi->PortInfo;
//DEADCODE RDH 07/03/00 	}
//DEADCODE RDH 07/03/00 
//DEADCODE RDH 07/03/00 	if (!temp)
//DEADCODE RDH 07/03/00 	{
//DEADCODE RDH 07/03/00 		combo->AddString(RESSTRING(NOTAVAILABLE));
//DEADCODE RDH 07/03/00 	}
//DEADCODE RDH 07/03/00 	else
//DEADCODE RDH 07/03/00 	{
//DEADCODE RDH 07/03/00 		ULong n=0;
//DEADCODE RDH 07/03/00 
//DEADCODE RDH 07/03/00 		while (temp)
//DEADCODE RDH 07/03/00 		{
//DEADCODE RDH 07/03/00 			combo->AddString(temp->device);
//DEADCODE RDH 07/03/00 			if (temp->port==Save_Data.MusicDevice)
//DEADCODE RDH 07/03/00 				index=n;
//DEADCODE RDH 07/03/00 
//DEADCODE RDH 07/03/00 			n++;
//DEADCODE RDH 07/03/00 			temp=temp->next;
//DEADCODE RDH 07/03/00 		}
//DEADCODE RDH 07/03/00 	}
//DEADCODE RDH 07/03/00 
//DEADCODE RDH 07/03/00 	combo->SetIndex(index);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}