void
GameScreen::ShowJoyDlg()
{
	if (joydlg) {
		if (quit_view) {
			quit_view->CloseMenu();
			Starshatter::GetInstance()->Pause(true);
		}

		HideAll();

		if (ctldlg)  {
			ctldlg->Show();
			ctldlg->SetTopMost(false);
		}

		if (joydlg)  joydlg->Show();

		if (mouse_con) {
			mouse_con->SetActive(false);
		}

		Mouse::Show(true);
	}
}
Exemple #2
0
void CDlgImgShow::SwitchToSpecifedImage(CString strPath)
{
	HideAll();
	m_picSpecified.Load(strPath);
	m_picSpecified.ShowWindow(SW_SHOW);
	UpdateWindow();
}
void
GameScreen::ShowModInfoDlg()
{
	if (moddlg && modInfoDlg) {
		if (quit_view) {
			quit_view->CloseMenu();
			Starshatter::GetInstance()->Pause(true);
		}

		HideAll();

		moddlg->Show();
		moddlg->SetTopMost(false);

		modInfoDlg->Show();
		modInfoDlg->SetTopMost(true);

		if (mouse_con) {
			mouse_active = mouse_con->Active();
			mouse_con->SetActive(false);
		}

		Mouse::Show(true);
	}
}
Exemple #4
0
BOOL COptions::OnInitDialog()
{
	CDialog::OnInitDialog();

	m_general.Create(IDD_OPT_GEN, this);
	m_systems.Create(IDD_OPT_SYSTEMS, this);
	m_decoder.Create(IDD_OPT_DECODER, this);
	m_render.Create(IDD_OPT_RENDER, this);
	m_render3D.Create(IDD_OPT_RENDER3D, this);
	m_audio.Create(IDD_OPT_AUDIO, this);
	m_http.Create(IDD_OPT_HTTP, this);
	m_font.Create(IDD_OPT_FONT, this);
	m_stream.Create(IDD_OPT_STREAM, this);

	m_Selection.AddString(_T("General"));
	m_Selection.AddString(_T("MPEG-4 Systems"));
	m_Selection.AddString(_T("Decoders"));
	m_Selection.AddString(_T("Compositor"));
	m_Selection.AddString(_T("3D Rendering"));
	m_Selection.AddString(_T("Audio"));
	m_Selection.AddString(_T("Text"));
	m_Selection.AddString(_T("Download"));
	m_Selection.AddString(_T("Streaming"));
	HideAll();

	const char *sOpt = gf_cfg_get_key(GetApp()->m_user.config, "General", "ConfigPanel");
	u32 sel = sOpt ? atoi(sOpt) : 0;
	if (sel>8) sel=8;
	m_Selection.SetCurSel(sel);
	OnSelchangeCombosel();

	SetFocus();
	return TRUE;
}
Exemple #5
0
void COptions::OnSelchangeCombosel()
{
	HideAll();
	switch (m_Selection.GetCurSel()) {
	case 0: m_general.ShowWindow(SW_SHOW); break;
	case 1: m_systems.ShowWindow(SW_SHOW); break;
	case 2: m_decoder.ShowWindow(SW_SHOW); break;
	case 3: m_render.ShowWindow(SW_SHOW); break;
	case 4: m_render3D.ShowWindow(SW_SHOW); break;
	case 5: m_audio.ShowWindow(SW_SHOW); break;
	case 6: m_font.ShowWindow(SW_SHOW); break;
	case 7: m_http.ShowWindow(SW_SHOW); break;
	case 8: m_stream.ShowWindow(SW_SHOW); break;
	}
}
Exemple #6
0
bool OSD::Reinit(const QRect &rect, float font_aspect)
{
    m_Refresh = true;
    int new_stretch = (int)((font_aspect * 100) + 0.5f);
    if ((rect == m_Rect) && (new_stretch == m_fontStretch))
        return true;

    HideAll(false);
    TearDown();
    if (!Init(rect, font_aspect))
    {
        LOG(VB_GENERAL, LOG_ERR, LOC + QString("Failed to re-init OSD."));
        return false;
    }
    return true;
}
Exemple #7
0
void CUIBagWnd::ShowSectionEx(int iSection){
	HideAll();

	if (-1 == iSection)
	{
		SetMenuLevel(mlRoot);	return;
	}

	R_ASSERT2((GROUP_2 <= iSection) && (iSection <= GROUP_34), "CUIBagWnd::ShowSectionEx() - invalid section number");

    m_groups[iSection].Show(true);

	if ( GROUP_BOXES == iSection )
		SetMenuLevel(mlBoxes);
	else
		SetMenuLevel(mlWpnSubType);
}
Exemple #8
0
void CUIBagWnd::ShowSection(int iSection)
{
	R_ASSERT2(  (GROUP_2 <= iSection) && (iSection <= GROUP_6 + 1), "CUIBagWnd::ShowSection() - invalid section number");

	HideAll();

	if (GROUP_6 + 1 != iSection)
	{
        m_groups[iSection].Show(true);

		if ( GROUP_BOXES == iSection )
			SetMenuLevel(mlBoxes);
		else
			SetMenuLevel(mlWpnSubType);
	}
	else
		SetMenuLevel(mlRoot);
}
Exemple #9
0
bool OSD::Init(const QRect &rect, float font_aspect)
{
    m_Rect = rect;
    m_fontStretch = (int)((font_aspect * 100) + 0.5f);
    OverrideUIScale();
    LoadWindows();
    RevertUIScale();

    if (!m_Children.size())
    {
        LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to load any windows.");
        return false;
    }

    LOG(VB_PLAYBACK, LOG_INFO, LOC +
        QString("Loaded OSD: size %1x%2 offset %3+%4")
            .arg(m_Rect.width()).arg(m_Rect.height())
            .arg(m_Rect.left()).arg(m_Rect.top()));
    HideAll(false);
    return true;
}
void
GameScreen::Hide()
{
	if (isShown) {
		HideAll();

		if (disp_view && gamewin) {
			gamewin->DelView(disp_view);
			disp_view->SetWindow(old_disp_win);
		}

		if (engdlg) engdlg->SetShip(0);
		if (fltdlg) fltdlg->SetShip(0);
		if (navdlg) navdlg->SetShip(0);

		HUDSounds::StopSound(HUDSounds::SND_RED_ALERT);

		screen->DelWindow(gamewin);
		isShown = false;
	}
}
void
GameScreen::ShowFltDlg()
{
	if (!gamewin) return;

	if (fltdlg && !fltdlg->IsShown()) {
		HideAll();

		fltdlg->SetShip(sim->GetPlayerShip());
		fltdlg->Show();

		if (mouse_con) {
			mouse_active = mouse_con->Active();
			mouse_con->SetActive(false);
		}

		Mouse::Show(true);
	}
	else {
		HideFltDlg();
	}
}
void
GameScreen::ShowNavDlg()
{
	if (!gamewin) return;

	if (navdlg && !navdlg->IsShown()) {
		HideAll();

		navdlg->SetSystem(sim->GetStarSystem());
		navdlg->SetShip(sim->GetPlayerShip());
		navdlg->Show();

		if (mouse_con) {
			mouse_active = mouse_con->Active();
			mouse_con->SetActive(false);
		}

		Mouse::Show(true);
	}
	else {
		HideNavDlg();
	}
}
Exemple #13
0
BOOL CDlgImgShow::OnInitDialog()
{
	CDialog::OnInitDialog();

	ModifyStyle(WS_CAPTION, NULL, SWP_DRAWFRAME);


	CString strImageMask;
	strImageMask.Empty();
	strImageMask.Append(_T("pic0.bmp"));
	m_picMask.Load(strImageMask);


	CString strImage2;
	strImage2.Empty();
	strImage2.Append(_T("pic1.bmp"));
	m_picMask2.Load(strImage2);

	CString strImage3;
	strImage3.Empty();
	strImage3.Append(TEXT("pic2.bmp"));
	m_picMask3.Load(strImage3);

	CString strImage4;
	strImage4.Empty();
	strImage4.Append(TEXT("black.bmp"));
	m_picUnUsed.Load(strImage4);

	CString strImage5;
	strImage5.Empty();
	strImage5.Append(TEXT("white.bmp"));
	m_picUsed.Load(strImage5);

	HideAll();
	return TRUE;  // return TRUE unless you set the focus to a control
}
Exemple #14
0
void CUIBagWnd::InitItems()
{
    FillUpGroups			();
	HideAll					();
	SetMenuLevel			(mlRoot);
}
Exemple #15
0
void QCSXCAD::BuildToolBar()
{
	QToolBar *mainTB = addToolBar(tr("General"));
	mainTB->setObjectName("General_ToolBar");
	QSize TBIconSize(16,16);
	mainTB->setIconSize(TBIconSize);

	if (QCSX_Settings.GetEdit())
		mainTB->addAction(QIcon(":/images/filenew.png"),tr("New"),this,SLOT(New()));
	if (QCSX_Settings.GetEdit())
		mainTB->addAction(QIcon(":/images/down.png"),tr("Import"),this,SLOT(ImportGeometry()));
	mainTB->addAction(QIcon(":/images/up.png"),tr("Export"),this,SLOT(ExportGeometry()));


	QToolBar *ItemTB = addToolBar(tr("Item View"));
	ItemTB->setIconSize(TBIconSize);
	ItemTB->setObjectName("Item_View_ToolBar");

	ItemTB->addAction(tr("CollapseAll"),CSTree,SLOT(collapseAll()));
	ItemTB->addAction(tr("ExpandAll"),CSTree,SLOT(expandAll()));

	ItemTB->addAction(QIcon(":/images/bulb.png"),tr("ShowAll"),this,SLOT(ShowAll()));
	ItemTB->addAction(QIcon(":/images/bulb_off.png"),tr("HideAll"),this,SLOT(HideAll()));

	QToolBar *newObjct = NULL;
	QAction* newAct = NULL;

	if (QCSX_Settings.GetEdit())
	{
		newObjct = addToolBar(tr("add new Primitive"));
		newObjct->setObjectName("New_Primitive_ToolBar");

		newAct = newObjct->addAction(tr("Box"),this,SLOT(NewBox()));
		newAct->setToolTip(tr("add new Box"));

		newAct = newObjct->addAction(tr("MultiBox"),this,SLOT(NewMultiBox()));
		newAct->setToolTip(tr("add new Multi-Box"));

		newAct = newObjct->addAction(tr("Sphere"),this,SLOT(NewSphere()));
		newAct->setToolTip(tr("add new Sphere"));

		newAct = newObjct->addAction(tr("Cylinder"),this,SLOT(NewCylinder()));
		newAct->setToolTip(tr("add new Cylinder"));

		newAct = newObjct->addAction(tr("Polygon"),this,SLOT(NewPolygon()));
		newAct->setToolTip(tr("add new Polygon"));

		newAct = newObjct->addAction(tr("User Defined"),this,SLOT(NewUserDefined()));
		newAct->setToolTip(tr("add new User Definied Primitive"));

		newObjct = addToolBar(tr("add new Property"));
		newObjct->setObjectName("New_Property_ToolBar");

		newAct = newObjct->addAction(tr("Material"),this,SLOT(NewMaterial()));
		newAct->setToolTip(tr("add new Material-Property"));

		newAct = newObjct->addAction(tr("Metal"),this,SLOT(NewMetal()));
		newAct->setToolTip(tr("add new Metal-Property"));

		newAct = newObjct->addAction(tr("Excitation"),this,SLOT(NewExcitation()));
		newAct->setToolTip(tr("add new Excitation-Property"));

		newAct = newObjct->addAction(tr("ProbeBox"),this,SLOT(NewChargeBox()));
		newAct->setToolTip(tr("add new Probe-Box-Property"));

		newAct = newObjct->addAction(tr("ResBox"),this,SLOT(NewResBox()));
		newAct->setToolTip(tr("add new Res-Box-Property"));

		newAct = newObjct->addAction(tr("DumpBox"),this,SLOT(NewDumpBox()));
		newAct->setToolTip(tr("add new Dump-Box-Property"));
	}

	newObjct = addToolBar(tr("Zoom"));
	newObjct->setIconSize(TBIconSize);
	newObjct->setObjectName("Zoom_ToolBar");

	newAct = newObjct->addAction(QIcon(":/images/viewmagfit.png"),tr("Zoom fit"),this,SLOT(BestView()));
	newAct->setToolTip("Zoom to best fit all objects");

	viewPlane[0] = newObjct->addAction(GridEditor->GetNormName(0),this,SLOT(setYZ()));
	viewPlane[0]->setToolTip(tr("Switch to y-z-plane view (x-normal)"));
	viewPlane[1] = newObjct->addAction(GridEditor->GetNormName(1),this,SLOT(setZX()));
	viewPlane[1]->setToolTip(tr("Switch to z-x-plane view (y-normal)"));
	viewPlane[2] = newObjct->addAction(GridEditor->GetNormName(2),this,SLOT(setXY()));
	viewPlane[2]->setToolTip(tr("Switch to x-y-plane view (z-normal)"));

	addToolBarBreak();

	QActionGroup* ActViewGrp = new QActionGroup(this);
	newAct = newObjct->addAction(tr("2D"),this,SLOT(View2D()));
	newAct->setToolTip(tr("Switch to 2D view mode"));
	ActViewGrp->addAction(newAct);
	newAct->setCheckable(true);
	newAct = newObjct->addAction(tr("3D"),this,SLOT(View3D()));
	newAct->setToolTip(tr("Switch to 3D view mode"));
	ActViewGrp->addAction(newAct);
	newAct->setCheckable(true);
	m_PPview = newObjct->addAction(tr("PP"));
	m_PPview->setToolTip(tr("Toggle parallel projection view mode"));
	QObject::connect(m_PPview,SIGNAL(toggled(bool)),this,SLOT(SetParallelProjection(bool)));
	m_PPview->setCheckable(true);

	if (QCSX_Settings.GetEdit())
		addToolBar(GridEditor->BuildToolbar());
}
Exemple #16
0
void CDlgImgShow::UseMask()
{
	HideAll();
	m_picMask.ShowWindow(SW_SHOW);
	UpdateWindow();
}
Exemple #17
0
void CDlgImgShow::Used()
{
	HideAll();
	m_picUsed.ShowWindow(SW_SHOW);
	UpdateWindow();
}
Exemple #18
0
void               P3DModelEditPanel::UpdatePanelMinSize
                                      ()
 {
  HideAll();
  RestoreAll();
 }
void CQuizRunningDlg::SetState(FormStates st)
{
	m_curState = st;
	PrgAPI* pAPI = PRGAPI();
	DisplayRunningResult();
	switch (st)
	{
	case ST_Start:
		SetCurrentGame(m_curGameIdx);
		m_pPlayer->Stop();
		m_curTime = 0;
		m_correctAnswers = 0;
		m_totalAnswers = 0;
		m_lastResponseTime = 0;
		if (m_poolCount < 4)
		{	
			m_subTitle.SetWindowText(pAPI->GetString(IDS_NOTENOUGHTRACKSTOPLAYTHEQUIZ));
		}
		else
		{
			HideAll();
			m_pButtons[BT_Start]->ShowWindow(SW_SHOW);
			m_pButtons[BT_SelectNext]->ShowWindow(SW_SHOW);
			m_pButtons[BT_SelectPrev]->ShowWindow(SW_SHOW);
			m_pButtons[BT_Exit]->ShowWindow(SW_SHOW);

			m_subTitle.SetWindowText(pAPI->GetString(IDS_RECOGNISESONG));
			//m_subTitle.SetColor(CLabelEx::COL_Text, RGB(200,200,200));

		}
		break;
	case ST_DisplayingQuestionsAndWait:
		{
			KillTimer(TIMER_CONTINUOUS);
			if (m_pButtons[BT_Start] ->IsWindowVisible())
				HideAll();
			INT numTimes = 0;
			while (!DisplayNextQuestion() && numTimes<4)
				numTimes++;
			for (INT i = BT_Answer1; i <= BT_AnswerNo; i++)
			{
				m_pButtons[i]->SetState(CMillionaireButton::ST_Disabled);
				m_pButtons[i]->SetTextAlign(DT_LEFT);
				m_pButtons[i]->EnableWindow(FALSE);
				m_pButtons[i]->ShowWindow(SW_SHOW);
				m_pButtons[i]->Invalidate();
			}
			m_progress.ShowWindow(SW_SHOW);
			m_pButtons[BT_EndGame]->ShowWindow(SW_SHOW);
			if (numTimes == 4)
				SetState(ST_GameOver);
			SetTimer(TIMER_DISPLAYQUESTIONSTIMER, TIMER_DISPLAYQUESTIONSTIMER_DELAY, NULL);
		}
		break;
	case ST_RunningQuestions:
		SetFocus();
		for (int i = BT_Answer1; i <= BT_AnswerNo; i++)
		{
			m_pButtons[i]->SetState(CMillionaireButton::ST_Normal);
			m_pButtons[i]->EnableWindow(TRUE);
			m_pButtons[i]->Invalidate();
		}
		m_pPlayer->Start();
		m_progress.ShowWindow(SW_SHOW);
		m_LastTickCount = GetTickCount();
		SetTimer(TIMER_CONTINUOUS, 25, NULL);
		break;
	case ST_DisplayingResultsAndWait:
		KillTimer(TIMER_CONTINUOUS);
		for (int i = BT_Answer1; i <= BT_AnswerNo; i++)
		{
			//m_pButtons[i]->SetState(CMillionaireButton::ST_Normal);
			m_pButtons[i]->EnableWindow(FALSE);
			//m_pButtons[i]->Invalidate();
		}
		SetTimer(TIMER_DISPLAYRESULTSTIMER, TIMER_DISPLAYRESULTSTIMER_DELAY, NULL);
		break;
	case ST_GameOver:
		m_pPlayer->SetVolume(40);
		KillTimer(TIMER_CONTINUOUS);
		KillTimer(TIMER_DISPLAYRESULTSTIMER);
		KillTimer(TIMER_DISPLAYQUESTIONSTIMER);
		HideAll();
		m_pButtons[BT_Submit]->ShowWindow(SW_SHOW);
		m_pButtons[BT_NewGame]->ShowWindow(SW_SHOW);
		m_pButtons[BT_Exit]->ShowWindow(SW_SHOW);
		SYSTEMTIME st;
		GetSystemTime(&st);
		m_gameTimeStamp = SystemTime2UnixTimeStamp(st);

		if (m_curGameBestScore < m_correctAnswers)
		{
			m_curGameBestScore = m_correctAnswers;
			AppSettings* pSettings = pAPI->GetAppSettings();
			TCHAR bf[500];
			_sntprintf(bf, 500, _T("%s.best"), m_curGame.gameName);
			pSettings->Write(SettingsCategory, bf, m_curGameBestScore);
			_sntprintf(bf, 500, _T("%s.bestdate"), m_curGame.gameName);
			TCHAR dateBuffer[200];
			::GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, 0, 0, dateBuffer, 200);
			pSettings->Write(SettingsCategory, bf, dateBuffer);
			m_curGameBestScoreDate = dateBuffer;
		}

		m_subTitle.SetWindowText(pAPI->GetString(IDS_GAMEOVER));
		m_subTitle.SetColor(CLabelEx::COL_Text, RGB(200,200,200));
		break;
	default:
		ASSERT(0);
		break;
	}

}
Exemple #20
0
void OSD::DialogShow(const QString &window, const QString &text, int updatefor)
{
    if (m_Dialog)
    {
        QString current = m_Dialog->objectName();
        if (current != window)
        {
            DialogQuit();
        }
        else
        {
            MythDialogBox *dialog = dynamic_cast<MythDialogBox*>(m_Dialog);
            if (dialog)
                dialog->Reset();

            DialogSetText(text);
        }
    }

    if (!m_Dialog)
    {
        OverrideUIScale();
        MythScreenType *dialog;

        if (window == OSD_DLG_EDITOR)
            dialog = new ChannelEditor(m_ParentObject, window.toLatin1());
        else if (window == OSD_DLG_CONFIRM)
            dialog = new MythConfirmationDialog(NULL, text, false);
        else
            dialog = new MythDialogBox(text, NULL, window.toLatin1(), false, true);

        dialog->SetPainter(m_CurrentPainter);
        if (dialog->Create())
        {
            PositionWindow(dialog);
            m_Dialog = dialog;
            MythDialogBox *dbox = dynamic_cast<MythDialogBox*>(m_Dialog);
            if (dbox)
                dbox->SetReturnEvent(m_ParentObject, window);
            MythConfirmationDialog *cbox = dynamic_cast<MythConfirmationDialog*>(m_Dialog);
            if (cbox)
            {
                cbox->SetReturnEvent(m_ParentObject, window);
                cbox->SetData("DIALOG_CONFIRM_X_X");
            }
            m_Children.insert(window, m_Dialog);
        }
        else
        {
            RevertUIScale();
            delete dialog;
            return;
        }

        RevertUIScale();
    }

    if (updatefor)
    {
        m_NextPulseUpdate  = MythDate::current();
        m_PulsedDialogText = text;
        SetExpiry(window, kOSDTimeout_None, updatefor);
    }

    DialogBack();
    HideAll(true, m_Dialog);
    m_Dialog->SetVisible(true);
}