void CMainMap::DimMap() { CWindow* pw; CMap* pm; CSlider* ps; Math::Point pos, dim; float value; pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW1)); if (pw == nullptr) return; pm = static_cast<CMap*>(pw->SearchControl(EVENT_OBJECT_MAP)); if (pm == nullptr) return; pm->SetState(STATE_VISIBLE, (m_mapMode != 0)); dim.x = 100.0f/640.0f; dim.y = 100.0f/480.0f; pos.x = 540.0f/640.0f; pos.y = 0.0f/480.0f; pm->SetPos(pos); pm->SetDim(dim); ps = static_cast<CSlider*>(pw->SearchControl(EVENT_OBJECT_MAPZOOM)); if (ps != nullptr) { ps->SetState(STATE_VISIBLE, (m_mapMode != 0)); dim.x = SCROLL_WIDTH; dim.y = 66.0f / 480.0f; pos.x = 523.0f / 640.0f; pos.y = 3.0f / 480.0f; ps->SetPos(pos); ps->SetDim(dim); value = pm->GetZoom(); value = (value-ZOOM_MIN) / (ZOOM_MAX-ZOOM_MIN); value = powf(value, 0.5f); ps->SetVisibleValue(value); ps->SetArrowStep(0.2f); } }
void CDisplayInfo::AdjustDisplayInfo(Math::Point wpos, Math::Point wdim) { CWindow* pw; CEdit* edit; CButton* button; CSlider* slider; CGroup* group; Math::Point pos, dim; wpos.x = 50.0f / 640.0f; wpos.y = 30.0f / 480.0f; wdim.x = 540.0f / 640.0f; wdim.y = 420.0f / 480.0f; pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW4)); if ( pw != 0 ) { pw->SetPos(wpos); pw->SetDim(wdim); wdim = pw->GetDim(); } pos.x = (50.0f + 10.0f) / 640.0f; pos.y = (30.0f + 10.0f + 24.0f + 10.0f + 324.0f - 48.0f) / 480.0f; dim.x = 48.0f / 640.0f; dim.y = 48.0f / 480.0f; button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_HUSTON)); if ( button != 0 ) { button->SetPos(pos); button->SetDim(dim); } pos.y -= (48.0f + 4.0f) / 480.0f; button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_SAT)); if ( button != 0 ) { button->SetPos(pos); button->SetDim(dim); } //? pos.y -= (48.0f+4.0f)/480.0f; //? button = (CButton*)pw->SearchControl(EVENT_SATCOM_OBJECT); //? if ( button != 0 ) //? { //? button->SetPos(pos); //? button->SetDim(dim); //? } pos.y -= (48.0f + 4.0f) / 480.0f; button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_LOADING)); if ( button != 0 ) { button->SetPos(pos); button->SetDim(dim); } pos.y -= (48.0f + 4.0f) / 480.0f; button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_PROG)); if ( button != 0 ) { button->SetPos(pos); button->SetDim(dim); } pos.y -= (48.0f + 4.0f) / 480.0f; button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_SOLUCE)); if ( button != 0 ) { button->SetPos(pos); button->SetDim(dim); } pos.x = (50.0f + 10.0f + 5.0f) / 640.0f; pos.y = (30.0f + 10.0f + 4.0f) / 480.0f; dim.x = (48.0f - 10.0f) / 640.0f; dim.y = 24.0f / 480.0f; button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_OBJECT_INFOOK)); if ( button != 0 ) { button->SetPos(pos); button->SetDim(dim); } pos.x = (50.0f + 10.0f + 48.0f + 10.0f) / 640.0f; pos.y = (30.0f + 10.0f) / 480.0f; dim.x = 462.0f / 640.0f; dim.y = 358.0f / 480.0f; edit = static_cast<Ui::CEdit*>(pw->SearchControl(EVENT_EDIT1)); if ( edit != 0 ) { edit->SetPos(pos); edit->SetDim(dim); } pos.x = (50.0f + 10.0f + 48.0f + 10.0f) / 640.0f; pos.y = (30.0f + 10.0f + 358.0f + 10.0f) / 480.0f; dim.x = 32.0f / 640.0f; dim.y = 32.0f / 480.0f; button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_PREV)); if ( button != 0 ) { button->SetPos(pos); button->SetDim(dim); } pos.x += 35.0f / 640.0f; button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_NEXT)); if ( button != 0 ) { button->SetPos(pos); button->SetDim(dim); } pos.x += 35.0f / 640.0f; button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_HOME)); if ( button != 0 ) { button->SetPos(pos); button->SetDim(dim); } pos.x += 50.0f / 640.0f; button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_SIZE1)); if ( button != 0 ) { button->SetPos(pos); button->SetDim(dim); } pos.x += 35.0f / 640.0f; button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_SIZE2)); if ( button != 0 ) { button->SetPos(pos); button->SetDim(dim); } pos.x += 35.0f / 640.0f; button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_SIZE3)); if ( button != 0 ) { button->SetPos(pos); button->SetDim(dim); } pos.x += 35.0f / 640.0f; button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_SIZE4)); if ( button != 0 ) { button->SetPos(pos); button->SetDim(dim); } pos.x += 35.0f / 640.0f; dim.x = 18.0f / 640.0f; slider = static_cast<Ui::CSlider*>(pw->SearchControl(EVENT_STUDIO_SIZE)); if ( slider != 0 ) { slider->SetPos(pos); slider->SetDim(dim); } pos.x += 50.0f / 640.0f; dim.x = 32.0f / 640.0f; button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_COPY)); if ( button != 0 ) { button->SetPos(pos); button->SetDim(dim); } pos.x = (50.0f + 10.0f) / 640.0f; pos.y = (30.0f + 10.0f + 24.0f + 10.0f + 324.0f + 6.0f) / 480.0f; dim.x = 48.0f / 640.0f; dim.y = 40.0f / 480.0f; group = static_cast<Ui::CGroup*>(pw->SearchControl(EVENT_LABEL2)); // symbol SatCom if ( group != 0 ) { group->SetPos(pos); group->SetDim(dim); } pos.x = (50.0f + 10.0f + 14.0f) / 640.0f; pos.y = (30.0f + 10.0f + 6.0f) / 480.0f; dim.x = 20.0f / 640.0f; dim.y = 20.0f / 480.0f; group = static_cast<Ui::CGroup*>(pw->SearchControl(EVENT_LABEL3)); // symbol stand-by if ( group != 0 ) { group->SetPos(pos); group->SetDim(dim); } }