#include <grid.h>
Inheritance diagram for ProcessGridUnitMsg:
Public Member Functions | |
ProcessGridUnitMsg (UnitMsg *pThisUnitMsg) | |
THE constructor for this class This assigns pThisUnitMsg to the member var pUnitMsg ready for its Process method to be called vai NodeGrid::ProcessAllGrids(). | |
void | Process (NodeGrid *pGrid) |
Checks to see if the grid is using the unit specified in the UnitMsg member var, and if so changes it if the unit is about to be deleted. | |
Private Attributes | |
UnitMsg * | pUnitMsg |
Definition at line 490 of file grid.h.
|
THE constructor for this class This assigns pThisUnitMsg to the member var pUnitMsg ready for its Process method to be called vai NodeGrid::ProcessAllGrids().
Definition at line 2586 of file grid.cpp. 02587 { 02588 pUnitMsg = pThisUnitMsg; 02589 }
|
|
Checks to see if the grid is using the unit specified in the UnitMsg member var, and if so changes it if the unit is about to be deleted.
Implements ProcessGrid. Definition at line 2605 of file grid.cpp. 02606 { 02607 switch (pUnitMsg->MsgType) 02608 { 02609 case (UnitMsg::BEFOREDELETE) : 02610 { 02611 UnitType OldUnitType = pUnitMsg->ThisUnitType; 02612 02613 if (pGrid->GetUnits() == OldUnitType) 02614 { 02615 double Div = pGrid->GetDivisions(); 02616 UINT32 SubDiv = pGrid->GetSubdivisions(); 02617 Unit* pThisUnit = pUnitMsg->pDocUnitList->FindUnit(OldUnitType); 02618 UnitType NewUnitType = pThisUnit->GetBaseUnitType(); 02619 02620 ENSURE(NewUnitType != NOTYPE,"Er, deleting a unit that has no base type"); 02621 02622 Div = Convert::ConvertToNewUnits(Div,OldUnitType,NewUnitType); 02623 02624 pGrid->SetGridParams(Div,SubDiv,NewUnitType); 02625 } 02626 } 02627 break; 02628 02629 case (UnitMsg::CHANGED) : 02630 { 02631 UnitType ChangedUnitType = pUnitMsg->ThisUnitType; 02632 02633 if (pGrid->GetUnits() == ChangedUnitType) 02634 { 02635 double Div = pGrid->GetDivisions(); 02636 UINT32 SubDiv = pGrid->GetSubdivisions(); 02637 02638 pGrid->SetGridParams(Div,SubDiv,ChangedUnitType); 02639 02640 if (!pGrid->IsDisabled()) 02641 { 02642 // Get ptr to selected doc view 02643 DocView* pDocView = DocView::GetSelected(); 02644 02645 // If there's a selected docview, redraw! 02646 if (pDocView != NULL) 02647 pDocView->ForceRedraw(pGrid->FindParentSpread(),pGrid->GetBlobBoundingRect()); 02648 } 02649 02650 //GridTool::ForceRedraw(pGrid); 02651 } 02652 } 02653 break; 02654 default: break; 02655 } 02656 }
|
|
|