GridTab Class Reference

Allows the user to set any options which are normally associated with the document's default grid and hence the page rulers. This includes such things as:- Grid and rulers origin Grid and rulers spacing and divisions Grid type. More...

#include <optsgrid.h>

Inheritance diagram for GridTab:

OptionsTabs ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 GridTab ()
 ~GridTab ()
 GridTab destructor.
virtual BOOL Init ()
 GridTab initialisation routine.
virtual BOOL HandleMsg (DialogMsg *Msg)
 Handles all the Page options tabs messages.
virtual BOOL InitSection ()
 Sets initial values for the Page section of the options dialog box. This section includes the:-.
virtual BOOL CommitSection ()
 Reads the gadgets on the Grid and Ruler Options Tab and sets the appropriate values in the grid in the spread dictated by the OptionsTab class, currently kept up to date with the first spread in the selected document.
virtual BOOL NewUnitsInSection ()
 Function called when new default units come into operation. We must convert all units fields to display in the newly specified units.
virtual BOOL GreySection ()
 Called when the user has closed all documents.
virtual BOOL UngreySection ()
 Called when the user has selected a new document.
BOOL ChangeControlStatus (const BOOL Status)
 Called to grey/ungrey all controls on this tab.
virtual BOOL UpdateSection (String_256 *DocumentName)
 Called when we have switched to a new document and need to update all the controls on this tab. Should only init the tab if the page is present. The document name allows the info field on the tab to be filled in correctly.
BOOL UpdateGridSection ()
 Called when we have undone a default grid resize operation and hence need to update the default grid's details on the page section of this tab. Should only init the tab if the page is present.
virtual CDlgResID GetPageID ()
 Allows the options dialog code to determine the dialog ID of this section.
virtual BOOL IsDocumentOption ()
 Allows the document options dialog code to determine if this tab belongs to the group of document options.
virtual BOOL IsProgramOption ()
 Allows the program options dialog code to determine if this tab belongs to the group of program options.
BOOL InvokeResize (GridResizeInfo *Param)
 Sets the new details of the page size and of the default grid. The default grid should always be resident in the spread. Assumes the class variables pDocument, pSpread have been set up. This function should be used instead of SetNewSizeOfPage and SetDefaultPageGrid as it is undoable and they aren't.

Protected Member Functions

BOOL InitGridSection ()
 Reflects the state of the default grid in the grid tab of the options dialog.

Private Attributes

double OldGridSpacing
UINT32 OldGridSubDivisions
UnitType OldGridUnits
GridType OldTypeOfGrid
MILLIPOINT OldOriginX
MILLIPOINT OldOriginY
BOOL GreyStatus

Detailed Description

Allows the user to set any options which are normally associated with the document's default grid and hence the page rulers. This includes such things as:- Grid and rulers origin Grid and rulers spacing and divisions Grid type.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
05/10/94
See also:
OptionsTabs; AppPrefsDlg;

Definition at line 148 of file optsgrid.h.


Constructor & Destructor Documentation

GridTab::GridTab  ) 
 

GridTab::~GridTab  ) 
 

GridTab destructor.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 181 of file optsgrid.cpp.

00182 {   
00183 }        


Member Function Documentation

BOOL GridTab::ChangeControlStatus const BOOL  Status  ) 
 

Called to grey/ungrey all controls on this tab.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
GridTab::GreySection; GridTab::UngreySection;

Definition at line 527 of file optsgrid.cpp.

00528 {
00529     // Grey/Ungrey the controls
00530     pPrefsDlg->EnableGadget(_R(IDC_OPTS_INFO), Status);
00531 
00532     pPrefsDlg->EnableGadget(_R(IDC_OPTS_ORIGINGROUP), Status);
00533 //WEBSTER-ranbirr-13/11/96
00534 #ifndef WEBSTER
00535     pPrefsDlg->EnableGadget(_R(IDC_OPTS_ORIGINXTXT), Status);
00536 #endif //webster
00537     pPrefsDlg->EnableGadget(_R(IDC_OPTS_ORIGINYTXT), Status);
00538 //WEBSTER-ranbirr-13/11/96
00539 #ifndef WEBSTER
00540     pPrefsDlg->EnableGadget(_R(IDC_OPTS_ORIGINX), Status);
00541     pPrefsDlg->EnableGadget(_R(IDC_OPTS_ORIGINY), Status);
00542     pPrefsDlg->EnableGadget(_R(IDC_OPTS_GRIDGROUP), Status);
00543 #endif //webster
00544     pPrefsDlg->EnableGadget(_R(IDC_OPTS_GRIDSPACETXT), Status);
00545     pPrefsDlg->EnableGadget(_R(IDC_OPTS_GRIDSPACING), Status);
00546 //WEBSTER-ranbirr-13/11/96
00547 #ifndef WEBSTER
00548     pPrefsDlg->EnableGadget(_R(IDC_OPTS_GRIDDIVTXT), Status);
00549 #endif //webster
00550     pPrefsDlg->EnableGadget(_R(IDC_OPTS_GRIDDIVISIONS), Status);
00551     pPrefsDlg->EnableGadget(_R(IDC_OPTS_GRIDTYPE), Status);
00552 //WEBSTER-ranbirr-13/11/96
00553 #ifndef WEBSTER
00554     pPrefsDlg->EnableGadget(_R(IDC_OPTS_ISOMETRIC), Status);
00555     pPrefsDlg->EnableGadget(_R(IDC_OPTS_RECTANGULAR), Status);
00556 #endif //webster
00557     return TRUE;
00558 }           

BOOL GridTab::CommitSection  )  [virtual]
 

Reads the gadgets on the Grid and Ruler Options Tab and sets the appropriate values in the grid in the spread dictated by the OptionsTab class, currently kept up to date with the first spread in the selected document.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/10/95
Returns:
TRUE if worked, FALSE if fails
If False is returned then **MUST** have reported error to the user otherwise the dialog box will refuse to close and the user will not know why. Also, individual controls must report their individual errors and not go through some crazy system and then ***NOT*** report the errors

Implements OptionsTabs.

Definition at line 292 of file optsgrid.cpp.

00293 {
00294     ERROR2IF(pPrefsDlg==NULL,FALSE,"GridTab::CommitSection() - pPrefsDlg==NULL");
00295 
00296     if (pDocument==NULL || pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_GRID))==FALSE)
00297         return TRUE;    // just return with no error
00298 
00299     // create storage for required values and init to arbitary but legal values
00300     UnitType GridUnits   = NOTYPE;
00301     double   GridSpacing = 72000.0;
00302     double   GridDivs    = 1.0;
00303     UINT32     GridSubDivs = 8;
00304     GridType TypeOfGrid  = RECTANGULAR;
00305 
00306     // Determine the current grid units and grid divisions (ie grid step in terms of units)
00307     // First the grid spacing
00308     BOOL ok = pPrefsDlg->GetDoubleAndUnitGadgetValue(&GridSpacing, &GridDivs, &GridUnits, _R(IDC_OPTS_GRIDSPACING), pSpread);
00309     if (!ok)
00310     {
00311         // We have had an error so inform the user that something is wrong
00312         InformWarning(_R(IDE_OPTS_INVALIDGRIDSPACE));
00313         return FALSE;   
00314     }
00315     // ensure sensible grid spacing
00316     if (GridSpacing <= 0 || GridSpacing >= MaxPageDimension)
00317     {
00318         InformWarning(_R(IDE_OPTS_INVALIDGRIDSPACE));
00319         return FALSE;
00320     }
00321 
00322 
00323     // determine grid sub-divisions
00324     GridSubDivs = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_GRIDDIVISIONS), 0,100, _R(IDE_OPTS_INVALIDGRIDDIV), &ok);
00325     if (!ok)
00326     {
00327         // We have had an error, informed the user so get out now before any more errors are reported
00328         return FALSE;   
00329     }
00330 
00331     // Make sure we have a sensible number of sub divisions
00332     if (GridSubDivs < 1)
00333         GridSubDivs = 1;
00334 
00335     // then grid type
00336 //WEBSTER-ranbirr-13/11/96
00337 #ifndef WEBSTER
00338     TypeOfGrid = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_RECTANGULAR), 0,1,0,&ok) ? RECTANGULAR : ISOMETRIC;
00339 #endif //webster
00340     // determine the origin
00341     DocCoord PageRelativeOrigin(0,0);
00342 //WEBSTER-ranbirr-13/11/96
00343 #ifndef WEBSTER
00344     PageRelativeOrigin.x = pPrefsDlg->GetDimensionGadgetValue(_R(IDC_OPTS_ORIGINX), pSpread, &ok);
00345     if (ok) PageRelativeOrigin.y = pPrefsDlg->GetDimensionGadgetValue(_R(IDC_OPTS_ORIGINY), pSpread, &ok);
00346     if (!ok)
00347     {
00348         // We have had an error so inform the user that something is wrong
00349         InformWarning(_R(IDE_OPTS_INVALIDORIGIN));
00350         return FALSE;   
00351     }
00352 
00353     DocCoord Origin(0,0);
00354     ok = pSpread->PagesCoordToSpreadCoord(&Origin,PageRelativeOrigin);
00355     if (!ok)
00356     {
00357         // We have had an error so inform the user that something is wrong
00358         InformWarning(_R(IDE_OPTS_INVALIDORIGIN));
00359         return FALSE;   
00360     }
00361 
00362     // Ensure the origin falls within the spread's pasteboard
00363     DocRect SpreadRect = pSpread->GetPasteboardRect(FALSE);
00364     pSpread->DocCoordToSpreadCoord(&SpreadRect);
00365 
00366     if (!SpreadRect.ContainsCoord(Origin))
00367     {
00368         InformWarning(_R(IDE_OPTS_INVALIDORIGIN));
00369         return FALSE;
00370     }
00371 #endif //webster
00372     // Set up param block with new grid info and invoke the resize op
00373     GridResizeInfo Param;
00374     Param.GridSpacing      = GridSpacing;
00375     Param.GridSubDivisions = GridSubDivs;
00376     Param.GridDivisions    = GridDivs;
00377     Param.GridUnits        = GridUnits;
00378     Param.TypeOfGrid       = TypeOfGrid;
00379     Param.OriginX          = PageRelativeOrigin.x;
00380     Param.OriginY          = PageRelativeOrigin.y;
00381     InvokeResize(&Param);
00382 
00383     return TRUE;
00384 }

CDlgResID GridTab::GetPageID  )  [virtual]
 

Allows the options dialog code to determine the dialog ID of this section.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The dialog ID of this tab section.

Errors: -

See also:
-

Implements OptionsTabs.

Definition at line 226 of file optsgrid.cpp.

00227 {
00228     return _R(IDD_OPTSTAB_GRID);
00229 }

BOOL GridTab::GreySection  )  [virtual]
 

Called when the user has closed all documents.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
GridTab::UngreySection;

Reimplemented from OptionsTabs.

Definition at line 443 of file optsgrid.cpp.

00444 {
00445 TRACEUSER( "Neville", _T("GreySection in page section\n"));
00446     ERROR2IF(pPrefsDlg == NULL,FALSE,"GridTab::GreySection called with no dialog pointer");
00447 
00448     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_GRID));  // The grid tab identifier
00449     if (!ok)
00450         return TRUE;    // Talk to page failed to return now
00451 
00452     // Make sure the information field displaying the name of the current document
00453     // is correct.
00454     String_256  DocumentName(_R(IDT_OPTS_GRID_INFO)); 
00455     DocumentName += *GetDocumentName();
00456     pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_INFO), DocumentName);
00457 
00458     // Only update if we are not already grey 
00459     if (GreyStatus == TRUE)
00460         return TRUE;
00461 
00462     // Call our central greying/ungreying function
00463     ok = ChangeControlStatus(FALSE);
00464     
00465     GreyStatus = TRUE;
00466 
00467     return ok;
00468 } 

BOOL GridTab::HandleMsg DialogMsg Msg  )  [virtual]
 

Handles all the Page options tabs messages.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Implements OptionsTabs.

Definition at line 661 of file optsgrid.cpp.

00662 {
00663 TRACEUSER( "Neville", _T("HandlePageMsg\n"));
00664     ERROR2IF(Msg == NULL,FALSE,"GridTab::Message null message received");
00665     ERROR2IF(pPrefsDlg == NULL,FALSE,"GridTab::HandleMsg called with no dialog pointer");
00666 
00667     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_GRID));  // The Page page identifier
00668     if (!ok)
00669         return TRUE;        // page not present
00670 
00671     switch(Msg->DlgMsg)
00672     {
00673         case DIM_CREATE:    // Initialise controls
00674             GreyStatus = FALSE; // we are ungreyed by default
00675             ok = InitSection();
00676             if (!ok)
00677                 InformError();
00678             break;
00679         case DIM_LFT_BN_CLICKED:
00680         case DIM_SELECTION_CHANGED:
00681         case DIM_TEXT_CHANGED:
00682             OptionsTabs::SetApplyNowState(TRUE);
00683             break;
00684         default:
00685             break;
00686     }
00687     
00688     return TRUE;
00689 }  

BOOL GridTab::Init void   )  [virtual]
 

GridTab initialisation routine.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
True if initialised ok, False if failed.

Errors: -

See also:
-

Reimplemented from OptionsTabs.

Definition at line 201 of file optsgrid.cpp.

00202 {   
00203     // Init (register) all our undoable operations
00204     if (!OpGridResize::Init())
00205         return(FALSE);
00206 
00207     return TRUE;
00208 }        

BOOL GridTab::InitGridSection  )  [protected]
 

Reflects the state of the default grid in the grid tab of the options dialog.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/9/95
Returns:
TRUE if everything went ok, FALSE if fails

Definition at line 748 of file optsgrid.cpp.

00749 {
00750     // validate spread/doc pointers associated with the options tab
00751     ERROR2IF(pDocument==NULL,FALSE,"GridTab::GetDefaultGridDetails() - pDocument==NULL");
00752     ERROR2IF(  pSpread==NULL,FALSE,"GridTab::GetDefaultGridDetails() - pSpread==|NULL");
00753 
00754     // get a pointer to the default grid
00755     NodeGrid* pDefaultGrid = pSpread->FindFirstDefaultGridInSpread();
00756     ERROR2IF(pDefaultGrid==NULL,FALSE,"GridTab::GetDefaultGridDetails() - pDefaultGrid==NULL");
00757 
00758     // read current grid settings
00759     double   GridSpacing      = pDefaultGrid->GetMainStep();        // seems to be equivalent
00760     UINT32     GridSubDivisions = pDefaultGrid->GetSubdivisions();
00761     UnitType GridUnits        = pDefaultGrid->GetUnits();
00762     GridType TypeOfGrid       = pDefaultGrid->GetGridType();
00763     ERROR2IF(GridUnits==NOTYPE,FALSE,"GridTab::GetDefaultGridDetails() - grid units should never be NOTYPE!");
00764     DocCoord GridOrigin(0,0);
00765     pDefaultGrid->GetOrigin(&GridOrigin.x, &GridOrigin.y);
00766     BOOL ok = pSpread->SpreadCoordToPagesCoord(&GridOrigin,GridOrigin);     // make origin page relative
00767 
00768     // reflect these in the gadgets
00769 //WEBSTER-ranbirr-13/11/96
00770 #ifndef WEBSTER
00771     ok = ok && pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_RECTANGULAR), TypeOfGrid==RECTANGULAR);
00772     ok = ok && pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_ISOMETRIC),   TypeOfGrid==ISOMETRIC);
00773 #endif //webster
00774     ok = ok && pPrefsDlg->SetLongGadgetValue(_R(IDC_OPTS_GRIDDIVISIONS), GridSubDivisions);
00775     ok = ok && pPrefsDlg->SetDimensionUnitGadgetValue(_R(IDC_OPTS_GRIDSPACING), GridUnits, GridSpacing, pDefaultGrid);
00776 //WEBSTER-ranbirr-13/11/96
00777 #ifndef WEBSTER
00778     ok = ok && pPrefsDlg->SetDimensionGadgetValue(_R(IDC_OPTS_ORIGINX), GridOrigin.x, pSpread);
00779     ok = ok && pPrefsDlg->SetDimensionGadgetValue(_R(IDC_OPTS_ORIGINY), GridOrigin.y, pSpread);
00780 #endif //webster
00781     // Note the states of the gadgets
00782     OldGridSpacing      = GridSpacing;
00783     OldGridSubDivisions = GridSubDivisions;
00784     OldGridUnits        = GridUnits;
00785     OldTypeOfGrid       = TypeOfGrid;
00786     OldOriginX          = GridOrigin.x;
00787     OldOriginY          = GridOrigin.y;
00788 
00789     return ok;
00790 }   

BOOL GridTab::InitSection  )  [virtual]
 

Sets initial values for the Page section of the options dialog box. This section includes the:-.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if successful, else FALSE

Errors: -

See also:
AppPrefsDlg; OptionsTabs; UpdateSection;

Implements OptionsTabs.

Definition at line 708 of file optsgrid.cpp.

00709 {
00710 TRACEUSER( "Neville", _T("InitPageSection\n"));
00711     ERROR2IF(pPrefsDlg == NULL,FALSE,"GridTab::InitSection called with no dialog pointer");
00712 
00713 //  BOOL ok = TRUE;         // Flag for whether value set up ok 
00714 
00715     // Make sure the information field displaying the name of the current document
00716     // is correct.
00717     String_256  DocumentName(_R(IDT_OPTS_GRID_INFO)); 
00718     DocumentName += *GetDocumentName();
00719     pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_INFO), DocumentName);
00720 
00721     // All units work off the selected document and so we must do nothing if there is no
00722     // selected document. Check our clas variable to see if this is true or not.
00723     // Units should have been set up by the caller.
00724     if (pDocument == NULL)
00725     {
00726         GreySection();
00727         return (TRUE);
00728     }
00729 
00730     // Set up our tab information
00731     InitGridSection();
00732 
00733     return TRUE;
00734 }

BOOL GridTab::InvokeResize GridResizeInfo pParam  ) 
 

Sets the new details of the page size and of the default grid. The default grid should always be resident in the spread. Assumes the class variables pDocument, pSpread have been set up. This function should be used instead of SetNewSizeOfPage and SetDefaultPageGrid as it is undoable and they aren't.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/2/95
Parameters:
[INPUTS] 
Returns:
True if managed to change the page/spread details ok.

Errors: -

See also:
AppPrefsDlg::SetCurrentSpread; SetDefaultPageGrid;

Definition at line 811 of file optsgrid.cpp.

00812 {
00813     // For now, get details on 1st page of spread 1
00814 
00815     // The dialog handler should have already set up the class variables pDocument and pSpread.
00816     // We will check that they are not null.
00817     ERROR2IF(pDocument==NULL,FALSE,"GridTab::InvokeResize() no selected document");
00818     ERROR2IF(  pSpread==NULL,FALSE,"GridTab::InvokeResize() no spread to work on");
00819 
00820     // Only change the page size/layout if something has changed 
00821     // If the user has changed anything then warn them that nothing will happen
00822     // if no grid params have changed, flag this in the param block, else use them as the new defaults
00823     MILLIPOINT bodge = 5;       // extra leeway on comparison required
00824     BOOL ChangeRequired = FALSE;
00825     if (
00826         OldGridSpacing == pParam->GridSpacing &&
00827         OldGridSubDivisions == pParam->GridSubDivisions &&
00828         OldGridUnits == pParam->GridUnits &&
00829         OldTypeOfGrid == pParam->TypeOfGrid &&
00830         (OldOriginX >= (pParam->OriginX - bodge)) && (OldOriginX <= (pParam->OriginX + bodge)) &&
00831         (OldOriginY >= (pParam->OriginY - bodge)) && (OldOriginY <= (pParam->OriginY + bodge))
00832        )
00833     {
00834         pParam->GridSpacing      = 0;
00835         pParam->GridDivisions    = 0;
00836         pParam->GridSubDivisions = 0;
00837         pParam->GridUnits        = NOTYPE;
00838     }
00839     else
00840     {
00841         ChangeRequired      = TRUE;
00842         OldGridSpacing      = pParam->GridSpacing;
00843         OldGridSubDivisions = pParam->GridSubDivisions;
00844         OldGridUnits        = pParam->GridUnits;
00845         OldTypeOfGrid       = pParam->TypeOfGrid;
00846         OldOriginX          = pParam->OriginX;
00847         OldOriginY          = pParam->OriginY;
00848     }
00849 
00850     if (ChangeRequired)
00851     {
00852         // Invoke the Page resizing operation so that we get Undo.
00853         OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(OpGridResize));
00854 
00855         if (pOpDesc != NULL)
00856         {
00857             // Set up the parameters which we require to do the page resizing operation 
00858             pParam->pSpread = pSpread;
00859 
00860             // Go for it!
00861             pOpDesc->Invoke((OpParam *) pParam);
00862         }
00863     }
00864 
00865     return TRUE;
00866 }   

BOOL GridTab::IsDocumentOption  )  [virtual]
 

Allows the document options dialog code to determine if this tab belongs to the group of document options.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Returns True if this tab is a document option.

Errors: -

See also:
IsProgramOption();

Implements OptionsTabs.

Definition at line 247 of file optsgrid.cpp.

00248 {
00249     return TRUE;    // This tab is not a document option 
00250 }

BOOL GridTab::IsProgramOption  )  [virtual]
 

Allows the program options dialog code to determine if this tab belongs to the group of program options.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Returns True if this tab is a program option.

Errors: -

See also:
IsProgramOption();

Implements OptionsTabs.

Definition at line 268 of file optsgrid.cpp.

00269 {
00270     return TRUE;    // This tab is a program option 
00271 }

BOOL GridTab::NewUnitsInSection  )  [virtual]
 

Function called when new default units come into operation. We must convert all units fields to display in the newly specified units.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
True if values in dialog box ok, False otherwise.

Errors: -

See also:
-

Reimplemented from OptionsTabs.

Definition at line 402 of file optsgrid.cpp.

00403 {
00404 TRACEUSER( "Neville", _T("New units in page section\n"));
00405     ERROR2IF(pPrefsDlg == NULL,FALSE,"GridTab::NewUnitsInSection called with no dialog pointer");
00406 
00407     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_GRID));  // The page tab identifier
00408     if (!ok)
00409         return TRUE;    // Talk to page failed to return now
00410 
00411 
00412     // All units work off the selected document and so we must do nothing if there is no
00413     // selected document. Check our clas variable to see if this is true or not.
00414     // Units should have been set up by the caller.
00415     if (pDocument == NULL)
00416     {
00417         // the dialog box is greyed.
00418         GreySection();
00419         return (TRUE);
00420     }
00421 
00422     // Do the same things as the normal init section code
00423     InitGridSection();
00424 
00425     return TRUE;
00426 }

BOOL GridTab::UngreySection  )  [virtual]
 

Called when the user has selected a new document.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
GridTab::UngreySection;

Reimplemented from OptionsTabs.

Definition at line 485 of file optsgrid.cpp.

00486 {
00487 TRACEUSER( "Neville", _T("UngreySection in page section\n"));
00488     ERROR2IF(pPrefsDlg == NULL,FALSE,"GridTab::UngreySection called with no dialog pointer");
00489 
00490     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_GRID));  // The grid tab identifier
00491     if (!ok)
00492         return TRUE;    // Talk to page failed to return now
00493 
00494     // Make sure the information field displaying the name of the current document
00495     // is correct.
00496     String_256  DocumentName(_R(IDT_OPTS_GRID_INFO)); 
00497     DocumentName += *GetDocumentName();
00498     pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_INFO), DocumentName);
00499 
00500     // Only update if we are not already ungrey 
00501     if (GreyStatus == FALSE)
00502         return TRUE;
00503 
00504     // Call our central greying/ungreying function
00505     ok = ChangeControlStatus(TRUE);
00506     
00507     GreyStatus = FALSE;
00508 
00509     return ok;
00510 }

BOOL GridTab::UpdateGridSection  ) 
 

Called when we have undone a default grid resize operation and hence need to update the default grid's details on the page section of this tab. Should only init the tab if the page is present.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
GridTab::GreySection; GridTab::UngreySection; GridTab::InitSection;

Definition at line 624 of file optsgrid.cpp.

00625 {
00626 TRACEUSER( "Neville", _T("GridTab::UpdateGridSection\n"));
00627     ERROR2IF(pPrefsDlg == NULL,FALSE,"GridTab::UpdateGridSection called with no dialog pointer");
00628 
00629     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_GRID));  // The Page page identifier
00630     if (!ok)
00631         return TRUE;        // page not present
00632 
00633     // All units work off the selected document and so we must do nothing if there is no
00634     // selected document. Check our clas variable to see if this is true or not.
00635     // Units should have been set up by the caller.
00636     if (pDocument == NULL)
00637     {
00638         GreySection();
00639         return (TRUE);
00640     }
00641 
00642     // Call the normal init section code for the page parts
00643     return InitGridSection();
00644 }

BOOL GridTab::UpdateSection String_256 DocumentName  )  [virtual]
 

Called when we have switched to a new document and need to update all the controls on this tab. Should only init the tab if the page is present. The document name allows the info field on the tab to be filled in correctly.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95
Parameters:
Name of document [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
GridTab::GreySection; GridTab::UngreySection; GridTab::InitSection;

Reimplemented from OptionsTabs.

Definition at line 577 of file optsgrid.cpp.

00578 {
00579 TRACEUSER( "Neville", _T("GridTab::UpdateSection\n"));
00580     ERROR2IF(pPrefsDlg == NULL,FALSE,"GridTab::UpdateSection called with no dialog pointer");
00581 
00582     BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_GRID));  // The Page page identifier
00583     if (!ok)
00584         return TRUE;        // page not present
00585 
00586     // Make sure the information field displaying the name of the current document is correct.
00587     String_256  DocName(_R(IDT_OPTS_GRID_INFO)); 
00588     DocName +=  *DocumentName;
00589     pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_INFO), DocName);
00590 
00591     // All units work off the selected document and so we must do nothing if there is no
00592     // selected document. Check our clas variable to see if this is true or not.
00593     // Units should have been set up by the caller.
00594     if (pDocument == NULL)
00595     {
00596         GreySection();
00597         return TRUE;
00598     }
00599 
00600     // Do the same things as the normal init section code
00601     InitGridSection();
00602 
00603     return TRUE;
00604 }


Member Data Documentation

BOOL GridTab::GreyStatus [private]
 

Definition at line 200 of file optsgrid.h.

double GridTab::OldGridSpacing [private]
 

Definition at line 192 of file optsgrid.h.

UINT32 GridTab::OldGridSubDivisions [private]
 

Definition at line 193 of file optsgrid.h.

UnitType GridTab::OldGridUnits [private]
 

Definition at line 194 of file optsgrid.h.

MILLIPOINT GridTab::OldOriginX [private]
 

Definition at line 197 of file optsgrid.h.

MILLIPOINT GridTab::OldOriginY [private]
 

Definition at line 198 of file optsgrid.h.

GridType GridTab::OldTypeOfGrid [private]
 

Definition at line 195 of file optsgrid.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:55:02 2007 for Camelot by  doxygen 1.4.4