void CThumbnail::OnPaint() { PAINTSTRUCT paintstruct; CDC* pDC; pDC=BeginPaint(&paintstruct); paintstruct.fErase=TRUE; CRect rect; GetClientRect(rect); // first draw scaled version of thumbnail underneath title bar CRButton* button; button=GETDLGITEM(IDJ_TITLE); CRect buttonrect; button->GetClientRect(buttonrect); rect.top+=buttonrect.bottom; // +1 prevents gaps int halfheight=rect.Height()/2+1; int offset=rect.Height()/8+1; int offset2=rect.Height()/16+1; DrawScaledBitmap(pDC,FIL_THUMBTOP,rect.left,rect.top-offset,rect.Width(),halfheight+offset2); DrawScaledBitmap(pDC,FIL_THUMBBOT,rect.left,rect.top+halfheight-offset2,rect.Width(),halfheight+offset2); // now draw the box in the appropriate position CRect rect2; m_pView->GetClientRect(rect2); m_boxSize=CSize((rect.right*rect2.right)/m_pView->m_size.cx, (rect.Height()*rect2.bottom)/m_pView->m_size.cy); if(m_LButtonDown==FALSE) { m_point=CPoint(((m_pView->m_scrollpoint.x*rect.right)/m_pView->m_size.cx)+(m_boxSize.cx/2), ((m_pView->m_scrollpoint.y*rect.Height())/m_pView->m_size.cy)+(m_boxSize.cy/2)+rect.top); m_point=m_point+offsetfix; //quick thumbnail fix } m_point.x=max(m_boxSize.cx/2,m_point.x); m_point.y=max((m_boxSize.cy/2)+rect.top,m_point.y); m_point.x=min(rect.right-(m_boxSize.cx/2),m_point.x); m_point.y=min(rect.bottom-(m_boxSize.cy/2),m_point.y); CPen pen; pen.CreatePen(PS_SOLID,2,RGB(255,0,0)); // red pen pDC->SelectObject(&pen); if (m_boxSize.cx<20) { pDC->MoveTo(m_point.x-10,m_point.y); pDC->LineTo(m_point.x-m_boxSize.cx/2,m_point.y); pDC->MoveTo(m_point.x+10,m_point.y); pDC->LineTo(m_point.x+m_boxSize.cx/2,m_point.y); } if (m_boxSize.cy<20) { pDC->MoveTo(m_point.x,m_point.y-10); pDC->LineTo(m_point.x,m_point.y-m_boxSize.cy/2); pDC->MoveTo(m_point.x,m_point.y+10); pDC->LineTo(m_point.x,m_point.y+m_boxSize.cy/2); } pDC->MoveTo(m_point.x-(m_boxSize.cx/2),m_point.y-(m_boxSize.cy/2)); pDC->LineTo(m_point.x+(m_boxSize.cx/2),m_point.y-(m_boxSize.cy/2)); pDC->LineTo(m_point.x+(m_boxSize.cx/2),m_point.y+(m_boxSize.cy/2)); pDC->LineTo(m_point.x-(m_boxSize.cx/2),m_point.y+(m_boxSize.cy/2)); pDC->LineTo(m_point.x-(m_boxSize.cx/2),m_point.y-(m_boxSize.cy/2)); EndPaint(&paintstruct); }
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 CComit_e::OnInitDialog() { CDialog::OnInitDialog(); RDialog* parent=(RDialog*)GetParent(); // parent->SetMaxSize(CRect(0,0,450,380)); dir_ctrl.AllocateAc(); CRStatic* s=GETDLGITEM(IDC_STRIKEINUSE); s->SetString(CSprintf("%i",dir_ctrl.TotalStrikeAcInUse)); s=GETDLGITEM(IDC_FIGHTERSINUSE); s->SetString(CSprintf("%i",dir_ctrl.TotalFighterACInUse)); s=GETDLGITEM(IDC_MISSIONSINUSE); s->SetString(CSprintf("%i",dir_ctrl.MissionsAlreadyDefined)); s=GETDLGITEM(IDC_TARGETSINUSE); s->SetString(CSprintf("%i",dir_ctrl.TargetsAlreadyDefined)); CRButton* b = GETDLGITEM(IDC_AUTOGENERATE); b->SetPressed(dir_ctrl.autogen); b = GETDLGITEM(IDC_AUTODISPLAY); b->SetPressed(dir_ctrl.autodisplay); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void CSCampaign::RefreshDate(int camp) { CRButton* s; s=GETDLGITEM(IDC_RBUTTONDATE); s->SetString(LoadResString(IDS_L_SCAMPAIGNDATE1+camp)); }
void CThumbnail::InvalidateMapOnly() { CRect rect; GetClientRect(rect); CRButton* button; button=GETDLGITEM(IDJ_TITLE); CRect buttonrect; button->GetClientRect(buttonrect); rect.top=buttonrect.bottom; InvalidateRect(rect); }
BOOL CFootage::OnInitDialog() { CDialog::OnInitDialog(); CRButton* title; title = GETDLGITEM(IDJ_TITLE); title->SetHelpButton(false); // TODO: Add extra initialization here return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void CThumbnail::OnLButtonDown(UINT nFlags, CPoint point) { CRButton* button; button=GETDLGITEM(IDJ_TITLE); CRect buttonrect; button->GetClientRect(buttonrect); if (point.y<=buttonrect.bottom) CDialog::OnLButtonDown(nFlags, point); else { m_LButtonDown=TRUE; SetCapture(); m_point=point; // m_point.y+=buttonrect.bottom; InvalidateMapOnly(); } }
BOOL CAuthorise::OnInitDialog() { CDialog::OnInitDialog(); CRButton* title; title = GETDLGITEM(IDJ_TITLE); if (RFullPanelDial::gameside == RFullPanelDial::SIDE_LW) { title->SetString(RESSTRING(TARGETLIST)); }else { title->SetString(RESSTRING(ASSETLIST)); } //DeadCode JIM 20Oct00 RDialog* parent=(RDialog*)GetParent(); // parent->SetMaxSize(CRect(0,0,600,600)); 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 }
BOOL BasesLuftflotte::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here CRButton* title; title = GETDLGITEM(IDJ_TITLE); if (RFullPanelDial::gameside == RFullPanelDial::SIDE_LW) title->SetString(RESSTRING(LUFTWAFFERESOURCES)); else title->SetString(RESSTRING(RAFRESOURCES)); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
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 CThumbnail::UpdateView() { // if (m_pView->m_drawing) return; CRect rect; GetClientRect(rect); CRButton* button; button=GETDLGITEM(IDJ_TITLE); CRect buttonrect; button->GetClientRect(buttonrect); rect.top=buttonrect.bottom; // CPoint oldscrollpoint=m_pView->m_scrollpoint; m_pView->m_scrollpoint=CPoint((((m_point.x-(m_boxSize.cx/2))*m_pView->m_size.cx)/rect.right)+1, (((m_point.y-(m_boxSize.cy/2)-rect.top)*m_pView->m_size.cy)/(rect.Height()))+1); if (m_pView->m_scrollpoint.x<0) m_pView->m_scrollpoint.x=0; if (m_pView->m_scrollpoint.y<0) m_pView->m_scrollpoint.y=0; // if (m_pView->m_scrollpoint!=oldscrollpoint) // { // m_pView->m_drawing=TRUE; // m_pView->UpdateScrollbars(); // m_pView->m_mapdlg.ScrollWindow(oldscrollpoint.x-m_pView->m_scrollpoint.x,oldscrollpoint.y-m_pView->m_scrollpoint.y); // } m_pView->m_mapdlg.Invalidate(); m_pView->UpdateScrollbars(); }
void MapFiltersRaids::Refresh() { CRRadio* pradio; pradio=GETDLGITEM(IDC_RRADIO_PLOTS); pradio->Clear(); pradio->AddButton(RESSTRING(AUTHENTICPLOTS)); pradio->AddButton(RESSTRING(ICONSREP)); pradio->AddButton(RESSTRING(ONEPLOTPERGESCHWADER)); pradio->AddButton(RESSTRING(ONEPLOTPERGRUPPE)); pradio->AddButton(RESSTRING(ONEPLOTPERSTAFFEL)); pradio->SetCurrentSelection((int)Save_Data.lwplots); CRButton* b; b = GETDLGITEM(IDC_LWARROWS); b->SetPressed(Save_Data.mapfilters[FILT_LWARROWS]); b = GETDLGITEM(IDC_RAFINTERCEPTS); b->SetPressed(Save_Data.mapfilters[FILT_RAFINTERCEPTS]); b = GETDLGITEM(IDC_RAFPATROLS); b->SetPressed(Save_Data.mapfilters[FILT_RAFPATROLS]); b = GETDLGITEM(IDC_RAFROUTELINES); if ( (Save_Data.mapfilters[FILT_RAFINTERCEPTS]) && (Save_Data.mapfilters[FILT_RAFPATROLS]) && (Save_Data.mapfilters[FILT_LWARROWS]) ) b->SetPressed(true); else b->SetPressed(false); }
void CMiscToolbar::OnShowWindow(BOOL bShow, UINT nStatus) { CRToolBar::OnShowWindow(bShow, nStatus); //DEADCODE RDH 19/03/99 if (!RFullPanelDial::incomms) //rdh 10/1/99 //DEADCODE RDH 19/03/99 { //DEADCODE RDH 19/03/99 CRButton* b; //DEADCODE RDH 19/03/99 b=GETDLGITEM(IDC_REPLAY); //DEADCODE RDH 19/03/99 b->ShowWindow(SW_SHOW); //DEADCODE RDH 19/03/99 b=GETDLGITEM(IDC_READYROOM); //DEADCODE RDH 19/03/99 b->ShowWindow(SW_HIDE); //DEADCODE RDH 19/03/99 }else //DEADCODE RDH 19/03/99 { //DEADCODE RDH 19/03/99 CRButton* b; //DEADCODE RDH 19/03/99 b=GETDLGITEM(IDC_REPLAY); //DEADCODE RDH 19/03/99 b->ShowWindow(SW_HIDE); //DEADCODE RDH 19/03/99 b=GETDLGITEM(IDC_READYROOM); //DEADCODE RDH 19/03/99 b->ShowWindow(SW_SHOW); //DEADCODE RDH 19/03/99 } CRButton* but = GETDLGITEM(IDC_REPLAY); but->SetPressed(FALSE); //always lift replay button, might have been pressed if (RFullPanelDial::incomms) { but->SetDisabled(true); but->SetHintString(RESSTRING(NOTAVAIL)); }else { but->SetDisabled(false); but->SetHintString(RESSTRING(REPLAY)); } }
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 {
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 MapFiltersTarget::Refresh(bool redrawmap) { CRButton* b; b = GETDLGITEM(IDC_RBUTTONFIGHTER); b->SetPressed(Save_Data.mapfilters[FILT_AF_FIGHTER]); b = GETDLGITEM(IDC_RBUTTONBOMBER); b->SetPressed(Save_Data.mapfilters[FILT_AF_BOMBER]); b = GETDLGITEM(IDC_RBUTTONCOASTAL); b->SetPressed(Save_Data.mapfilters[FILT_AF_COASTAL]); b = GETDLGITEM(IDC_AIRFIELDS); if ( (Save_Data.mapfilters[FILT_AF_FIGHTER]) && (Save_Data.mapfilters[FILT_AF_BOMBER]) && (Save_Data.mapfilters[FILT_AF_COASTAL]) ) b->SetPressed(true); else b->SetPressed(false); b = GETDLGITEM(IDC_DOCKS); if ( (Save_Data.mapfilters[FILT_DOCK_NAVAL]) && (Save_Data.mapfilters[FILT_DOCK_CIV]) ) b->SetPressed(true); else b->SetPressed(false); b = GETDLGITEM(IDC_RBUTTON_DOCK_NAVAL); b->SetPressed(Save_Data.mapfilters[FILT_DOCK_NAVAL]); b = GETDLGITEM(IDC_RBUTTON_DOCK_CIV); b->SetPressed(Save_Data.mapfilters[FILT_DOCK_CIV]); b = GETDLGITEM(IDC_DEFENCES); if ( (Save_Data.mapfilters[FILT_BALLOONZONES]) && (Save_Data.mapfilters[FILT_FLAKZONES]) ) b->SetPressed(true); else b->SetPressed(false); b = GETDLGITEM(IDC_BALLOONZONES); b->SetPressed(Save_Data.mapfilters[FILT_BALLOONZONES]); b = GETDLGITEM(IDC_FLAKZONES); b->SetPressed(Save_Data.mapfilters[FILT_FLAKZONES]); b = GETDLGITEM(IDC_RDF); if ( (Save_Data.mapfilters[FILT_CH]) && (Save_Data.mapfilters[FILT_CHL]) ) b->SetPressed(true); else b->SetPressed(false); b = GETDLGITEM(IDC_CH); b->SetPressed(Save_Data.mapfilters[FILT_CH]); b = GETDLGITEM(IDC_CHL); b->SetPressed(Save_Data.mapfilters[FILT_CHL]); b = GETDLGITEM(IDC_CONVOYS); b->SetPressed(Save_Data.mapfilters[FILT_CONVOYS]); b = GETDLGITEM(IDC_FACTORIES); if ( (Save_Data.mapfilters[FILT_FACTORYFIGHTER]) && (Save_Data.mapfilters[FILT_FACTORYBOMBER]) && (Save_Data.mapfilters[FILT_FACTORYOTHER]) && (Save_Data.mapfilters[FILT_OIL]) && (Save_Data.mapfilters[FILT_POWER]) ) b->SetPressed(true); else b->SetPressed(false); b = GETDLGITEM(IDC_RBUTTON_FACTORYFIGHTER); b->SetPressed(Save_Data.mapfilters[FILT_FACTORYFIGHTER]); b = GETDLGITEM(IDC_RBUTTON_FACTORYBOMBER); b->SetPressed(Save_Data.mapfilters[FILT_FACTORYBOMBER]); b = GETDLGITEM(IDC_RBUTTON_FACTORYOTHER); b->SetPressed(Save_Data.mapfilters[FILT_FACTORYOTHER]); b = GETDLGITEM(IDC_RBUTTON_OIL); b->SetPressed(Save_Data.mapfilters[FILT_OIL]); b = GETDLGITEM(IDC_RBUTTON_POWER); b->SetPressed(Save_Data.mapfilters[FILT_POWER]); b = GETDLGITEM(IDC_NAVPOINTS); if ( (Save_Data.mapfilters[FILT_CITY]) && (Save_Data.mapfilters[FILT_TOWN]) && (Save_Data.mapfilters[FILT_VILLAGES]) && (Save_Data.mapfilters[FILT_LIGHTHOUSES]) //DeadCode RDH 9Sep00 && (Save_Data.mapfilters[FILT_TUNNELS]) ) b->SetPressed(true); else b->SetPressed(false); b = GETDLGITEM(IDC_RBUTTONCITY); b->SetPressed(Save_Data.mapfilters[FILT_CITY]); b = GETDLGITEM(IDC_RBUTTONTOWN); b->SetPressed(Save_Data.mapfilters[FILT_TOWN]); b = GETDLGITEM(IDC_RBUTTONVILAGES); b->SetPressed(Save_Data.mapfilters[FILT_VILLAGES]); b = GETDLGITEM(IDC_RBUTTONLIGHTHOUSES); b->SetPressed(Save_Data.mapfilters[FILT_LIGHTHOUSES]); //DeadCode RDH 2Aug00 b = GETDLGITEM(IDC_RBUTTONTUNNELS); //DeadCode RDH 2Aug00 b->SetPressed(Save_Data.mapfilters[FILT_TUNNELS]); b = GETDLGITEM(IDC_OPERATIONALITEMS); b->SetPressed(Save_Data.mapfilters[FILT_OPERATIONALITEMS]); b = GETDLGITEM(IDC_DAMAGEDITEMS); b->SetPressed(Save_Data.mapfilters[FILT_DAMAGEDITEMS]); b = GETDLGITEM(IDC_DESTROYEDITEMS); b->SetPressed(Save_Data.mapfilters[FILT_DESTROYEDITEMS]); if (redrawmap) m_pView->m_mapdlg.Invalidate(); }
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); } }
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); }
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); } } }