BOOL CInteraction::OnInitDialog() { CPropertyPage::OnInitDialog(); UpdateDialogData(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL CMouse::OnInitDialog() { CPropertyPage::OnInitDialog(); m_mousexscale.SetRange(MIN_MOUSEXSCALE, MAX_MOUSEXSCALE); m_mousexscale.SetTicFreq(TIC_MOUSEXSCALE); m_mouseyscale.SetRange(MIN_MOUSEYSCALE, MAX_MOUSEYSCALE); m_mouseyscale.SetTicFreq(TIC_MOUSEYSCALE); UpdateDialogData(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
//----------------------------------------------------------------------------- // Purpose: // Input : uCmd - // Output : Returns TRUE on success, FALSE on failure. //----------------------------------------------------------------------------- BOOL CFaceEditMaterialPage::OnAlign( UINT uCmd ) { // Set the material tool current. SetMaterialPageTool( MATERIALPAGETOOL_MATERIAL ); // mark position in undo stack GetHistory()->MarkUndoPosition(NULL, "Align texture"); CFaceEditSheet *pSheet = ( CFaceEditSheet* )GetParent(); int faceCount = pSheet->GetFaceListCount(); for( int i = 0; i < faceCount; i++ ) { CMapFace *pFace = pSheet->GetFaceListDataFace( i ); CMapSolid *pSolid = pSheet->GetFaceListDataSolid( i ); GetHistory()->Keep( pSolid ); switch( uCmd ) { case IDC_ALIGN_WORLD: { pFace->InitializeTextureAxes( TEXTURE_ALIGN_WORLD, INIT_TEXTURE_AXES | INIT_TEXTURE_FORCE ); break; } case IDC_ALIGN_FACE: { pFace->InitializeTextureAxes( TEXTURE_ALIGN_FACE, INIT_TEXTURE_AXES | INIT_TEXTURE_FORCE ); break; } } } CMapDoc::GetActiveMapDoc()->SetModifiedFlag(); UpdateDialogData(); return ( TRUE ); }
void CCircularGrid::OnUpdateCirctGridRadiusStep() { UpdateDialogData(); }
void CCircularGrid::OnUpdateCircGridYorigin() { UpdateDialogData(); }
void CCircularGrid::OnUpdateCircGridRotationAngle() { UpdateDialogData(); }
void CCircularGrid::OnUpdateCircGridDivNumber() { UpdateDialogData(); }
//----------------------------------------------------------------------------- //----------------------------------------------------------------------------- void CFaceEditMaterialPage::ClickFace( CMapSolid *pSolid, int faceIndex, int cmd, int clickMode ) { // get the face CMapFace *pFace = pSolid->GetFace( faceIndex ); // // are updates enabled? // CFaceEditSheet *pSheet = ( CFaceEditSheet* )GetParent(); bool bEnableUpdate = pSheet->HasUpdateEnabled(); // // find the behavior of the page based on the "click mode" // switch( clickMode ) { case CFaceEditSheet::ModeAlignToView: { AlignToView( pFace ); break; } case CFaceEditSheet::ModeLift: { if( bEnableUpdate ) { UpdateDialogData( pFace ); } break; } case CFaceEditSheet::ModeLiftSelect: { if ( bEnableUpdate ) { UpdateDialogData(); } break; } case CFaceEditSheet::ModeApplyLightmapScale: { // Apply the lightmap scale only. Leave everything else alone. Apply(pFace, FACE_APPLY_LIGHTMAP_SCALE); break; } case CFaceEditSheet::ModeApply: case CFaceEditSheet::ModeApplyAll: { int flags = 0; if (cmd & CFaceEditSheet::cfEdgeAlign) { // Adust the mapping to align with a reference face. flags |= FACE_APPLY_ALIGN_EDGE; } if (clickMode == CFaceEditSheet::ModeApplyAll) { // Apply the material, mapping, lightmap scale, etc. flags |= FACE_APPLY_ALL; } else { // Apply the material only. Leave everything else alone. flags |= FACE_APPLY_MATERIAL; } Apply(pFace, flags); break; } } }
//----------------------------------------------------------------------------- // Purpose: // Input : uCmd - // Output : Returns TRUE on success, FALSE on failure. //----------------------------------------------------------------------------- BOOL CFaceEditMaterialPage::OnJustify( UINT uCmd ) { // Set the material tool current. SetMaterialPageTool( MATERIALPAGETOOL_MATERIAL ); BOOL bTreatManyAsOneFace; Extents_t Extents; // mark undo position GetHistory()->MarkUndoPosition( NULL, "Justify texture" ); CFaceEditSheet *pSheet = ( CFaceEditSheet* )GetParent(); int faceCount = pSheet->GetFaceListCount(); // If multiple faces are selected, use the m_bTreatManyAsOneFace variable to determine // how to perform the justification. if( faceCount > 1 ) { bTreatManyAsOneFace = m_bTreatAsOneFace; if( bTreatManyAsOneFace ) { GetAllFaceExtents( Extents ); } } // If only one face is selected, treat it singly. else { bTreatManyAsOneFace = FALSE; } for( int i = 0; i < faceCount; i++ ) { CMapFace *pFace = pSheet->GetFaceListDataFace( i ); CMapSolid *pSolid = pSheet->GetFaceListDataSolid( i ); GetHistory()->Keep( pSolid ); if( !bTreatManyAsOneFace ) { pFace->GetFaceExtents( Extents ); } switch (uCmd) { case IDC_JUSTIFY_TOP: { pFace->JustifyTextureUsingExtents(TEXTURE_JUSTIFY_TOP, Extents); break; } case IDC_JUSTIFY_BOTTOM: { pFace->JustifyTextureUsingExtents(TEXTURE_JUSTIFY_BOTTOM, Extents); break; } case IDC_JUSTIFY_LEFT: { pFace->JustifyTextureUsingExtents(TEXTURE_JUSTIFY_LEFT, Extents); break; } case IDC_JUSTIFY_RIGHT: { pFace->JustifyTextureUsingExtents(TEXTURE_JUSTIFY_RIGHT, Extents); break; } case IDC_JUSTIFY_CENTER: { pFace->JustifyTextureUsingExtents(TEXTURE_JUSTIFY_CENTER, Extents); break; } case IDC_JUSTIFY_FITTOFACE: { pFace->JustifyTextureUsingExtents(TEXTURE_JUSTIFY_FIT, Extents); break; } } } CMapDoc::GetActiveMapDoc()->SetModifiedFlag(); UpdateDialogData(); return(TRUE); }