Esempio n. 1
0
File: simud.c Progetto: chinacat/rs
void ShowResidualProg()
{
   char tmpstr[TEMPSTRINGLEN];
   static Arg arglist [] = 
   {
      {XtNlabel, (XtArgVal) ""},
      {XtNvalue, (XtArgVal) ""},
   };
   Cardinal n = 0;


   if (exitFlag == True)
      StartSimilix();

   if (shellFlag == True)
      XtDestroyWidget(dialogShell);
   dialogShell = CreateShell();

   n = 0;
   XtSetArg(arglist[n], XtNlabel,
        "Show residual program --- Input the name of residual program:"); n++;
   XtSetArg(arglist[n], XtNvalue, RESNAME); n++;

   dialog[11] = XtCreateManagedWidget("Res11", dialogWidgetClass,
				      dialogShell, 
				      arglist, XtNumber(arglist));
   XtVaSetValues(dialog[11], XtNfont, font1Struct, NULL);

   XawDialogAddButton(dialog[11], "OK", ShowResProgOK, NULL);
   XawDialogAddButton(dialog[11], "Cancel", ShowResProgCancel, NULL);
   XawDialogAddButton(dialog[11], "Help", ShowResProgHelp, NULL);

   XtPopup(dialogShell, XtGrabNone);
   shellFlag = True;
}
Esempio n. 2
0
File: simug.c Progetto: chinacat/rs
void ExitSimu()
{
   char tmpstr[TEMPSTRINGLEN];
   Position x, y;
   Dimension width, height;
   Cardinal n = 0;
   Arg args[5];


   if (shellFlag == True)
      XtDestroyWidget(dialogShell);
   dialogShell = CreateShell();

   XtSetArg(dialog0Args[0], XtNlabel, "Quit the Simu system?");

   dialog0 = XtCreateManagedWidget("dialog0", dialogWidgetClass, dialogShell,
	        		   dialog0Args, XtNumber(dialog0Args));
   XtVaSetValues(dialog0, XtNfont, font1Struct, NULL);

   XawDialogAddButton(dialog0, "OK", ExitSimuOK, NULL); 
   XawDialogAddButton(dialog0, "Cancel", CancelDialog, dialog0);
   XawDialogAddButton(dialog0, "Help", ExitSimuHelp, NULL); 

   XtRealizeWidget(dialogShell);
   Popup(dialogShell, XtGrabNone);
/*   XtPopup(dialogShell, XtGrabNone); */
   shellFlag = True;
}
Esempio n. 3
0
File: simud.c Progetto: chinacat/rs
void BindResidualProg()
{
   char tmpstr[TEMPSTRINGLEN];
   Cardinal n = 0;
   static Arg dialogArgs [] = 
   {
      {XtNlabel, (XtArgVal) ""},
      {XtNvalue, (XtArgVal) ""}
   };


   if (exitFlag == True)
      StartSimilix();

   if (shellFlag == True)
      XtDestroyWidget(dialogShell);
   dialogShell = CreateShell();

   n = 0; 
   XtSetArg(dialogArgs[n], XtNlabel,
         "Bind residual program --- Input the name of bound variable:"); n++;
   XtSetArg(dialogArgs[n], XtNvalue, VARNAME); n++;

   dialog[15] = XtCreateManagedWidget("Var15", dialogWidgetClass,
                                      dialogShell, dialogArgs,
                                      XtNumber(dialogArgs));
   XtVaSetValues(dialog[15], XtNfont, font1Struct, NULL);

   XawDialogAddButton(dialog[15], "OK", BindResProgOK, NULL);
   XawDialogAddButton(dialog[15], "Cancel", BindResProgCancel, NULL);

   XtPopup(dialogShell, XtGrabNone);
   shellFlag = True;
}
Esempio n. 4
0
void CShellIconHelper<T>::SetShellVisible (bool bVisible)
{
    if (bVisible == true) // User wants to show the icon in the shell
    {
        if (m_bVisible == false) // Doesn't already exist?
        {
            // Create the shell, and timer (if applicable)
            CreateShell ();
        } // Otherwise, well you already have icon in the shell. :-)

        SetShellTimer (m_bTimerActive, m_wTimerDuration);

    }
    else // User wants rid of the icon
    { 
        if (m_bVisible == true)  // Is it there already?
        {
            // Destroy any running timer
            if (m_bTimerActive == true)
            {
                ::KillTimer (m_hWnd, m_TimerId);
            }
            DestroyShell (); // Get rid
        }
    }

    m_bVisible = bVisible;
}
Esempio n. 5
0
void CCharacterPhysicsSupport::KillHit( SHit &H )
{
#ifdef	DEBUG
	if( death_anim_debug )
			Msg( "death anim: kill hit  " );
#endif
	VERIFY( m_EntityAlife.Visual( ) );
	VERIFY( m_EntityAlife.Visual( )->dcast_PKinematics( ) );
	m_character_shell_control.TestForWounded( m_EntityAlife.XFORM( ), m_EntityAlife.Visual( )->dcast_PKinematics( ) );
	Fmatrix prev_pose; prev_pose.set( mXFORM );

	Fvector start;start.set( m_EntityAlife.Position( ) );
	Fvector velocity;
	Fvector death_position;
	CreateShell( H.who, death_position, velocity );
	//ActivateShell( H.who );

//	if(Type() == etStalker && xr_strcmp(dbg_stalker_death_anim, "none") != 0)
	float hit_angle = 0;
	MotionID m = m_death_anims.motion( m_EntityAlife, H, hit_angle );

	CAI_Stalker* const	holder = m_EntityAlife.cast_stalker();
	if (holder && (holder->wounded() || holder->movement().current_params().cover()) )
		m		= MotionID();

	if( m.valid( ) )//&& cmp( prev_pose, mXFORM ) 
	{
		destroy( m_interactive_motion );
		if( false && b_death_anim_velocity )
			m_interactive_motion = new imotion_velocity( );
		else
			m_interactive_motion = new imotion_position( );
		m_interactive_motion->setup( m ,m_pPhysicsShell, hit_angle );
	} else 
		DestroyIKController( );

	if( is_imotion(m_interactive_motion ) )
				m_interactive_motion->play( );


	m_character_shell_control.set_fatal_impulse( H );

	if( !is_imotion( m_interactive_motion ) )
	{
		
#ifdef	DEBUG
		if( death_anim_debug )
		{
			Msg( "death anim: kill hit use free ragdoll " );
			Msg( "death anim: fatal impulse: %f, ", H.impulse );
		}
#endif
		
		EndActivateFreeShell( H.who, start ,death_position, velocity );	
		m_flags.set( fl_block_hit, TRUE );
	}
}
Esempio n. 6
0
void CCharacterPhysicsSupport::ActivateShell			( CObject* who )
{
	R_ASSERT( _valid(m_EntityAlife.Position( )) );
	Fvector start;start.set( m_EntityAlife.Position( ) );
	Fvector velocity;
	Fvector death_position;
	CreateShell( who, death_position, velocity );
	EndActivateFreeShell( who, start ,death_position, velocity );
	VERIFY( m_pPhysicsShell );
	m_pPhysicsShell->Enable();
	m_pPhysicsShell->set_LinearVel( Fvector().set(0,-1,0) );
}
Esempio n. 7
0
File: simud.c Progetto: chinacat/rs
void ShowCurrentResidualProg()
{
   Position x, y;
   Cardinal n = 0;
   Arg args[12];
   Widget board, label, okbtn, cancelbtn, helpbtn;


   if (shellFlag == True)
      XtDestroyWidget(dialogShell);
   dialogShell = CreateShell();

   n = 0;
   XtSetArg(args[0], XtNx, &x); n++;
   XtSetArg(args[1], XtNy, &y); n++;
   XtGetValues(dialogShell, args, n);

   board = XtVaCreateManagedWidget("board", boxWidgetClass,
				   dialogShell,
				   XtNx, x,
				   XtNy, y,
				   XtNwidth, 550,
				   XtNheight, 1000,
				   XtNresize, XawtextResizeBoth,
				   NULL);

   n = 0;
   XtSetArg(args[n], XtNborderWidth, 0); n++;
   XtSetArg(args[n], XtNlabel, "        Show Current Residual Program       "); n++;
   label = XtCreateManagedWidget("label", labelWidgetClass,
				  board, args, n);
   XtVaSetValues(label, XtNfont, font0Struct, NULL);

   okbtn = XtCreateManagedWidget("OK", commandWidgetClass, board,
				 NULL, 0);
   XtVaSetValues(okbtn, XtNfont, font1Struct, NULL);

   cancelbtn = XtCreateManagedWidget("Cancel", commandWidgetClass, board,
				     NULL, 0);
   XtVaSetValues(cancelbtn, XtNfont, font1Struct, NULL);

   helpbtn = XtCreateManagedWidget("Help", commandWidgetClass, board,
				   NULL, 0);
   XtVaSetValues(helpbtn, XtNfont, font1Struct, NULL);

   XtAddCallback(okbtn, XtNcallback, ShowCurrentResidualProgOK, NULL);
   XtAddCallback(cancelbtn, XtNcallback, ShowCurrentPreprocessProgCancel, board);
   XtAddCallback(helpbtn, XtNcallback, ShowCurrentResidualProgHelp, NULL);

   XtPopup(dialogShell, XtGrabNone);
   shellFlag = True;
}
Esempio n. 8
0
void wxStEditApp::OnMenuEvent(wxCommandEvent& event)
{
    switch (event.GetId())
    {
        case ID_SHOW_HELP:
        {
            CreateHelpFrame(wxString::Format(_("Help for %s"), STE_APPDISPLAYNAME), (const char*)wxstedit_htm);
            break;
        }
        case ID_SHOW_README:
        {
            CreateHelpFrame(wxString::Format(_("Programming help for %s"), STE_APPDISPLAYNAME), (const char*)readme_htm);
            break;
        }

#if (wxVERSION_NUMBER >= 2900) || defined(__WXMSW__)
        case ID_SHOW_USAGE:
        {
            ::wxCommandLineUsage(m_frame);
            break;
        }
#endif
        case ID_TEST_STESHELL :
        {
            CreateShell();
            break;
        }
        case ID_NEW_STEFRAME :
        {
            wxFrame* frame = CreateMainFrame();
            if (frame)
                frame->Show();

            break;
        }
        default:
        {
            event.Skip();
            break;
        }
    }
}
Esempio n. 9
0
LTBOOL CWeaponFX::CreateObject(ILTClient* pClientDE)
{
    if (!CSpecialFX::CreateObject(pClientDE) || !g_pWeaponMgr) return LTFALSE;

	CGameSettings* pSettings = g_pInterfaceMgr->GetSettings();
    if (!pSettings) return LTFALSE;

	// Set up our data members...

	// Set the local client id...

    uint32 dwId;
    g_pLTClient->GetLocalClientID(&dwId);
    m_nLocalId = (uint8)dwId;


	m_nDetailLevel = pSettings->SpecialFXSetting();

	// Fire pos may get tweaked a little...

	m_vFirePos = CalcFirePos(m_vFirePos);

	m_vDir = m_vPos - m_vFirePos;
	m_fFireDistance = m_vDir.Mag();
	m_vDir.Norm();

    g_pLTClient->AlignRotation(&m_rSurfaceRot, &m_vSurfaceNormal, LTNULL);
    g_pLTClient->AlignRotation(&m_rDirRot, &m_vDir, LTNULL);

	SetupExitInfo();



	// Calculate if the camera can see the fire position and the impact
	// position...

	g_bCanSeeImpactPos	= LTTRUE;
	g_bCanSeeFirePos	= LTTRUE;
	g_bDistantImpactPos	= LTFALSE;
	g_bDistantFirePos	= LTFALSE;

	if (g_vtWeaponFXUseFOVPerformance.GetFloat())
	{
		HOBJECT hCamera = g_pGameClientShell->GetCamera();
		LTVector vCameraPos, vU, vR, vF, vDir;
		LTRotation rCameraRot;
		g_pLTClient->GetObjectPos(hCamera, &vCameraPos);
		g_pLTClient->GetObjectRotation(hCamera, &rCameraRot);
		g_pLTClient->GetRotationVectors(&rCameraRot, &vU, &vR, &vF);

		vDir = m_vPos - vCameraPos;
		LTFLOAT fImpactDist = vDir.Mag();

		if (fImpactDist > g_vtWeaponFXMaxImpactDist.GetFloat())
		{
			g_bDistantImpactPos = LTTRUE;
		}

		vDir.Norm();

		LTFLOAT fMul = VEC_DOT(vDir, vF);
		g_bCanSeeImpactPos = (fMul < g_vtWeaponFXMinImpactDot.GetFloat() ? LTFALSE : LTTRUE);

		// In multiplayer we need to account for impacts that occur around
		// our camera that we didn't cause (this is also an issue in single
		// player, but due to the singler player gameplay dynamics it isn't
		// as noticeable)...

		if (!g_bCanSeeImpactPos && IsMultiplayerGame())
		{
			// Somebody else shot this...if the impact is close enough, we 
			// "saw" it...
			if (m_nLocalId != m_nShooterId && fImpactDist <= g_vtWeaponFXMaxMultiImpactDist.GetFloat())
			{
				g_bCanSeeImpactPos = LTTRUE;
			}
		}

		vDir = m_vFirePos - vCameraPos;

		if (vDir.Mag() > g_vtWeaponFXMaxFireDist.GetFloat())
		{
			g_bDistantFirePos = LTTRUE;
		}

		vDir.Norm();

		fMul = VEC_DOT(vDir, vF);
		g_bCanSeeFirePos = (fMul < g_vtWeaponFXMinFireDot.GetFloat() ? LTFALSE : LTTRUE);
	}



	// Determine what container the sfx is in...

	HLOCALOBJ objList[1];
    LTVector vTestPos = m_vPos + m_vSurfaceNormal;  // Test a little closer...
    uint32 dwNum = g_pLTClient->GetPointContainers(&vTestPos, objList, 1);

	if (dwNum > 0 && objList[0])
	{
        uint32 dwUserFlags;
        g_pLTClient->GetObjectUserFlags(objList[0], &dwUserFlags);

		if (dwUserFlags & USRFLG_VISIBLE)
		{
            uint16 dwCode;
            if (g_pLTClient->GetContainerCode(objList[0], &dwCode))
			{
				m_eCode = (ContainerCode)dwCode;
			}
		}
	}

	// Determine if the fire point is in liquid

	vTestPos = m_vFirePos + m_vDir;  // Test a little further in...
    dwNum = g_pLTClient->GetPointContainers(&vTestPos, objList, 1);

	if (dwNum > 0 && objList[0])
	{
        uint32 dwUserFlags;
        g_pLTClient->GetObjectUserFlags(objList[0], &dwUserFlags);

		if (dwUserFlags & USRFLG_VISIBLE)
		{
            uint16 dwCode;
            if (g_pLTClient->GetContainerCode(objList[0], &dwCode))
			{
				m_eFirePosCode = (ContainerCode)dwCode;
			}
		}
	}


	if (IsLiquid(m_eCode))
	{
		m_wImpactFX	= m_pAmmo->pUWImpactFX ? m_pAmmo->pUWImpactFX->nFlags : 0;
	}
	else
	{
		m_wImpactFX	= m_pAmmo->pImpactFX ? m_pAmmo->pImpactFX->nFlags : 0;
	}

	m_wFireFX = m_pAmmo->pFireFX ? m_pAmmo->pFireFX->nFlags : 0;

	// Assume alt-fire, silenced, and tracer...these will be cleared by
	// IgnoreFX if not used...

	m_wFireFX |= WFX_ALTFIRESND | WFX_SILENCED | WFX_TRACER;

	// Assume impact ding, it will be cleared if not used...

	m_wImpactFX |= WFX_IMPACTDING;

	// Clear all the fire fx we want to ignore...

	m_wFireFX &= ~m_wIgnoreFX;
	m_wImpactFX &= ~m_wIgnoreFX;


	// See if this is a redundant weapon fx (i.e., this client shot the
	// weapon so they've already seen this fx)...

	if (g_pGameClientShell->IsMultiplayerGame())
	{
		if (m_pAmmo->eType != PROJECTILE)
		{
			if (!m_bLocal && m_nLocalId >= 0 && m_nLocalId == m_nShooterId)
			{
				if (m_wImpactFX & WFX_IMPACTDING)
				{
					if (g_vtMultiDing.GetFloat())
					{
						PlayImpactDing();
					}
				}

                return LTFALSE;
			}
		}
	}


	// Show the fire path...(debugging...)

	if (g_cvarShowFirePath.GetFloat() > 0)
	{
		PLFXCREATESTRUCT pls;

		pls.vStartPos			= m_vFirePos;
		pls.vEndPos				= m_vPos;
        pls.vInnerColorStart    = LTVector(GetRandom(127.0f, 255.0f), GetRandom(127.0f, 255.0f), GetRandom(127.0f, 255.0f));
		pls.vInnerColorEnd		= pls.vInnerColorStart;
        pls.vOuterColorStart    = LTVector(0, 0, 0);
        pls.vOuterColorEnd      = LTVector(0, 0, 0);
		pls.fAlphaStart			= 1.0f;
		pls.fAlphaEnd			= 1.0f;
		pls.fMinWidth			= 0;
		pls.fMaxWidth			= 10;
		pls.fMinDistMult		= 1.0f;
		pls.fMaxDistMult		= 1.0f;
		pls.fLifeTime			= 10.0f;
		pls.fAlphaLifeTime		= 10.0f;
		pls.fPerturb			= 0.0f;
        pls.bAdditive           = LTFALSE;
		pls.nWidthStyle			= PLWS_CONSTANT;
		pls.nNumSegments		= 2;

		CSpecialFX* pFX = g_pGameClientShell->GetSFXMgr()->CreateSFX(SFX_POLYLINE_ID, &pls);
		if (pFX) pFX->Update();
	}


	// If the surface is the sky, don't create any impact related fx...

	if (m_eSurfaceType != ST_SKY || (m_wImpactFX & WFX_IMPACTONSKY))
	{
		CreateWeaponSpecificFX();

		if (g_bCanSeeImpactPos)
		{
			if ((m_wImpactFX & WFX_MARK) && ShowsMark(m_eSurfaceType) && (LTBOOL)GetConsoleInt("MarkShow", 1))
			{
				LTBOOL bCreateMark = LTTRUE;
				if (g_bDistantImpactPos && m_nLocalId == m_nShooterId)
				{
					// Assume we'll see the mark if we're zoomed in ;)
					bCreateMark = g_pGameClientShell->IsZoomed();
				}

				if (bCreateMark)
				{
					CreateMark(m_vPos, m_vSurfaceNormal, m_rSurfaceRot, m_eSurfaceType);
				}
			}

			CreateSurfaceSpecificFX();
		}

		PlayImpactSound();
	}


	if (IsBulletTrailWeapon())
	{
		if (IsLiquid(m_eFirePosCode))
		{
			if (m_nDetailLevel != RS_LOW)
			{
				CreateBulletTrail(&m_vFirePos);
			}
		}
	}


	// No tracers under water...

	if ((LTBOOL)GetConsoleInt("Tracers", 1) && (m_wFireFX & WFX_TRACER) && !IsLiquid(m_eCode))
	{
		CreateTracer();
	}

	if (g_bCanSeeFirePos)
	{
		// Only do muzzle fx for the client (not for AIs)...

		if ((m_wFireFX & WFX_MUZZLE) && (m_nLocalId == m_nShooterId))
		{
			CreateMuzzleFX();
		}

		if (!g_bDistantFirePos &&
			(LTBOOL)GetConsoleInt("ShellCasings", 1) &&
			(m_wFireFX & WFX_SHELL))
		{
			CreateShell();
		}

		if ((m_wFireFX & WFX_LIGHT))
		{
			CreateMuzzleLight();
		}
	}

	if ((m_wFireFX & WFX_FIRESOUND) || (m_wFireFX & WFX_ALTFIRESND) || (m_wFireFX & WFX_SILENCED))
	{
		PlayFireSound();
	}

	// Only do fly-by sounds for weapons that leave bullet trails...

	if (IsBulletTrailWeapon())
	{
		PlayBulletFlyBySound();
	}


    return LTFALSE;  // Just delete me, I'm done :)
}
Esempio n. 10
0
File: simud.c Progetto: chinacat/rs
void PostUnfolding()
{
   Position x, y;
   Cardinal n = 0;
   Arg args[12];
   Widget name1, name2, buttonOK, buttonCancel, buttonHelp;


   if (shellFlag == True)
      XtDestroyWidget(dialogShell);
   dialogShell = CreateShell();

   n = 0;
   XtSetArg(args[n], XtNx, &x); n++;
   XtSetArg(args[n], XtNy, &y); n++;
   XtGetValues(dialogShell, args, n);

   radio4 = XtVaCreateManagedWidget("radio4", boxWidgetClass,
			 	   dialogShell,
                                   XtNx, x,
                                   XtNy, y,
                                   XtNwidth, 250,
                                   XtNheight, 100,
                                   NULL);
   n = 0;
   XtSetArg(args[n], XtNborderWidth, 0); n++;
   XtSetArg(args[n], XtNlabel, POSTUNFDLABEL); n++;
   name1 = XtCreateManagedWidget("name1", labelWidgetClass, radio4, args, n);
   XtVaSetValues(name1, XtNfont, font1Struct, NULL);

   n = 0;
   if (punfdFlag == True)
   {
      XtSetArg(args[n], XtNstate, True); n++;
   }
   XtSetArg(args[n], XtNlabel, "On"); n++;
   punfdOn = XtCreateManagedWidget("On", toggleWidgetClass, radio4, args, n);
   XtVaSetValues(punfdOn, XtNfont, font1Struct, NULL);

   n = 0;
   XtSetArg(args[n], XtNborderWidth, 0); n++;
   XtSetArg(args[n], XtNlabel, POSTUNFDLABEL); n++;
   name2 = XtCreateManagedWidget("name2", labelWidgetClass, radio4, args, n);
   XtVaSetValues(name2, XtNfont, font1Struct, NULL);

   n = 0;
   if (punfdFlag == False)
   {
      XtSetArg(args[n], XtNstate, True); n++;
   }
   XtSetArg(args[n], XtNlabel, "Off"); n++;

   punfdOff = XtCreateManagedWidget("Off", toggleWidgetClass, radio4, args, n);
   XtVaSetValues(punfdOff, XtNfont, font1Struct, NULL);

   XtVaSetValues(punfdOn, XtNradioGroup, punfdOff, NULL);
   XtVaSetValues(punfdOff, XtNradioGroup, punfdOn, NULL);

   buttonOK = XtCreateManagedWidget("OK", commandWidgetClass, radio4, NULL, 0);
   XtVaSetValues(buttonOK, XtNfont, font1Struct, NULL);

   buttonCancel = XtCreateManagedWidget("Cancel", commandWidgetClass, radio4,
				        NULL, 0);
   XtVaSetValues(buttonCancel, XtNfont, font1Struct, NULL);

   buttonHelp = XtCreateManagedWidget("Help", commandWidgetClass, radio4,
				      NULL, 0);
   XtVaSetValues(buttonHelp, XtNfont, font1Struct, NULL);

   XtAddCallback(buttonOK, XtNcallback, PostUnfoldingOK, NULL);
   XtAddCallback(buttonCancel, XtNcallback, PostUnfoldingCancel, NULL);
   XtAddCallback(buttonHelp, XtNcallback, PostUnfoldingHelp, NULL);

   XtPopup(dialogShell, XtGrabNone);
   shellFlag = True;
}
Esempio n. 11
0
File: simud.c Progetto: chinacat/rs
void VerboseSpecialization()
{
   Position x, y;
   Cardinal n = 0;
   Arg args[12];
   Widget name1, name2, name3, buttonOK, buttonCancel, buttonHelp;


   if (shellFlag == True)
      XtDestroyWidget(dialogShell);
   dialogShell = CreateShell();

   n = 0;
   XtSetArg(args[n], XtNx, &x); n++;
   XtSetArg(args[n], XtNy, &y); n++;
   XtGetValues(dialogShell, args, n);

   radio2 = XtVaCreateManagedWidget("radio2", boxWidgetClass,
			 	   dialogShell,
                                   XtNx, x,
                                   XtNy, y,
                                   XtNwidth, 250,
                                   XtNheight, 100,
                                   NULL);
   n = 0;
   XtSetArg(args[n], XtNborderWidth, 0); n++;
   XtSetArg(args[n], XtNlabel, VERBOSESPECLABEL1); n++;
   name1 = XtCreateManagedWidget("name1", labelWidgetClass, radio2, args, n);
   XtVaSetValues(name1, XtNfont, font1Struct, NULL);

   n = 0;
   if (vspecFlag == SIMUZERO)
   {
      XtSetArg(args[n], XtNstate, True); n++;
   }
   XtSetArg(args[n], XtNlabel, "0"); n++;
   vspec0 = XtCreateManagedWidget("0", toggleWidgetClass, radio2, args, n);
   XtVaSetValues(vspec0, XtNfont, font1Struct, NULL);

   n = 0;
   XtSetArg(args[n], XtNborderWidth, 0); n++;
   XtSetArg(args[n], XtNlabel, VERBOSESPECLABEL2); n++;
   name2 = XtCreateManagedWidget("name2", labelWidgetClass, radio2, args, n);
   XtVaSetValues(name2, XtNfont, font1Struct, NULL);

   n = 0;
   if (vspecFlag == SIMUONE)
   {
      XtSetArg(args[n], XtNstate, True); n++;
   }
   XtSetArg(args[n], XtNlabel, "1"); n++;
   vspec1 = XtCreateManagedWidget("1", toggleWidgetClass, radio2, args, n);
   XtVaSetValues(vspec1, XtNfont, font1Struct, NULL);

   n = 0;
   XtSetArg(args[n], XtNborderWidth, 0); n++;
   XtSetArg(args[n], XtNlabel, VERBOSESPECLABEL3); n++;
   name3 = XtCreateManagedWidget("name3", labelWidgetClass, radio2, args, n);
   XtVaSetValues(name3, XtNfont, font1Struct, NULL);

   n = 0;
   if (vspecFlag == SIMUTWO)
   {
      XtSetArg(args[n], XtNstate, True); n++;
   }
   XtSetArg(args[n], XtNlabel, "2"); n++;
   vspec2 = XtCreateManagedWidget("2", toggleWidgetClass, radio2, args, n);
   XtVaSetValues(vspec2, XtNfont, font1Struct, NULL);

   XtVaSetValues(vspec0, XtNradioGroup, vspec1, NULL);
   XtVaSetValues(vspec1, XtNradioGroup, vspec0, NULL);
   XtVaSetValues(vspec2, XtNradioGroup, vspec1, NULL);

   buttonOK = XtCreateManagedWidget("OK", commandWidgetClass, radio2, NULL, 0);
   XtVaSetValues(buttonOK, XtNfont, font1Struct, NULL);

   buttonCancel = XtCreateManagedWidget("Cancel", commandWidgetClass, radio2,
				        NULL, 0);
   XtVaSetValues(buttonCancel, XtNfont, font1Struct, NULL);

   buttonHelp = XtCreateManagedWidget("Help", commandWidgetClass, radio2,
				      NULL, 0);
   XtVaSetValues(buttonHelp, XtNfont, font1Struct, NULL);

   XtAddCallback(buttonOK, XtNcallback, VerboseSpecializationOK, NULL);
   XtAddCallback(buttonCancel, XtNcallback, VerboseSpecializationCancel, NULL);
   XtAddCallback(buttonHelp, XtNcallback, VerboseSpecializationHelp, NULL);

   XtPopup(dialogShell, XtGrabNone);
   shellFlag = True;

}
Esempio n. 12
0
//  object control
void PS_ObjectDialog::OpenObjectDialog()
{
    if (!IsCreated())
    {
        //controlDialog.CreateShell(basePlatform.plotShell.GetWidget(), true, "Plot Object Control");
        CRect rect(0, 0, 180, 400);

        char plotName[80];
        basePlatform.GetMainWindowTitle(plotName, false, 80);
        ConcatString(plotName, "::Control", 80);

        CreateShell(NULL, true, plotName, rect);

        ArgListC args;

        //args.AddArg(XmNautoUnmanage,          True);
        //args.AddWidthHeight(175, 400);
        //controlDialogForm.CreateWidget(controlDialog, args);
        //TODO:
        //controlDialogForm.AddCallback(XmNfocusCallback, FocusCB, this);

        // add buttons to bottom
        // bottom row buttons
        args.Clear();
        args.LeftFormAttach();
        args.RightFormAttach();
        args.BottomFormAttach();
        bottomRowForm.InitWidget(controlDialogForm.GetWidget(), args);

        args.Clear();
        args.AddArg(Arg::XmNwidth, 76);
        args.BottomFormAttach(2);
        args.SetPlaceHolder();

        // close
        args.LeftPosAttach(2);
        //TODO:
        //controlCloseButton.FixedSizeButtonArgs(args);
        controlCloseButton.StdButtonInit(" Close ", bottomRowForm.GetWidget(), args);
        controlCloseButton.AddOtherObjectCallback(CloseButtonCB, this);

        // apply
        args.ResetPlace();
        args.LeftPosAttach(50);
        controlApplyButton.StdButtonInit("Apply", bottomRowForm.GetWidget(), args);
        controlApplyButton.AddOtherObjectCallback(ApplyButtonCB, this);

        // next row buttons
        args.Clear();
        args.LeftFormAttach();
        args.RightFormAttach();
        args.BottomBaseAttach(bottomRowForm);
        nextRowForm.InitWidget(controlDialogForm.GetWidget(), args);

        args.Clear();
        args.AddArg(Arg::XmNwidth, 76);
        args.BottomFormAttach(2);
        args.SetPlaceHolder();

        // step button
        args.LeftPosAttach(2);
        controlClearButton.StdButtonInit(" Clear ", nextRowForm.GetWidget(), args);
        controlClearButton.AddOtherObjectCallback(ClearAllButtonCB, this);

        //  to start
        args.ResetPlace();
        args.LeftPosAttach(50);
        controlAllButton.StdButtonInit(" Set ", nextRowForm.GetWidget(), args);
        controlAllButton.AddOtherObjectCallback(SetAllButtonCB, this);

        // scroll window
        args.Clear();
        args.StdFormAttach();
        args.BottomBaseAttach(nextRowForm);
        //controlScrollArea.needHorizontal = false;
        controlScrollArea.InitWidget(controlDialogForm.GetWidget(), args);
        SetForm(&controlDialogForm);
    }

    Manage();
}
Esempio n. 13
0
File: simuc.c Progetto: chinacat/rs
void ShowCurrentPreprocessProg()
{
   Position x, y;
   Cardinal n = 0;
   Arg args[12];
   Widget board, label, annbtn0, annbtn, flowallbtn0, flowallbtn, flowidlabel,
          okbtn, cancelbtn, helpbtn;


   if (shellFlag == True)
      XtDestroyWidget(dialogShell);
   dialogShell = CreateShell();

   n = 0;
   XtSetArg(args[0], XtNx, &x); n++;
   XtSetArg(args[1], XtNy, &y); n++;
   XtGetValues(dialogShell, args, n);

   board = XtVaCreateManagedWidget("board", boxWidgetClass,
				   dialogShell,
				   XtNx, x,
				   XtNy, y,
				   XtNwidth, 550,
				   XtNheight, 1000,
				   XtNresize, XawtextResizeBoth,
				   NULL);

   n = 0;
   XtSetArg(args[n], XtNborderWidth, 0); n++;
   XtSetArg(args[n], XtNlabel, "        Show Current Preprocessed Program Functions          "); n++;
   label = XtCreateManagedWidget("label", labelWidgetClass,
				  board, args, n);
   XtVaSetValues(label, XtNfont, font0Struct, NULL);

   n = 0;
   XtSetArg(args[n], XtNborderWidth, 0); n++;
   XtSetArg(args[n], XtNlabel, "Show current preprocessed program                  "); n++;
   annbtn0 = XtCreateManagedWidget("annbtnlabel",
				   labelWidgetClass, board, args, n);
   XtVaSetValues(annbtn0, XtNfont, font1Struct, NULL);

   annbtn = XtCreateManagedWidget("OK",
				  commandWidgetClass, board, NULL, 0);
   XtVaSetValues(annbtn, XtNfont, font1Struct, NULL);

   n = 0;
   XtSetArg(args[n], XtNborderWidth, 0); n++;
   XtSetArg(args[n], XtNlabel, "Show current preprocessed program with all of flows"); n++;
   flowallbtn0 = XtCreateManagedWidget("flowalllabel",
				       labelWidgetClass, board, args, n);
   XtVaSetValues(flowallbtn0, XtNfont, font1Struct, NULL);

   flowallbtn = XtCreateManagedWidget("OK",
				      commandWidgetClass, board, NULL, 0);
   XtVaSetValues(flowallbtn, XtNfont, font1Struct, NULL);

   n = 0;
   XtSetArg(args[n], XtNborderWidth, 0); n++;
   XtSetArg(args[n], XtNlabel, "Show current preprocessed program with the flow ID:"); n++;
   flowidlabel = XtCreateManagedWidget("flowidlabel", labelWidgetClass,
				       board, args, n);
   XtVaSetValues(flowidlabel, XtNfont, font1Struct, NULL);

   n = 0;
   XtSetArg(args[n], XtNstring, FLOWID); n++;
   XtSetArg(args[n], XtNwidth, 468);	 n++;
   XtSetArg(args[n], XtNheight, 20);	 n++;
   XtSetArg(args[n], XtNborderWidth, 1); n++;
   XtSetArg(args[n], XtNtype, XawAsciiString); n++;
   XtSetArg(args[n], XtNeditType, XawtextEdit); n++;
   XtSetArg(args[n], XtNresize, XawtextResizeBoth); n++;
   flowidinput = XtCreateManagedWidget("flowidinput", asciiTextWidgetClass,
				       board, args, n);
   XtVaSetValues(flowidinput, XtNfont, font1Struct, NULL);

   okbtn = XtCreateManagedWidget("OK", commandWidgetClass, board,
				 NULL, 0);
   XtVaSetValues(okbtn, XtNfont, font1Struct, NULL);

   cancelbtn = XtCreateManagedWidget("Cancel", commandWidgetClass, board,
				     NULL, 0);
   XtVaSetValues(cancelbtn, XtNfont, font1Struct, NULL);

   helpbtn = XtCreateManagedWidget("Help", commandWidgetClass, board,
				   NULL, 0);
   XtVaSetValues(helpbtn, XtNfont, font1Struct, NULL);

   XtAddCallback(annbtn, XtNcallback, ShowCurrentAnnProg, NULL);
   XtAddCallback(flowallbtn, XtNcallback, ShowCurrentFlowAllProg, NULL);
   XtAddCallback(okbtn, XtNcallback, ShowCurrentFlowIdProg, NULL);
   XtAddCallback(cancelbtn, XtNcallback, ShowCurrentPreprocessProgCancel, board);
   XtAddCallback(helpbtn, XtNcallback, ShowCurrentPreprocessProgHelp, NULL);

   XtPopup(dialogShell, XtGrabNone);
   shellFlag = True;
}
Esempio n. 14
0
void PS_TransparencyDialog::DoCreateDialog(CWnd* pParentWnd)
{
    ArgListC args;
    CRect rect(0, 0, 350, 550);

    char plotName[80];
    base3DPlatform.GetMainWindowTitle(plotName, false, 80);
    ConcatString(plotName, "::Transparency", 80);

    CreateShell(pParentWnd, true, plotName, rect);
    CenterWindow();

    args.StdFormAttach();
    topRowForm.InitWidget(transparencyDialogForm.GetWidget(), args);

    args.StdToggleSetup(5);
    useTransparencyUI.StdToggleInit("Enable transparency", topRowForm.GetWidget(), args);
    useTransparencyUI.AddOtherObjectCallback(SetAllSensitiveCB, this);

    args.StdTopObjectAttach(topRowForm.GetWidget());
    groupForm.InitWidget(transparencyDialogForm.GetWidget(), args);

    args.StdFormAttach();
    for (int i = 0; i < PC_TransparencySpec::maxTransparencyGroup; i++)
    {
        char tempStr[80];
        ConcatInt(i + 1, "Group ", tempStr, 1, 80);
        transparencyGroupsUI[i].InitFramedUI(tempStr, groupForm.GetWidget(), args);
        args.StdTopObjectAttach(transparencyGroupsUI[i]);
    }

    // bottom row buttons
    args.Clear();
    args.LeftFormAttach();
    args.RightFormAttach();
    args.BottomFormAttach();
    bottomRowForm.InitWidget(transparencyDialogForm.GetWidget(), args);

    // animate
    args.StdSplitMiddle(2, 30);
    animateButton.StdButtonInit("Anim.", bottomRowForm.GetWidget(), args);
    animateButton.AddOtherObjectCallback(AnimateButtonCB, this);

    args.StdSplitMiddle(32, 64);
    applyButton.StdButtonInit("Apply", bottomRowForm.GetWidget(), args);
    applyButton.AddOtherObjectCallback(ApplyButtonCB, this);

    //  close
    args.StdSplitMiddle(66, 99);
    closeButton.StdButtonInit("Close", bottomRowForm.GetWidget(), args);
    closeButton.AddOtherObjectCallback(CloseButtonCB, this);

    // next row buttons
    args.Clear();
    args.LeftFormAttach();
    args.RightFormAttach();
    args.BottomBaseAttach(bottomRowForm);
    nextRowForm.InitWidget(transparencyDialogForm.GetWidget(), args);

    args.StdSplitMiddle(2, 30);
    stepButton.StdButtonInit("Step", nextRowForm.GetWidget(), args);
    stepButton.AddOtherObjectCallback(StepButtonCB, this);

    args.StdSplitMiddle(32, 64);
    startButton.StdButtonInit("Start", nextRowForm.GetWidget(), args);
    startButton.AddOtherObjectCallback(StartButtonCB, this);

    args.StdSplitMiddle(66, 98);
    endButton.StdButtonInit("End", nextRowForm.GetWidget(), args);
    endButton.AddOtherObjectCallback(EndButtonCB, this);

    // # of frames
    args.Clear();
    args.LeftFormAttach();
    args.RightFormAttach();
    args.BottomBaseAttach(nextRowForm);
    ntransStepsUI.SetFieldLen(5);
    ntransStepsUI.InitLabeledUI("# of frames", transparencyDialogForm.GetWidget(), args);

    SetForm(&transparencyDialogForm);
    ResetForm();
}