void RenderLogic::ShowNextDemo()
{
	short newDemo = m_CurDemoNum + 1;
	ShowSubDemo(SUBDEMOSTART);
	//std::cout << "newDemo: " << newDemo << std::endl;
	if(newDemo > 5)
	{
		newDemo--;
	}
	ShowDemo(newDemo);
}
Exemple #2
0
bool WinFrame::ExecExpr(const std::string& expr)
{
    /* If expression is empty -> show information */
    if (expr.empty())
        ShowIntro();
    else if (expr == "exit")
    {
        /* Clear input to avoid storing "exit" in the config-file */
        SetInput("");
        Close();
    }
    else if (expr == "demo")
        ShowDemo();
    else if (expr == "const")
        ShowConstants();
    else if (expr == "clear")
    {
        constantsSet_.constants.clear();
        constantsSet_.ResetStd();
        ShowConstants();
    }
    else
    {
        /* Setup compute mode */
        Ac::ComputeMode mode;
        mode.degree = GetOptionDegree();

        /* Show status message */
        SetOutput("computing ...");

#ifdef AC_MULTI_THREADED

        /* Wait until previous thread has successfully terminated */
        if (computing_)
            return false;
        JoinThread();

#endif

        /* Compute expression */
#ifdef AC_MULTI_THREADED

        computing_ = true;
        thread_ = std::unique_ptr<std::thread>(new std::thread(&WinFrame::ComputeThreadProc, this, expr, mode));

#else

        ComputeThreadProc(expr.ToStdString(), mode);

#endif
    }

    return true;
}
Exemple #3
0
void WinFrame::OnMenuItem(wxCommandEvent& event)
{
    switch (event.GetId())
    {
    case MENU_QUIT:
        Close();
        break;
    case MENU_INTRO:
        ShowIntro();
        break;
    case MENU_DEMO:
        ShowDemo();
        break;
    case MENU_INFO:
        ShowAbout();
        break;
    }
}