void TestSplitByAmountDlgProc::UpdateTypeDlg( HWND hWnd, int type )
{
	bool enable = (type == kSplitByAmount_testType_fraction);
	bool bRandom = enable;
	EnableWindow( GetDlgItem( hWnd, IDC_RATIOTEXT ), enable );
	ISpinnerControl* spin = GetISpinner( GetDlgItem( hWnd, IDC_RATIO2SPIN ) );
	spin->Enable( enable );
	ReleaseISpinner( spin );

	enable = (type == kSplitByAmount_testType_everyN);
	EnableWindow( GetDlgItem( hWnd, IDC_EVERYNTEXT ), enable );
	spin = GetISpinner( GetDlgItem( hWnd, IDC_EVERYNSPIN ) );
	spin->Enable( enable );
	ReleaseISpinner( spin );

	enable = (type >= kSplitByAmount_testType_firstN);
	EnableWindow( GetDlgItem( hWnd, IDC_FIRSTNTEXT ), enable );
	EnableWindow( GetDlgItem( hWnd, IDC_PERSOURCE ), enable );
	spin = GetISpinner( GetDlgItem( hWnd, IDC_FIRSTNSPIN ) );
	spin->Enable( enable );
	ReleaseISpinner( spin );

	EnableWindow( GetDlgItem( hWnd, IDC_UNIQUENESSBOX ), bRandom );
	EnableWindow( GetDlgItem( hWnd, IDC_SEEDTEXT ), bRandom );
	spin = GetISpinner( GetDlgItem( hWnd, IDC_SEEDSPIN ) );
	spin->Enable( bRandom );
	ReleaseISpinner( spin );
	ICustButton* button = GetICustButton( GetDlgItem( hWnd, IDC_NEW ) );
	button->Enable( bRandom );
	ReleaseICustButton( button );
}
Exemplo n.º 2
0
void RendSpline::CheckAspectLock(TimeValue t)
{
	ParamID lengthID;
	ParamID widthID;
	ParamID aspectlockID;
	float length, width, aspect = 1.0f;
	BOOL aspectlocked = FALSE;

	if(UseViewOrRenderParams(t) == rbViewport)
	{
		widthID = rnd_v2_vpt_width;
		lengthID = rnd_v2_vpt_length;
		aspectlockID = rnd_v2_vpt_aspect_lock;
	}
	else
	{
		widthID = rnd_v2_width;
		lengthID = rnd_v2_length;
		aspectlockID = rnd_v2_aspect_lock;
	}
	pblock->GetValue(lengthID,t,length,FOREVER);
	pblock->GetValue(widthID,t,width,FOREVER);
	pblock->GetValue(aspectlockID,t,aspectlocked,FOREVER);	

	IParamMap2 *map = pblock->GetMap(0);

	if(map)
	{
		ISpinnerControl *iSpin = GetISpinner(GetDlgItem(map->GetHWnd(), IDC_ASPECTSPIN));
		aspect = iSpin->GetFVal();
	}

	pblock->GetMap()->Enable(aspectlockID,((length != 0.0f && width != 0.0f && aspect != 0.0f) || aspectlocked));
}
Exemplo n.º 3
0
void  WardShaderDlg::LoadDialog(BOOL draw) 
{
	if (pShader && hRollup) {
		dlevSpin->SetValue(FracToPc(pShader->GetDiffuseLevel()),FALSE);
		dlevSpin->SetKeyBrackets(KeyAtCurTime(PB_DIFFUSE_LEV));

		slevSpin->SetValue(FracToPc(pShader->GetSpecularLevel()/SPEC_MAX),FALSE);
		slevSpin->SetKeyBrackets(KeyAtCurTime(PB_SPECULAR_LEV));

		glxSpin->SetValue( 100.0f * ((ALPHA_MAX - pShader->GetGlossiness())/ALPHA_SZ),FALSE);
		glxSpin->SetKeyBrackets(KeyAtCurTime(PB_GLOSSINESS_X));
		glySpin->SetValue(100.0f * ((ALPHA_MAX - pShader->GetGlossinessY())/ALPHA_SZ),FALSE);
		glySpin->SetKeyBrackets(KeyAtCurTime(PB_GLOSSINESS_Y));

		trSpin->SetValue(FracToPc(pMtl->GetOpacity( curTime )),FALSE);
		trSpin->SetKeyBrackets(pMtl->KeyAtTime(OPACITY_PARAM, curTime));

		CheckButton(hRollup, IDC_LOCK_AD, pShader->GetLockAD() );
		CheckButton(hRollup, IDC_LOCK_DS, pShader->GetLockDS() );
		SetCheckBox(hRollup, IDC_NORMALIZE_CHECK, !pShader->GetNormalizeOn() ); 
	 	UpdateLockADTex( FALSE ); //don't send to mtl

		UpdateColSwatches();
		UpdateHilite();
	}
}
Exemplo n.º 4
0
// Fill in all the data in the polygon counter dialog.
void
PolygonCounter::DrawBars()
{
    TSTR buf;
    int val;

    GetAppData(thePolyCounter.ip, MAX_POLYS_ID, _T("10000"), buf);
	if (atoi(buf, val))
		thePolyCounter.maxPolys->SetValue(val, FALSE);
    GetAppData(thePolyCounter.ip, MAX_SELECTED_ID, _T("1000"), buf);
	if (atoi(buf, val))
		thePolyCounter.maxSelected->SetValue(val, FALSE);

    HWND hName = GetDlgItem(thePolyCounter.hDlg, IDC_POLY_COUNT);
    TCHAR str[256];
    _stprintf(str, _T("%d"), faceCount);
    Static_SetText(hName, str);
    
    hName = GetDlgItem(thePolyCounter.hDlg, IDC_SEL_COUNT);
    _stprintf(str, _T("%d"), selFaceCount);
    Static_SetText(hName, str);

    HWND hPolyBar = GetDlgItem(hDlg, IDC_POLY_BAR);
    int maxFaces = maxPolys->GetIVal();
    DrawBar(hPolyBar, faceCount, maxFaces);
    HWND hSelBar = GetDlgItem(hDlg, IDC_SELECTED_BAR);
    int maxSel = maxSelected->GetIVal();
    DrawBar(hSelBar,  selFaceCount, maxSel);
}
Exemplo n.º 5
0
static INT_PTR CALLBACK NumMapsDlgProc(
		HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
	{
	switch (msg) {
		case WM_INITDIALOG: {
			ISpinnerControl *spin = 
				SetupIntSpinner(
					hWnd,IDC_COMP_NUMMAPSSPIN,IDC_COMP_NUMMAPS,
					2,1000,(int)lParam);
			ReleaseISpinner(spin);
			CenterWindow(hWnd,GetParent(hWnd));
			break;
			}

		case WM_COMMAND:
			switch (LOWORD(wParam)) {
				case IDOK: {
					ISpinnerControl *spin = 
						GetISpinner(GetDlgItem(hWnd,IDC_COMP_NUMMAPSSPIN));
					EndDialog(hWnd,spin->GetIVal());
					ReleaseISpinner(spin);
					break;
					}

				case IDCANCEL:
					EndDialog(hWnd,-1);
					break;
				}
			break;

		default:
			return FALSE;
		}
	return TRUE;
	}
Exemplo n.º 6
0
void RendSplineParamsMapDlgProc::Initialize(HWND hWnd, TimeValue t)
{
	if (hWnd == NULL) return;
	else
	{
		ISpinnerControl *iSpin = GetISpinner(GetDlgItem(hWnd, IDC_ASPECTSPIN));
		iSpin->LinkToEdit(GetDlgItem(hWnd, IDC_ASPECT), EDITTYPE_FLOAT);
		iSpin->SetLimits(0.0f,99999999.0f);
		iSpin->SetAutoScale(TRUE);
		ReleaseISpinner(iSpin);

		if (RendSpline::hLockButton == NULL) {
			HBITMAP hBitmap, hMask;
			RendSpline::hLockButton = ImageList_Create(16, 15, TRUE, 2, 0);
			hBitmap = LoadBitmap(RendSplineDesc.HInstance(), MAKEINTRESOURCE(IDB_LOCK));
			hMask   = LoadBitmap(RendSplineDesc.HInstance(), MAKEINTRESOURCE(IDB_LOCKMASK));
			ImageList_Add(RendSpline::hLockButton,hBitmap,hMask);
			DeleteObject(hBitmap);
			DeleteObject(hMask);
		}

		ICustButton *lockAspect = GetICustButton(GetDlgItem(hWnd,IDC_ASPECTLOCK));
		lockAspect->SetImage(RendSpline::hLockButton,0,0,1,1,16,15);
		lockAspect->SetType(CBT_CHECK);
		ReleaseICustButton(lockAspect);

		CheckRadioButton(hWnd, IDC_VIEWPORT, IDC_RENDERER, IDC_RENDERER);

        BOOL usePhysUVs = mod->GetUsePhysicalScaleUVs();
        CheckDlgButton(hWnd, IDC_REAL_WORLD_MAP_SIZE, usePhysUVs);
	}

}
void PFOperatorForceSpaceWarpDlgProc::UpdateInfluenceDlg( HWND hWnd, bool enable )
{
	EnableWindow( GetDlgItem( hWnd, IDC_INFLUENCETEXT), enable );
	ISpinnerControl* spin = GetISpinner( GetDlgItem( hWnd, IDC_INFLUENCESPIN ) );
	spin->Enable(enable);
	ReleaseISpinner( spin );
}
void TestGoToRotationDlgProc::UpdateMatchDlg( HWND hWnd, int matchSpin )
{
	bool enable = (matchSpin == 0);
	EnableWindow( GetDlgItem(hWnd, IDC_SPINTEXT), enable );
	ISpinnerControl* spin = GetISpinner( GetDlgItem( hWnd, IDC_SPINRATESPIN ) );
	spin->Enable(enable);
	ReleaseISpinner(spin);
}
void PFOperatorSimplePositionDlgProc::UpdateInheritSpeedDlg( HWND hWnd, BOOL lock, BOOL inherit )
{
	EnableWindow( GetDlgItem( hWnd, IDC_INHERIT ), !lock );
	bool useInherit = ((lock == 0) && (inherit != 0));
	EnableWindow( GetDlgItem( hWnd, IDC_MULTIPLIERTEXT ), useInherit);
	ISpinnerControl* spin = GetISpinner( GetDlgItem( hWnd, IDC_MULTIPLIERSPIN ) );
	spin->Enable(useInherit);
	ReleaseISpinner( spin );
}
Exemplo n.º 10
0
static INT_PTR CALLBACK MouseDeviceDlgProc(
      HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
   {
   IMCParamDlg *dlg = DLGetWindowLongPtr<IMCParamDlg*>(hWnd);
   if (!dlg && msg!=WM_INITDIALOG) return FALSE;

   switch (msg) {
      case WM_INITDIALOG:
         dlg = (IMCParamDlg*)lParam;
         dlg->binding->UpdateRollup(dlg->iRoll);
         DLSetWindowLongPtr(hWnd, lParam);
         break;

      case WM_COMMAND:
         switch (LOWORD(wParam)) {
            case IDC_MOUSE_X: {
               MouseDeviceBinding *b = (MouseDeviceBinding*)dlg->binding;
               b->which = MC_MOUSE_X;
               b->NotifyDependents(FOREVER,0,REFMSG_CHANGE);
               break;
               }

            case IDC_MOUSE_Y: {
               MouseDeviceBinding *b = (MouseDeviceBinding*)dlg->binding;
               b->which = MC_MOUSE_Y;
               b->NotifyDependents(FOREVER,0,REFMSG_CHANGE);
               break;
               }

            case IDC_MOUSE_FLIP: {
               MouseDeviceBinding *b = (MouseDeviceBinding*)dlg->binding;
               b->invert = IsDlgButtonChecked(hWnd,IDC_MOUSE_FLIP);
               b->NotifyDependents(FOREVER,0,REFMSG_CHANGE);
               break;
               }
            }
         break;

      case CC_SPINNER_CHANGE: {
         ISpinnerControl *spin = (ISpinnerControl *)lParam;
         MouseDeviceBinding *b = (MouseDeviceBinding*)dlg->binding;
         b->scale = spin->GetFVal();
         b->NotifyDependents(FOREVER,0,REFMSG_CHANGE);
         break;
         }

      case WM_LBUTTONDOWN:
      case WM_LBUTTONUP:
      case WM_MOUSEMOVE:            
            dlg->iRoll->DlgMouseMessage(hWnd,msg,wParam,lParam);
         break; 

      default:
         return FALSE;
      }
   return TRUE;
   }
void TestSpawnOnCollisionDlgProc::UpdateSpeedTypeDlg( HWND hWnd, int speedType )
{
	ISpinnerControl* spin = GetISpinner( GetDlgItem( hWnd, IDC_SPEEDSPIN ) );
	spin->Enable(speedType == kSpawnCollision_speedType_units);
	ReleaseISpinner(spin);
	spin = GetISpinner( GetDlgItem( hWnd, IDC_INHERITEDSPIN ) );
	spin->Enable(speedType == kSpawnCollision_speedType_inherited);
	ReleaseISpinner(spin);
}
void PFOperatorSimplePositionDlgProc::UpdateDistinctPointsDlg( HWND hWnd, int locationType, int useDistinct )
{
	BOOL enable = (locationType != kSimplePosition_locationType_pivot);

	EnableWindow( GetDlgItem( hWnd, IDC_DISTINCT ), enable );
	EnableWindow( GetDlgItem( hWnd, IDC_TOTALTEXT ), enable && (useDistinct != 0));
	ISpinnerControl* spin = GetISpinner( GetDlgItem( hWnd, IDC_TOTALDISTINCTSPIN ) );
	spin->Enable( enable && (useDistinct != 0));
	ReleaseISpinner( spin );
}
Exemplo n.º 13
0
//----------------------------------------------------------------------------
BOOL PX2SceneExport::OnEnableFrameSpinners (HWND hWnd, BOOL bEnabled)
{
	ISpinnerControl* spinner = GetISpinner(GetDlgItem(hWnd,
		IDC_SPINNER_STARTFRAME)); 
	spinner->Enable(bEnabled);
	ReleaseISpinner(spinner); 
	spinner = GetISpinner(GetDlgItem(hWnd, IDC_SPINNER_ENDFRAME)); 
	spinner->Enable(bEnabled);
	return TRUE;
}
void TestSpawnOnCollisionDlgProc::UpdateSpawnTypeDlg( HWND hWnd, int spawnType, int deleteParent )
{
	bool multType = (spawnType == kSpawnCollision_spawnType_multiple);
	bool sentParent = (multType || (deleteParent == 0));
	EnableWindow( GetDlgItem(hWnd, IDC_PARTICLESCOLLIDED), sentParent );
	EnableWindow( GetDlgItem(hWnd, IDC_DELETEPARENT), spawnType == kSpawnCollision_spawnType_once );
	EnableWindow( GetDlgItem(hWnd, IDC_UNTILTEXT), multType);
	ISpinnerControl* spin = GetISpinner( GetDlgItem( hWnd, IDC_UNTILSPIN ) );
	spin->Enable(multType);
	ReleaseISpinner(spin);
}
void TestGoToRotationDlgProc::UpdateVariationDlg( HWND hWnd, TimeValue timeVar, float spinVar )
{
	bool enable = ((timeVar != 0) || (spinVar != 0.0f));
	EnableWindow( GetDlgItem(hWnd, IDC_UNIQUENESSBOX), enable );
	EnableWindow( GetDlgItem(hWnd, IDC_SEEDTEXT), enable );
	ISpinnerControl* spin = GetISpinner( GetDlgItem( hWnd, IDC_SEEDSPIN ) );
	spin->Enable(enable);
	ReleaseISpinner(spin);
	ICustButton* but = GetICustButton( GetDlgItem( hWnd, IDC_NEW ) );
	but->Enable(enable);
	ReleaseICustButton(but);
}
void TestSpawnOnCollisionDlgProc::UpdateRandomSeedDlg( HWND hWnd, float affects, float multVar, float speedVar, float divergence, float scaleVar )
{
	bool hasChaos = !(((affects==0.0f) || (affects==1.0f)) && (multVar==0.0f) && (speedVar==0.0f) && (divergence==0.0f) && (scaleVar==0.0f));
	EnableWindow( GetDlgItem(hWnd, IDC_UNIQUENESSBOX), hasChaos );
	EnableWindow( GetDlgItem(hWnd, IDC_SEEDTEXT), hasChaos );
	ISpinnerControl* spin = GetISpinner( GetDlgItem( hWnd, IDC_SEEDSPIN ) );
	spin->Enable(hasChaos);
	ReleaseISpinner(spin);
	ICustButton* but = GetICustButton( GetDlgItem( hWnd, IDC_NEW ) );
	but->Enable(hasChaos);
	ReleaseICustButton(but);
}
Exemplo n.º 17
0
void RandKeysUtil::SpinnerChange(int id) 
	{
	switch (id) {
		case IDC_RANDKEYS_POSTIMESPIN:
			posTime = iPosTime->GetIVal(); break;
		case IDC_RANDKEYS_NEGTIMESPIN:
			negTime = iNegTime->GetIVal(); break;
		case IDC_RANDKEYS_POSVALSPIN:
			posVal = iPosVal->GetFVal(); break;
		case IDC_RANDKEYS_NEGVALSPIN:
			negVal = iNegVal->GetFVal(); break;
		}
	}
void PFOperatorInstanceShapeDlgProc::UpdateScaleDlg( HWND hWnd, BOOL setScale)
{
	ISpinnerControl *spin;
	bool enable = (setScale != 0);

	EnableWindow( GetDlgItem( hWnd, IDC_VARIATIONTEXT ), enable );
	spin = GetISpinner( GetDlgItem( hWnd, IDC_PARTICLESCALESPIN ) );
	spin->Enable( enable );
	ReleaseISpinner( spin );
	spin = GetISpinner( GetDlgItem( hWnd, IDC_VARIATIONSPIN ) );
	spin->Enable( enable );
	ReleaseISpinner( spin );
}
Exemplo n.º 19
0
//void RendSpline::UpdateAspect(HWND hWnd, TimeValue t)
//{
//	
//	//ISpinnerControl *iSpin = GetISpinner(GetDlgItem(hWnd, IDC_ASPECTSPIN));
//	//
//	//iSpin->SetValue(this->GetAspect((UseViewOrRenderParams(t)== rbViewport)),FALSE);
//	//ReleaseISpinner(iSpin);
//}
void RendSpline::OnSetWidthLength(HWND hWnd, ParamID lengthID, ParamID widthID, TimeValue t, BOOL widthSet)
{
	static BOOL reenter = FALSE;
	if(reenter)
		return;
	reenter = TRUE;
	ISpinnerControl *iSpin = GetISpinner(GetDlgItem(hWnd, IDC_ASPECTSPIN));
	BOOL aspectlocked;
	float length, width;

	if(UseViewOrRenderParams(t) == rbViewport)
		pblock->GetValue(rnd_v2_vpt_aspect_lock,t,aspectlocked,FOREVER);
	else
		pblock->GetValue(rnd_v2_aspect_lock,t,aspectlocked,FOREVER);

	pblock->GetValue(lengthID,t,length,FOREVER);
	pblock->GetValue(widthID,t,width,FOREVER);

	
	if(!aspectlocked)
	{
		CheckAspectLock(t);

		if(width == 0.0f)
		{
			width = EPS;
			//iSpin->SetValue(0.0f, FALSE);
			//iSpin->SetIndeterminate(TRUE);
		}
		else
			iSpin->SetValue(length/width, FALSE);
			
	}
	else
	{
		if(widthSet)
		{
			pblock->SetValue(lengthID,t,mAspect*width);
		}
		else
		{
			if(mAspect == 0.0f)
				mAspect = EPS;
				//pblock->SetValue(widthID,t,0.0f);
			pblock->SetValue(widthID,t,length/mAspect);
		}
	}

	ReleaseISpinner(iSpin);
	reenter = FALSE;
}
void PFOperatorSimpleOrientationDlgProc::SetCtlByDir(IParamMap2* map, HWND hWnd)
{
	BOOL bEulerSpinOn = false;
	if(map && hWnd) {
		IParamBlock2* ppb = map->GetParamBlock();
		if(ppb) {
			int iDir = ppb->GetInt(kSimpleOrientation_direction, 0);
			if((iDir == kSO_World) || (iDir == kSO_Speed) || (iDir == kSO_SpeedFollow))
				bEulerSpinOn = true;

			EnableWindow(GetDlgItem(hWnd, IDC_XTEXT), bEulerSpinOn);
			ISpinnerControl* psc = GetISpinner(GetDlgItem(hWnd, IDC_XSPIN));
			psc->Enable(bEulerSpinOn);
			ReleaseISpinner(psc);
			EnableWindow(GetDlgItem(hWnd, IDC_YTEXT), bEulerSpinOn);
			psc = GetISpinner(GetDlgItem(hWnd, IDC_YSPIN));
			psc->Enable(bEulerSpinOn);
			ReleaseISpinner(psc);
			EnableWindow(GetDlgItem(hWnd, IDC_ZTEXT), bEulerSpinOn);
			psc = GetISpinner(GetDlgItem(hWnd, IDC_ZSPIN));
			psc->Enable(bEulerSpinOn);
			ReleaseISpinner(psc);
			bool bDivergenceAvailable = ((iDir != kSO_Rand_3D) && (iDir != kSO_SpeedFollow));
			EnableWindow(GetDlgItem(hWnd, IDC_DIVERGENCETEXT), bDivergenceAvailable);
			psc = GetISpinner(GetDlgItem(hWnd, IDC_DIVERGENCESPIN));
			psc->Enable(bDivergenceAvailable);
			ReleaseISpinner(psc);
			
			EnableWindow(GetDlgItem(hWnd, IDC_RESTRICTTOAXIS), bDivergenceAvailable);
			bool bRestrictToAxis = (ppb->GetInt(kSimpleOrientation_restrictToAxis, 0) != 0) && bDivergenceAvailable;
			EnableWindow(GetDlgItem(hWnd, IDC_DIVERGENCEAXISBOX), bRestrictToAxis);
			EnableWindow(GetDlgItem(hWnd, IDC_AXISXTEXT), bRestrictToAxis);
			psc = GetISpinner(GetDlgItem(hWnd, IDC_AXISXSPIN));
			psc->Enable(bRestrictToAxis);
			ReleaseISpinner(psc);
			EnableWindow(GetDlgItem(hWnd, IDC_AXISYTEXT), bRestrictToAxis);
			psc = GetISpinner(GetDlgItem(hWnd, IDC_AXISYSPIN));
			psc->Enable(bRestrictToAxis);
			ReleaseISpinner(psc);
			EnableWindow(GetDlgItem(hWnd, IDC_AXISZTEXT), bRestrictToAxis);
			psc = GetISpinner(GetDlgItem(hWnd, IDC_AXISZSPIN));
			psc->Enable(bRestrictToAxis);
			ReleaseISpinner(psc);

			bool bChaosAvailable = (iDir != kSO_SpeedFollow);
			EnableWindow(GetDlgItem(hWnd, IDC_UNIQUENESSBOX), bChaosAvailable);
			EnableWindow(GetDlgItem(hWnd, IDC_SEEDTEXT), bChaosAvailable);
			psc = GetISpinner(GetDlgItem(hWnd, IDC_SEEDSPIN));
			psc->Enable(bChaosAvailable);
			ReleaseISpinner(psc);
			ICustButton* but = GetICustButton(GetDlgItem(hWnd, IDC_NEW));
			but->Enable(bChaosAvailable);
			ReleaseICustButton(but);
		}
	}
}
void TestDurationDlgProc::UpdateVariationDlg( HWND hWnd, TimeValue variation )
{
	bool useRandom = (variation != 0);
	ISpinnerControl* spin;

	EnableWindow( GetDlgItem( hWnd, IDC_UNIQUENESSBOX ), useRandom );
	EnableWindow( GetDlgItem( hWnd, IDC_SEEDTEXT ), useRandom );
	spin = GetISpinner( GetDlgItem( hWnd, IDC_SEEDSPIN ) );
	spin->Enable( useRandom );
	ReleaseISpinner( spin );
	ICustButton* button = GetICustButton( GetDlgItem( hWnd, IDC_NEW ) );
	button->Enable( useRandom );
	ReleaseICustButton( button );
}
Exemplo n.º 22
0
void  StraussShaderDlg::LoadDialog(BOOL draw) 
{
   if (pShader && hRollup) {
      glSpin->SetValue( FracToPc( pShader->GetGlossiness() ),FALSE);
      glSpin->SetKeyBrackets(KeyAtCurTime(st_glossiness));
      
      mtSpin->SetValue( FracToPc( pShader->GetMetalness() ), FALSE);
      mtSpin->SetKeyBrackets(KeyAtCurTime(st_metalness));

      trSpin->SetValue(FracToPc(pMtl->GetOpacity(curTime)),FALSE);
      trSpin->SetKeyBrackets(pMtl->KeyAtTimeByID(OPACITY_PARAM, curTime));

      UpdateColSwatches();
      UpdateHilite();

      IParamBlock2 * shaderpblock = pShader->pblock;
      if ( shaderpblock ) {
		  cs[0]->UpdateEnableState( shaderpblock, shaderpblock->GetAnimNum( st_diffuse ) );
		  glSpin->UpdateEnableState( shaderpblock, shaderpblock->GetAnimNum( st_glossiness ) );
		  mtSpin->UpdateEnableState( shaderpblock, shaderpblock->GetAnimNum( st_metalness ) );
	  }
	  // trSpin: opacity is accessed through the material: only handle StdMat2.
	  EnableMtl2OpacityControl( pMtl, trSpin );
   }
}
Exemplo n.º 23
0
void RendSpline::OnSetAspect(HWND hWnd, TimeValue t, ParamID widthID, ParamID lengthID)
{
	CheckAspectLock(t);

	ISpinnerControl *iSpin = GetISpinner(GetDlgItem(hWnd, IDC_ASPECTSPIN));
	mAspect = iSpin->GetFVal();

	float width;

	pblock->GetValue(widthID,t,width,FOREVER);
	pblock->SetValue(lengthID,t,mAspect*width);

	ReleaseISpinner(iSpin);
}
Exemplo n.º 24
0
void plMultipassMtlDlg::IGetSpinnerVal()
{
    ISpinnerControl *spin = GetISpinner(GetDlgItem(fhRollup, IDC_LAYER_SPIN));
    if (!spin)
        return;

    // If new number of layers is invalid, set to current num
    if (!ISetNumLayers(spin->GetIVal()))
    {
        int nLayers = fPBlock->GetInt(kMultCount);
        spin->SetValue(nLayers, FALSE);
    }

    ReleaseISpinner(spin);
}
void PFOperatorInstanceShapeDlgProc::UpdateAnimatedSahpeDlg( HWND hWnd, BOOL animatedShape, BOOL addRandomOffset )
{
	ISpinnerControl *spin;
	BOOL enableOffset = animatedShape && addRandomOffset;

	EnableWindow( GetDlgItem( hWnd, IDC_ACQUIRE ), !animatedShape );
	EnableWindow( GetDlgItem( hWnd, IDC_SYNCFRAME ), animatedShape );
	EnableWindow( GetDlgItem( hWnd, IDC_SYNCBYTEXT ), animatedShape );
	EnableWindow( GetDlgItem( hWnd, IDC_SYNC ), animatedShape );
	EnableWindow( GetDlgItem( hWnd, IDC_SYNCRANDOM ), animatedShape );
	EnableWindow( GetDlgItem( hWnd, IDC_SYNCOFFSET ), enableOffset );
	spin = GetISpinner( GetDlgItem( hWnd, IDC_SYNCOFFSETSPIN ) );
	spin->Enable( enableOffset );
	ReleaseISpinner( spin );
}
Exemplo n.º 26
0
void MouseDeviceBinding::UpdateRollup(IRollupWindow *iRoll)
   {
   if (iRoll->GetNumPanels()>1) {
      HWND hWnd = iRoll->GetPanelDlg(1);
      CheckDlgButton(hWnd,IDC_MOUSE_X,which==MC_MOUSE_X);
      CheckDlgButton(hWnd,IDC_MOUSE_Y,which==MC_MOUSE_Y);
      CheckDlgButton(hWnd,IDC_MOUSE_FLIP,invert);

      ISpinnerControl *spin = GetISpinner(GetDlgItem(hWnd,IDC_MOUSE_SCALESPIN));
      spin->SetLimits(0.0f, float(999999), FALSE);
      spin->SetScale(0.01f);
      spin->LinkToEdit(GetDlgItem(hWnd,IDC_MOUSE_SCALE), EDITTYPE_FLOAT);
      spin->SetValue(scale,FALSE);
      ReleaseISpinner(spin);
      }
   }
Exemplo n.º 27
0
Value*
FooControl::set_property(Value** arg_list, int count)
{
	Value* val = arg_list[0];
	Value* prop = arg_list[1];

	if (prop == n_value)
	{
		value = val->to_float();
		if (parent_rollout != NULL && parent_rollout->page != NULL)
		{
			ISpinnerControl* spin = GetISpinner(GetDlgItem(parent_rollout->page, control_ID));
			if (spin_type == EDITTYPE_INT)
				spin->SetValue((int)value, FALSE);
			else
				spin->SetValue(value, FALSE);
			ReleaseISpinner(spin);
		}
	}
	else if (prop == n_range)
	{
		Point3 p;
		if (is_point3(val))
			p = val->to_point3();
		else
			throw TypeError (MaxSDK::GetResourceStringAsMSTR(IDS_SPINNER_RANGE_MUST_BE_A_VECTOR), val);
		min = p.x; max = p.y; value = p.z;

		if (parent_rollout != NULL && parent_rollout->page != NULL)
		{
			ISpinnerControl* spin = GetISpinner(GetDlgItem(parent_rollout->page, control_ID));
			if (spin_type == EDITTYPE_INT)
			{
				spin->SetLimits((int)p.x, (int)p.y, FALSE);
				spin->SetScale(1.0F);
				spin->SetValue((int)p.z, FALSE);
			}
			else
			{
				spin->SetLimits(p.x, p.y, FALSE);
				spin->SetScale(0.1F);
				spin->SetValue(p.z, FALSE);
			}
			ReleaseISpinner(spin);
		}
	}
	else
		return RolloutControl::set_property(arg_list, count);

	return val;
}
Exemplo n.º 28
0
//----------------------------------------------------------------------------
BOOL PX2SceneExport::OnStartFrameSpinnerChanged (HWND hWnd)
{
	// start frame
	ISpinnerControl* spinner = GetISpinner(GetDlgItem(hWnd,
		IDC_SPINNER_STARTFRAME)); 
	int startFrame = spinner->GetIVal();
	ReleaseISpinner(spinner);

	// end frame
	spinner = GetISpinner(GetDlgItem(hWnd,IDC_SPINNER_ENDFRAME)); 
	int endFrame = spinner->GetIVal();
	if ( endFrame < startFrame )
		spinner->SetValue(startFrame,FALSE);
	ReleaseISpinner(spinner); 

	return TRUE;
}
void PFOperatorMaterialFrequencyDlgProc::UpdateAssignIDDlg( HWND hWnd, int assign)
{
	ISpinnerControl *spin;
	bool enableAssign = (assign != 0);
	
	EnableWindow( GetDlgItem( hWnd, IDC_SHOWINVIEWPORT), enableAssign);
	EnableWindow( GetDlgItem( hWnd, IDC_NUMSUBSTEXT), enableAssign);
	EnableWindow( GetDlgItem( hWnd, IDC_NUMSUBS), enableAssign);
	int textIDC[] = { IDC_ID1TEXT, IDC_ID2TEXT, IDC_ID3TEXT, IDC_ID4TEXT, IDC_ID5TEXT, IDC_ID6TEXT, IDC_ID7TEXT, IDC_ID8TEXT, IDC_ID9TEXT, IDC_ID10TEXT };
	int spinIDC[] = { IDC_ID1SPIN, IDC_ID2SPIN, IDC_ID3SPIN, IDC_ID4SPIN, IDC_ID5SPIN, IDC_ID6SPIN, IDC_ID7SPIN, IDC_ID8SPIN, IDC_ID9SPIN, IDC_ID10SPIN };
	for(int i=0; i<10; i++) {
		EnableWindow( GetDlgItem( hWnd, textIDC[i]), enableAssign);
		spin = GetISpinner( GetDlgItem(hWnd, spinIDC[i]) );
		spin->Enable( enableAssign );
		ReleaseISpinner( spin );
	}
}
void PFOperatorMaterialFrequencyDlgProc::UpdateAssignMaterialDlg( HWND hWnd, int assign, int assignID, Mtl *mtl )
{
	ICustButton* but = GetICustButton(GetDlgItem(hWnd, IDC_MATERIAL));
	but->Enable( assign != 0);
	ReleaseICustButton(but);
	
	BOOL enable = (assign != 0) || (assignID != 0);
	EnableWindow( GetDlgItem( hWnd, IDC_TEXT_MTLIDOFFSET), enable);

	ISpinnerControl* spin = GetISpinner(GetDlgItem(hWnd, IDC_MTLIDOFFSETSPIN));
	spin->Enable( enable );
	ReleaseISpinner( spin );

	int numSubs = (mtl != NULL) ? mtl->NumSubMtls() : 0;
	TCHAR buf[32];
	_stprintf_s(buf, 32, _T("%d"), numSubs);
	SetWindowText( GetDlgItem( hWnd, IDC_NUMSUBS ), buf );
}