BOOL CCommsPaint::OnInitDialog() { CDialog::OnInitDialog(); CRButton* rbutton; int decals; for(int i=0;i<32;i++) { rbutton=GETDLGITEM(IDC_NOSEART0+i); if (DPlay::H2H_Player[_DPlay.mySlot].squadron < PT_GER_FLYABLE) { rbutton->ShowWindow(SW_SHOW); if (i < 16) decals = i + FIL_NOSE_STD_1; else decals = i - 16 + FIL_NOSE_USER_1; rbutton->SetNormalFileNum(decals); rbutton->SetPressedFileNum(1); }else { rbutton->ShowWindow(SW_HIDE); } } paintshop_timer=SetTimer(DPlay::TIMER_PAINTSHOP,0,NULL); //DeadCode AMM 16Nov99 _DPlay.UISendInPaintShopMessage(); //DeadCode AMM 16Nov99 DPlay::H2H_Player[_DPlay.mySlot].status=CPS_PAINTSHOP; _DPlay.SendStatusChange(DPlay::CPS_PAINTSHOP); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
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 }
void LWDiaryDetails::RefreshButtons() { CRButton* but; if (quickmission) { but = GETDLGITEM(IDC_RBUTTON_PREV); but->ShowWindow(false); but = GETDLGITEM(IDC_RBUTTON_NEXT); but->ShowWindow(false); }else { but = GETDLGITEM(IDC_RBUTTON_PREV); but->ShowWindow(true); if (*currentptr != 0) { but->SetForeColor(RGB(255,255,0)); but->SetDisabled(false); }else { but->SetForeColor(RGB(160,160,0)); but->SetBackColor(RGB(160,160,0)); but->SetDisabled(true); } but = GETDLGITEM(IDC_RBUTTON_NEXT); but->ShowWindow(true); if (grdtlsptr[*currentptr +1] != NULL) { but->SetForeColor(RGB(255,255,0)); but->SetDisabled(false); }else { but->SetForeColor(RGB(160,160,0)); but->SetBackColor(RGB(160,160,0)); but->SetDisabled(true); } } }
BOOL CCurrEmblem::OnInitDialog() { CDialog::OnInitDialog(); CRButton* rbutton; rbutton=GETDLGITEM(IDC_NOSEART0); CRStatic* s = GETDLGITEM(IDC_RSTATICCTRL24); if (DPlay::H2H_Player[_DPlay.mySlot].squadron < PT_GER_FLYABLE) { rbutton->ShowWindow(SW_SHOW); s->ShowWindow(SW_SHOW); //DEADCODE AMM 17/01/00 int decal = DPlay::H2H_Player[_DPlay.mySlot].decal; int decal=0; assert (decal>=0 && decal<32) if (decal < 16) decal = decal + FIL_NOSE_STD_1; else decal = decal - 16 + FIL_NOSE_USER_1; rbutton->SetNormalFileNum(decal); rbutton->SetPressedFileNum(decal); }else
void LWRouteMain::RefreshButtons() { if (Todays_Packages.hiwp != UID_Null) { info_waypoint* wp=*Persons2::ConvertPtrUID(Todays_Packages.hiwp); CRButton* but; but = GETDLGITEM(IDC_RBUTTONINSERT); if ( (wp->uid.Evaluate() == -SGR_WPP_TakeOff) || (wp->uid.Evaluate() == -SGR_WPP_EscDisperse) || (wp->uid.Evaluate() == -SGR_WPP_BombDisperse) || (wp->uid.Evaluate() == -SGR_WPP_Landing) || (wp->uid.Evaluate() == -SGR_WPC_TakeOff) || (wp->uid.Evaluate() == -SGR_WPC_Landing) ) { but->SetForeColor(RGB(160,160,0)); but->SetBackColor(RGB(160,160,0)); but->SetDisabled(true); }else { but->SetForeColor(RGB(255,255,0)); but->SetBackColor(RGB(255,255,0)); but->SetDisabled(false); } but = GETDLGITEM(IDC_RBUTTONDELETE); if (wp->uid.Evaluate() == GOT_UNDEFINED_VAL) //user wp { but->SetForeColor(RGB(255,255,0)); but->SetDisabled(false); but->SetBackColor(RGB(255,255,0)); }else { but->SetForeColor(RGB(160,160,0)); but->SetBackColor(RGB(160,160,0)); but->SetDisabled(true); } but = GETDLGITEM(IDC_RBUTTONCENTRE); but->SetForeColor(RGB(255,255,0)); but->SetBackColor(RGB(255,255,0)); but->SetDisabled(false); but = GETDLGITEM(IDC_RBUTTONNEWDOGLEG); if (RFullPanelDial::gameside == RFullPanelDial::SIDE_LW) { but->ShowWindow(true); if (Todays_Packages.pack[Todays_Packages.hipack].packagestatus < Profile::PS_TAKINGOFF) { but->SetForeColor(RGB(255,255,0)); but->SetBackColor(RGB(255,255,0)); but->SetDisabled(false); }else { but->SetForeColor(RGB(160,160,0)); but->SetBackColor(RGB(160,160,0)); but->SetDisabled(true); } }else { but->ShowWindow(false); } but = GETDLGITEM(IDC_RBUTTONAPPLYALT); but->SetForeColor(RGB(255,255,0)); but->SetBackColor(RGB(255,255,0)); but->SetDisabled(false); }else { CRButton* but = GETDLGITEM(IDC_RBUTTONINSERT); but->SetForeColor(RGB(160,160,0)); but->SetBackColor(RGB(160,160,0)); but->SetDisabled(true); but = GETDLGITEM(IDC_RBUTTONDELETE); but->SetForeColor(RGB(160,160,0)); but->SetBackColor(RGB(160,160,0)); but->SetDisabled(true); but = GETDLGITEM(IDC_RBUTTONCENTRE); but->SetForeColor(RGB(160,160,0)); but->SetBackColor(RGB(160,160,0)); but->SetDisabled(true); but = GETDLGITEM(IDC_RBUTTONNEWDOGLEG); but->SetForeColor(RGB(160,160,0)); but->SetBackColor(RGB(160,160,0)); but->SetDisabled(true); but = GETDLGITEM(IDC_RBUTTONAPPLYALT); but->SetForeColor(RGB(160,160,0)); but->SetBackColor(RGB(160,160,0)); but->SetDisabled(true); } }
BOOL Dossier::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here CRButton* title; title = GETDLGITEM(IDJ_TITLE); title->SetString(GetTargName(uid)); CRButton* authbut = GETDLGITEM(IDC_AUTHORISE); if (Node_Data.GotBadWeatherPeriod()) authbut->ShowWindow(SW_HIDE); else if (RFullPanelDial::gameside == RFullPanelDial::SIDE_LW) authbut->SetString(RESSTRING(AUTHORISE)); else { authbut->SetString(RESSTRING(PATROL)); authbut->SetHintString(RESSTRING(HIDC_PATROL)); } authbut = GETDLGITEM(IDC_PHOTO); if (Node_Data.GotBadWeatherPeriod()) authbut->ShowWindow(SW_HIDE); else if (Node_Data[uid]==Target::TSS_TargetConvoy || Node_Data[uid]==NULL || Node_Data[uid].truetargtype==Target::TT_GERMAN) authbut->ShowWindow(SW_HIDE); else if (ReconnRequired()) { authbut->SetString(RESSTRING(RECONN)); authbut->SetHintString(RESSTRING(HIDC_RECONN)); } else authbut->SetString(RESSTRING(PHOTO)); if (LUF_FighterLF2BAND==Persons2::GetBandFromUID(uid)) { authbut = GETDLGITEM(IDC_AUTHORISE); authbut->ShowWindow(SW_HIDE); if (RFullPanelDial::gameside == RFullPanelDial::SIDE_LW) { // we now want to display a button for fighters and/or bombers if there are any // at this LW AF int i=0; SLong fighters=-1; SLong bombers=-1; while (Node_Data.gruppe[i].squadron != SQ_ZERO) { if (Node_Data.gruppe[i].homeairfield == uid) { if (Node_Data.gruppe[i].AcType()<PT_LW_BOMBERS) fighters=i; else bombers=i; } i++; } // Photo button becomes fighters if (fighters!=-1) { authbut = GETDLGITEM(IDC_PHOTO); authbut->SetString(RESSTRING(FIGHTERS)); authbut->SetHintString(Node_Data.gruppe[fighters].ShortName()); authbut->ShowWindow(SW_SHOW); } // Authorise button becomes bombers if (bombers!=-1) { authbut = GETDLGITEM(IDC_AUTHORISE); authbut->SetString(RESSTRING(BOMBERS)); authbut->SetHintString(Node_Data.gruppe[bombers].ShortName()); authbut->ShowWindow(SW_SHOW); } } } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void ToteSector::RefreshLights() { CRect parentpos(1,1,0,0); GetWindowRect(parentpos); parentpos.top=1; CPoint parentoff(-parentpos.left,parentpos.top); enum{MAXSQUAD = 4, MAXAIRFIELDS = 10}; SquadNum squad[MAXSQUAD]; UniqueID Airfields[MAXAIRFIELDS]; TargetFighterField* af = Node_Data[sectoraf]; int m = 0; Airfields[m++] = sectoraf; while ( ((af = af->nextsatelite())!= NULL) && (m < MAXAIRFIELDS) ) Airfields[m++]= af->uid; while (m < MAXAIRFIELDS) Airfields[m++]= UID_Null; int j=0, k = 0; m = 0; while (Node_Data.squadron[k].squadron != SQ_ZERO) { for (m = 0; m < MAXAIRFIELDS; m++) { if (Node_Data.squadron[k].homeairfield == Airfields[m]) { squad[j++] = Node_Data.squadron[k].squadron; } } k++; } BritSquadron* sq; int i =0; CRButton* bb; CRButton* bw; CRStatic* sn; CRStatic* sp; CRStatic* sa; while (i < 5) { switch(i) { default_neverreferenced; case 0: { bw = GETDLGITEM(IDC_RBUTTON_W0); bb = GETDLGITEM(IDC_RBUTTON_B0); sn=GETDLGITEM(IDC_RSTATICSQ0); sp=GETDLGITEM(IDC_RSTATIC_PLT0); sa=GETDLGITEM(IDC_RSTATIC_AC0); break; } case 1: { bw = GETDLGITEM(IDC_RBUTTON_W1); bb = GETDLGITEM(IDC_RBUTTON_B1); sn=GETDLGITEM(IDC_RSTATICSQ1); sp=GETDLGITEM(IDC_RSTATIC_PLT1); sa=GETDLGITEM(IDC_RSTATIC_AC1); break; } case 2: { bw = GETDLGITEM(IDC_RBUTTON_W2); bb = GETDLGITEM(IDC_RBUTTON_B2); sn=GETDLGITEM(IDC_RSTATICSQ2); sp=GETDLGITEM(IDC_RSTATIC_PLT2); sa=GETDLGITEM(IDC_RSTATIC_AC2); break; } case 3: { bw = GETDLGITEM(IDC_RBUTTON_W3); bb = GETDLGITEM(IDC_RBUTTON_B3); sn=GETDLGITEM(IDC_RSTATICSQ3); sp=GETDLGITEM(IDC_RSTATIC_PLT3); sa=GETDLGITEM(IDC_RSTATIC_AC3); break; } case 4: { bw = GETDLGITEM(IDC_RBUTTON_W4); bb = GETDLGITEM(IDC_RBUTTON_B4); sn=GETDLGITEM(IDC_RSTATICSQ4); sp=GETDLGITEM(IDC_RSTATIC_PLT4); sa=GETDLGITEM(IDC_RSTATIC_AC4); break; } } if (i<j) { sq = Node_Data[squad[i]]; sn->SetString(sq->SubName()); sp->SetString(CSprintf("%i", sq->pilotsavail)); sa->SetString(CSprintf("%i", sq->acavail)); bw->ShowWindow(true); bb->ShowWindow(true); CRect dlistpos; bw->GetWindowRect(dlistpos); int status = sq->totestatus; int index = readinesslevel[status]; if (index < 9) index = 76+ index *28; else index = 392 + ((index - 9) * 28); parentoff.y=parentpos.top+(index)-dlistpos.top; SLong hr, mins; hr = MMC.currtime / SECSPERHR; mins = ((MMC.currtime- (SECSPERHR * hr)) / SECSPERMIN); SWord ind = mins %15; ind = ind /5; ind = 3 - ind; if (sq->totestatus<Profile::PS_PLANNED) { int max=sq->acavail; if (max>sq->pilotsavail) max=sq->pilotsavail; if (max>15) max=15; max=max/3; dlistpos.right=dlistpos.left+(max*10); ind=0; } else { int availbits=sq->usedacbits; int avail = Bit_Count_Nibble[availbits&15]; avail += Bit_Count_Nibble[(availbits>>4)&15]; avail += Bit_Count_Nibble[(availbits>>8)&15]; avail/=3; dlistpos.right=dlistpos.left+(avail*10); } dlistpos+=parentoff; bw->MoveWindow(dlistpos); bb->GetWindowRect(dlistpos); bb->SetNormalFileNum(ICON_BTOTE+ind-1); parentoff.y=parentpos.top+316+(ind*14)-dlistpos.top; dlistpos+=parentoff; bb->MoveWindow(dlistpos); }else {