Exemplo n.º 1
0
INT_PTR MonoFlectorTypeObjDlgProc::DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	int id = LOWORD(wParam);
	switch (msg) 
	{
		case WM_INITDIALOG:
		{ 	ICustButton *iBut = GetICustButton(GetDlgItem(hWnd,IDC_EP_PICKBUTTON));
			iBut->SetType(CBT_CHECK);
			iBut->SetHighlightColor(GREEN_WASH);
			ReleaseICustButton(iBut);
			mf->hParams=hWnd;
			mf->ShowName(mf->pblock2->GetINode(PB_MESHNODE));
		}
			break;
		case WM_DESTROY:
			ICustButton *iBut;
			iBut=GetICustButton(GetDlgItem(hWnd,IDC_EP_PICKBUTTON));
			if (iBut) iBut->SetCheck(FALSE);
			ReleaseICustButton(iBut);
			break;
		case WM_COMMAND:
			switch(LOWORD(wParam)) 
			{
			  case IDC_EP_PICKBUTTON:
			  { sso->IntoPickMode();
				break;
			  }
			}
			break;
	}
	return TRUE;
}
Exemplo n.º 2
0
    /// Called to update the controls of the dialog
    virtual void    Update( TimeValue t, Interval &valid, IParamMap2 *map )
    {
        ICustButton     *bmSelectBtn;
        IParamBlock2    *pblock;
        int             i;
        long            buttons[ 6 ] = { IDC_FRONT_NAME, IDC_BACK_NAME, IDC_LEFT_NAME, IDC_RIGHT_NAME, IDC_TOP_NAME, IDC_BOTTOM_NAME };
        BitmapInfo      bi;


        ParamMap2UserDlgProc::Update( t, valid, map );

        pblock = map->GetParamBlock();
        for( i = plStaticEnvLayer::kBmpFrontBitmap; i <= plStaticEnvLayer::kBmpBottomBitmap; i++ )
        {
            bmSelectBtn = GetICustButton( GetDlgItem( map->GetHWnd(), buttons[ i ] ) );
            PBBitmap *pbbm = pblock->GetBitmap( i, t );
            if( pbbm )
                bmSelectBtn->SetText( (TCHAR *)pbbm->bi.Filename() );
            else
                bmSelectBtn->SetText( _T( "None" ) );
            ReleaseICustButton( bmSelectBtn );
        }

        plStaticEnvLayer *layer = (plStaticEnvLayer *)map->GetParamBlock()->GetOwner();
        bi.SetName( layer->GetBaseFilename( t ) );
        SetDlgItemText( map->GetHWnd(), IDC_BASE_FILENAME, bi.Filename() );
        map->Enable( plStaticEnvLayer::kBmpGenerateFaces, ( bi.Name() == NULL || bi.Name()[ 0 ] == 0 ) ? FALSE : TRUE );

        bmSelectBtn = GetICustButton( GetDlgItem( map->GetHWnd(), IDC_GENERATE_FACES ) );
        bmSelectBtn->SetText( _T( "Generate From Node" ) );
        ReleaseICustButton( bmSelectBtn );

        i = pblock->GetInt( plStaticEnvLayer::kBmpTextureSize, t );
        pblock->SetValue( plStaticEnvLayer::kBmpLastTextureSize, t, i );
    }
Exemplo n.º 3
0
INT_PTR EditPolyPaintDeformDlgProc::DlgProc (TimeValue t, IParamMap2 *pmap, HWND hWnd,
						   UINT msg, WPARAM wParam, LPARAM lParam)
{
	//BOOL ret;
	switch (msg) {
	case WM_INITDIALOG: {
			uiValid = false;
			ICustButton *btn = GetICustButton(GetDlgItem(hWnd,IDC_PAINTDEFORM_PUSHPULL));
			btn->SetType(CBT_CHECK);
			ReleaseICustButton(btn);

			btn = GetICustButton(GetDlgItem(hWnd,IDC_PAINTDEFORM_RELAX));
			btn->SetType(CBT_CHECK);
			ReleaseICustButton(btn);

			btn = GetICustButton(GetDlgItem(hWnd,IDC_PAINTDEFORM_REVERT));
			btn->SetType(CBT_CHECK);
			ReleaseICustButton(btn);
			break;
		}

	case WM_PAINT:
		if (uiValid) break;
		SetEnables (hWnd);
		break;

	case WM_COMMAND:
		//uiValid = false;
		switch (LOWORD(wParam)) {
		case IDC_PAINTDEFORM_PUSHPULL:
			mpEPoly->OnPaintBtn( PAINTMODE_PAINTPUSHPULL, t );
			SetEnables (hWnd);
			break;
		case IDC_PAINTDEFORM_RELAX:
			mpEPoly->OnPaintBtn( PAINTMODE_PAINTRELAX, t );
			SetEnables (hWnd);
			break;
		case IDC_PAINTDEFORM_REVERT:
			mpEPoly->OnPaintBtn( PAINTMODE_ERASEDEFORM, t );
			SetEnables (hWnd);
			break;
		case IDC_PAINTDEFORM_APPLY:
			theHold.Begin ();
			mpEPoly->EpModCommit (t, false, true);
			theHold.Accept (GetString (IDS_PAINTDEFORM));
			break;
		case IDC_PAINTDEFORM_CANCEL:
			mpEPoly->EpModCancel ();
			break;
		case IDC_PAINTDEFORM_OPTIONS:
			GetMeshPaintMgr()->BringUpOptions();
			break;

		default:
			InvalidateUI (hWnd);
			break;
		}
	}
	return FALSE;
}
Exemplo n.º 4
0
void ParticleMesherObject::UpdateUI()
{
   Point3 min,max;
   pblock2->GetValue(particlemesher_customboundsa,0,min,FOREVER);
   pblock2->GetValue(particlemesher_customboundsb,0,max,FOREVER);


   Box3 box;
   box.Init();
   box += min;
   box += max;

   
   TSTR text;
   BOOL useBounds;
   pblock2->GetValue(particlemesher_usecustombounds, 0, useBounds, FOREVER);

   if (useBounds)
      {
      if (box.IsEmpty())
         text.printf(_T("%s"),GetString(IDS_EMPTY));
      else 
         {
         text.printf(_T("(%0.0f,%0.0f,%0.0f)"),min.x,min.y,min.z);
         SetWindowText(GetDlgItem(hParams,IDC_BOUNDSTEXT),
            text);
         text.printf(_T("(%0.0f,%0.0f,%0.0f)"),max.x,max.y,max.z);
         SetWindowText(GetDlgItem(hParams,IDC_BOUNDSTEXT2),
            text);
         }

//make sure we only enable the button in the modify panel
// bug 257747 1/30/01 watje
      if (ip)
         {
         ICustButton *iBut = GetICustButton(GetDlgItem(hParams,IDC_PICKBB));
         if (ip->GetCommandPanelTaskMode()==TASK_MODE_MODIFY)
            {
            if (iBut) iBut->Enable(TRUE);
            }
         ReleaseICustButton(iBut);
         }

      }
   else
      {
      text.printf(_T(" "));
      SetWindowText(GetDlgItem(hParams,IDC_BOUNDSTEXT),
         text);
      text.printf(_T(" "));
      SetWindowText(GetDlgItem(hParams,IDC_BOUNDSTEXT2),
         text);
      ICustButton *iBut = GetICustButton(GetDlgItem(hParams,IDC_PICKBB));
      if (iBut) iBut->Enable(FALSE);
      ReleaseICustButton(iBut);

      }
   
}
Exemplo n.º 5
0
void
BlobMesh::DisableButtons(HWND hWnd)
{
	if (GetCOREInterface()->GetCommandPanelTaskMode() == TASK_MODE_CREATE)
		{
		ICustButton *iBut = GetICustButton(GetDlgItem(hWnd, IDC_ADD));
		if (iBut)
			{
			iBut->Enable(FALSE);
			ReleaseICustButton(iBut);
			}

		iBut = NULL;
		iBut = GetICustButton(GetDlgItem(hWnd, IDC_PICK));
		if (iBut)
			{
			iBut->Enable(FALSE);
			ReleaseICustButton(iBut);
			}
			
		iBut = NULL;
		iBut = GetICustButton(GetDlgItem(hWnd, IDC_REMOVE));
		if (iBut)
			{
			iBut->Enable(FALSE);
			ReleaseICustButton(iBut);
			}
			

		}
	else
		{
		ICustButton *iBut = GetICustButton(GetDlgItem(hWnd, IDC_ADD));
		if (iBut)
			{
			iBut->Enable(TRUE);
			iBut->SetHighlightColor(GREEN_WASH);
			
			ReleaseICustButton(iBut);
			}

		iBut = NULL;
		iBut = GetICustButton(GetDlgItem(hWnd, IDC_PICK));
		if (iBut)
			{
			iBut->Enable(TRUE);
			iBut->SetType(CBT_CHECK);
			iBut->SetHighlightColor(GREEN_WASH);
			ReleaseICustButton(iBut);
			}

		}
}
Exemplo n.º 6
0
CompMatDlgProc::~CompMatDlgProc()
		{
		for (int i=0; i<MAX_NUM_MTLS-1; i++) 
			{
			ReleaseICustButton(iABut[i]);
			ReleaseICustButton(iSBut[i]);
			ReleaseICustButton(iMBut[i]);
			iABut[i] = NULL; 
			iSBut[i] = NULL; 
			iMBut[i] = NULL; 
			}
		

		}		
void PickOrientNode::EnterMode(IObjParam *ip)
	{
	ICustButton *iBut = GetICustButton(GetDlgItem(p->hWnd,IDC_ORIENT_TARG_PICKNODE));
	if (iBut) iBut->SetCheck(TRUE);
	ReleaseICustButton(iBut);
	GetCOREInterface()->PushPrompt(_T("Select Orientation Target Object"));
	}
Exemplo n.º 8
0
void TurnButton(HWND hWnd,int SpinNum,BOOL ison)
{	ICustButton *iBut;
	iBut=GetICustButton(GetDlgItem(hWnd,SpinNum));
	if (iBut) 
	{	if (ison) iBut->Enable(); else iBut->Disable();}
	ReleaseICustButton(iBut);
}
Exemplo n.º 9
0
OrenNayarShaderDlg::~OrenNayarShaderDlg()
{
	HDC hdc = GetDC(hRollup);
	GetGPort()->RestorePalette(hdc, hOldPal);
	ReleaseDC(hRollup, hdc);

	if( pShader ) pShader->SetParamDlg(NULL,0);

	for (long i=0; i < NMBUTS; i++ ){
		ReleaseICustButton( texMBut[i] );
		texMBut[i] = NULL; 
	}

	for (i=0; i<NCOLBOX; i++)
		if (cs[i]) ReleaseIColorSwatch(cs[i]); // mjm - 5.10.99
	
 	ReleaseISpinner(shSpin);
	ReleaseISpinner(ssSpin);
	ReleaseISpinner(softSpin);
	ReleaseISpinner(siSpin);
	ReleaseISpinner(dlevSpin);
	ReleaseISpinner(roughSpin);
	ReleaseISpinner(trSpin);

	SetWindowLongPtr(hRollup, GWLP_USERDATA, NULL);
	SetWindowLongPtr(hwHilite, GWLP_USERDATA, NULL);
	hwHilite = hRollup = NULL;
}
Exemplo n.º 10
0
void CheckButton(HWND hWnd,int id, BOOL check) {
   ICustButton *iBut;
   iBut = GetICustButton(GetDlgItem(hWnd,id));
   if( iBut )
      iBut->SetCheck(check);
   ReleaseICustButton(iBut);
   }
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.º 12
0
    void Set(PB2Value& val, ReferenceMaker* owner, ParamID id, int tabIndex, TimeValue t)
    {
        if (!owner)
            return;

        plStaticEnvLayer* layer = (plStaticEnvLayer*)owner;
        IParamBlock2 *pb = layer->GetParamBlockByID(plStaticEnvLayer::kBlkBitmap);

        switch (id)
        {
        case plStaticEnvLayer::kBmpFrontBitmap:
        case plStaticEnvLayer::kBmpBackBitmap:
        case plStaticEnvLayer::kBmpLeftBitmap:
        case plStaticEnvLayer::kBmpRightBitmap:
        case plStaticEnvLayer::kBmpTopBitmap:
        case plStaticEnvLayer::kBmpBottomBitmap:
            // Set up the enums so these would match...
            if (pb->GetMap())
                pb->GetMap()->Invalidate( id );
            // Update the bitmap saved by the layer
            //layer->SetBitmap( id, &val.bm->bi );
            break;

        case plStaticEnvLayer::kBmpBaseFilename:
            if( pb->GetMap() )
            {
                pb->GetMap()->Enable( plStaticEnvLayer::kBmpGenerateFaces, ( val.s == NULL || val.s[ 0 ] == 0 ) ? FALSE : TRUE );

                ICustButton     *bmSelectBtn = GetICustButton( GetDlgItem( pb->GetMap()->GetHWnd(), IDC_GENERATE_FACES ) );
                bmSelectBtn->SetText( _T( "Generate From Node" ) );
                ReleaseICustButton( bmSelectBtn );
            }
            break;
        }
    }
Exemplo n.º 13
0
BOOL SWrapObjectDlgProc::DlgProc(
		TimeValue t,IParamMap *map,HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
	{int FToTick=(int)((float)TIME_TICKSPERSEC/(float)GetFrameRate());
	switch (msg) {
		case WM_INITDIALOG: {
			ICustButton *iBut = GetICustButton(GetDlgItem(hWnd,IDC_AP_WRAPBUTTON));
			iBut->SetType(CBT_CHECK);
			iBut->SetHighlightColor(GREEN_WASH);
			ReleaseICustButton(iBut);
			po->hParams=hWnd;
			Update(t);
			return FALSE;	// stop default keyboard focus - DB 2/27  
			}
		case WM_COMMAND:
			switch (LOWORD(wParam)) 
			{    case IDC_AP_WRAPBUTTON:
				   { if (po->ip->GetCommandMode()->ID() == CID_STDPICK) 
					{ if (po->creating) 
						{  theCreateSWrapObjectMode.JumpStart(po->ip,po);
							po->ip->SetCommandMode(&theCreateSWrapObjectMode);
						} else {po->ip->SetStdCommandMode(CID_OBJMOVE);}
					} else 
						{ po->pickCB.po = po;						
						  po->ip->SetPickMode(&po->pickCB);
						}
					break;
				}

			}
			break;	
		}
	return TRUE;
	}
Exemplo n.º 14
0
void PickOrientNode::ExitMode(IObjParam *ip)
	{
	ICustButton *iBut = GetICustButton(GetDlgItem(p->hWnd,IDC_ORIENT_TARG_PICKNODE));
	if (iBut) iBut->SetCheck(FALSE);
	ReleaseICustButton(iBut);
	GetCOREInterface()->PopPrompt();
	}
Exemplo n.º 15
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 PFOperatorInstanceShapeDlgProc::UpdateObjectNameDlg( HWND hWnd, TSTR& objectName )
{
	ICustButton* but;
	but = GetICustButton( GetDlgItem( hWnd, IDC_PICK ) );
	but->SetText(objectName);
	ReleaseICustButton(but);
}
Exemplo n.º 17
0
BOOL UnwrapMod::AddDefaultActionToBar(ICustToolbar *toolBar, int id)
{

	int numOps = NumElements(spActions)/3;
	UnwrapAction *wtActions = NULL;
	int ct = 0;
	for (int i =0; i < numOps; i++)
	{
		int testid, ids1, ids2;
		testid = spActions[ct++];
		ids1 = spActions[ct++];
		ids2 = spActions[ct++];
		if (testid == id)
		{
			TSTR name;
			name.printf(_T("%s"),GetString(ids2));
			int l = name.Length();
			toolBar->AddTool(ToolButtonItem(CTB_PUSHBUTTON,0, 0, 0, 0, 16, 15, l*8, 22, id));
			ICustButton *but  = toolBar->GetICustButton(id);
			but->SetHighlightColor(GREEN_WASH);
			but->SetTooltip(TRUE,GetString(ids1));
			but->SetImage(NULL,0,0,0,0,0,0);
			but->SetText(GetString(ids2));

			ReleaseICustButton(but);				
			i = numOps;
			return TRUE;
		}
	}

	return FALSE;
}
Exemplo n.º 18
0
StraussShaderDlg::~StraussShaderDlg()
{
   HDC hdc = GetDC(hRollup);
   GetGPort()->RestorePalette(hdc, hOldPal);
   ReleaseDC(hRollup, hdc);

   if( pShader ) pShader->SetParamDlg(NULL,0);

   for (long i=0; i < NMBUTS; i++ ){
      ReleaseICustButton( texMBut[i] );
      texMBut[i] = NULL; 
   }

   for (long i=0; i<STRAUSS_NCOLBOX; i++)
      if (cs[i]) ReleaseIColorSwatch(cs[i]); // mjm - 5.10.99
   
   ReleaseISpinner(glSpin);
   ReleaseISpinner(mtSpin);
   ReleaseISpinner(trSpin);

   DLSetWindowLongPtr(hRollup, NULL);
   DLSetWindowLongPtr(hwHilite, NULL);

   if(pShader){
      IRollupWindow* pRollup = pMtlPar->GetMtlEditorRollup();
      pShader->SetPanelOpen(pRollup->IsPanelOpen(pRollup->GetPanelIndex(hRollup)));
   }

   hwHilite = hRollup = NULL;
}
Exemplo n.º 19
0
void SetupPadLockButton(HWND hWnd,int id, BOOL check) {
   ICustButton *iBut;
   iBut = GetICustButton(GetDlgItem(hWnd,id));
   iBut->SetImage(hLockButtons,2,2,2,2,16,15);
   iBut->SetType(CBT_CHECK);
   ReleaseICustButton(iBut);
   }
Exemplo n.º 20
0
INT_PTR BerconWoodDlgProc::DlgProc(TimeValue t,IParamMap2 *map,HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)	{	
	switch (msg) {
		case WM_INITDIALOG:	{			
			// Lock buttons
			ICustButton* custButton = GetICustButton(GetDlgItem(hWnd, IDC_LOCK_GRAIN));
			custButton->SetText(_T("L"));
			ReleaseICustButton(custButton); 

			// Wood type
			HWND hwndMap = GetDlgItem(hWnd, IDC_WOOD_TYPE);  
			SendMessage(hwndMap, CB_ADDSTRING, 0, (LPARAM)GetString(IDS_RADIAL_WOOD));
			SendMessage(hwndMap, CB_ADDSTRING, 0, (LPARAM)GetString(IDS_PERLIN_WOOD));
			SendMessage(hwndMap, CB_ADDSTRING, 0, (LPARAM)GetString(IDS_SIMPLEX_WOOD));
			SendMessage(hwndMap, CB_ADDSTRING, 0, (LPARAM)GetString(IDS_LINEAR_WOOD));

			// Set correct dropdown value
			int curIndex;
			map->GetParamBlock()->GetValue(wood_type, t, curIndex, FOREVER);
			SendMessage(GetDlgItem(hWnd, IDC_WOOD_TYPE), CB_SETCURSEL, (WPARAM)curIndex, 0);						
			break;
		}		
		case WM_SHOWWINDOW:	{		
			// Set correct dropdown value
			int curIndex;
			map->GetParamBlock()->GetValue(wood_type, t, curIndex, FOREVER);
			SendMessage(GetDlgItem(hWnd, IDC_WOOD_TYPE), CB_SETCURSEL, (WPARAM)curIndex, 0);
			break;
		}
		default: return FALSE;
	}
	return TRUE;
}
Exemplo n.º 21
0
void EditPatchMod::SetSelDlgEnables() 
{
	if (!hSelectPanel)
		return;
	ICustButton *but = GetICustButton(GetDlgItem(hSelectPanel, IDC_NS_PASTE));
	but->Disable();
	switch (GetSubobjectLevel())
	{
		case PO_VERTEX:
			if (GetPatchNamedSelClip(CLIP_P_VERT))
				but->Enable();
			break;
		case PO_EDGE:
			if (GetPatchNamedSelClip(CLIP_P_EDGE))
				but->Enable();
			break;
		case PO_PATCH:
			if (GetPatchNamedSelClip(CLIP_P_PATCH))
				but->Enable();
			break;
		case PO_TILE:
			break;
		}
	ReleaseICustButton(but);
	}
Exemplo n.º 22
0
// Helper method
static BOOL IsButtonEnabled(HWND hParent, DWORD id) {
	if( hParent==NULL ) return FALSE;
	ICustButton* but = GetICustButton(GetDlgItem(hParent,id));
	BOOL retval = but->IsEnabled();
	ReleaseICustButton(but);
	return retval;
}
Exemplo n.º 23
0
void SWrapPickOperand::EnterMode(IObjParam *ip)
	{
	ICustButton *iBut;
	iBut=GetICustButton(GetDlgItem(po->hParams,IDC_AP_WRAPBUTTON));
	if (iBut) iBut->SetCheck(TRUE);
	ReleaseICustButton(iBut);
	GetCOREInterface()->PushPrompt(GetString(IDS_AP_PICKMODE));
	}
Exemplo n.º 24
0
void SWrapPickOperand::ExitMode(IObjParam *ip)
	{
	ICustButton *iBut;
	iBut=GetICustButton(GetDlgItem(po->hParams,IDC_AP_WRAPBUTTON));
	if (iBut) iBut->SetCheck(FALSE);
	ReleaseICustButton(iBut);
    GetCOREInterface()->PopPrompt();
	}
Exemplo n.º 25
0
void SWrapObjectDlgProc::Update(TimeValue t)
{ float size;
	po->pblock->GetValue(PB_ICONSIZE,0,size,FOREVER);
	ICustButton *iBut = GetICustButton(GetDlgItem(po->hParams,IDC_AP_WRAPBUTTON));
	if (size<0.01f) iBut->Disable(); else iBut->Enable();
	ReleaseICustButton(iBut);
	po->ShowName();
}
Exemplo n.º 26
0
        BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
        {
            IParamBlock2        *pb = map->GetParamBlock();
            plRTProjDirLight    *lite = (plRTProjDirLight *)pb->GetOwner();
            PBBitmap            *bitmap;
            plLayerTex          *layer = (plLayerTex *)lite->GetProjMap();
            ICustButton         *bmSelectBtn;


            switch( msg )
            {
                case WM_COMMAND:
                    if( LOWORD( wParam ) == IDC_PROJ_MAPNAME )
                    {
                        BOOL selectedNewBitmap = layer->HandleBitmapSelection();
                        if( selectedNewBitmap )
                        {
                            bmSelectBtn = GetICustButton( GetDlgItem( hWnd, IDC_PROJ_MAPNAME ) );
                            bitmap = layer->GetPBBitmap();
                            bmSelectBtn->SetText( bitmap != nil ? (TCHAR *)bitmap->bi.Filename() : "");
                            ReleaseICustButton( bmSelectBtn );
                        }
                        return false;
                    }
                    break;

                case WM_INITDIALOG:

                    // Set projection map bitmap name
                    bmSelectBtn = GetICustButton( GetDlgItem( hWnd, IDC_PROJ_MAPNAME ) );
                    if( bmSelectBtn != nil )
                    {
                        bitmap = ( layer == nil ) ? nil : layer->GetPBBitmap();
                        if( bitmap != nil )
                            bmSelectBtn->SetText( (TCHAR *)bitmap->bi.Filename() );
                        else
                            bmSelectBtn->SetText( _T( "<none>" ) );
                        ReleaseICustButton( bmSelectBtn );
                    }

                    break;
            }

            return plBaseLightProc::DlgProc( t, map, hWnd, msg, wParam, lParam );
        }
Exemplo n.º 27
0
BOOL IsButtonChecked(HWND hWnd,int id)
   {
   ICustButton *iBut;
   BOOL res;
   iBut = GetICustButton(GetDlgItem(hWnd,id));
   res = iBut->IsChecked();
   ReleaseICustButton(iBut);
   return res;
   }
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);
		}
	}
}
Exemplo n.º 29
0
void PickProtTarget::ExitMode(IObjParam *ip) 
{
   ICustButton *iBut = GetICustButton(GetDlgItem(hDlg, which ? 
               IDC_PROT_PICK_TARGET2 : IDC_PROT_PICK_TARGET1));
   if (iBut) {
      iBut->SetCheck(FALSE);
      ReleaseICustButton(iBut);
   }
   doingPick = 0;
}
Exemplo n.º 30
0
void PaintDeformTest::DestroyUI(HWND hWnd)
{
	ReleaseICustButton(iPaintButton);
	iPaintButton = NULL;
	if (pPainter)
		{
		if (pPainter->InPaintMode() )
			pPainter->EndPaintSession();
		}
}