Exemple #1
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;
}
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;
}
    /// 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 );
    }
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);

      }
   
}
Exemple #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);
			}

		}
}
Exemple #6
0
//WIN32 : BOOL UVWFrameDlgProc::DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
INT_PTR UVWFrameDlgProc::DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	int id = LOWORD(wParam);
	switch (msg) 
	{
		case WM_INITDIALOG:
			SetWindowText(GetDlgItem(hWnd,IDC_TKU_ABOUT),UVWFRAME_LABEL);
			if (sho->uvwMesh)
				SetWindowText(GetDlgItem(hWnd, IDC_UVWF_PICKOBJ), sho->uvwMesh->GetName()); 
			else
				SetWindowText(GetDlgItem(hWnd, IDC_UVWF_PICKOBJ), _T("Pick Object")); 

			LoadImages();
			ICustButton *iTmp;

			iTmp = GetICustButton(GetDlgItem(hWnd,IDC_TL_ABOUT));
			iTmp->SetImage(hAboutImage, 0, 0, 0, 0, 16, 16);
			iTmp->SetTooltip(TRUE,_T("About UVW Frame"));

			iTmp = GetICustButton(GetDlgItem(hWnd,IDC_TL_HELP));
			iTmp->SetImage(hHelpImage, 0, 0, 0, 0, 16, 16);
			iTmp->SetTooltip(TRUE,_T("UVW Frame Help"));

			ReleaseICustButton(iTmp);
		break;

		case WM_DESTROY:
		break;

		case WM_COMMAND:
			switch(id) 
			{
				case IDC_TL_ABOUT:
					DialogBoxParam(	hInstance, MAKEINTRESOURCE(IDD_ABOUT), GetCOREInterface()->GetMAXHWnd(), AboutDlgProc, 0);
				break;

				case IDC_TL_HELP:
					ShellExecute(NULL, _T("open"), _T("http://www.mankua.com/uvwframe.php"), NULL, NULL, SW_SHOWNORMAL);
				break;

				case IDC_UVWF_SAVE:
					sho->SaveUVW(hWnd);
				break;

				case IDC_UVWF_LOAD:
					sho->LoadUVW(hWnd);
				break;
			}
		break;
	}

	return FALSE;
}
    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;
        }
    }
Exemple #8
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;
	}
void PickOrientNode::ExitMode(IObjParam *ip)
	{
	ICustButton *iBut = GetICustButton(GetDlgItem(p->hWnd,IDC_ORIENT_TARG_PICKNODE));
	if (iBut) iBut->SetCheck(FALSE);
	ReleaseICustButton(iBut);
	GetCOREInterface()->PopPrompt();
	}
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 );
}
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);
	}

}
Exemple #12
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;
}
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);
   }
Exemple #14
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);
}
void CheckButton(HWND hWnd,int id, BOOL check) {
   ICustButton *iBut;
   iBut = GetICustButton(GetDlgItem(hWnd,id));
   if( iBut )
      iBut->SetCheck(check);
   ReleaseICustButton(iBut);
   }
Exemple #16
0
void 
CppOut::Init(HWND hWnd)
{
    iPick = GetICustButton(GetDlgItem(hWnd,IDC_CPPOUT_PICK));
    iPick->SetType(CBT_CHECK);
    iPick->SetHighlightColor(GREEN_WASH);
}
Exemple #17
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);
	}
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"));
	}
Exemple #19
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;
}
void PFOperatorInstanceShapeDlgProc::UpdateObjectNameDlg( HWND hWnd, TSTR& objectName )
{
	ICustButton* but;
	but = GetICustButton( GetDlgItem( hWnd, IDC_PICK ) );
	but->SetText(objectName);
	ReleaseICustButton(but);
}
Exemple #21
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));
	}
Exemple #22
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();
	}
Exemple #23
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();
}
Exemple #24
0
INT_PTR SkelTexDlgProc::DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	int id = LOWORD(wParam);
	switch (msg) 
	{
		case WM_INITDIALOG:
			InitAuthorized(hWnd);

			LoadImages();
			ICustButton *iTmp;

			iTmp = GetICustButton(GetDlgItem(hWnd,IDC_STRESS_ABOUT));
			iTmp->SetImage(hAboutImage, 0, 0, 0, 0, 16, 16);
			iTmp->SetTooltip(TRUE,_T("About Stress"));

			iTmp = GetICustButton(GetDlgItem(hWnd,IDC_STRESS_HELP));
			iTmp->SetImage(hHelpImage, 0, 0, 0, 0, 16, 16);
			iTmp->SetTooltip(TRUE,_T("Stress Help"));

			ReleaseICustButton(iTmp);

		break;

		case WM_DESTROY:
			break;

		case WM_COMMAND:
			switch (LOWORD(wParam))
			{
				case IDC_BANNER_CRACKART:
					ShellExecute(NULL, _T("open"), _T("http://www.crackart.org"), NULL, NULL, SW_SHOWNORMAL);
				break;

				case IDC_STRESS_HELP:
					ShellExecute(NULL, _T("open"), _T("http://www.mankua.com/stress.php"), NULL, NULL, SW_SHOWNORMAL);
				break;

				case IDC_STRESS_ABOUT:
					DialogBoxParam(	hInstance, MAKEINTRESOURCE(IDD_ABOUT), GetCOREInterface()->GetMAXHWnd(), AboutDlgProc, 0);
				break;
			}
			break;
	}
	return FALSE;
}
Exemple #25
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 );
        }
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);
		}
	}
}
 void    ExitMode()
 {
     ICustButton     *iBut = GetICustButton( GetDlgItem( fHWnd, IDC_GENERATE_FACES ) );
     if( iBut )
     {
         iBut->SetCheck( FALSE );
         iBut->SetText( _T( "Generate From Node" ) );
     }
     ReleaseICustButton( iBut );
 }
Exemple #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;
}
Exemple #30
0
void PickControlNode::ExitMode(IObjParam *ip)
	{
	ICustButton *iBut = GetICustButton(GetDlgItem(hWnd, IDC_PICK));
	if (iBut)
		{
		iBut->SetCheck( FALSE);
		ReleaseICustButton(iBut);
		}

	obj->inPickMode = FALSE;	
	}