// Enable/disable selected buttons // // dwFlags can be any combination of: // // PSWIZB_BACK Back button // PSWIZB_NEXT Next button // PSWIZB_FINISH Finish button // void CNGWizard::EnableWizardButtons(DWORD dwFlags, BOOL bEnable) { if (dwFlags & PSWIZB_BACK) { EnableDlgControl(ID_WIZBACK, bEnable); } if (dwFlags & PSWIZB_NEXT) { EnableDlgControl(ID_WIZNEXT, bEnable); } if (dwFlags & PSWIZB_FINISH) { EnableDlgControl(ID_WIZFINISH, bEnable); } }
// options dialog message handler INT_PTR Options::ExportOptionsDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM) { ISpinnerControl* spin; // int ticksPerFrame = GetTicksPerFrame(); Interval animRange = mMaxInterface->GetAnimRange(); int sceneStart = animRange.Start(); int sceneEnd = animRange.End(); switch (message) { case WM_INITDIALOG: { CenterWindow(hWnd, GetParent(hWnd)); // grab scene timing details & clip anim start & end if needed if (mAnimationStart < sceneStart) mAnimationStart = sceneStart; if (mAnimationStart > sceneEnd) mAnimationStart = sceneEnd; if (mAnimationEnd < sceneStart) mAnimationEnd = sceneStart; if (mAnimationEnd > sceneEnd) mAnimationEnd = sceneEnd; // setup checkboxes CheckDlgButton(hWnd, IDC_GEOM_NORMALS, mNormals); CheckDlgButton(hWnd, IDC_GEOM_TRIANGLES, mTriangulate); CheckDlgButton(hWnd, IDC_GEOM_XREFS, mIncludeXrefs); CheckDlgButton(hWnd, IDC_GEOM_TANGENTS, mTangents); CheckDlgButton(hWnd, IDC_ANIM_ENABLE, mAnimations); CheckDlgButton(hWnd, IDC_ANIM_SAMPLE, mSampleAnimation); CheckDlgButton(hWnd, IDC_ANIM_CLIP, mCreateClip); CheckDlgButton(hWnd, IDC_LAYERS_TO_CLIPS, mLayersAsClips); CheckDlgButton(hWnd, IDC_BAKE_MATRICES, mBakeMatrices); CheckDlgButton(hWnd, IDC_RELATIVE_PATHS, mRelativePaths); CheckDlgButton(hWnd, IDC_COPY_IMAGES, mCopyImages); CheckDlgButton(hWnd, IDC_EXPORT_USER_PROPERTIES, mExportUserDefinedProperties); // Animation checkboxes depend on the enable button. EnableDlgControl(hWnd, IDC_ANIM_SAMPLE, mAnimations); EnableDlgControl(hWnd, IDC_ANIM_CLIP, mAnimations); #if defined(MAX_RELEASE_R17) && (MAX_RELEASE >= MAX_RELEASE_R17) EnableDlgControl(hWnd, IDC_LAYERS_TO_CLIPS, mAnimations); #else EnableDlgControl(hWnd, IDC_LAYERS_TO_CLIPS, false); #endif // setup spinners spin = GetISpinner(GetDlgItem(hWnd, IDC_ANIM_START_SPIN)); spin->LinkToEdit(GetDlgItem(hWnd,IDC_ANIM_START), EDITTYPE_TIME); spin->SetLimits(sceneStart, sceneEnd, true); spin->SetScale(1.0f); spin->SetValue(mAnimationStart, true); spin->Enable(mSampleAnimation && mAnimations); EnableWindow(GetDlgItem(hWnd, IDC_START_LABEL), mSampleAnimation && mAnimations); ReleaseISpinner(spin); spin = GetISpinner(GetDlgItem(hWnd, IDC_ANIM_END_SPIN)); spin->LinkToEdit(GetDlgItem(hWnd,IDC_ANIM_END), EDITTYPE_TIME); spin->SetLimits(sceneStart, sceneEnd, true); spin->SetScale(1.0f); spin->SetValue(mAnimationEnd, false); spin->Enable(mSampleAnimation && mAnimations); EnableWindow(GetDlgItem(hWnd, IDC_END_LABEL), mSampleAnimation && mAnimations); ReleaseISpinner(spin); return true; } case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_ANIM_ENABLE: mAnimations = IsDlgButtonChecked(hWnd, IDC_ANIM_ENABLE) == BST_CHECKED; EnableDlgControl(hWnd, IDC_ANIM_SAMPLE, mAnimations); EnableDlgControl(hWnd, IDC_ANIM_CLIP, mAnimations); #if defined(MAX_RELEASE_R17) && (MAX_RELEASE >= MAX_RELEASE_R17) EnableDlgControl(hWnd, IDC_LAYERS_TO_CLIPS, mAnimations); #else EnableDlgControl(hWnd, IDC_LAYERS_TO_CLIPS, false); #endif /*spin = GetISpinner(GetDlgItem(hWnd, IDC_ANIM_START_SPIN)); //spin->LinkToEdit(GetDlgItem(hWnd,IDC_ANIM_START), EDITTYPE_INT); spin->Enable(sampleAnim && animations); EnableWindow(GetDlgItem(hWnd, IDC_START_LABEL), sampleAnim && animations); ReleaseISpinner(spin); spin = GetISpinner(GetDlgItem(hWnd, IDC_ANIM_END_SPIN)); //spin->LinkToEdit(GetDlgItem(hWnd,IDC_ANIM_END), EDITTYPE_INT); spin->Enable(sampleAnim && animations); EnableWindow(GetDlgItem(hWnd, IDC_END_LABEL), sampleAnim && animations); ReleaseISpinner(spin); break; */ case IDC_ANIM_SAMPLE: mSampleAnimation = IsDlgButtonChecked(hWnd, IDC_ANIM_SAMPLE) == BST_CHECKED; spin = GetISpinner(GetDlgItem(hWnd, IDC_ANIM_START_SPIN)); spin->Enable(mSampleAnimation && mAnimations); EnableWindow(GetDlgItem(hWnd, IDC_START_LABEL), mSampleAnimation && mAnimations); ReleaseISpinner(spin); spin = GetISpinner(GetDlgItem(hWnd, IDC_ANIM_END_SPIN)); spin->Enable(mSampleAnimation && mAnimations); EnableWindow(GetDlgItem(hWnd, IDC_END_LABEL), mSampleAnimation && mAnimations); ReleaseISpinner(spin); break; case IDOK: // hit OK, pick up control values & end dialog mBakeMatrices = IsDlgButtonChecked(hWnd, IDC_BAKE_MATRICES) == BST_CHECKED; mRelativePaths = IsDlgButtonChecked(hWnd, IDC_RELATIVE_PATHS) == BST_CHECKED; mAnimations = IsDlgButtonChecked(hWnd, IDC_ANIM_ENABLE) == BST_CHECKED; mSampleAnimation = IsDlgButtonChecked(hWnd, IDC_ANIM_SAMPLE) == BST_CHECKED; mCreateClip = IsDlgButtonChecked(hWnd, IDC_ANIM_CLIP) == BST_CHECKED; mLayersAsClips = IsDlgButtonChecked(hWnd, IDC_LAYERS_TO_CLIPS) == BST_CHECKED; mNormals = IsDlgButtonChecked(hWnd, IDC_GEOM_NORMALS) == BST_CHECKED; mTriangulate = IsDlgButtonChecked(hWnd, IDC_GEOM_TRIANGLES) == BST_CHECKED; mIncludeXrefs = IsDlgButtonChecked(hWnd, IDC_GEOM_XREFS) == BST_CHECKED; mTangents = IsDlgButtonChecked(hWnd, IDC_GEOM_TANGENTS) == BST_CHECKED; mCopyImages = IsDlgButtonChecked(hWnd, IDC_COPY_IMAGES) == BST_CHECKED; mExportUserDefinedProperties = IsDlgButtonChecked(hWnd, IDC_EXPORT_USER_PROPERTIES) == BST_CHECKED; spin = GetISpinner(GetDlgItem(hWnd, IDC_ANIM_START_SPIN)); mAnimationStart = mSampleAnimation ? spin->GetIVal() : sceneStart; ReleaseISpinner(spin); spin = GetISpinner(GetDlgItem(hWnd, IDC_ANIM_END_SPIN)); mAnimationEnd = mSampleAnimation ? spin->GetIVal() : sceneEnd; ReleaseISpinner(spin); EndDialog(hWnd, 1); break; case IDCANCEL: EndDialog(hWnd, 0); break; } default: return false; } return true; }