ProcessGridUnitMsg Class Reference

Something has happened to the units system. More...

#include <grid.h>

Inheritance diagram for ProcessGridUnitMsg:

ProcessGrid SimpleCCObject List of all members.

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

UnitMsgpUnitMsg

Detailed Description

Something has happened to the units system.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/7/94

Definition at line 490 of file grid.h.


Constructor & Destructor Documentation

ProcessGridUnitMsg::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().

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/7/94
Parameters:
pUnitMsg = ptr to the unit msg [INPUTS]
Returns:
-
See also:
-

Definition at line 2586 of file grid.cpp.

02587 {
02588     pUnitMsg = pThisUnitMsg;
02589 }


Member Function Documentation

void ProcessGridUnitMsg::Process NodeGrid pGrid  )  [virtual]
 

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.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/7/94
Parameters:
pGrid = the grid to process [INPUTS]
Returns:
-
See also:
-

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 }


Member Data Documentation

UnitMsg* ProcessGridUnitMsg::pUnitMsg [private]
 

Definition at line 498 of file grid.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:00:09 2007 for Camelot by  doxygen 1.4.4